-
Notifications
You must be signed in to change notification settings - Fork 89
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
Revamp how Tekton pipelines to run notebooks work. #703
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9dfe13e
Revamp how Tekton pipelines to run notebooks work.
6b96600
tekton_client.py can't use format strings yet because we are still ru…
1b4eb83
Remove f-style strings.
90f099a
Fix typo.
068625b
Address PR comments.
2857397
* copy-buckets should not abort on error as this prevents artifacts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...repos/kf-ci-v1/namespaces/auto-deploy/tekton.dev_v1alpha1_task_notebook-test-builder.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Task | ||
metadata: | ||
annotations: | ||
sidecar.istio.io/inject: "false" | ||
name: notebook-test-builder | ||
namespace: auto-deploy | ||
spec: | ||
inputs: | ||
params: | ||
- default: gcr.io/kubeflow-ci/test-worker-py3:3780b5d-dirty@sha256:4a766d6f5cc6cbcb00dbc96205f7a5b2816bc5f2b6d516fd67124d4a3e6508ea | ||
description: The docker image to run the tests in | ||
name: test-image | ||
type: string | ||
- description: GCS bucket and directory artifacts will be uploaded to. Should | ||
be in the form of 'gs://' | ||
name: artifacts-gcs | ||
type: string | ||
resources: | ||
- name: notebook-repo | ||
type: git | ||
- name: image | ||
type: image | ||
steps: | ||
- image: $(inputs.params.test-image) | ||
name: setup | ||
script: | | ||
#!/usr/bin/env bash | ||
set -x | ||
mkdir -p /workspace/build | ||
cd /workspace/build | ||
# Copy the source code | ||
cp -r /workspace/$(inputs.resources.notebook-repo.name) . | ||
cp -r /srcCache/kubeflow/testing/notebook_testing/Dockerfile.notebook_runner ./Dockerfile.notebook_runner | ||
mkdir -p kubeflow/ | ||
# Copy over the kubeflow/testing directory because we need it to run the | ||
# notebooks; note that the copy is coming from the worker test image. | ||
cp -r /srcCache/kubeflow/testing ./kubeflow/testing | ||
# Create the artifacts directory | ||
mkdir -p /workspace/artifacts | ||
- command: | ||
- /kaniko/executor | ||
- --dockerfile=/workspace/build/Dockerfile.notebook_runner | ||
- --destination=$(inputs.resources.image.url) | ||
- --context=/workspace/build | ||
- --digest-file=/workspace/artifacts/image-digest | ||
image: gcr.io/kaniko-project/executor:v0.23.0 | ||
name: build-push | ||
resources: | ||
requests: | ||
cpu: 7 | ||
memory: 16Gi | ||
- args: | ||
- -m | ||
- kubeflow.testing.tekton_client | ||
- create-image-file | ||
- --image-name=$(inputs.resources.image.url) | ||
- --digest-file=/workspace/artifacts/image-digest | ||
- --output=$(inputs.params.artifacts-gcs)/image.yaml | ||
command: | ||
- python | ||
env: | ||
- name: PYTHONPATH | ||
value: /srcCache/kubeflow/testing/py | ||
image: $(inputs.params.test-image) | ||
name: create-image-file |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work with building these images? Are the git sha hard coded or are these auto updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The images are currently built using skaffold. We use a CLI option with skaffold to emit the URL of the image to a json file. We then use kpt to change the images to point at the new image. There's a make rule to provide syntactic sugar to string these commands together.
Ideally we would automate this so that on postsubmit new images would be automatically built and a PR opened to update all the images.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for the explanation!