Skip to content

Deploy on OpenShift

Jennings Zhang edited this page Feb 3, 2023 · 13 revisions
# Step 1: create "ImageStream"
# This indicates which image we want to use for s2i
oc import-image nodejs:18 --from=quay.io/fedora/nodejs-18 --confirm

# Step 2: create BuildConfig and Deployment
# the command `oc new-app` attempts to do almost everything:
# given a Github repo URL, create a BuildConfig, Deployment, Service,
# and start a build.
oc new-app --name chrisui \
    --build-env=npm_config_legacy_peer_deps=true \
    --build-env=REACT_APP_CHRIS_UI_URL=https://cube.chrisproject.org/api/v1/ \
    nodejs:18~https://github.com/FNNDSC/ChRIS_ui.git
# Figure out how to set environment variables
# e.g. REACT_APP_CHRIS_UI_URL=https://cube.chrisproject.org/api/v1/
# and other stuff like the BuildConfig's `runPolicy: SerialLatestOnly`

# Step 3: increase memory limit
# Default limit is 2Gi mem, it needs to be increased
oc patch bc/chrisui --patch '{"spec":{"resources":{"limits":{"memory":"8Gi"}}}}'

# Step 4: add webhook to Github project
# https://docs.openshift.com/container-platform/4.7/cicd/builds/triggering-builds-build-hooks.html
# https://github.com/FNNDSC/ChRIS_ui/settings/hooks

# Step 5: everything works?

# Step 6: create route

Known Problems

It seems like print_version.sh doesn't work unless you manually specify a git ref for your BuildConfig. You should be doing so anyways, e.g. refs/heads/master or refs/tags/freeze-chrisproject-org

Clone this wiki locally