From e1799b1bd851bd7c2ad7d478b7bfb6e980afe209 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag Date: Fri, 13 Jan 2023 17:59:36 -0500 Subject: [PATCH 01/20] add cicd --- cicd.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 cicd.py diff --git a/cicd.py b/cicd.py new file mode 100644 index 0000000..a4e4eaa --- /dev/null +++ b/cicd.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +import argparse,os +from domino import Domino + +def parse_args(): + parser=argparse.ArgumentParser(description="a script to do stuff") + parser.add_argument("DOMINO_PROJECT_OWNER") + parser.add_argument("DOMINO_PROJECT_NAME") + parser.add_argument("DOMINO_USER_API_KEY") + parser.add_argument("DOMINO_API_HOST") + args=parser.parse_args() + return args + +def list_environments(domino): + all_available_environments = domino.environments_list() + global_environments = list( + filter( + lambda x: x.get("visibility") == "Global", all_available_environments["data"] + ) + ) + print( + "This Domino deployment has \ + {} global environments".format( + len(global_environments) + ) + ) + + +def main(): + inputs=parse_args() + print(inputs.DOMINO_PROJECT_OWNER) + print(inputs.DOMINO_PROJECT_NAME) + print(inputs.DOMINO_USER_API_KEY) + print(inputs.DOMINO_API_HOST) + + project= inputs.DOMINO_PROJECT_OWNER + "/" + inputs.DOMINO_PROJECT_NAME + domino = Domino( + project, + api_key=inputs.DOMINO_USER_API_KEY, + host=inputs.DOMINO_API_HOST, + ) + + list_environments(domino) + +if __name__ == '__main__': + main() From 987546b6942fe2acc0532f67086e1a9f3790d1c4 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag Date: Fri, 13 Jan 2023 18:00:55 -0500 Subject: [PATCH 02/20] move cicd --- cicd.py => cicd/cicd.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cicd.py => cicd/cicd.py (100%) diff --git a/cicd.py b/cicd/cicd.py similarity index 100% rename from cicd.py rename to cicd/cicd.py From aee6af767023ac363818fec8b2620fec3a8e662f Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:03:12 -0500 Subject: [PATCH 03/20] Update dummy.txt --- dummy.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dummy.txt b/dummy.txt index 367d34a..5f74838 100644 --- a/dummy.txt +++ b/dummy.txt @@ -1 +1 @@ -Test33 +Test333 From 1f0433c69a0ccc81a6c2ec23bb84a6c0634bf0e2 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:12:29 -0500 Subject: [PATCH 04/20] Update dummy.txt --- dummy.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dummy.txt b/dummy.txt index 5f74838..b08f7b0 100644 --- a/dummy.txt +++ b/dummy.txt @@ -1 +1 @@ -Test333 +Test3 From 81ba927b902fd8a680f7df2f0bb9cb1b0a77eaf2 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:22:43 -0500 Subject: [PATCH 05/20] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 465f861..a2ad0e6 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,5 +36,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Connect to Domino run: | - python cicd/cicd.py ${{ env.DOMINO_PROJECT_OWNER }} ${{ env.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ env.DOMINO_API_HOST }}d + python cicd/cicd.py ${{ env.DOMINO_PROJECT_OWNER }} ${{ env.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ env.DOMINO_API_HOST }} From 6b158de093137b6102474ba4ff24e38cddb89083 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:23:15 -0500 Subject: [PATCH 06/20] Update dummy.txt --- dummy.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dummy.txt b/dummy.txt index b08f7b0..db4ffe2 100644 --- a/dummy.txt +++ b/dummy.txt @@ -1 +1 @@ -Test3 +Test322 From 867782c207502fa46284c94872744bcbacaaf491 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:29:13 -0500 Subject: [PATCH 07/20] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a2ad0e6..bad074c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,5 +36,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Connect to Domino run: | - python cicd/cicd.py ${{ env.DOMINO_PROJECT_OWNER }} ${{ env.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ env.DOMINO_API_HOST }} + python cicd/cicd.py ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} From 7d5553ce0f55a7c201b5a3bc4b1018bc5c100bb9 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 20:29:28 -0500 Subject: [PATCH 08/20] Update dummy.txt --- dummy.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dummy.txt b/dummy.txt index db4ffe2..345e6ae 100644 --- a/dummy.txt +++ b/dummy.txt @@ -1 +1 @@ -Test322 +Test From 6ba0d983948680f1ee012b4f3fae74daa9511829 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 22:08:51 -0500 Subject: [PATCH 09/20] Update python-app.yml --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index bad074c..5c3e19c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -14,9 +14,7 @@ permissions: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 @@ -34,6 +32,8 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test vars + run: echo ${{ secrets.DOMINO_USER_API_KEY }} - name: Connect to Domino run: | python cicd/cicd.py ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} From 5ddf4227945d67a7c397d620433464755c4c827f Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 22:13:56 -0500 Subject: [PATCH 10/20] Update python-app.yml --- .github/workflows/python-app.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5c3e19c..1127f3d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,7 +33,9 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test vars - run: echo ${{ secrets.DOMINO_USER_API_KEY }} + run: echo ${{ vars.DOMINO_PROJECT_NAME }} + - name: Test secrets + run: echo ${{ secrets.DOMINO_USER_API_KEY }} - name: Connect to Domino run: | python cicd/cicd.py ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} From 20b76c08096bc87fe886150c6dc496d7ceea8f85 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 22:20:57 -0500 Subject: [PATCH 11/20] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 1127f3d..376e033 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,7 +33,7 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test vars - run: echo ${{ vars.DOMINO_PROJECT_NAME }} + run: echo ${{ vars.DOMINO_PROJECT_OWNER }} - name: Test secrets run: echo ${{ secrets.DOMINO_USER_API_KEY }} - name: Connect to Domino From 787a86b52a766122eac11aec5b498694f8f5cc29 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Fri, 13 Jan 2023 22:26:18 -0500 Subject: [PATCH 12/20] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 376e033..1127f3d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,7 +33,7 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test vars - run: echo ${{ vars.DOMINO_PROJECT_OWNER }} + run: echo ${{ vars.DOMINO_PROJECT_NAME }} - name: Test secrets run: echo ${{ secrets.DOMINO_USER_API_KEY }} - name: Connect to Domino From 91d39e2a961d070847347f558046be4ff086d6e6 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Sat, 14 Jan 2023 20:15:01 -0500 Subject: [PATCH 13/20] Update cicd.py --- cicd/cicd.py | 76 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/cicd/cicd.py b/cicd/cicd.py index a4e4eaa..31f1842 100644 --- a/cicd/cicd.py +++ b/cicd/cicd.py @@ -3,11 +3,17 @@ from domino import Domino def parse_args(): - parser=argparse.ArgumentParser(description="a script to do stuff") - parser.add_argument("DOMINO_PROJECT_OWNER") - parser.add_argument("DOMINO_PROJECT_NAME") - parser.add_argument("DOMINO_USER_API_KEY") - parser.add_argument("DOMINO_API_HOST") + parser=argparse.ArgumentParser(description="a script to publish Domino Models") + parser.add_argument("DOMINO_MODEL_OP", type=str, help="create, list or update.") + parser.add_argument("DOMINO_PROJECT_OWNER", type=str, help="Domino Project Owner.") + parser.add_argument("DOMINO_PROJECT_NAME", type=str, help="Domino Project Name.") + parser.add_argument("DOMINO_USER_API_KEY", type=str, help="Domino user API Key.") + parser.add_argument("DOMINO_API_HOST", type=str, help="Domino URL for external or http://nucleus-frontend.domino-platform:80 from a workspace.") + parser.add_argument("DOMINO_MODEL_NAME", type=str, help="Name of the model.") + parser.add_argument("DOMINO_MODEL_DESC", type=str, help="Description of the model.") + parser.add_argument("DOMINO_MODEL_FILE", type=str, help="Name of the model file.") + parser.add_argument("DOMINO_MODEL_FUNC", type=str, help="Name of the model function.") + parser.add_argument("DOMINO_MODEL_CE", type=str, help="ID of the model compute environment.") args=parser.parse_args() return args @@ -24,14 +30,50 @@ def list_environments(domino): len(global_environments) ) ) + +def list_models(domino): + print(f"{domino.models_list()}") + +def model_exist(domino, model_name): + models = domino.models_list() + for i in models['data']: + if i['name'] == model_name: + return True +def create_model(domino,model_name, model_desc, model_file, model_func, model_ce): + # Publish a brand new model + published_model = domino.model_publish( + file=model_file, + function=model_func, + environment_id=model_ce, + name=model_name, + description=model_desc, + ) + published_model_id = published_model.get("data", {}).get("_id") + print("Model {} published, details below:".format(published_model_id)) + print(published_model) + +def publish_revision(domino,model_name, model_desc, model_file, model_func, model_ce): + # Publlish another version for this model + models = domino.models_list() + for i in models['data']: + if i['name'] == model_name: + published_model_id = i['id'] + another_model_version = domino.model_version_publish( + model_id=published_model_id, + file=model_file, + function=model_func, + environment_id=model_ce, + description=model_desc, + ) + def main(): inputs=parse_args() - print(inputs.DOMINO_PROJECT_OWNER) - print(inputs.DOMINO_PROJECT_NAME) - print(inputs.DOMINO_USER_API_KEY) - print(inputs.DOMINO_API_HOST) + print(inputs.DOMINO_MODEL_NAME) + #print(inputs.DOMINO_PROJECT_NAME) + #print(inputs.DOMINO_USER_API_KEY) + #print(inputs.DOMINO_API_HOST) project= inputs.DOMINO_PROJECT_OWNER + "/" + inputs.DOMINO_PROJECT_NAME domino = Domino( @@ -39,8 +81,20 @@ def main(): api_key=inputs.DOMINO_USER_API_KEY, host=inputs.DOMINO_API_HOST, ) - - list_environments(domino) + if inputs.DOMINO_MODEL_OP == "list": + list_models(domino) + elif inputs.DOMINO_MODEL_OP == "create": + create_model(domino,inputs.DOMINO_MODEL_NAME, inputs.DOMINO_MODEL_DESC, inputs.DOMINO_MODEL_FILE, inputs.DOMINO_MODEL_FUNC, inputs.DOMINO_MODEL_CE) + elif inputs.DOMINO_MODEL_OP == "update": + publish_revision(domino,inputs.DOMINO_MODEL_NAME, inputs.DOMINO_MODEL_DESC, inputs.DOMINO_MODEL_FILE, inputs.DOMINO_MODEL_FUNC, inputs.DOMINO_MODEL_CE) + elif inputs.DOMINO_MODEL_OP == "publish": + if model_exist(domino, inputs.DOMINO_MODEL_NAME): + publish_revision(domino,inputs.DOMINO_MODEL_NAME, inputs.DOMINO_MODEL_DESC, inputs.DOMINO_MODEL_FILE, inputs.DOMINO_MODEL_FUNC, inputs.DOMINO_MODEL_CE) + else : + create_model(domino,inputs.DOMINO_MODEL_NAME, inputs.DOMINO_MODEL_DESC, inputs.DOMINO_MODEL_FILE, inputs.DOMINO_MODEL_FUNC, inputs.DOMINO_MODEL_CE) + + if __name__ == '__main__': main() + From b48dc3c3f7776e72c18f74267c6801bb059c2f1c Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Sat, 14 Jan 2023 20:22:33 -0500 Subject: [PATCH 14/20] Update python-app.yml --- .github/workflows/python-app.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 1127f3d..f04ee49 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -38,5 +38,6 @@ jobs: run: echo ${{ secrets.DOMINO_USER_API_KEY }} - name: Connect to Domino run: | - python cicd/cicd.py ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} - + python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} +${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} +${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} From d8f144fd1cc64b27d756c99124ca7a1703af0694 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Sat, 14 Jan 2023 20:23:29 -0500 Subject: [PATCH 15/20] Update python-app.yml --- .github/workflows/python-app.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index f04ee49..a341f8e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -39,5 +39,4 @@ jobs: - name: Connect to Domino run: | python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} -${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} -${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} +${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} From 809718e302a2259434019191e63a85dc03e8fdd1 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Sat, 14 Jan 2023 20:24:18 -0500 Subject: [PATCH 16/20] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a341f8e..396cf99 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -39,4 +39,4 @@ jobs: - name: Connect to Domino run: | python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} -${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} +${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} From 6b4ab9ce8548c3d8a17df55573e780411d7022e4 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Sat, 14 Jan 2023 20:25:50 -0500 Subject: [PATCH 17/20] Update python-app.yml --- .github/workflows/python-app.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 396cf99..af3a3d5 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -38,5 +38,4 @@ jobs: run: echo ${{ secrets.DOMINO_USER_API_KEY }} - name: Connect to Domino run: | - python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} -${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} + python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} From f3ffb12cf98c57295b6ebd5b412137283065a2c2 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Tue, 17 Jan 2023 08:50:39 -0500 Subject: [PATCH 18/20] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index af3a3d5..8d8bb72 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,6 +36,6 @@ jobs: run: echo ${{ vars.DOMINO_PROJECT_NAME }} - name: Test secrets run: echo ${{ secrets.DOMINO_USER_API_KEY }} - - name: Connect to Domino + - name: Deploy to Domino Staging run: | python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} From d0b2b48bdf0f7e8a39948cdc71aa3daa51b4879e Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Tue, 17 Jan 2023 09:27:53 -0500 Subject: [PATCH 19/20] Update python-app.yml --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8d8bb72..c5ca82f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,8 +13,9 @@ permissions: contents: read jobs: - build: + deploy-staging: runs-on: ubuntu-latest + environment: 'staging' steps: - uses: actions/checkout@v3 - name: Set up Python 3.10 From ec3537b2d5daacffb60e83cf0f38c50e97b8c487 Mon Sep 17 00:00:00 2001 From: ddl-wasanthag <101346855+ddl-wasanthag@users.noreply.github.com> Date: Tue, 17 Jan 2023 09:58:11 -0500 Subject: [PATCH 20/20] Update python-app.yml --- .github/workflows/python-app.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index c5ca82f..ed76f46 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -40,3 +40,21 @@ jobs: - name: Deploy to Domino Staging run: | python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }} + deploy-production: + runs-on: ubuntu-latest + environment: 'production' + needs: deploy-staging + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest dominodatalab + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Deploy to Domino Production + run: | + python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }}