When should we update dvc.lock and dvc push in GitHub Actions?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Prüfe zuerst den verknüpften GitHub Actions-Workflow, dvc.yaml und dvc.lock. Verfolge, wann dvc repro die Lockdatei ändert und wann model.pt erzeugt wird, und bestimme anschließend, welcher Workflow-Schritt für das Committen und Pushen von Artefakten zuständig sein sollte. Als erledigt gilt die Aufgabe, wenn der Issue einen dokumentierten, eindeutigen Workflow für Pull Requests und Merges enthält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Discussed in https://github.com/iterative/dvc/discussions/6542
Originally posted by Hongbo-Miao September 6, 2021
Currently, my GitHub Actions workflow looks like this: when I open a pull request (change some model codes / params), CML creates a AWS EC2 instance, and DVC pull the data.
Here is my current GitHub Actions workflow:
Click to expand!
cml-cloud-set-up-cloud:
name: CML (Cloud) - Set up cloud
runs-on: ubuntu-20.04
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up CML
uses: iterative/setup-cml@v1
- name: Set up cloud
shell: bash
env:
REPO_TOKEN: ${{ secrets.CML_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cml-runner \
--cloud=aws \
--cloud-region=us-west-2 \
--cloud-type=t2.small \
--labels=cml-runner
cml-cloud-train:
name: CML (Cloud) - Train
needs: cml-cloud-set-up-cloud
runs-on: [self-hosted, cml-runner]
# container: docker://iterativeai/cml:0-dvc2-base1-gpu
container: docker://iterativeai/cml:0-dvc2-base1
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: hm-cnn
- name: Install requirements
working-directory: convolutional-neural-network
shell: bash -l {0}
run: |
conda install pytorch torchvision torchaudio --channel=pytorch
conda install pandas
conda install tabulate
pip install -r requirements.txt
- name: Pull Data
working-directory: convolutional-neural-network
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
dvc pull
- name: Train model
working-directory: convolutional-neural-network
shell: bash -l {0}
env:
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
run: |
dvc repro
- name: Write CML report
working-directory: convolutional-neural-network
shell: bash -l {0}
env:
REPO_TOKEN: ${{ secrets.CML_ACCESS_TOKEN }}
run: |
echo "# CML (Cloud) Report" >> report.md
echo "## Params" >> report.md
cat output/reports/params.txt >> report.md
cml-send-comment report.md
My dvc.yaml looks like this:
stages:
prepare:
cmd: tar -xf data/raw/cifar-10-python.tar.gz --dir=data/processed
deps:
- data/raw/cifar-10-python.tar.gz
outs:
- data/processed/cifar-10-batches-py/
main:
cmd: python main.py
deps:
- data/processed/cifar-10-batches-py/
- evaluate.py
- main.py
- model/
- train.py
params:
- lr
- train.epochs
outs:
- output/models/model.pt
After training, if I think the change is good because the performance is better based on the reports,
- the dvc.lock I feel needs to get update.
- the new model
model.ptneeds to be uploaded to AWS S3 in my case.
My question is, after dvc repro, am I supposed to add dvc push and then commit? Something like
- name: Train model
working-directory: convolutional-neural-network
shell: bash -l {0}
env:
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
run: |
dvc repro
dvc push # New added
git add . # New added
git commit -m "update dvc.lock, etc." # New added
git push origin current_pr # New added, need somehow get the current pull request name
This above method will apply when the pull request is open.
However, I kind of feeling the best moment adding would be when I decide merging because I think this is a good pull request that actually improves the machine learning performance. But at this moment, the EC2 instance has been destroyed.
Any suggestion? Thanks!
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13
- Forks
- 22
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus iterative/cml.dev
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 48/100
-
Link Checker ReportOffenlink-check-all
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 40/100
-
Link Checker ReportOffenlink-check-all
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 45/100
-
crossref DVCLiveEvtl. wieder frei @casperdcl hat das vor 1390 Tagen übernommen, und es ist kein Pull Request offen. OffenC: guide C: ref documentation p1-important
-
docs: driver token timeoutEvtl. wieder frei @dacbd hat das vor 1403 Tagen übernommen, und es ist kein Pull Request offen. OffenC: guide C: ref documentation
Alle Issues in iterative/cml.dev
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Vessel9817/onion-site-template#512 ·
Maintainer antworten meist innerhalb von 1 Tag
-
nightly-tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
BlackBeltTechnology/pi-agent-dashboard#1256 ·
Maintainer antworten meist innerhalb von 1 Tag
-
approved
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
fritzprix/libr-agent#3266 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
better-auth/better-auth#13101 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag