Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions example-get-started-experiments/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Custom
*.zip
/tmp
build/
61 changes: 61 additions & 0 deletions example-get-started-experiments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Generate the actual repo by running:

```
bash generate.sh
```

The repo generated in `build/example-get-started-experiments` is intended to be
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:

```
cd build/example-get-started-experiments
git remote add origin https://github.com/iterative/example-get-started-experiments.git
git push --force origin main
git push --force origin tune-architecture
git push --force origin --tags
```

Run these to drop and then rewrite the experiment references on the repo:

```
dvc exp remove -A -g origin
dvc exp push origin -A
```

And this to clean the remote cache to only contain the last iteration:

```
dvc gc -c --all-experiments
```

- `tune-architecture` P.R.

To create a PR from the "tune-architecture" branch:

```
gh pr create -t "Run experiments tuning architecture" \
-B main -H tune-architecture
```

Finally, return to the directory where you started:

```
cd ../..
```

You may remove the generated repo with:

```
rm -fR build
```

- Manual Studio P.R.

Once the repo has been generated and pushed, go to the
[corresponding Studio project](https://studio.iterative.ai/team/Iterative/projects/example-get-started-experiments-y8toqd433r)
and create a P.R. using the `Experiment` button, increasing epochs from `8` to
`12`.
18 changes: 18 additions & 0 deletions example-get-started-experiments/code/.devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "example-cv",
"image": "mcr.microsoft.com/devcontainers/python:3.10",
"runArgs": ["--ipc=host"],
"features": {
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
"installCudnn": true
},
"ghcr.io/iterative/features/dvc:1": {},
"ghcr.io/iterative/features/nvtop:1": {}
},
"extensions": [
"Iterative.dvc",
"ms-python.python",
"redhat.vscode-yaml"
],
"postCreateCommand": "pip install --user -r requirements.txt"
}
2 changes: 2 additions & 0 deletions example-get-started-experiments/code/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.dvc linguist-language=YAML
dvc.lock linguist-language=YAML
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Run Studio Experiment
on:
push:
paths:
- ".github/workflows/run-experiment.yaml"
- "data/**"
- "src/**"
- "params.yaml"
- "dvc.*"
jobs:
deploy-runner:
if: github.actor == 'iterative-studio[bot]'
environment: cloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: iterative/setup-cml@v1
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::342840881361:role/SandboxUser
role-duration-seconds: 43200
- name: Create Runner
env:
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
cml runner launch --single \
--labels=cml \
--cloud=aws \
--cloud-region=us-east \
--cloud-hdd-size=40 \
--cloud-type=g5.2xlarge
runner-job:
needs: deploy-runner
runs-on: [ self-hosted, cml ]
container:
image: iterativeai/cml:0-dvc2-base1-gpu
options: --gpus all --ipc host
steps:
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: training
env:
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
STUDIO_TOKEN: ${{ secrets.STUDIO_TOKEN }}
DVCLIVE_LOGLEVEL: DEBUG
run: |
pip install -r requirements.txt
dvc pull
cml comment create --publish --watch results/train/report.md & dvc exp run
dvc push
cml pr --squash --skip-ci .
cml comment create --pr --publish results/evaluate/report.md
129 changes: 129 additions & 0 deletions example-get-started-experiments/code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
21 changes: 21 additions & 0 deletions example-get-started-experiments/code/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Iterative

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading