Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##################################################
#
# go backend build
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS gobuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS gobuilder
RUN mkdir -p /go/src/github.com/openshift/console/
ADD . /go/src/github.com/openshift/console/
WORKDIR /go/src/github.com/openshift/console/
Expand All @@ -11,7 +11,7 @@ RUN ./build-backend.sh
##################################################
#
# nodejs frontend build
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.16 AS nodebuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.17 AS nodebuilder

ADD . .

Expand Down Expand Up @@ -51,7 +51,7 @@ RUN container-entrypoint ./build-frontend.sh
##################################################
#
# actual base image for final product
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
FROM registry.ci.openshift.org/ocp/4.17:base-rhel9
RUN mkdir -p /opt/bridge/bin
COPY --from=gobuilder /go/src/github.com/openshift/console/bin/bridge /opt/bridge/bin
COPY --from=nodebuilder /opt/app-root/src/frontend/public/dist /opt/bridge/static
Expand Down
56 changes: 0 additions & 56 deletions Dockerfile.builder

This file was deleted.

68 changes: 68 additions & 0 deletions Dockerfile.cypress
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
##################################################
#
# cypress image
FROM cypress/included:13.10.0

##################################################
#
# go backend build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it, we wont need to build backend in the this image, since we are testing agains live cluster.

FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS gobuilder
RUN mkdir -p /go/src/github.com/openshift/console/
ADD . /go/src/github.com/openshift/console/
WORKDIR /go/src/github.com/openshift/console/
RUN ./build-backend.sh


##################################################
#
# nodejs frontend build
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.17 AS nodebuilder

ADD . .

USER 0

ARG YARN_VERSION=v1.22.19

# bootstrap yarn so we can install and run the other tools.
RUN CACHED_YARN=./artifacts/yarn-${YARN_VERSION}.tar.gz; \
if [ -f ${CACHED_YARN} ]; then \
npm install ${CACHED_YARN}; \
else \
npm install https://github.com/yarnpkg/yarn/releases/download/${YARN_VERSION}/yarn-${YARN_VERSION}.tar.gz; \
fi

# The REMOTE_SOURCES value is set by the build system to indicate the location of the cachito-backed artifacts cache.
# As cachito might not be available in all environments, we need to make sure the value is set before trying to use it and
# that the COPY layer below doesn't fail. Setting it to be the Dockerfile itself is fairly safe, as it will always be
# available.
ARG REMOTE_SOURCES=./Dockerfile.product
ARG REMOTE_SOURCE_DIR=/tmp/remote-sources

COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR

# use dependencies provided by Cachito
RUN test -d ${REMOTE_SOURCES}/cachito-gomod-with-deps || exit 0; \
cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/registry-ca.pem . \
&& cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/frontend/{.npmrc,.yarnrc,yarn.lock} frontend/

# run the build
RUN container-entrypoint ./build-frontend.sh


##################################################
#
# actual base image for final product
FROM registry.ci.openshift.org/ocp/4.17:base-rhel9
RUN mkdir -p /opt/bridge/bin
COPY --from=gobuilder /go/src/github.com/openshift/console/bin/bridge /opt/bridge/bin
COPY --from=nodebuilder /opt/app-root/src/frontend/public/dist /opt/bridge/static
COPY --from=gobuilder /go/src/github.com/openshift/console/pkg/graphql/schema.graphql /pkg/graphql/schema.graphql

WORKDIR /
# doesn't require a root user.
USER 1001

CMD [ "/opt/bridge/bin/bridge", "--public-dir=/opt/bridge/static" ]


19 changes: 15 additions & 4 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
# Dockerfile to build console image from pre-built front end.

FROM quay.io/coreos/tectonic-console-builder:v26 AS build
##################################################
#
# go backend build
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS gobuilder
RUN mkdir -p /go/src/github.com/openshift/console/
ADD . /go/src/github.com/openshift/console/
WORKDIR /go/src/github.com/openshift/console/
RUN ./build-backend.sh

FROM openshift/origin-base
COPY --from=build /go/src/github.com/openshift/console/bin/bridge /opt/bridge/bin/bridge

##################################################
#
# copy local pre-built nodejs frontend build
FROM registry.ci.openshift.org/ocp/4.17:base-rhel9
RUN mkdir -p /opt/bridge/bin
COPY --from=gobuilder /go/src/github.com/openshift/console/bin/bridge /opt/bridge/bin/bridge
COPY ./frontend/public/dist /opt/bridge/static
COPY ./pkg/graphql/schema.graphql /pkg/graphql/schema.graphql
COPY --from=gobuilder /go/src/github.com/openshift/console/pkg/graphql/schema.graphql /pkg/graphql/schema.graphql

WORKDIR /
# doesn't require a root user.
USER 1001

CMD [ "/opt/bridge/bin/bridge", "--public-dir=/opt/bridge/static" ]
47 changes: 39 additions & 8 deletions Dockerfile.plugins.demo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,38 @@
# See dynamic-demo-plugin/README.md for details.

# Stage 0: build the demo plugin
FROM quay.io/coreos/tectonic-console-builder:v26 AS build
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.17 AS nodebuilder

ADD . .

USER 0

ARG YARN_VERSION=v1.22.19

# bootstrap yarn so we can install and run the other tools.
RUN CACHED_YARN=./artifacts/yarn-${YARN_VERSION}.tar.gz; \
if [ -f ${CACHED_YARN} ]; then \
npm install ${CACHED_YARN}; \
else \
npm install https://github.com/yarnpkg/yarn/releases/download/${YARN_VERSION}/yarn-${YARN_VERSION}.tar.gz; \
fi

# The REMOTE_SOURCES value is set by the build system to indicate the location of the cachito-backed artifacts cache.
# As cachito might not be available in all environments, we need to make sure the value is set before trying to use it and
# that the COPY layer below doesn't fail. Setting it to be the Dockerfile itself is fairly safe, as it will always be
# available.
ARG REMOTE_SOURCES=./Dockerfile.product
ARG REMOTE_SOURCE_DIR=/tmp/remote-sources

COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR

# use dependencies provided by Cachito
RUN test -d ${REMOTE_SOURCES}/cachito-gomod-with-deps || exit 0; \
cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/registry-ca.pem . \
&& cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/frontend/{.npmrc,.yarnrc,yarn.lock} frontend/

# prevent download of cypress binary as part of module installs
ENV CYPRESS_INSTALL_BINARY=0

RUN mkdir -p /src/console
COPY . /src/console
Expand All @@ -16,16 +47,16 @@ RUN yarn install && \
yarn build

# Stage 1: build the target image
FROM node:10
FROM node:18

COPY --from=build /src/console/dynamic-demo-plugin/dist /opt/console-plugin-demo/static
COPY --from=build /src/console/dynamic-demo-plugin/node_modules /opt/console-plugin-demo/node_modules
COPY --from=build /src/console/dynamic-demo-plugin/http-server.sh /opt/console-plugin-demo/http-server.sh
COPY --from=nodebuilder /src/console/dynamic-demo-plugin/dist /opt/console-plugin-demo/static
COPY --from=nodebuilder /src/console/dynamic-demo-plugin/node_modules /opt/console-plugin-demo/node_modules
COPY --from=nodebuilder /src/console/dynamic-demo-plugin/http-server.sh /opt/console-plugin-demo/http-server.sh

LABEL io.k8s.display-name="OpenShift Console Demo Plugin" \
io.k8s.description="Sample OpenShift Console dynamic plugin used for testing purposes." \
io.openshift.tags="openshift" \
maintainer="Vojtech Szocs <[email protected]>"
io.k8s.description="Sample OpenShift Console dynamic plugin used for testing purposes." \
io.openshift.tags="openshift" \
maintainer="Vojtech Szocs <[email protected]>"

USER 1001

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.plugins.demo2 → Dockerfile.plugins.demo.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Dockerfile to build console-demo-plugin image from pre-built front end.
#
# This image is used for testing OpenShift Console dynamic plugin capabilities.
#
# See dynamic-demo-plugin/README.md for details.
Expand All @@ -11,7 +13,7 @@
# yarn build

# Stage 1: build the target image
FROM node:10
FROM node:18

COPY ./dynamic-demo-plugin/dist /opt/console-demo-plugin/static
COPY ./dynamic-demo-plugin/node_modules /opt/console-demo-plugin/node_modules
Expand Down
16 changes: 0 additions & 16 deletions Dockerfile.product.nodejs

This file was deleted.

19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,6 @@ In order to enable the monitoring UI and see the "Observe" navigation item while
export BRIDGE_PLUGINS="monitoring-plugin=http://localhost:9001"
```

#### Updating `tectonic-console-builder` image
Updating `tectonic-console-builder` image is needed whenever there is a change in the build-time dependencies and/or go versions.

In order to update the `tectonic-console-builder` to a new version i.e. v27, follow these steps:

1. Update the `tectonic-console-builder` image tag in files listed below:
- .ci-operator.yaml
- Dockerfile.dev
- Dockerfile.plugins.demo
For example, `tectonic-console-builder:27`
2. Update the dependencies in Dockerfile.builder file i.e. v18.0.0.
3. Run `./push-builder.sh` script build and push the updated builder image to quay.io.
Note: You can test the image using `./builder-run.sh ./build-backend.sh`.
To update the image on quay.io, you need edit permission to the quay.io/coreos/ tectonic-console-builder repo.
4. Lastly, update the mapping of `tectonic-console-builder` image tag in
[openshift/release](https:// github.com/openshift/release/blob/master/core-services/image-mirroring/supplemental-ci-images/mapping_supplemental_ci_images_ci) repository.
Note: There could be scenario were you would have to add the new image reference in the "mapping_supplemental_ci_images_ci" file, i.e. to avoid CI downtime for upcoming release cycle.
Optional: Request for the [rhel-8-base-nodejs-openshift-4.15](https://github.com/openshift-eng/ocp-build-data/pull/3775/files) nodebuilder update if it doesn't match the node version in `tectonic-console-builder`.

#### CodeReady Containers

If you want to use CodeReady for local development, first make sure [it is set up](https://crc.dev/crc/#setting-up-codeready-containers_gsg), and the [OpenShift cluster is started](https://crc.dev/crc/#starting-the-virtual-machine_gsg).
Expand Down
35 changes: 0 additions & 35 deletions builder-run.sh

This file was deleted.

19 changes: 0 additions & 19 deletions push-builder.sh

This file was deleted.