We appreciate your interest in contributing to dstack! This document will help you get up to speed with dstack codebase and guide you through the contribution process.
If you are using any kind of AI assistance while contributing to dstack,
this must be disclosed in the pull request, along with the extent to
which AI assistance was used.
As an exception, tab-completions and trivial PRs don't need to be disclosed.
An example disclosure:
This PR was written primarily by Claude Code.
Failure to disclose this, makes it difficult to determine how much scrutiny to apply to the contribution. Please be respectful to maintainers and disclose AI assistance.
Follow contributing/DEVELOPMENT.md.
If you make a non-trivial change to dstack, we recommend you learn about dstack internals. A good place to start is contributing/ARCHITECTURE.md.
- Look for an existing issue or create a new one.
- Fork the repo.
- Commit your changes.
- Open a PR. Link the PR to the issue (if you are solving one).
- Bug fixes that address a clearly defined bug. Include steps to reproduce in the linked issue or the PR.
- New features. Before submitting a feature PR, create an issue with a proposal to discuss it with the core team and other interested parties.
- Minor fixes such as typos.
- Examples.
We use ruff to format Python code and to sort Python imports. Before committing your changes, run:
uv run ruff check --fixuv run ruff format
There are also helper pre-commits installed for
ruffthat make commits fail if the code is not formatted or the imports are not sorted. They also change the code as required so that you can review the changes and commit again.
It's recommended to run tests locally before running them in CI. To run Python tests, first ensure you've install dev dependencies as described in contributing/DEVELOPMENT.md. Then you can do:
uv run pytest src/tests(Optionally) By default, tests run against SQLite.
Use the --runpostgres flag to run the tests against Postgres as well:
uv run pytest src/tests --runpostgresIf you'd like to integrate a new cloud provider to dstack, follow contributing/BACKENDS.md.
You can find more subject-focused guides in the contributing directory.
If you have any questions, you can always get help in our Discord community.