-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·35 lines (33 loc) · 1.58 KB
/
wandb_create_and_build_job.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
name: "Create W&B Job (+ cloud build)"
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo content
uses: actions/checkout@v4 # checkout the repository content to github runner.
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.10.14 #install the python needed
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wandb
- name: "Login to W&B"
run: |
wandb login ${{ secrets.WANDB_API_KEY }}
- name: "Login to GCP" # at this point we could deploy with wandb job create code, which would deploy with this version, however it then wouldn't link back to the Github branch on W&B which is really handy.##git config credential.helper '!f() { echo username=dead-water; echo "password=${{ secrets.PAT_GITHUB_READONLY_THIS_REPO }}"; };f'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_CRED }}
- name: "Submit Google Cloud Build"
run: |
tar -cvzf ../repo.tgz ./*
gcloud builds submit ../repo.tgz --tag ${{ secrets.GCP_ARTIFACT_REG }}/sdofm:${{ github.ref_name }}
- name: "Create W&B job"
run: |
wandb job create --project "${{ secrets.WANDB_PROJECT }}" --entity "${{ secrets.WANDB_ORG }}" --name "GHA-SDO-FM" -g ${{ github.ref_name }}" -a ${{ github.ref_name }}" --entry-point "scripts/main.py --config-name=default" image ${{ secrets.GCP_ARTIFACT_REG }}/sdofm:${{ github.ref_name }}