Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Use tagged version of the CodeFlare operator (#817)
Browse files Browse the repository at this point in the history
* Use tagged version of the CodeFlare operator

Signed-off-by: Anish Asthana <anishasthana1@gmail.com>

* Revise resource requirements for jobs

Signed-off-by: Anish Asthana <anishasthana1@gmail.com>

---------

Signed-off-by: Anish Asthana <anishasthana1@gmail.com>
  • Loading branch information
anishasthana authored May 18, 2023
1 parent 5916ffa commit 0d02c23
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: codeflare-operator-system
spec:

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: codeflare-operator-system-manager-edit-rolebinding
subjects:
- kind: ServiceAccount
name: codeflare-operator-controller-manager
namespace: codeflare-operator-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: edit
4 changes: 3 additions & 1 deletion tests/resources/codeflare-stack/codeflare-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: codeflare-operator
namespace: openshift-operators
namespace: codeflare-operator-system
spec:
channel: alpha
name: codeflare-operator
source: community-operators
sourceNamespace: openshift-marketplace
installPlanApproval: Manual
startingCSV: codeflare-operator.v0.0.1
4 changes: 2 additions & 2 deletions tests/resources/codeflare-stack/custom-nb-small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ spec:
resources:
limits:
cpu: "2"
memory: 8Gi
memory: 3Gi
requests:
cpu: "1"
memory: 8Gi
memory: 3Gi
volumeMounts:
- mountPath: /opt/app-root/src
name: jupyterhub-nb-kube-3aadmin-pvc
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/codeflare-stack/mnist_mcad_mini.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"metadata": {},
"outputs": [],
"source": [
"job = DDPJobDefinition(name=\"mnistjob\", script=\"mnist.py\", scheduler_args={\"namespace\": \"opendatahub\"}, j=\"1x1\", gpu=0, cpu=1, memMB=8000, image=\"quay.io/project-codeflare/mnist-job-test:v0.0.1\").submit()"
"job = DDPJobDefinition(name=\"mnistjob\", script=\"mnist.py\", scheduler_args={\"namespace\": \"opendatahub\"}, j=\"1x1\", gpu=0, cpu=3, memMB=4000, image=\"quay.io/project-codeflare/mnist-job-test:v0.0.1\").submit()"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/codeflare-stack/mnist_ray_mini.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"outputs": [],
"source": [
"# Create our cluster and submit appwrapper\n",
"cluster = Cluster(ClusterConfiguration(namespace='opendatahub', name='mnisttest', min_worker=2, max_worker=2, min_cpus=1, max_cpus=1, min_memory=4, max_memory=4, gpu=0, instascale=False))"
"cluster = Cluster(ClusterConfiguration(namespace='opendatahub', name='mnisttest', min_worker=2, max_worker=2, min_cpus=2, max_cpus=2, min_memory=4, max_memory=4, gpu=0, instascale=False))"
]
},
{
Expand Down
5 changes: 5 additions & 0 deletions tests/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ done
popd
## Install CodFlare Operator
echo "Installing CodeFlare operator"
oc new-project codeflare-operator-system
oc apply -f $HOME/peak/operator-tests/odh-manifests/resources/codeflare-stack/codeflare-subscription.yaml
oc apply -f $HOME/peak/operator-tests/odh-manifests/resources/codeflare-stack/codeflare-operator-system-dependencies.yaml
sleep 15
# We need to manually approve the install plan for the CodeFlare operator as we want to use a tagged version of the operator
oc patch installplan $(oc get installplans -n codeflare-operator-system -o jsonpath='{.items[?(@.metadata.ownerReferences[0].name=="codeflare-operator")].metadata.name}') -n codeflare-operator-system --type merge -p '{"spec":{"approved":true}}'
## Grabbing and applying the patch in the PR we are testing
pushd ~/src/odh-manifests
if [ -z "$PULL_NUMBER" ]; then
Expand Down

0 comments on commit 0d02c23

Please sign in to comment.