Skip to content

Commit

Permalink
test(sdk): Restored the ParallelFor compiler test data (#4103)
Browse files Browse the repository at this point in the history
* SDK - Tests - Restored the ParallelFor compiler test data

Fixes #4102

* Removed the pipeline-sdk-type annotations

* Fixed the test_artifact_passing_using_volume test data
  • Loading branch information
Ark-kun authored and Bobgy committed Jul 2, 2020
1 parent e60704c commit 47b0878
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 174 deletions.
141 changes: 141 additions & 0 deletions sdk/python/tests/compiler/testdata/artifact_passing_using_volume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"name": "artifact_passing_pipeline"}'
generateName: artifact-passing-pipeline-
spec:
arguments:
parameters: []
entrypoint: artifact-passing-pipeline
serviceAccountName: pipeline-runner
templates:
- name: artifact-passing-pipeline
dag:
tasks:
- name: consumer
template: consumer
arguments:
parameters:
- name: processor-Output-1
value: '{{tasks.processor.outputs.parameters.processor-Output-1}}'
- name: processor-Output-2-subpath
value: '{{tasks.processor.outputs.parameters.processor-Output-2-subpath}}'
dependencies:
- processor
- name: processor
template: processor
arguments:
parameters:
- name: producer-Output-1
value: '{{tasks.producer.outputs.parameters.producer-Output-1}}'
- name: producer-Output-2-subpath
value: '{{tasks.producer.outputs.parameters.producer-Output-2-subpath}}'
dependencies:
- producer
- name: producer
template: producer
- name: consumer
metadata:
annotations:
pipelines.kubeflow.org/component_spec: '{"inputs": [{"name": "Input parameter"}, {"name": "Input artifact"}], "name": "Consumer"}'
inputs:
parameters:
- name: processor-Output-1
- name: processor-Output-2-subpath
container:
image: alpine
command:
- sh
- -c
- |
echo "Input parameter = $0"
echo "Input artifact = " && cat "$1"
args:
- '{{inputs.parameters.processor-Output-1}}'
- /tmp/inputs/Input_artifact/data
volumeMounts:
- name: data-storage
mountPath: /tmp/inputs/Input_artifact
readOnly: true
subPath: '{{inputs.parameters.processor-Output-2-subpath}}'
- name: processor
metadata:
annotations:
pipelines.kubeflow.org/component_spec: '{"inputs": [{"name": "Input parameter"}, {"name": "Input artifact"}], "name": "Processor", "outputs": [{"name": "Output 1"}, {"name": "Output 2"}]}'
inputs:
parameters:
- name: producer-Output-1
- name: producer-Output-2-subpath
outputs:
parameters:
- name: processor-Output-1
valueFrom:
path: /tmp/outputs/Output_1/data
- name: processor-Output-1-subpath
value: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-1
- name: processor-Output-2-subpath
value: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-2
container:
image: alpine
command:
- sh
- -c
- |
mkdir -p "$(dirname "$2")"
mkdir -p "$(dirname "$3")"
echo "$0" > "$2"
cp "$1" "$3"
args:
- '{{inputs.parameters.producer-Output-1}}'
- /tmp/inputs/Input_artifact/data
- /tmp/outputs/Output_1/data
- /tmp/outputs/Output_2/data
volumeMounts:
- mountPath: /tmp/inputs/Input_artifact
name: data-storage
readOnly: true
subPath: '{{inputs.parameters.producer-Output-2-subpath}}'
- mountPath: /tmp/outputs/Output_1
name: data-storage
subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-1
- mountPath: /tmp/outputs/Output_2
name: data-storage
subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/processor-Output-2
- name: producer
metadata:
annotations:
pipelines.kubeflow.org/component_spec: '{"name": "Producer", "outputs": [{"name": "Output 1"}, {"name": "Output 2"}]}'
outputs:
parameters:
- name: producer-Output-1
valueFrom:
path: /tmp/outputs/Output_1/data
- name: producer-Output-1-subpath
value: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-1
- name: producer-Output-2-subpath
value: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-2
container:
image: alpine
command:
- sh
- -c
- |
mkdir -p "$(dirname "$0")"
mkdir -p "$(dirname "$1")"
echo "Data 1" > $0
echo "Data 2" > $1
args:
- /tmp/outputs/Output_1/data
- /tmp/outputs/Output_2/data
volumeMounts:
- mountPath: /tmp/outputs/Output_1
name: data-storage
subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-1
- mountPath: /tmp/outputs/Output_2
name: data-storage
subPath: artifact_data/{{workflow.uid}}_{{pod.name}}/producer-Output-2
volumes:
- name: data-storage
persistentVolumeClaim:
claimName: data-volume
Loading

0 comments on commit 47b0878

Please sign in to comment.