Skip to content

Commit

Permalink
Enable new GH Action
Browse files Browse the repository at this point in the history
  • Loading branch information
totycro committed Oct 23, 2023
1 parent f1072b1 commit edcaf54
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/check_notebook_submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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
Expand All @@ -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

0 comments on commit edcaf54

Please sign in to comment.