-
Notifications
You must be signed in to change notification settings - Fork 49
79 lines (75 loc) · 2.53 KB
/
run-syne-tune.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Run Syne Tune
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
on:
workflow_call:
inputs:
script-path:
required: true
type: string
requires-aws-credentials:
required: false
type: boolean
additional-command:
required: false
type: string
timeout-minutes:
required: false
type: number
extras-require:
required: false
type: string
download-artifact-path:
required: false
type: string
download-artifact-name:
required: false
type: string
secrets:
PROD_AWS_INTEG_TEST_ROLE_ARN:
required: false
env:
AWS_DEFAULT_REGION: us-west-2
SCRIPT_PATH: ${{ inputs.script-path }}
AWS_ROLE: ${{ secrets.PROD_AWS_INTEG_TEST_ROLE_ARN }}
jobs:
run:
runs-on: syne-tune_ubuntu-latest_16-core
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- name: Configure AWS Credentials (if required)
if: ${{ inputs.requires-aws-credentials == true }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PROD_AWS_INTEG_TEST_ROLE_ARN }}
role-session-name: integtestsession
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: 'pip'
- name: Pip install basics
run: |
python -m pip install wheel
python -m pip install --upgrade pip
- name: Install Syne Tune with core dependencies only
if: ${{ inputs.extras-require == '' }}
run: python -m pip install -e '.'
- name: Install Syne Tune with selected dependencies
if: ${{ inputs.extras-require != '' }}
run: python -m pip install -e '.[${{ inputs.extras-require }}]'
- name: Download artifact (must have been previously uploaded via actions/upload-artifact)
if: ${{ inputs.download-artifact-path != '' }}
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ inputs.download-artifact-name }}
path: ${{ inputs.download-artifact-path }}
- name: Run optional custom command
if: ${{ inputs.additional-command != '' }}
run: ${{ inputs.additional-command }}
- name: Run Syne Tune Script
run: |
python ${{ inputs.script-path }}