From edcaf541d466de0a2c7b306ce66229746a89ca3e Mon Sep 17 00:00:00 2001 From: Bernhard Mallinger Date: Mon, 23 Oct 2023 16:41:44 +0200 Subject: [PATCH] Enable new GH Action --- .../workflows/check_notebook_submission.yml | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check_notebook_submission.yml b/.github/workflows/check_notebook_submission.yml index 685c922..0419741 100644 --- a/.github/workflows/check_notebook_submission.yml +++ b/.github/workflows/check_notebook_submission.yml @@ -5,10 +5,10 @@ jobs: name: "Check submission" runs-on: ubuntu-latest steps: - - name: "Set up Python 3.7" + - name: "Set up Python 3.11" uses: actions/setup-python@v1 with: - python-version: "3.7" + python-version: "3.11" - name: "Checkout pull request" uses: actions/checkout@v2 @@ -35,7 +35,7 @@ jobs: - name: "Check submissions" if: "!contains(steps.commitmsg.outputs.commitmsg, 'skip ci')" env: - CONTRIBUTION_HANDLER_API_KEY: ${{ secrets.CONTRIBUTION_HANDLER_API_KEY }} + HUB_PYGEOAPI_AUTH_TOKEN: ${{ secrets.CONTRIBUTION_HANDLER_API_KEY }} run: | set -e pull_request_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") @@ -45,11 +45,22 @@ jobs: function trigger_execution() { notebook_path=$1 echo "Triggering execution of ${notebook_path}" - curl --silent \ + + curl -X POST \ --fail \ + -v "https://hub.eox.at/services/eoxhub-gateway/eurodatacube0/pygeoapi" \ --header 'Content-Type: application/json' \ - --data-raw "{\"notebook_path\": \"${notebook_path}\", \"pull_request_number\": \"${pull_request_number}\"}" \ - "https://contributions-api.hub.eox.at/notebook-submission-check?api_key=${CONTRIBUTION_HANDLER_API_KEY}" + -H "Authorization: Token ${HUB_PYGEOAPI_AUTH_TOKEN}" \ + --data-raw '{"inputs": { + "notebook": "extra/notebook-verification/execute-eurodatacube-from-pr.ipynb", + "cpu_requests": "0.3", + "cpu_limit": "0.3", + "mem_requests": "1G", + "mem_limit": "1G", + "kernel": "python3", + "parameters_json": {"pull_request_number": "${pull_request_number}", "notebook_path_in_repo": "${notebook_path}"} + }}' + if [ $? -ne 0 ] ; then echo "Notebook execution trigger failed" exit 1 @@ -73,5 +84,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - msg: "I have scheduled automatic execution for all changed notebooks on the EDC cluster. The results should arrive within minutes." + msg: "I have scheduled an automatic execution for all changed notebooks on EOxHub. The results should arrive within minutes." check_for_duplicate_msg: false