DIVE Python Packages
There are several important python packages in this application
dive_serveris a collection of girder plugins for the web serverdive_tasksis a collection of girder worker plugins for the celery workerscriptshas general command-line utilitiesdive_utilsis shared code between the above packages
Prerequisites
Set up your system as described in the Basic Deployment
Development
In development, the server and client are run in separate processes. In production, the client is built and bundled as static files into the server image.
This python project uses uv for dependency management.
# Optional, for intellisense or whatever. Not required for docker-compose
uv sync
Running in development with docker
# Copy .env.default and make any changes
cp .env.default .env
# Option 1) Build the project from source
docker-compose build
# Option 2) Pull pre-build images
docker-compose pull
# Start the project
docker-compose up -d
# The web server has hot reload, so code changes will
# immediately trigger a server restart.
# The Celery workers do not have hot reload.
# To test code changes, a restart is needed
docker-compose up girder_worker_default
# or
docker-compose up girder_worker_pipelines
# or
docker-compose up girder_worker_training
Access the server at http://localhost:8010
To work on the Vue client, see development instructions in ../client.
PyPI release build
The dive-dsa distribution (PyPI name) bundles the DIVE annotator SPA and the
Girder plugin web client. Import packages remain dive_server, dive_tasks, and
dive_utils. Use one script for local build, verify, and optional publish.
Prerequisites
- Node.js 20+ (24 recommended) and npm
- uv
- Git history in the checkout (version comes from
uv-dynamic-versioning)
Local build
From the repository root:
bash server/scripts/build_wheel.sh
This stages frontends (scripts/build_release_assets.sh), runs uv build, and
checks that the wheel contains dive_client and the plugin UI. The wheel lands
in server/dist/dive_dsa-*.whl (hyphens in the PyPI name become underscores in
the wheel filename).
Useful flags:
# Reuse already-built dive_client/ and web_client/dist/
bash server/scripts/build_wheel.sh --skip-assets
# Build + verify only; do not upload (even with --publish)
bash server/scripts/build_wheel.sh --publish --dry-run
Equivalent from test_deployment/:
bash test_deployment/prepare.sh
Local publish
PyPI rejects local versions
(1.0.0.postN.dev0+gHASH). Those are produced when the checkout is not
exactly on a version tag. Either tag a release:
git tag v1.2.3
git push origin v1.2.3
export UV_PUBLISH_TOKEN=pypi-...
bash server/scripts/build_wheel.sh --publish
or force a clean version without tagging (uses
UV_DYNAMIC_VERSIONING_BYPASS):
export UV_PUBLISH_TOKEN=pypi-...
bash server/scripts/build_wheel.sh --version 1.2.3 --publish
# also accepts: --version v1.2.3
build_wheel.sh --publish clears server/dist/, rebuilds, refuses versions
containing +..., and uploads only the new wheel + sdist.
UV_PUBLISH_TOKEN is the preferred auth for uv publish. Alternatively set
UV_PUBLISH_USERNAME=__token__ and UV_PUBLISH_PASSWORD to the same token.
See uv packaging docs.
GitHub Actions publish
Publishing is automated via .github/workflows/release-dive-server.yml on
GitHub Release (or workflow_dispatch). CI uses
PyPI trusted publishing (OIDC) —
no UV_PUBLISH_TOKEN secret required. Pull requests also run a wheel build
smoke job in .github/workflows/CI.yml and upload the wheel as an artifact.
Test wheel install in Docker (Girder 5 package path)
The test_deployment/ stack installs Girder from PyPI and DIVE from a
wheel (SPA + plugin UI bundled into the package), matching Girder 5's
Python-package install model. The wheel is built inside Docker — no host
npm/uv build required:
docker compose -f test_deployment/docker-compose.yml up --build
See test_deployment/README.md for SPA placement details and optional host
wheel builds (bash test_deployment/prepare.sh → server/scripts/build_wheel.sh).
- Girder UI: http://localhost:8010/girder (login
admin/letmein) - DIVE SPA: http://localhost:8010/dive
- RabbitMQ management: http://localhost:15672 (guest / guest)
The stack includes RabbitMQ, a localworker (Girder local queue), and a
worker (DIVE celery queue).
Unit Testing and Static Checks
Automation is done with Tox with tox-uv plugin.
# run only lint checks
uv run tox -e lint
# run only type checks
uv run tox -e type
# run only unit tests
uv run tox -e testunit
# run only a particular test
uv run tox -e testunit -- -k test_image_sort
# run all tests
uv run tox
# automatically format all code to comply to linting checks
uv run tox -e format
# run mkdocs and serve the documentation page
uv run tox -e docs
# creates docs in the /site folder for eventual deployment
uv run tox -e builddocs
Debug utils and command line tools
# Requires a local uv installation
uv sync
# show options
uv run dive --help
# build the standalone executable into ./dist
uv run tox -e buildcli
Metadata properties
This section explains the metadata properties used to record application state in Girder. These properties can be modified through the Girder UI editor.
Dataset
Image chips that compose a video are stored as girder items in a folder. Videos are stored as a single item in its own folder. The parent folder must have the following metadata.
annotate(boolean) marks a folder as a valid DIVE datasettype('video' | 'image-sequence') dataset typefps(number) annotation framerate, not to be confused with video raw framerateffprobe_info(JSON) output of ffprobe for raw input videoconfidenceFilters(JSON) map of filter name to float in [0, 1]customTypeStyline(JSON) map of class name to GeoJS display attributes.foreign_media_id(string) For "cloned" datasets, this is an objectId pointer to the source media
Video Item
codec(string) video codecsource_video(boolean) whether the video is a raw user upload or a trancoded video
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dive_dsa-0.0.1.tar.gz.
File metadata
- Download URL: dive_dsa-0.0.1.tar.gz
- Upload date:
- Size: 6.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ff994d1035c4c33de8f5a2915f5868436859ec0b4361a0471749f919093891d
|
|
| MD5 |
a7b0012137814545e07b215a91123c89
|
|
| BLAKE2b-256 |
ac43f813afa7c59cddbc96f6221d59f32277f4093a89785b2e4ff6f28ad5eeec
|
File details
Details for the file dive_dsa-0.0.1-py3-none-any.whl.
File metadata
- Download URL: dive_dsa-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c983c4483fc29f0dda700b0c639d1a5d753b91eddfb8c35df5a471b5407c2e46
|
|
| MD5 |
4960a53c1a52815a95008bcd67d562c5
|
|
| BLAKE2b-256 |
5cdfcd3b0c3177ccd70393a1f49b438f60ec242330a028d076907038e3f55902
|