Skip to content

Commit

Permalink
Merge pull request opendatahub-io#509 from harshad16/fix-tf-kfp
Browse files Browse the repository at this point in the history
Patch elyra kfp template to fix kfp-kubernetes issue
  • Loading branch information
harshad16 authored Apr 23, 2024
2 parents bf358c8 + 4792f3a commit f65c333
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jupyter/tensorflow/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ LABEL name="odh-notebook-cuda-jupyter-tensorflow-ubi9-python-3.9" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/tensorflow/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/workbench-images:cuda-jupyter-tensorflow-ubi9-python-3.9"

COPY utils ./utils/
# Install Python packages and Jupyterlab extensions from Pipfile.lock
COPY Pipfile.lock ./

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

# Temporary:Workaround for fixing the kfp-kubernetes 1.0.0 for elyra pipeline execution
# TODO: Remove this patch once the issue is fixed with kfp-kubernetes upgrade.
RUN patch /opt/app-root/lib/python3.9/site-packages/elyra/templates/kubeflow/v2/python_dsl_template.jinja2 -i utils/python_dsl_template.patch

# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
RUN sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json

Expand Down
29 changes: 29 additions & 0 deletions jupyter/tensorflow/ubi9-python-3.9/utils/python_dsl_template.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/python_dsl_template.jinja2 2024-04-18 17:54:08.373533064 -0400
+++ b/python_dsl_template.jinja2 2024-04-18 18:01:30.152253439 -0400
@@ -97,9 +97,6 @@
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" })
{% endif %}
{{ task_name }}.set_display_name("{{ workflow_task.name | string_delimiter_safe }}")
-{% if workflow_task.doc %}
- add_pod_annotation({{ task_name }}, "elyra/node-user-doc","""{{ workflow_task.doc| string_delimiter_safe }}""")
-{% endif %}
{% if workflow_task.task_modifiers.cpu_request %}
{{ task_name }}.set_cpu_request(cpu="{{ workflow_task.task_modifiers.cpu_request }}")
{% endif %}
@@ -126,16 +123,6 @@
{% if workflow_task.task_modifiers.disable_node_caching %}
{{ task_name }}.execution_options.caching_strategy.max_cache_staleness = "P0D"
{% endif %}
-{% if workflow_task.task_modifiers.pod_labels %}
-{% for pod_label_key, pod_label_value in workflow_task.task_modifiers.pod_labels.items() %}
- add_pod_label({{ task_name }}, "{{ pod_label_key }}", "{{ pod_label_value }}")
-{% endfor %}
-{% endif %}
-{% if workflow_task.task_modifiers.pod_annotations %}
-{% for pod_annotation_key, pod_annotation_value in workflow_task.task_modifiers.pod_annotations.items() %}
- add_pod_annotation({{ task_name }}, "{{ pod_annotation_key }}" , """{{ pod_annotation_value | string_delimiter_safe }}""")
-{% endfor %}
-{% endif %}
{% if workflow_task.task_modifiers.kubernetes_secrets %}
{% for env_var, secret_dict in workflow_task.task_modifiers.kubernetes_secrets.items() %}
secret.use_secret_as_env({{ task_name }}, "{{ secret_dict.name }}", { "{{ secret_dict.key }}" : "{{ env_var }}" })

0 comments on commit f65c333

Please sign in to comment.