Skip to content

Manage the tree-build pipeline with DVC#122

Draft
jaredkhan wants to merge 19 commits intoOneZoom:mainfrom
jaredkhan:dvc
Draft

Manage the tree-build pipeline with DVC#122
jaredkhan wants to merge 19 commits intoOneZoom:mainfrom
jaredkhan:dvc

Conversation

@jaredkhan
Copy link
Copy Markdown

@jaredkhan jaredkhan commented Mar 28, 2026

https://dvc.org/

I wanted to be able to script the construction of the main tree so that it could all be run in one command.
Of course, many of these steps are quite time consuming so you don't want to have to re-run them if they've already been run recently. Enter DVC ('data version control'). It's a little tool for letting you cache files based on their hash (like Git LFS) and also setting up pipelines for reproducing all these files. So far, I've set up a pipeline for producing the mainline AllLife outputs.

Source configuration files (such as the bespoke tree files) remain tracked in git.
Derived files (such as the filtered wikipedia titles files) become tracked in DVC and their reproduction is now as simple as:

dvc repro --pull

All the download stages have been automated to make this work.

The underlying logic being run has for the most part been left untouched, though some paths have been shuffled around to make the caching tidier.

I wanted to put it up for review at this stage and see if we're keen on moving forward with this.
I've set up a bucket for mucking about with this and I'll share the keys on the Slack channel. If we want to go ahead, we should set up a bucket that's under the orgs control rather than mine.

@jaredkhan jaredkhan marked this pull request as draft March 28, 2026 13:58
@jaredkhan
Copy link
Copy Markdown
Author

Marking as draft only because the bucket should be changed and we should get @davidebbo's eyes on it before it's ready

@@ -0,0 +1,6 @@
# Ignore everything
Copy link
Copy Markdown
Collaborator

@davidebbo davidebbo Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are js_output and js_outputs meant to be distinct folders, or is this a typo?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah just a typo

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so this whole js_outputs folder can be removed?

### Updating parameters

Edit `params.yaml` to change the OpenTree version, taxonomy version, build version, etc. DVC will detect the parameter changes and re-run only the affected stages.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the step where it gives you SQL commands to run to update the DB (steps 6 and 9 in the manual steps)? Isn't that still needed with DVC?

dvc.yaml Outdated

download_wikipedia_sql:
cmd: >-
wget --progress=bar:force -O data/Wiki/wp_SQL/enwiki-latest-page.sql.gz
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add --retry-connrefused to deal with transient failures?

@jaredkhan jaredkhan force-pushed the dvc branch 7 times, most recently from 4e3f53c to 9f1fcb0 Compare April 3, 2026 14:13
@jaredkhan jaredkhan force-pushed the dvc branch 6 times, most recently from ce09133 to 0c3044d Compare April 3, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants