generated from jupyter-naas/data-product-framework
-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (40 loc) · 1.4 KB
/
scheduler__main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
jobs:
scheduler:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
- name: Pull Docker image
run: docker pull ghcr.io/${{ github.repository }}/abi:latest
- env:
NAAS_CREDENTIALS_JWT_TOKEN: ${{ secrets.NAAS_CREDENTIALS_JWT_TOKEN }}
name: main
run: '
# Generate unique id
export SCHEDULER_ID=$(python -c "import uuid; print(uuid.uuid4())")
# Execute the Scheduler script
docker run --name $SCHEDULER_ID -i -e NAAS_CREDENTIALS_JWT_TOKEN="$NAAS_CREDENTIALS_JWT_TOKEN"
--platform linux/amd64 ghcr.io/${{ github.repository }}/abi:latest python
.github/scripts/run_scheduler.py "main"
# Create the output directory that will be used to store the output files
and save them as artifacts.
mkdir -p outputs/
# Copy the output files from the container to the host.
docker cp $SCHEDULER_ID:/app/outputs ./outputs
'
- name: Upload output artifacts
uses: actions/upload-artifact@v4
with:
name: output-files
path: ./outputs
name: Scheduler - main
'on':
schedule:
- cron: 0 9 * * *
workflow_dispatch: null