Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate Elyra runtime images configMap from runtime images imagestream manifests and mounts it on the Notebook CR #513

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

atheo89
Copy link
Member

@atheo89 atheo89 commented Feb 20, 2025

Related to: https://issues.redhat.com/browse/RHOAIENG-19051

Related PRs for this workload:
New set of runtime ImageStreams: opendatahub-io/notebooks#930
Unwire .json files from the Datascience Notebook: opendatahub-io/notebooks#909

Description

This PR add a new notebook_runtime script where includes the logic to create/watch/update a new ConfigMap the pipeline-runtime-images from the runtime images imagesStreams (related PR) and mount it as volume with the name /opt/app-root/pipeline-runtimes/ on the notebook CR when is getting created.

NOTE: We don't make a use of devFlag for this feature, as it doesn't seem to have any issue with Applications -> Embeded-> JupyterLab spinup notebook

How Has This Been Tested?

  1. Update the RHOAI DSC with the following:
    workbenches:
      devFlags:
        manifests:
          - contextDir: components/odh-notebook-controller/config
            sourcePath: ''
            uri: 'https://github.com/atheo89/kubeflow/archive/rhoaieng-19050-configmap-generator.tar.gz'
          - contextDir: manifests
            sourcePath: ''
            uri: 'https://github.com/opendatahub-io/notebooks/archive/main.tar.gz'
      managementState: Managed
      
  1. Import the quay.io/rh_ee_atheodor/workbench-images@sha256:f2bc105afab97575007a5743e39cc4c045fa276ba8612b6a8241758d48711913 notebook (Includes the changes from this PR) This is a notebook without the .json runtimes in it.

  2. Spin up this Custom Datascience notebook via UI
    Click on the left side menu and click this icon.
    image

You should see the runtimes mounted like below:
image

On the Back-end side:
4. Inspect the logs on the odh-notebook-controller to find the related logs on the configMap creation and the mounting, like below.

...
{"level":"info","ts":"2025-02-20T10:13:31Z","logger":"controllers.Notebook","msg":"Created new ConfigMap for runtime images","namespace":"atheo","ConfigMap.Name":"pipeline-runtime-images"}
...
{"level":"info","ts":"2025-02-20T10:13:31Z","logger":"controllers.Notebook","msg":"Injecting runtime-images volume into notebook","notebook":"t1","namespace":"atheo","notebook":"t1","namespace":"atheo"}
...

  1. Check on the notebook pod statefullset for the config map, press on it to inspect also the data from this configMap
    image

  2. Check as well on the notebook CR to evaluate the mounting, as is on the bellow image:
    image

image

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from caponetto and jstourac February 20, 2025 10:51
Copy link

openshift-ci bot commented Feb 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from atheo89. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added size/l and removed size/l labels Feb 20, 2025
@openshift-ci openshift-ci bot added size/l and removed size/l labels Feb 20, 2025
@atheo89
Copy link
Member Author

atheo89 commented Feb 20, 2025

/hold
Until investigate if we have any issue with notebook tile

@openshift-ci openshift-ci bot added do-not-merge/hold Do not merge this PR size/l and removed size/l labels Feb 20, 2025
@atheo89 atheo89 changed the title Populate Elyra runtime images configMap from runtime images imagestream manifests and mounts it on the Notebook CR WIP: Populate Elyra runtime images configMap from runtime images imagestream manifests and mounts it on the Notebook CR Feb 20, 2025
@atheo89 atheo89 force-pushed the rhoaieng-19050-configmap-generator branch from 1ad60c1 to 3402caf Compare February 20, 2025 15:12
@openshift-ci openshift-ci bot added size/l and removed size/l labels Feb 20, 2025
@atheo89 atheo89 force-pushed the rhoaieng-19050-configmap-generator branch from 3402caf to 9dc2dd8 Compare February 20, 2025 15:19
@openshift-ci openshift-ci bot added size/l and removed size/l labels Feb 20, 2025
atheo89 and others added 11 commits March 10, 2025 15:51
…watch/update a new ConfigMap the `pipeline-runtime-images` for runtime images and mount it as volume on the notebook when is getting created

Move ConfigMapName, mountPath and volumeName as global vars

Add DevFlag SET_RUNTIMES_CM to enable/diable the feature

Add test cases for the new configMap configuration

Remove devflag

Revert changes on makefile
…t the end of the run

This way we should see what the controller was logging in case the test fails.
@openshift-ci openshift-ci bot added size/l and removed size/l labels Mar 10, 2025
@atheo89 atheo89 force-pushed the rhoaieng-19050-configmap-generator branch from a5bf7ef to db27716 Compare March 10, 2025 14:58
@atheo89
Copy link
Member Author

atheo89 commented Mar 10, 2025

Just rebased the PR, sorry Jiri for ping you again for your review :P
Rest folks, please take a look once you are available

@openshift-ci openshift-ci bot added size/l and removed size/l labels Mar 10, 2025
@jiridanek
Copy link
Member

jiridanek commented Mar 10, 2025

/lgtm

I'm going to trust you on this being just a rebase

don't see anything suspicious

normally I'd check https://github.com/opendatahub-io/kubeflow/compare/a5bf7efc2d06ba74dd6f5b79e06a0e92ee1af3fe..db27716ce20f463529ebeef0c50cddfbca1b7779 but there is 250k lines changed since PR was opened ;{

@openshift-ci openshift-ci bot added the lgtm label Mar 10, 2025
@atheo89
Copy link
Member Author

atheo89 commented Mar 10, 2025

/lgtm
I'm going to trust you on this being just a rebase

Thanks again Jiri, basicaly nothing strange happened on my end when i did rebase, looks that i got all the changes moreover, the commit that you added about the ImageStreams dropped while the rebase, because the one from Wen was merged.
Plus i don't bring double commits after the rebase, as i see from this UI view there are only the changes related to this PR.
image

Copy link
Member

@harshad16 harshad16 left a comment

Choose a reason for hiding this comment

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

Great work 🎉

Left one question.

Testing the following scenarios:

  • On upgrade, existing notebook are not touched: ✔️
  • Existing notebook on restart, are not attached with rutimes: ✔️
  • New notebook on creation are attached with runtimes: ✔️
  • New notebook with old image are attached with runtimes, however they are not used by elyra and stay in separate dir: ✔️
  • Creation of imagestream in ods-application, updates configamp: ✔️
  • edit of configmap in username , reconciles the configmap: ✔️

Pending the testing, i need to check these in jupyter tile
(due to shortage of time , couldn't check, will check soon and provide final review)

@openshift-ci openshift-ci bot removed the lgtm label Mar 12, 2025
Copy link

openshift-ci bot commented Mar 12, 2025

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci bot added size/l and removed size/l labels Mar 12, 2025
@atheo89 atheo89 removed the request for review from caponetto March 12, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants