Skip to content

Commit 4792f3a

Browse files
committed
Patch elyra kfp template to fix kfp-kubernetes issue
Signed-off-by: Harshad Reddy Nalla <[email protected]>
1 parent 5166b53 commit 4792f3a

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

jupyter/tensorflow/ubi9-python-3.9/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ LABEL name="odh-notebook-cuda-jupyter-tensorflow-ubi9-python-3.9" \
1111
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/tensorflow/ubi9-python-3.9" \
1212
io.openshift.build.image="quay.io/opendatahub/workbench-images:cuda-jupyter-tensorflow-ubi9-python-3.9"
1313

14+
COPY utils ./utils/
1415
# Install Python packages and Jupyterlab extensions from Pipfile.lock
1516
COPY Pipfile.lock ./
1617

1718
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
1819

20+
# Temporary:Workaround for fixing the kfp-kubernetes 1.0.0 for elyra pipeline execution
21+
# TODO: Remove this patch once the issue is fixed with kfp-kubernetes upgrade.
22+
RUN patch /opt/app-root/lib/python3.9/site-packages/elyra/templates/kubeflow/v2/python_dsl_template.jinja2 -i utils/python_dsl_template.patch
23+
1924
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
2025
RUN sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json
2126

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--- a/python_dsl_template.jinja2 2024-04-18 17:54:08.373533064 -0400
2+
+++ b/python_dsl_template.jinja2 2024-04-18 18:01:30.152253439 -0400
3+
@@ -97,9 +97,6 @@
4+
secret.use_secret_as_env({{ task_name }}, "{{ workflow_task.task_modifiers.object_storage_secret }}", { "AWS_ACCESS_KEY_ID": "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY": "AWS_SECRET_ACCESS_KEY" })
5+
{% endif %}
6+
{{ task_name }}.set_display_name("{{ workflow_task.name | string_delimiter_safe }}")
7+
-{% if workflow_task.doc %}
8+
- add_pod_annotation({{ task_name }}, "elyra/node-user-doc","""{{ workflow_task.doc| string_delimiter_safe }}""")
9+
-{% endif %}
10+
{% if workflow_task.task_modifiers.cpu_request %}
11+
{{ task_name }}.set_cpu_request(cpu="{{ workflow_task.task_modifiers.cpu_request }}")
12+
{% endif %}
13+
@@ -126,16 +123,6 @@
14+
{% if workflow_task.task_modifiers.disable_node_caching %}
15+
{{ task_name }}.execution_options.caching_strategy.max_cache_staleness = "P0D"
16+
{% endif %}
17+
-{% if workflow_task.task_modifiers.pod_labels %}
18+
-{% for pod_label_key, pod_label_value in workflow_task.task_modifiers.pod_labels.items() %}
19+
- add_pod_label({{ task_name }}, "{{ pod_label_key }}", "{{ pod_label_value }}")
20+
-{% endfor %}
21+
-{% endif %}
22+
-{% if workflow_task.task_modifiers.pod_annotations %}
23+
-{% for pod_annotation_key, pod_annotation_value in workflow_task.task_modifiers.pod_annotations.items() %}
24+
- add_pod_annotation({{ task_name }}, "{{ pod_annotation_key }}" , """{{ pod_annotation_value | string_delimiter_safe }}""")
25+
-{% endfor %}
26+
-{% endif %}
27+
{% if workflow_task.task_modifiers.kubernetes_secrets %}
28+
{% for env_var, secret_dict in workflow_task.task_modifiers.kubernetes_secrets.items() %}
29+
secret.use_secret_as_env({{ task_name }}, "{{ secret_dict.name }}", { "{{ secret_dict.key }}" : "{{ env_var }}" })

0 commit comments

Comments
 (0)