Skip to content

Instantly share code, notes, and snippets.

@jiridanek
Last active March 15, 2024 21:59
Show Gist options
  • Save jiridanek/45305109360c1bf8cc284a6641250a6e to your computer and use it in GitHub Desktop.
Save jiridanek/45305109360c1bf8cc284a6641250a6e to your computer and use it in GitHub Desktop.
Kustomize RStudio Server BuildConfigs

Kustomize

$ oc kustomize --output rstudio-rhoai28.yaml

Review rstudio-rhoai28.yaml and apply it to the cluster

$ oc apply -f rstudio-rhoai28.yaml
buildconfig.build.openshift.io/cuda-rhel9-rhoai28 created
buildconfig.build.openshift.io/cuda-rstudio-server-rhel9-rhoai28 created
buildconfig.build.openshift.io/rstudio-server-rhel9-rhoai28 created
imagestream.image.openshift.io/cuda-rhel9-rhoai28 created
imagestream.image.openshift.io/cuda-rstudio-rhel9-rhoai28 created
imagestream.image.openshift.io/rstudio-rhel9-rhoai28 created

Build images as usual, except add -rhoai28 suffix to all the names

for the record, here's how I tried this out

oc create secret generic rhel-subscription-secret \
    --from-literal=USERNAME=xxx \
    --from-literal=PASSWORD=yyy \
    --from-literal=SERVERURL=subscription.rhsm.stage.redhat.com:443/subscription \
    --from-literal=BASEURL=cdn.redhat.com \
    -n redhat-ods-applications

# https://access.redhat.com/documentation/en-us/red_hat_openshift_ai_cloud_service/1/html-single/getting_started_with_red_hat_openshift_ai_cloud_service/index#building_the_rstudio_server_notebook_images

oc start-build rstudio-server-rhel9-rhoai28 -n redhat-ods-applications --follow

oc start-build cuda-rhel9-rhoai28 -n redhat-ods-applications --follow

oc get builds -n redhat-ods-applications

oc label -n redhat-ods-applications imagestream rstudio-rhel9-rhoai28 opendatahub.io/notebook-image='true'

oc label -n redhat-ods-applications imagestream cuda-rstudio-rhel9-rhoai28 opendatahub.io/notebook-image='true'
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://raw.githubusercontent.com/red-hat-data-services/notebooks/rhoai-2.8/manifests/base/rstudio-buildconfig.yaml
- https://raw.githubusercontent.com/red-hat-data-services/notebooks/rhoai-2.8/manifests/base/cuda-rstudio-buildconfig.yaml
namespace: redhat-ods-applications
patches:
- patch: |-
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
annotations:
opendatahub.io/notebook-image-url: https://github.com/red-hat-data-services/notebooks/tree/rhoai-2.8/rstudio
name: rstudio-rhel9-rhoai28
target:
kind: ImageStream
name: rstudio-rhel9
options:
allowNameChange: true
- patch: |-
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
name: cuda-rhel9-rhoai28
target:
kind: ImageStream
name: cuda-rhel9
options:
allowNameChange: true
- patch: |-
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
annotations:
opendatahub.io/notebook-image-url: https://github.com/red-hat-data-services/notebooks/tree/rhoai-2.8/rstudio
name: cuda-rstudio-rhel9-rhoai28
target:
kind: ImageStream
name: cuda-rstudio-rhel9
options:
allowNameChange: true
- patch: |-
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: rstudio-server-rhel9-rhoai28
spec:
source:
git:
ref: rhoai-2.8
output:
to:
name: "rstudio-rhel9-rhoai28:latest"
target:
kind: BuildConfig
name: rstudio-server-rhel9
options:
allowNameChange: true
- patch: |-
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: cuda-rhel9-rhoai28
labels:
app: buildchain-rhoai28
component: cuda-rhel9-rhoai28
spec:
source:
git:
ref: rhoai-2.8
output:
to:
name: "cuda-rhel9-rhoai28:latest"
target:
kind: BuildConfig
name: cuda-rhel9
options:
allowNameChange: true
- patch: |-
kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
name: cuda-rstudio-server-rhel9-rhoai28
labels:
app: buildchain-rhoai28
component: cuda-rstudio-server-image-rhoai28
spec:
source:
git:
ref: rhoai-2.8
strategy:
dockerStrategy:
from:
name: "cuda-rhel9-rhoai28:latest"
output:
to:
name: "cuda-rstudio-rhel9-rhoai28:latest"
target:
kind: BuildConfig
name: cuda-rstudio-server-rhel9
options:
allowNameChange: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment