Skip to content

Commit

Permalink
Rename run-experiment to dvc-studio. Add cml runner inputs. (#220)
Browse files Browse the repository at this point in the history
* Rename run-experiment to dvc-studio. Add cml runner inputs.

Per https://github.com/iterative/studio/pull/6755

* Add fixture

* Set defauls

* Update README

* Drop fixture permissions
  • Loading branch information
daavoo authored Jul 19, 2023
1 parent c037461 commit bdc4563
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 27 deletions.
6 changes: 0 additions & 6 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
},
"iterative/example-get-started-experiments": {
"permissions": "write-all"
},
"iterative/example-get-started-frozen": {
"permissions": "write-all"
},
"iterative/example-get-started-experiments-frozen": {
"permissions": "write-all"
}
}
}
Expand Down
20 changes: 6 additions & 14 deletions example-get-started-experiments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ published on https://github.com/iterative/example-get-started-experiments.
Make sure the Github repo exists first and that you have appropriate write
permissions.

Run these commands to force push it:
Run the commands below to force push it.
Modify `ORIGIN` on demmand, for example use
`[email protected]:iterative.ai/example-get-started-experiments.git` to force
push a copy to GitLab.

```shell
cd build/example-get-started-experiments
git remote add origin git remote add origin [email protected]:<slug>/example-get-started-experiments.git
export ORIGIN=https://github.com/iterative/example-get-started-experiments.git
git remote add origin ${ORIGIN}
git push --force origin main
# we push git tags one by one for Studio to receive webhooks:
git tag --sort=creatordate | xargs -n 1 git push --force origin
Expand All @@ -27,18 +31,6 @@ dvc exp remove -A -g origin
dvc exp push origin -A
```

To push a copy to GitLab:

```shell
git remote add gitlab [email protected]:iterative.ai/example-get-started-experiments.git
git push --force gitlab main
# we push git tags one by one for Studio to receive webhooks:
git tag --sort=creatordate | xargs -n 1 git push --force gitlab
# push experiments
dvc exp remove -A -g gitlab
dvc exp push gitlab -A
```

Finally, return to the directory where you started:

```shell
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Run Experiment
on:
name: DVC Studio Experiment

on:

push:

Expand All @@ -8,8 +9,41 @@ on:
exp-run-args:
description: 'Args to be passed to dvc exp run call'
required: false
type: string
default: ''

cloud:
description: 'Cloud compute provider to host the runner'
required: false
default: 'aws'
type: choice
options:
- aws
- azure
- gcp
type:
description: 'https://registry.terraform.io/providers/iterative/iterative/latest/docs/resources/task#machine-type'
required: false
default: 'g5.2xlarge'
region:
description: 'https://registry.terraform.io/providers/iterative/iterative/latest/docs/resources/task#cloud-region'
required: false
default: 'us-east'
spot:
description: 'Request a spot instance'
required: false
default: false
type: boolean
storage:
description: 'Disk size in GB'
required: false
default: 40
type: number
timeout:
description: 'Timeout in seconds'
required: false
default: 3600
type: number

permissions:
contents: write
id-token: write
Expand All @@ -36,10 +70,12 @@ jobs:
run: |
cml runner launch --single \
--labels=cml \
--cloud=aws \
--cloud-region=us-east \
--cloud-hdd-size=40 \
--cloud-type=g5.2xlarge
--cloud=${{ inputs.cloud || 'aws' }} \
--cloud-region=${{ inputs.region || 'us-east' }} \
--cloud-hdd-size=${{ inputs.storage || '40' }} \
--cloud-type=${{ inputs.type || 'g5.2xlarge' }} \
--idle-timeout=${{ inputs.timeout || '3600' }} \
${{ inputs.spot && '--cloud-spot' }}
runner-job:
needs: deploy-runner
Expand Down

0 comments on commit bdc4563

Please sign in to comment.