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

add ability to customize kfp-launcher ConfigMap data contents #681

Conversation

gregsheremeta
Copy link
Contributor

@gregsheremeta gregsheremeta commented Aug 5, 2024

The issue resolved by this Pull Request:

Resolves https://issues.redhat.com/browse/RHOAIENG-4528

Description of your changes:

Allow the user to fully replace the data contents of the kfp-launcher ConfigMap. The kfp-launcher component requires a ConfigMap to exist in the namespace where it runs (i.e. the namespace where pipelines run). This ConfigMap contains object storage configuration, as well as pipeline root (object store root path where artifacts will be uploaded) configuration. Currently this ConfigMap must be named "kfp-launcher". We currently deploy a default copy of the kfp-launcher ConfigMap via DSPO, but a user may want to provide their own ConfigMap configuration, so that they can specify multiple object storage sources and paths.

Add a CustomKfpLauncherConfigMap parameter to DSPA.ApiServer. When specified, the data contents of the kfp-launcher ConfigMap that DSPO writes will be fully replaced with the data contents of the ConfigMap specified here.

Fixes: https://issues.redhat.com/browse/RHOAIENG-4528

Testing instructions

login to openshift
$ oc login --token=sha256~jMYSUPERSECRETTOKEN --server=https://api.greg-1234.bd9q.p3.openshiftapps.com:443

make a new project for dspo to be deployed
$ oc new-project dspo

check out the PR
$ gh pr checkout 681

deploy it using the pre-built image
$ make deploy IMG="quay.io/opendatahub/data-science-pipelines-operator:pr-681" OPERATOR_NS=dspo

wait a bit for the deployment to finish, and make sure it's up

Screenshot from 2024-08-05 16-36-18

make a new project to deploy a DSPA into
Screenshot from 2024-08-05 16-37-32

first, create a ConfigMap to copy data from (click the plus button at the top).
Screenshot from 2024-08-05 16-38-10

Example:

kind: ConfigMap
apiVersion: v1
metadata:
  name: my-custom-kfp-launcher
  namespace: dspa1
data:
  defaultPipelineRoot: 's3://some-path'
  greg: isCool
  hey: |
    - what: isUp

Here's another more complex example (don't have screenshots for this one, but it should work the same)

kind: ConfigMap
apiVersion: v1
metadata:
  name: my-custom-kfp-launcher
  namespace: dspa1
data:
  defaultPipelineRoot: s3://mlpipeline/special/location
  providers: |-
    s3:
      default:
        endpoint: s3.amazonaws.com
        disableSSL: false
        region: us-east-2
        credentials:
          fromEnv: true
    gs:
      default:
        credentials:
          fromEnv: false
          secretRef:
            secretName: your-k8s-secret
            tokenKey: some-key-1

Screenshot from 2024-08-05 16-39-19

deploy the DSPA, also using the plus button. Don't forget to tell it about your new ConfigMap --

notice the customKfpLauncherConfigMap: my-custom-kfp-launcher line!

apiVersion: datasciencepipelinesapplications.opendatahub.io/v1alpha1
kind: DataSciencePipelinesApplication
metadata:
  name: dspa1
spec:
  dspVersion: v2
  apiServer:
    image: "quay.io/opendatahub/ds-pipelines-api-server:latest"
    argoDriverImage: "quay.io/opendatahub/ds-pipelines-driver:latest"
    argoLauncherImage: "quay.io/opendatahub/ds-pipelines-launcher:latest"
    customKfpLauncherConfigMap: my-custom-kfp-launcher
  persistenceAgent:
    image: "quay.io/opendatahub/ds-pipelines-persistenceagent:latest"
  scheduledWorkflow:
    image: "quay.io/opendatahub/ds-pipelines-scheduledworkflow:latest"
  mlmd:  
    deploy: true  # Optional component
    grpc:
      image: "quay.io/opendatahub/mlmd-grpc-server:latest"
    envoy:
      image: "registry.redhat.io/openshift-service-mesh/proxyv2-rhel8:2.3.9-2"
  mlpipelineUI:
    deploy: true  # Optional component 
    image: "quay.io/opendatahub/ds-pipelines-frontend:latest"
  objectStorage:
    minio:
      deploy: true
      image: 'quay.io/opendatahub/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance'

Screenshot from 2024-08-05 16-40-54

wait a bit for DSPO to reconcile the new DSPA … once you start to see pods come up, should be good

Screenshot from 2024-08-05 16-41-25

then check the kfp-launcher ConfigMap. It's data section should look like what you put in the my-custom-kfp-launcher ConfigMap

Screenshot from 2024-08-05 16-42-11

Screenshot from 2024-08-05 16-42-25

Now delete the DSPA and redeploy it, but this time leave out the customKfpLauncherConfigMap: my-custom-kfp-launcher line from the DSPA. The kfp-launcher ConfigMap should now look how it usually does.

Screenshot from 2024-08-05 16-55-07

Checklist

  • 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

@dsp-developers
Copy link
Contributor

A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-681
An OCP cluster where you are logged in as cluster admin is required.

To use this image run the following:

cd $(mktemp -d)
git clone git@github.com:opendatahub-io/data-science-pipelines-operator.git
cd data-science-pipelines-operator/
git fetch origin pull/681/head
git checkout -b pullrequest 167bb2433fe8fa74ab55b36197c1049174676a02
oc new-project opendatahub
make deploy IMG="quay.io/opendatahub/data-science-pipelines-operator:pr-681"

More instructions here on how to deploy and test a Data Science Pipelines Application.

@VaniHaripriya
Copy link
Contributor

/verified
Tested as per instructions, both the scenarios works as expected.

@gregsheremeta
Copy link
Contributor Author

/hold

found a bug while writing the test :)

@gregsheremeta gregsheremeta force-pushed the customize-kfp-launcher-configmap-contents branch from 167bb24 to 04e0a81 Compare August 6, 2024 17:18
@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-681

@gregsheremeta
Copy link
Contributor Author

@HumairAK here's the screenshots showing it works with a more complex yaml from your doc

source:
Screenshot from 2024-08-06 13-33-01

dest:
Screenshot from 2024-08-06 13-32-51

text diff:
image

controllers/dspipeline_params.go Outdated Show resolved Hide resolved
controllers/dspipeline_params.go Outdated Show resolved Hide resolved
@gregsheremeta gregsheremeta force-pushed the customize-kfp-launcher-configmap-contents branch from 04e0a81 to 0d8b27c Compare August 6, 2024 21:45
@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-681

@gregsheremeta gregsheremeta force-pushed the customize-kfp-launcher-configmap-contents branch from 0d8b27c to dbbb704 Compare August 6, 2024 21:51
@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-681

@gregsheremeta gregsheremeta force-pushed the customize-kfp-launcher-configmap-contents branch from dbbb704 to 1f75522 Compare August 6, 2024 21:53
@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-681

Copy link
Contributor

@hbelmiro hbelmiro left a comment

Choose a reason for hiding this comment

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

Just left an optional nit.
I don't want to block the merge just because of that. So...
/lgtm

controllers/dspipeline_params_test.go Outdated Show resolved Hide resolved
controllers/dspipeline_params_test.go Outdated Show resolved Hide resolved
controllers/dspipeline_params_test.go Outdated Show resolved Hide resolved
Allow the user to fully replace the `data` contents of the kfp-launcher ConfigMap.
The `kfp-launcher` component requires a ConfigMap to exist in the namespace
where it runs (i.e. the namespace where pipelines run). This ConfigMap contains
object storage configuration, as well as pipeline root (object store root path
where artifacts will be uploaded) configuration. Currently this ConfigMap *must*
be named "kfp-launcher". We currently deploy a default copy of the kfp-launcher
ConfigMap via DSPO, but a user may want to provide their own ConfigMap configuration,
so that they can specify multiple object storage sources and paths.

Add a `CustomKfpLauncherConfigMap` parameter to DSPA.ApiServer. When specified,
the `data` contents of the `kfp-launcher` ConfigMap that DSPO writes will be fully
replaced with the `data` contents of the ConfigMap specified here.

Fixes: https://issues.redhat.com/browse/RHOAIENG-4528

Co-authored-by: Achyut Madhusudan <amadhusu@redhat.com>
@gregsheremeta gregsheremeta force-pushed the customize-kfp-launcher-configmap-contents branch from 1f75522 to d42a130 Compare August 7, 2024 12:13
@openshift-ci openshift-ci bot removed the lgtm label Aug 7, 2024
@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-681

Copy link
Contributor

@hbelmiro hbelmiro left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Aug 7, 2024
@HumairAK
Copy link
Contributor

HumairAK commented Aug 7, 2024

/lgtm
/approve

Copy link
Contributor

openshift-ci bot commented Aug 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HumairAK

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

The pull request process is described 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 the approved label Aug 7, 2024
@gregsheremeta
Copy link
Contributor Author

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit 455b92e into opendatahub-io:main Aug 7, 2024
6 checks passed
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