Skip to content

Commit c5eccec

Browse files
authored
Merge pull request #6 from codingpot/fix/typo-wandb
Fix/typo wandb
2 parents 62bcb66 + ae77982 commit c5eccec

File tree

4 files changed

+36
-32
lines changed

4 files changed

+36
-32
lines changed

.github/actions/exp/jl-dvc/action.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ runs:
1717
using: "composite"
1818
steps:
1919
- name: prepare script
20-
if: steps.check.outputs.triggered == 'true'
2120
env:
22-
CUR_BRANCH: ${{ steps.pr_data.outputs.branch }}
23-
CUR_PR_ID: ${{ steps.pr_data.outputs.number }}
24-
GDRIVE_CREDENTIAL: ${{ secrets.GDRIVE_CREDENTIAL }}
25-
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
26-
CLOUD_ID: ${{ env.JARVISLABS_ID }}
27-
CLOUD_AT: ${{ env.JARVISLABS_ACCESS_TOKEN }}
21+
CUR_BRANCH: ${{ inputs.CUR_BRANCH }}
22+
CUR_PR_ID: ${{ inputs.CUR_PR_ID }}
23+
GDRIVE_CREDENTIAL: ${{ inputs.GDRIVE_CREDENTIAL }}
24+
GH_ACCESS_TOKEN: ${{ inputs.GH_ACCESS_TOKEN }}
25+
CLOUD_ID: ${{ inputs.JARVISLABS_ID }}
26+
CLOUD_AT: ${{ inputs.JARVISLABS_ACCESS_TOKEN }}
2827
run: |
2928
envsubst \
3029
'$CUR_BRANCH, \
@@ -36,32 +35,28 @@ runs:
3635
< scripts/experiments.sh \
3736
> scripts/experiments_tmp.sh
3837
39-
- name: install jarvislabs client
40-
if: steps.check.outputs.triggered == 'true'
38+
- name: install jarvislabs client
4139
run: |
4240
pip install typer
4341
pip install git+https://github.com/jarvislabsai/jlclient.git
4442
4543
- name: add script to jarvislabs
4644
id: add_script
47-
if: steps.check.outputs.triggered == 'true'
4845
run: |
4946
python clouds/jarvislabs.py \
5047
script add \
51-
${{ env.CLOUD_AT }} ${{ env.CLOUD_ID }} scripts/experiments_tmp.sh \
48+
${{ inputs.JARVISLABS_ACCESS_TOKEN }} ${{ inputs.JARVISLABS_ID }} scripts/experiments_tmp.sh \
5249
> outputs.txt
5350
echo "::set-output name=script_id::$(cat outputs.txt)"
5451
5552
- name: create vm on jarvislabs
56-
if: steps.check.outputs.triggered == 'true'
5753
run: |
5854
python clouds/jarvislabs.py \
5955
vm create \
60-
${{ env.CLOUD_AT }} ${{ env.CLOUD_ID }} ${{ steps.add_script.outputs.script_id }}
56+
${{ inputs.JARVISLABS_ACCESS_TOKEN }} ${{ inputs.JARVISLABS_ID }} ${{ steps.add_script.outputs.script_id }}
6157
6258
- name: remove script from jarvislabs
63-
if: steps.check.outputs.triggered == 'true'
6459
run: |
6560
python clouds/jarvislabs.py \
6661
script remove \
67-
${{ env.CLOUD_AT }} ${{ env.CLOUD_ID }} ${{ steps.add_script.outputs.script_id }}
62+
${{ inputs.JARVISLABS_ACCESS_TOKEN }} ${{ inputs.JARVISLABS_ID }} ${{ steps.add_script.outputs.script_id }}

.github/actions/exp/jl-wandb/action.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,47 +22,54 @@ runs:
2222
steps:
2323
- name: prepare script
2424
env:
25-
CUR_BRANCH: $CUR_BRANCH
26-
CUR_PR_ID: $CUR_PR_ID
27-
GDRIVE_CREDENTIAL: $GDRIVE_CREDENTIAL
28-
GH_ACCESS_TOKEN: $GH_ACCESS_TOKEN
29-
CLOUD_ID: $JARVISLABS_ID
30-
CLOUD_AT: $JARVISLABS_ACCESS_TOKEN
31-
WANDB_PROJECT: $WANDB_PROJECT
32-
WANDB_API_KEY: $WANDB_API_KEY
25+
CUR_BRANCH: ${{ inputs.CUR_BRANCH }}
26+
CUR_PR_ID: ${{ inputs.CUR_PR_ID }}
27+
GDRIVE_CREDENTIAL: ${{ inputs.GDRIVE_CREDENTIAL }}
28+
GH_ACCESS_TOKEN: ${{ inputs.GH_ACCESS_TOKEN }}
29+
CLOUD_ID: ${{ inputs.JARVISLABS_ID }}
30+
CLOUD_AT: ${{ inputs.JARVISLABS_ACCESS_TOKEN }}
31+
WANDB_PROJECT: ${{ inputs.WANDB_PROJECT }}
32+
WANDB_API_KEY: ${{ inputs.WANDB_API_KEY }}
3333
run: |
3434
envsubst \
3535
'$CUR_BRANCH, \
3636
$CUR_PR_ID, \
3737
$GDRIVE_CREDENTIAL, \
3838
$GH_ACCESS_TOKEN, \
3939
$CLOUD_ID, \
40-
$CLOUD_AT' \
41-
< scripts/js_exp_wandb.sh \
42-
> scripts/js_exp_wandb_tmp.sh
40+
$CLOUD_AT, \
41+
$WANDB_PROJECT, \
42+
$WANDB_API_KEY' \
43+
< scripts/jl_exp_wandb.sh \
44+
> scripts/jl_exp_wandb_tmp.sh
45+
shell: bash
4346

4447
- name: install jarvislabs client
4548
run: |
4649
pip install typer
4750
pip install git+https://github.com/jarvislabsai/jlclient.git
51+
shell: bash
4852

4953
- name: add script to jarvislabs
5054
id: add_script
5155
run: |
5256
python clouds/jarvislabs.py \
5357
script add \
54-
${{ env.CLOUD_AT }} ${{ env.CLOUD_ID }} scripts/js_exp_wandb_tmp.sh \
58+
${{ inputs.JARVISLABS_ACCESS_TOKEN }} ${{ inputs.JARVISLABS_ID }} scripts/jl_exp_wandb_tmp.sh \
5559
> outputs.txt
5660
echo "::set-output name=script_id::$(cat outputs.txt)"
61+
shell: bash
5762

5863
- name: create vm on jarvislabs
5964
run: |
6065
python clouds/jarvislabs.py \
6166
vm create \
62-
${{ env.CLOUD_AT }} ${{ env.CLOUD_ID }} ${{ steps.add_script.outputs.script_id }}
67+
${{ inputs.JARVISLABS_ACCESS_TOKEN }} ${{ inputs.JARVISLABS_ID }} ${{ steps.add_script.outputs.script_id }}
68+
shell: bash
6369

6470
- name: remove script from jarvislabs
6571
run: |
6672
python clouds/jarvislabs.py \
6773
script remove \
68-
${{ env.CLOUD_AT }} ${{ env.CLOUD_ID }} ${{ steps.add_script.outputs.script_id }}
74+
${{ inputs.JARVISLABS_ACCESS_TOKEN }} ${{ inputs.JARVISLABS_ID }} ${{ steps.add_script.outputs.script_id }}
75+
shell: bash

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ $ dvc stage add -n train \
4040
# if you want to use W&B for tracking training progress
4141
$ dvc stage add -n train \
4242
-p train.train_size,train.batch_size,train.epoch,train.lr \
43-
-d pipeline/modeling.py -d pipeline/train.py -d data \
43+
-d pipeline/modeling.py -d pipeline/train_wandb.py -d data \
4444
-o outputs/model \
45-
python pipeline/train.py outputs/model
45+
python pipeline/train_wandb.py outputs/model
4646
```
4747
11. Run the following `dvc stage add` for evaluate stage
4848
```bash
@@ -68,12 +68,13 @@ $ dvc stage add -n evaluate \
6868
18. Run `git add . && git commit -m "add initial pipeline run" && git push origin main`
6969
19. Add access token and user email of [JarvisLabs.ai](https://jarvislabs.ai/) to GitHub Secret as `JARVISLABS_ACCESS_TOKEN` and `JARVISLABS_USER_EMAIL`
7070
20. Add GitHub access token to GitHub Secret as `GH_ACCESS_TOKEN`
71-
21. Create a PR and write `#train` as in comment (you have to be the onwer of the repo)
71+
21. Create a PR and write `#train --with dvc` as in comment (you have to be the onwer of the repo)
7272

7373
### W&B Integration Setup
7474

7575
1. Add W&B's project name to GitHub Secret as `WANDB_PROJECT`
7676
2. Add W&B's API KEY to GitHub Secret as `WANDB_API_KEY`
77+
3. Use `#train --with wandb` instead of `#train --with dvc`
7778

7879
### HuggingFace Integration Setup
7980

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
dvc[gdrive]==2.10.2
2+
wandb==0.12.19
23
tensorflow==2.8
34
typer==0.4.1
45
docopt==0.6.2

0 commit comments

Comments
 (0)