Skip to content

Testing a PR on the CodeFlare Operator

James Busche edited this page Oct 6, 2023 · 2 revisions

I used these steps to test Antonin's PR 120

  1. oc login from my laptop to your test OpenShift Cluster

  2. Clean up the old codeflare operator deployment, if it exists:

oc delete -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/codeflare-stack-kfdef.yaml -n opendatahub
oc delete sub codeflare-operator -n openshift-operators ; oc delete csv codeflare-operator.v0.0.3 -n openshift-operators
oc delete crd instascales.codeflare.codeflare.dev  mcads.codeflare.codeflare.dev
  1. Downloaded the code from the PR fork, and switch to the branch in the PR
git clone https://github.com/astefanutti/codeflare-operator.git
cd codeflare-operator
git checkout pr-04
  1. Install the PR's code:
make manifests # to compile new api(crd)
make install   # will install crd in the cluster
# Note, to get this to run on my mac, I had to run this command:
make install -e SED=/opt/homebrew/bin/gsed
make run       # runs the operator locally, you'll see the operator logs in your terminal…
  1. Now in another window, let's deploy the regular kfdef
oc apply -f https://raw.githubusercontent.com/opendatahub-io/distributed-workloads/main/codeflare-stack-kfdef.yaml -n opendatahub

This PR is testing that the InstaScale image can be replaced in the instascale CR. So what follows is a specific test for this change:

  1. Edit the instascale cr to add a controllerimage line like this:
oc edit instascale instascale

and under spec: add something like this: (Note, the current existing instascale is instascale-controller:v0.0.3)

spec:   
  controllerImage: quay.io/project-codeflare/instascale-controller:v0.0.2
  1. Now the instascale deploy and pod should revert to image v0.0.2. To confirm it:
oc describe deploy instascale-instascale |grep Image:
    Image:      quay.io/project-codeflare/instascale-controller:v0.0.2

and
oc describe pod instascale-instascale-67568d99db-gqmjt |grep Image:
    Image:         quay.io/project-codeflare/instascale-controller:v0.0.2
  1. And then edit the instascale cr to add a controllerimage line like this: