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

fix(backend): Update compiler with new test sdk and fix dag publisher execution id #1425

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/v2/compiler/tektoncompiler/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (i *pubDagDriverInputs) getParentDagID(isExitHandler bool) string {
if isExitHandler && i.parentDagID == compiler.RootComponentName {
return fmt.Sprintf("$(params.%s)", paramParentDagID)
} else if i.inLoopDag {
return fmt.Sprintf("$(params.%s)", paramParentDagID)
return taskOutputParameter(getDAGDriverTaskName(i.parentDagID), paramExecutionID)
Copy link
Member

Choose a reason for hiding this comment

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

merge this with the else block?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe we have 4 cases here,

  1. if root
  2. if exit handler root
  3. if subdag
  4. else

In all our current test cases, we only trigger the last two scenarios because it doesn't make sense for publisher to be root or exit handler root. We can either keep all these 4 scenarios to be in sync with getParentDagID. Or we can just make the whole function to return taskOutputParameter(getDAGDriverTaskName(i.parentDagID), paramExecutionID).

WDYT? I would just go ahead and check if getParentDagID != "" or nil then return taskOutputParameter else raise error.

Copy link
Member

Choose a reason for hiding this comment

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

for me, logically, merging them and adding comments there would be good. otherwise, it's confusing.

} else {
return taskOutputParameter(getDAGDriverTaskName(i.parentDagID), paramExecutionID)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.12'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand Down Expand Up @@ -127,7 +127,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.12'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand Down Expand Up @@ -156,7 +156,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.12'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand All @@ -183,7 +183,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.12'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand All @@ -210,7 +210,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.12'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand Down Expand Up @@ -285,4 +285,4 @@ pipelineSpec:
isOptional: true
parameterType: STRING
schemaVersion: 2.1.0
sdkVersion: kfp-2.0.0-beta.12
sdkVersion: kfp-2.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
value: '{"args":["--executor_input","{{$}}","--function_to_execute","print_op"],"command":["sh","-c","\nif
! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||
python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.0-beta.6''
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.1''
\u0026\u0026 \"$0\" \"$@\"\n","sh","-ec","program_path=$(mktemp
-d)\nprintf \"%s\" \"$0\" \u003e \"$program_path/ephemeral_component.py\"\npython3
-m kfp.components.executor_main --component_module_path \"$program_path/ephemeral_component.py\" \"$@\"\n","\nimport
Expand Down Expand Up @@ -97,7 +97,7 @@ spec:
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi

PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.6' && "$0" "$@"
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1' && "$0" "$@"
- sh
- -ec
- |
Expand Down Expand Up @@ -205,7 +205,7 @@ spec:
value: '{"args":["--executor_input","{{$}}","--function_to_execute","fail_op"],"command":["sh","-c","\nif
! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip || python3
-m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.0-beta.6''
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.1''
\u0026\u0026 \"$0\" \"$@\"\n","sh","-ec","program_path=$(mktemp -d)\nprintf
\"%s\" \"$0\" \u003e \"$program_path/ephemeral_component.py\"\npython3 -m
kfp.components.executor_main --component_module_path \"$program_path/ephemeral_component.py\" \"$@\"\n","\nimport
Expand Down Expand Up @@ -258,7 +258,7 @@ spec:
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi

PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.6' && "$0" "$@"
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1' && "$0" "$@"
- sh
- -ec
- |
Expand Down Expand Up @@ -347,7 +347,7 @@ spec:
value: '{"args":["--executor_input","{{$}}","--function_to_execute","print_op"],"command":["sh","-c","\nif
! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip || python3
-m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.0-beta.6''
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.1''
\u0026\u0026 \"$0\" \"$@\"\n","sh","-ec","program_path=$(mktemp -d)\nprintf
\"%s\" \"$0\" \u003e \"$program_path/ephemeral_component.py\"\npython3 -m
kfp.components.executor_main --component_module_path \"$program_path/ephemeral_component.py\" \"$@\"\n","\nimport
Expand Down Expand Up @@ -400,7 +400,7 @@ spec:
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi

PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.6' && "$0" "$@"
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1' && "$0" "$@"
- sh
- -ec
- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.6'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand All @@ -89,7 +89,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.6'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand All @@ -116,7 +116,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.6'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand Down Expand Up @@ -167,4 +167,4 @@ pipelineSpec:
defaultValue: Hello World!
parameterType: STRING
schemaVersion: 2.1.0
sdkVersion: kfp-2.0.0-beta.6
sdkVersion: kfp-2.0.1
14 changes: 7 additions & 7 deletions backend/src/v2/compiler/tektoncompiler/testdata/loop_static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
- name: run-id
value: $(context.pipelineRun.uid)
- name: dag-execution-id
value: $(params.parent-dag-id)
value: $(tasks.for-loop-2-loop-dag-driver.results.execution-id)
- name: mlmd-server-address
value: metadata-grpc-service.kubeflow.svc.cluster.local
- name: mlmd-server-port
Expand All @@ -98,7 +98,7 @@ spec:
value: '{"args":["--executor_input","{{$}}","--function_to_execute","concat_op"],"command":["sh","-c","\nif
! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||
python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.0-beta.15''
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.1''
\u0026\u0026 \"$0\" \"$@\"\n","sh","-ec","program_path=$(mktemp
-d)\nprintf \"%s\" \"$0\" \u003e \"$program_path/ephemeral_component.py\"\npython3
-m kfp.components.executor_main --component_module_path \"$program_path/ephemeral_component.py\" \"$@\"\n","\nimport
Expand Down Expand Up @@ -152,7 +152,7 @@ spec:
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi

PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.15' && "$0" "$@"
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1' && "$0" "$@"
- sh
- -ec
- |
Expand Down Expand Up @@ -239,7 +239,7 @@ spec:
value: '{"args":["--executor_input","{{$}}","--function_to_execute","print_op"],"command":["sh","-c","\nif
! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||
python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.0-beta.15''
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.1''
\u0026\u0026 \"$0\" \"$@\"\n","sh","-ec","program_path=$(mktemp
-d)\nprintf \"%s\" \"$0\" \u003e \"$program_path/ephemeral_component.py\"\npython3
-m kfp.components.executor_main --component_module_path \"$program_path/ephemeral_component.py\" \"$@\"\n","\nimport
Expand Down Expand Up @@ -295,7 +295,7 @@ spec:
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi

PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.15' && "$0" "$@"
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1' && "$0" "$@"
- sh
- -ec
- |
Expand Down Expand Up @@ -427,7 +427,7 @@ spec:
value: '{"args":["--executor_input","{{$}}","--function_to_execute","print_op"],"command":["sh","-c","\nif
! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip || python3
-m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.0-beta.15''
python3 -m pip install --quiet --no-warn-script-location ''kfp==2.0.1''
\u0026\u0026 \"$0\" \"$@\"\n","sh","-ec","program_path=$(mktemp -d)\nprintf
\"%s\" \"$0\" \u003e \"$program_path/ephemeral_component.py\"\npython3 -m
kfp.components.executor_main --component_module_path \"$program_path/ephemeral_component.py\" \"$@\"\n","\nimport
Expand Down Expand Up @@ -480,7 +480,7 @@ spec:
python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip
fi

PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.15' && "$0" "$@"
PIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1' && "$0" "$@"
- sh
- -ec
- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.15'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand All @@ -114,7 +114,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.15'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand All @@ -141,7 +141,7 @@ pipelineSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.0-beta.15'\
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.0.1'\
\ && \"$0\" \"$@\"\n"
- sh
- -ec
Expand Down Expand Up @@ -188,4 +188,4 @@ pipelineSpec:
isOptional: true
parameterType: STRING
schemaVersion: 2.1.0
sdkVersion: kfp-2.0.0-beta.15
sdkVersion: kfp-2.0.1
Loading
Loading