@@ -3,13 +3,13 @@ name: Build
33on :
44 push :
55 branches :
6- - ' master'
6+ - " master"
77 paths-ignore :
8- - ' docs/**'
9- - ' mkdocs.yml'
8+ - " docs/**"
9+ - " mkdocs.yml"
1010 pull_request :
1111 branches :
12- - ' master'
12+ - " master"
1313 workflow_dispatch :
1414 inputs :
1515 intergation-tests :
@@ -56,20 +56,20 @@ jobs:
5656 path : frontend/build
5757
5858 python-test :
59- needs : [ python-lint, frontend-build ]
59+ needs : [python-lint, frontend-build]
6060 runs-on : ${{ matrix.os }}
6161 strategy :
6262 matrix :
63- os : [ macos-latest, ubuntu-latest, windows-latest ]
64- python-version : [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
63+ os : [macos-latest, ubuntu-latest, windows-latest]
64+ python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
6565 steps :
6666 - uses : actions/checkout@v4
6767 - name : Set up Python ${{ matrix.python-version }}
68- uses : actions /setup-python @v5
68+ uses : astral-sh /setup-uv @v5
6969 with :
7070 python-version : ${{ matrix.python-version }}
7171 - name : Install dependencies
72- run : pip install -U '.[ all]' -r requirements_dev.txt
72+ run : uv sync -- all-extras
7373 - name : Download frontend build
7474 uses : actions/download-artifact@v4
7575 with :
@@ -83,22 +83,26 @@ jobs:
8383 if [ "${{ matrix.os }}" != "macos-latest" ]; then
8484 RUNPOSTGRES="--runpostgres"
8585 fi
86- pytest src/tests --runui $RUNPOSTGRES
86+ uv run pytest src/tests --runui $RUNPOSTGRES
8787 - name : Run pytest on Windows
8888 if : matrix.os == 'windows-latest'
8989 run : |
90- pytest src/tests --runui --runpostgres
90+ uv run pytest src/tests --runui --runpostgres
9191
9292 update-get-dstack :
9393 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
94- needs : [ python-test ]
94+ needs : [python-test]
9595 runs-on : ubuntu-latest
9696 env :
9797 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
9898 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
9999 steps :
100+ - name : Set up uv
101+ uses : astral-sh/setup-uv@v5
102+ with :
103+ python-version : 3.11
100104 - name : Install AWS
101- run : pip install awscli
105+ run : uv tool install awscli
102106 - run : |
103107 VERSION=$((${{ github.run_number }} + ${{ env.BUILD_INCREMENT }}))
104108 echo $VERSION | aws s3 cp - s3://get-dstack/stgn-cli/latest-version --acl public-read
@@ -181,8 +185,12 @@ jobs:
181185 needs : [runner-compile]
182186 runs-on : ubuntu-latest
183187 steps :
188+ - name : Set up uv
189+ uses : astral-sh/setup-uv@v5
190+ with :
191+ python-version : 3.11
184192 - name : Install AWS
185- run : pip install awscli
193+ run : uv tool install awscli
186194 - name : Download Runner
187195 uses : actions/download-artifact@v4
188196 with :
@@ -201,24 +209,24 @@ jobs:
201209
202210 generate-json-schema :
203211 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
204- needs : [ python-test ]
212+ needs : [python-test]
205213 env :
206214 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
207215 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
208216 runs-on : ubuntu-latest
209217 steps :
210218 - uses : actions/checkout@v4
211- - uses : actions /setup-python @v5
219+ - uses : astral-sh /setup-uv @v5
212220 with :
213221 python-version : 3.11
214222 - name : Install AWS
215- run : pip install awscli
223+ run : uv tool install awscli
216224 - name : Install dstack
217- run : pip install .
225+ run : uv sync
218226 - name : Generate json schema
219227 run : |
220- python -c "from dstack._internal.core.models.configurations import DstackConfiguration; print(DstackConfiguration.schema_json(indent=2))" > configuration.json
221- python -c "from dstack._internal.core.models.profiles import ProfilesConfig; print(ProfilesConfig.schema_json(indent=2))" > profiles.json
228+ uv run python -c "from dstack._internal.core.models.configurations import DstackConfiguration; print(DstackConfiguration.schema_json(indent=2))" > configuration.json
229+ uv run python -c "from dstack._internal.core.models.profiles import ProfilesConfig; print(ProfilesConfig.schema_json(indent=2))" > profiles.json
222230 - name : Upload json schema to S3
223231 run : |
224232 VERSION=$((${{ github.run_number }} + ${{ env.BUILD_INCREMENT }}))
@@ -235,20 +243,18 @@ jobs:
235243 working-directory : gateway
236244 steps :
237245 - uses : actions/checkout@v4
238- - name : Set up Python 3.11
239- uses : actions /setup-python @v5
246+ - name : Set up uv
247+ uses : astral-sh /setup-uv @v5
240248 with :
241249 python-version : 3.11
242250 - name : Install AWS
243- run : pip install awscli
244- - name : Install dependencies
245- run : pip install wheel build
251+ run : uv tool install awscli
246252 - name : Compute version
247253 run : echo VERSION=$((${{ github.run_number }} + ${{ env.BUILD_INCREMENT }})) > $GITHUB_ENV
248254 - name : Build package
249255 run : |
250256 echo "__version__ = \"${{ env.VERSION }}\"" > src/dstack/gateway/version.py
251- python -m build .
257+ uv build
252258 - name : Upload to S3
253259 env :
254260 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -257,23 +263,24 @@ jobs:
257263 WHEEL=dstack_gateway-${{ env.VERSION }}-py3-none-any.whl
258264 aws s3 cp dist/$WHEEL "s3://dstack-gateway-downloads/stgn/$WHEEL"
259265 echo "${{ env.VERSION }}" | aws s3 cp - "s3://dstack-gateway-downloads/stgn/latest-version"
260-
266+
261267 docs-build :
262268 # Skip for PRs from forks since mkdocs-material-insiders is not available in forks
263269 if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
264270 runs-on : ubuntu-latest
265271 steps :
266272 - uses : actions/checkout@v4
267- - uses : actions /setup-python @v5
273+ - uses : astral-sh /setup-uv @v5
268274 with :
269275 python-version : 3.11
270276 - name : Install dstack
271277 run : |
272- pip install -e .[server]
278+ uv sync --extra server
279+ # Move these deps into an extra and install that way
273280 - name : Build
274281 run : |
275- pip install pillow cairosvg
282+ uv pip install pillow cairosvg
276283 sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
277- pip install mkdocs-material "mkdocs-material[imaging]" mkdocs-material-extensions mkdocs-redirects mkdocs-gen-files "mkdocstrings[python]" mkdocs-render-swagger-plugin --upgrade
278- pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
279- mkdocs build -s
284+ uv pip install mkdocs-material "mkdocs-material[imaging]" mkdocs-material-extensions mkdocs-redirects mkdocs-gen-files "mkdocstrings[python]" mkdocs-render-swagger-plugin --upgrade
285+ uv pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
286+ uv mkdocs build -s
0 commit comments