Packaging and Distribution
This guide covers the utilities and automation available for packaging AlphaSwarm components for distribution.
Consistent Versioning
AlphaSwarm consists of multiple repositories that should maintain consistent versioning to ensure compatibility.
Unified Version Bumper
A utility script is provided to update the version across all pyproject.toml, package.json, and Python __version__ strings.
From the alphaswarm directory:
# Apply changes
make bump-version VERSION=0.2.0
Or run the script directly:
# Preview changes
./alphaswarm_platform/scripts/bump-version.py 0.2.0 --dry-run
The script updates:
versioninpyproject.toml- Dependencies on other
alphaswarm-*packages inpyproject.toml versioninpackage.json__version__in__init__.pyandversion.pyfiles.
Source Packaging
To package all Python modules as wheels and source distributions, and the frontend as a tarball.
From the alphaswarm directory:
make package-source
Or run the script directly:
./alphaswarm_platform/scripts/package-source.sh
Artefacts will be collected in the dist/ directory at the root of the workspace.
Python Wheels
Each Python subproject (e.g., alphaswarm_core, alphaswarm_api) is built using the build PEP 517 builder. The resulting .whl and .tar.gz files are moved to the central dist/ folder.
Frontend Bundle
The alphaswarm_client is built using pnpm build. The resulting dist/ folder is compressed into alphaswarm-client-dist.tar.gz.
Docker Images
Multi-arch Docker images are the primary distribution format for production deployments.
Building all images
From the alphaswarm directory:
make build IMAGE_TAG=0.2.0
This builds images for:
alphaswarm-clientalphaswarm-controlleralphaswarm-workeralphaswarm-ingestionalphaswarm-admin
Publishing to a Registry
Use the publish-rpi command in alphaswarm-cli or manual docker push after building.
alphaswarm-cli deploy publish-rpi --registry docker.io/myorg --tag 0.2.0
Tagging Strategy
When releasing a new version:
- Run
bump-version.py <version>. - Commit the changes.
- Tag each repository with
v<version>. - Push tags to trigger CI/CD pipelines.
Automated tagging across all repos can be performed via:
for d in alphaswarm*; do
git -C "$d" tag -a "v0.2.0" -m "Release v0.2.0"
done