Skip to content

Commit 31c509f

Browse files
committed
Enable new github action for PRs
1 parent 0a1c907 commit 31c509f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.github/workflows/check_notebook_submission.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ jobs:
55
name: "Check submission"
66
runs-on: ubuntu-latest
77
steps:
8-
- name: "Set up Python 3.7"
9-
uses: actions/setup-python@v1
10-
with:
11-
python-version: "3.7"
12-
138
- name: "Checkout pull request"
149
uses: actions/checkout@v2
1510
with:
@@ -35,21 +30,31 @@ jobs:
3530
- name: "Check submissions"
3631
if: "!contains(steps.commitmsg.outputs.commitmsg, 'skip ci')"
3732
env:
38-
CONTRIBUTION_HANDLER_API_KEY: ${{ secrets.CONTRIBUTION_HANDLER_API_KEY }}
33+
HUB_PYGEOAPI_AUTH_TOKEN: ${{ secrets.HUB_PYGEOAPI_AUTH_TOKEN }}
3934
run: |
4035
set -e
4136
pull_request_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
4237
43-
exit 0
44-
4538
function trigger_execution() {
4639
notebook_path=$1
4740
echo "Triggering execution of ${notebook_path}"
48-
curl --silent \
41+
42+
curl -X POST \
4943
--fail \
44+
-v \
45+
"https://hub.eox.at/services/eoxhub-gateway/eurodatacube0/pygeoapi/processes/execute-notebook/execution" \
5046
--header 'Content-Type: application/json' \
51-
--data-raw "{\"notebook_path\": \"${notebook_path}\", \"pull_request_number\": \"${pull_request_number}\"}" \
52-
"https://contributions-api.hub.eox.at/notebook-submission-check?api_key=${CONTRIBUTION_HANDLER_API_KEY}"
47+
-H "Authorization: Token ${HUB_PYGEOAPI_AUTH_TOKEN}" \
48+
--data-raw '{"inputs": {
49+
"notebook": "extra/notebook-verification/execute-eurodatacube-from-PR.ipynb",
50+
"cpu_requests": "0.3",
51+
"cpu_limit": "0.3",
52+
"mem_requests": "1G",
53+
"mem_limit": "1G",
54+
"kernel": "python3",
55+
"parameters_json": {"pull_request_number": '"${pull_request_number}"', "notebook_path_in_repo": "'"${notebook_path}"'"}
56+
}}'
57+
5358
if [ $? -ne 0 ] ; then
5459
echo "Notebook execution trigger failed"
5560
exit 1
@@ -58,12 +63,10 @@ jobs:
5863
5964
for new_file in $(jq --raw-output ".[]" $HOME/files_added.json); do
6065
echo "Checking newfile: $new_file"
61-
python ./master/.github/check_nb_metadata.py "$new_file"
6266
trigger_execution "$new_file"
6367
done
6468
for mod_file in $(jq --raw-output ".[]" $HOME/files_modified.json); do
6569
echo "Checking modified file: $mod_file"
66-
python ./master/.github/check_nb_metadata.py "$mod_file"
6770
trigger_execution "$mod_file"
6871
done
6972
@@ -73,5 +76,5 @@ jobs:
7376
env:
7477
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7578
with:
76-
msg: "I have scheduled automatic execution for all changed notebooks on the EDC cluster. The results should arrive within minutes."
79+
msg: "I have scheduled an automatic execution for all changed notebooks on EOxHub. The results should arrive within minutes."
7780
check_for_duplicate_msg: false

0 commit comments

Comments
 (0)