Skip to content

Commit 05baded

Browse files
authored
feat(backend): specify the image for result step (kubeflow#1104)
Allow users to specify the image for `step-move-all-results-to-tekton-home` step. Add an env variable for the custom image: `MOVERESULTS_IMAGE` in the api server. Signed-off-by: Yihong Wang <[email protected]> Signed-off-by: Yihong Wang <[email protected]>
1 parent d39886d commit 05baded

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

backend/src/apiserver/common/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const (
4545
InjectDefaultScript string = "INJECT_DEFAULT_SCRIPT"
4646
ApplyTektonCustomResource string = "APPLY_TEKTON_CUSTOM_RESOURCE"
4747
TerminateStatus string = "TERMINATE_STATUS"
48+
MoveResultsImage string = "MOVERESULTS_IMAGE"
4849
Path4InternalResults string = "PATH_FOR_INTERNAL_RESULTS"
4950
ObjectStoreAccessKey string = "OBJECTSTORECONFIG_ACCESSKEY"
5051
ObjectStoreSecretKey string = "OBJECTSTORECONFIG_SECRETKEY"
@@ -144,6 +145,10 @@ func GetArtifactImage() string {
144145
return GetStringConfigWithDefault(ArtifactImage, DefaultArtifactImage)
145146
}
146147

148+
func GetMoveResultsImage() string {
149+
return GetStringConfigWithDefault(MoveResultsImage, DefaultMoveResultImage)
150+
}
151+
147152
func GetCopyStepTemplate() *workflowapi.Step {
148153
var tpl workflowapi.Step
149154
if err := viper.UnmarshalKey(ArtifactCopyStepTemplate, &tpl); err != nil {

backend/src/apiserver/common/const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const (
7373
DefaultArtifactEndpoint string = "minio-service.kubeflow:9000"
7474
DefaultArtifactEndpointScheme string = "http://"
7575
DefaultArtifactImage string = "minio/mc"
76+
DefaultMoveResultImage string = "busybox"
7677
)
7778

7879
const (

backend/src/apiserver/template/tekton_template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (t *Tekton) injectArchivalStep(workflow util.Workflow, artifactItemsJSON ma
308308
// move all results to /tekton/home/tep-results to avoid result duplication in copy-artifacts step
309309
// TODO: disable eof strip, since no results under /tekton/results after this step
310310
moveResults := workflowapi.Step{
311-
Image: "busybox",
311+
Image: common.GetMoveResultsImage(),
312312
Name: "move-all-results-to-tekton-home",
313313
Command: []string{"sh", "-c"},
314314
Args: []string{fmt.Sprintf("if [ -d /tekton/results ]; then mkdir -p %s; mv /tekton/results/* %s/ || true; fi\n",

manifests/kustomize/base/pipeline/apiserver-deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ spec:
110110
configMapKeyRef:
111111
name: kfp-tekton-config
112112
key: artifact_image
113+
- name: MOVERESULTS_IMAGE
114+
valueFrom:
115+
configMapKeyRef:
116+
name: kfp-tekton-config
117+
key: moveresults_image
113118
- name: INJECT_DEFAULT_SCRIPT
114119
valueFrom:
115120
configMapKeyRef:

manifests/kustomize/base/pipeline/kfp-pipeline-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ data:
88
artifact_endpoint_scheme: "http://"
99
artifact_image: "minio/mc:RELEASE.2020-11-25T23-04-07Z"
1010
archive_logs: "true"
11+
moveresults_image: "busybox:1.34.1"
1112
track_artifacts: "true"
1213
strip_eof: "true"
1314
inject_default_script: "true"

0 commit comments

Comments
 (0)