forked from opendatahub-io/ai-edge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opendatahub-io#137 from adelton/issue-92
File the pull request with information about the latest built and pushed image for the model
- Loading branch information
Showing
11 changed files
with
97 additions
and
15 deletions.
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
22 changes: 22 additions & 0 deletions
22
pipelines/tekton/gitops-update-pipeline/test-mlflow-retrieve-image-info-task.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,22 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: retrieve-image-info | ||
spec: | ||
description: Retrieve location and SHA of the built image from the previous PipelineRun | ||
params: | ||
- name: namespace | ||
type: string | ||
- name: model-name | ||
type: string | ||
steps: | ||
- name: get-image-sha | ||
image: image-registry.openshift-image-registry.svc:5000/openshift/cli:latest | ||
script: | | ||
oc get -n $(params.namespace) pipelinerun --selector tekton.dev/pipeline=test-mlflow-image --sort-by=.status.completionTime -o jsonpath='{range .items[?(@.spec.params[0].name == "model-name")]}{.spec.params[?(@.name == "model-name")].value} {.status.results[?(@.name == "image-sha")].value} {.status.results[?(@.name == "target-registry-url")].value}{"\n"}{end}' | awk -v model=$(params.model-name) '$1 == model && NF == 3 { print $2, $3 }' | tail -1 | tee /dev/stderr | while read sha registry ; do echo -n "$sha" > $(results.image-sha.path) ; echo -n "$registry" > $(results.target-registry-url.path) ; done ; | ||
test -s $(results.image-sha.path) && test -s $(results.target-registry-url.path) | ||
results: | ||
- name: target-registry-url | ||
description: The target-registry-url where the image will be stored | ||
- name: image-sha | ||
description: The image checksum |
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
2 changes: 0 additions & 2 deletions
2
pipelines/tekton/test-mlflow-image-pipeline/test-mlflow-image-pipelinerun-bike-rental.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
2 changes: 0 additions & 2 deletions
2
...s/tekton/test-mlflow-image-pipeline/test-mlflow-image-pipelinerun-tensorflow-housing.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
27 changes: 27 additions & 0 deletions
27
pipelines/tekton/test-mlflow-image-pipeline/test-mlflow-record-image-task.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,27 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: record-image | ||
spec: | ||
description: Record location and SHA of the built image | ||
params: | ||
- name: namespace | ||
type: string | ||
- name: model-name | ||
type: string | ||
- name: model-version | ||
type: string | ||
- name: target-registry-url | ||
type: string | ||
steps: | ||
- name: get-image-sha | ||
image: image-registry.openshift-image-registry.svc:5000/openshift/cli:latest | ||
script: | | ||
echo -n "$(params.target-registry-url)" | tee $(results.target-registry-url.path) ; | ||
echo ; | ||
oc get -n $(params.namespace) -o jsonpath='{.status.tags[?(@.tag == "$(params.model-version)")].items[0].image}' imagestream/$(params.model-name) | tee $(results.image-sha.path) | ||
results: | ||
- name: target-registry-url | ||
description: The target-registry-url where the image will be stored | ||
- name: image-sha | ||
description: The image checksum |