From 5bd2dcadbc9b5243f605deea12e6497ff9bb54e0 Mon Sep 17 00:00:00 2001 From: GiladShapira94 <100074049+GiladShapira94@users.noreply.github.com> Date: Tue, 25 Apr 2023 12:21:57 +0300 Subject: [PATCH] [Test] Add subpath to test remote workflow with relative subpath folder (#1) --- test_remote_workflow_subpath/add_1.py | 5 ++++ test_remote_workflow_subpath/add_2.py | 5 ++++ test_remote_workflow_subpath/nuclio-func.py | 5 ++++ test_remote_workflow_subpath/project.yaml | 26 +++++++++++++++++++++ test_remote_workflow_subpath/workflow.py | 15 ++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 test_remote_workflow_subpath/add_1.py create mode 100644 test_remote_workflow_subpath/add_2.py create mode 100644 test_remote_workflow_subpath/nuclio-func.py create mode 100644 test_remote_workflow_subpath/project.yaml create mode 100644 test_remote_workflow_subpath/workflow.py diff --git a/test_remote_workflow_subpath/add_1.py b/test_remote_workflow_subpath/add_1.py new file mode 100644 index 0000000..2ec06e1 --- /dev/null +++ b/test_remote_workflow_subpath/add_1.py @@ -0,0 +1,5 @@ + +def add_1(x): + x = x+3 + + return x diff --git a/test_remote_workflow_subpath/add_2.py b/test_remote_workflow_subpath/add_2.py new file mode 100644 index 0000000..ca3cfe7 --- /dev/null +++ b/test_remote_workflow_subpath/add_2.py @@ -0,0 +1,5 @@ + +def add_2(x): + x = x+2 + + return x diff --git a/test_remote_workflow_subpath/nuclio-func.py b/test_remote_workflow_subpath/nuclio-func.py new file mode 100644 index 0000000..f52dcab --- /dev/null +++ b/test_remote_workflow_subpath/nuclio-func.py @@ -0,0 +1,5 @@ + + +def handler(conext,event): + + return 1 diff --git a/test_remote_workflow_subpath/project.yaml b/test_remote_workflow_subpath/project.yaml new file mode 100644 index 0000000..f8166a8 --- /dev/null +++ b/test_remote_workflow_subpath/project.yaml @@ -0,0 +1,26 @@ +kind: project +metadata: + name: testing-workdir + created: '2023-03-26T07:22:52.792000' +spec: + functions: + - name: add-1 + kind: job + image: mlrun/mlrun + handler: add_1.add_1 + with_repo: true + - name: add-2 + kind: job + image: mlrun/mlrun + handler: add_2.add_2 + with_repo: true + workflows: + - path: ./test_remote_workflow_subpath/workflow.py + name: main + artifacts: [] + conda: '' + source: git://github.com/mlrun/system-tests.git#master + subpath: ./test_remote_workflow_subpath + origin_url: git://github.com/mlrun/system-tests.git#master + load_source_on_run: true + desired_state: online \ No newline at end of file diff --git a/test_remote_workflow_subpath/workflow.py b/test_remote_workflow_subpath/workflow.py new file mode 100644 index 0000000..a197344 --- /dev/null +++ b/test_remote_workflow_subpath/workflow.py @@ -0,0 +1,15 @@ + + +from kfp import dsl +from mlrun.platforms import auto_mount +import os +import sys +import mlrun + +funcs = {} + + +def kfpipeline(x): + add_1 = mlrun.run_function('add-1',params={'x':x},outputs=['return']) + + add_2 = mlrun.run_function('add-2',params={'x':add_1.outputs['return']})