Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example-gto: remove annotate and move artifacts to dvc.yaml #192

Merged
merged 4 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion example-gto/code/.github/workflows/gto-act-on-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- name: "GTO: figure out what was registered/promoted and show the Registry state"
id: gto
uses: iterative/gto-action@v1
uses: iterative/gto-action@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
- uses: actions/checkout@v3
- name: "GTO: figure out what was registered/promoted and show the Registry state"
id: gto
uses: iterative/gto-action@v1
uses: iterative/gto-action@v2
with:
download: true
aguschin marked this conversation as resolved.
Show resolved Hide resolved
# we define the Job outputs here to let the next Job use them
outputs:
name: ${{ steps.gto.outputs.name }}
Expand Down
23 changes: 18 additions & 5 deletions example-gto/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ source $BUILD_PATH/.venv/bin/activate

TOTAL_TAGS=15
STEP_TIME=100000
SLEEP_TIME=30
SLEEP_TIME=90
BEGIN_TIME=$(($(date +%s) - (${TOTAL_TAGS} * ${STEP_TIME})))
export TAG_TIME=${BEGIN_TIME}
export GIT_AUTHOR_DATE="${TAG_TIME} +0000"
Expand Down Expand Up @@ -84,17 +84,30 @@ if $PUSH; then
git ls-remote --tags origin | awk '/^(.*)(\s+)(.*[a-zA-Z0-9])$/ {print ":" $2}' | xargs git push origin
fi

echo "Initialize DVC"
dvc init
git commit -m "Initialize DVC"
echo "Create new models"
mkdir models
echo "1st version" > models/churn.pkl
git add models requirements.txt
tick
git commit -am "Create models"

gto annotate churn --type model --path models/churn.pkl --must-exist
gto annotate segment --type model --path s3://mycorp/proj-ml/segm-model-2022-04-15.pt
gto annotate cv-class --type model --path s3://mycorp/proj-ml/classif-v2.pt
git add artifacts.yaml
cat >> dvc.yaml<< EOF
artifacts:
churn:
type: model
path: models/churn.pkl
segment:
type: model
path: s3://mycorp/proj-ml/segm-model-2022-04-15.pt
cv-class:
type: model
path: s3://mycorp/proj-ml/classif-v2.pt
EOF
git add dvc.yaml

tick
git commit -m "Annotate models with GTO"
if $PUSH; then
Expand Down