Skip to content

Commit bf926eb

Browse files
committed
Merge branch 'master' into property_filter
# Conflicts: # frontend/src/pages/Runs/List/index.tsx
2 parents 20f1bf1 + 8732138 commit bf926eb

395 files changed

Lines changed: 10336 additions & 3519 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ jobs:
164164
strategy:
165165
matrix:
166166
include:
167-
- { goos: "linux", goarch: "amd64", runson: "ubuntu-latest" }
167+
- { goos: "linux", goarch: "amd64" }
168+
- { goos: "linux", goarch: "arm64" }
168169
runs-on: ubuntu-latest
169170
steps:
170171
- uses: actions/checkout@v4
@@ -177,7 +178,6 @@ jobs:
177178
env:
178179
GOOS: ${{ matrix.goos }}
179180
GOARCH: ${{ matrix.goarch }}
180-
ACTIONSOS: ${{ matrix.runson }}
181181
CGO_ENABLED: 0
182182
run: |
183183
VERSION=$((${{ github.run_number }} + ${{ env.BUILD_INCREMENT }}))
@@ -287,12 +287,13 @@ jobs:
287287
python-version: 3.11
288288
- name: Install dstack
289289
run: |
290-
uv sync --extra server
290+
uv pip install examples/plugins/example_plugin_server
291+
uv pip install -e '.[server]'
291292
# Move these deps into an extra and install that way
292293
- name: Build
293294
run: |
294295
uv pip install pillow cairosvg
295-
sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
296+
sudo apt-get update && sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
296297
uv pip install mkdocs-material "mkdocs-material[imaging]" mkdocs-material-extensions mkdocs-redirects mkdocs-gen-files "mkdocstrings[python]" mkdocs-render-swagger-plugin --upgrade
297298
uv pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
298299
uv run mkdocs build -s
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build AMD SMI Docker image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image_name:
7+
description: "Docker image name"
8+
required: true
9+
default: "dstackai/amd-smi"
10+
rocm_version:
11+
description: "ROCm version"
12+
required: true
13+
default: "6.4"
14+
dstack_revision:
15+
description: "Docker image revision"
16+
required: true
17+
default: 0
18+
19+
jobs:
20+
build-amd-smi:
21+
defaults:
22+
run:
23+
working-directory: docker/amd-smi
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
- name: Login to DockerHub
31+
uses: docker/login-action@v3
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
- name: Build and upload to DockerHub
36+
run: |
37+
IMAGE_NAME=${{ inputs.image_name }}
38+
docker buildx build . \
39+
--load \
40+
--provenance=false \
41+
--platform linux/amd64 \
42+
--build-arg IMAGE_NAME=${IMAGE_NAME} \
43+
--build-arg UBUNTU_VERSION=noble \
44+
--build-arg ROCM_VERSION=${{ inputs.rocm_version }} \
45+
--build-arg DSTACK_REVISION=${{ inputs.dstack_revision }} \
46+
--build-arg BUILD_DATE=$(date --utc --iso-8601=seconds)Z \
47+
--tag ${IMAGE_NAME}:latest
48+
VERSION=$(docker inspect --format '{{ index .Config.Labels "org.opencontainers.image.version" }}' ${IMAGE_NAME})
49+
docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${VERSION}
50+
docker push ${IMAGE_NAME}:${VERSION}
51+
docker push ${IMAGE_NAME}:latest

.github/workflows/docker.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ on:
88
description: "Docker image version"
99
required: true
1010
staging:
11-
description: "Staging build"
11+
description: "Build staging images"
12+
type: boolean
13+
default: false
14+
prepull_staging:
15+
description: "Pre-pull staging Docker images"
1216
type: boolean
1317
default: false
1418
build_docker:
15-
description: "Build docker images"
19+
description: "Build Docker images"
1620
type: boolean
1721
default: true
1822
build_aws:
@@ -34,7 +38,9 @@ on:
3438

3539
env:
3640
PACKER_VERSION: "1.9.2"
37-
BUILD_PREFIX: ${{ inputs.staging && format('stgn-{0}-', github.run_number) || '' }} # staging ? prefix : ''
41+
BUILD_DOCKER_REPO: ${{ inputs.staging && 'base-stgn' || 'base' }}
42+
PREPULL_DOCKER_REPO: ${{ inputs.prepull_staging && 'base-stgn' || 'base' }}
43+
VM_IMAGE_BUILD_PREFIX: ${{ inputs.staging && format('stgn-{0}-', github.run_number) || '' }} # staging ? prefix : ''
3844

3945
jobs:
4046
build-docker:
@@ -46,6 +52,7 @@ jobs:
4652
strategy:
4753
matrix:
4854
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
55+
flavor: ["base", "devel"]
4956
steps:
5057
- name: Checkout repository
5158
uses: actions/checkout@v4
@@ -60,8 +67,7 @@ jobs:
6067
uses: docker/setup-qemu-action@v3
6168
- name: Build and upload to DockerHub
6269
run: |
63-
docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }}-cuda-12.1 -f base/Dockerfile .
64-
docker buildx build --platform linux/amd64 --build-arg PYTHON=${{ matrix.python }} --build-arg VERSION=${{ inputs.image_version }} --push --provenance=false --tag dstackai/base:py${{ matrix.python }}-${{ inputs.image_version }}-cuda-12.1-devel -f base/devel.Dockerfile .
70+
docker buildx build --platform linux/amd64 --build-arg FLAVOR=${{ matrix.flavor }} --build-arg PYTHON=${{ matrix.python }} --push --provenance=false --tag dstackai/${{ env.BUILD_DOCKER_REPO }}:py${{ matrix.python }}-${{ inputs.image_version }}-cuda-12.1${{ matrix.flavor == 'devel' && '-devel' || '' }} -f base/Dockerfile .
6571
6672
build-aws-images:
6773
needs: build-docker
@@ -85,7 +91,7 @@ jobs:
8591
chmod +x packer
8692
- name: Run packer
8793
run: |
88-
./packer build -var-file=versions.json $PROD_VARS -var image_version=${{ inputs.image_version }} -var build_prefix=$BUILD_PREFIX aws-image${{ matrix.variant }}.json
94+
./packer build -var-file=versions.json $PROD_VARS -var image_repo=${{ env.PREPULL_DOCKER_REPO }} -var image_version=${{ inputs.image_version }} -var build_prefix=$VM_IMAGE_BUILD_PREFIX aws-image${{ matrix.variant }}.json
8995
env:
9096
PROD_VARS: ${{ !inputs.staging && '-var-file=aws-vars-prod.json' || '' }} # production ? var-file : ''
9197

@@ -118,12 +124,12 @@ jobs:
118124
chmod +x packer
119125
- name: Run packer
120126
run: |
121-
./packer build -var-file=versions.json -var image_version=${{ inputs.image_version }} -var build_prefix=$BUILD_PREFIX azure-image${{ matrix.variant }}.json
127+
./packer build -var-file=versions.json -var image_repo=${{ env.PREPULL_DOCKER_REPO }} -var image_version=${{ inputs.image_version }} -var build_prefix=$VM_IMAGE_BUILD_PREFIX azure-image${{ matrix.variant }}.json
122128
- name: Publish azure image
123129
if: ${{ !inputs.staging }}
124130
run: |
125-
IMAGE_DEFINITION=${BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }}
126-
IMAGE_NAME=${BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }}
131+
IMAGE_DEFINITION=${VM_IMAGE_BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }}
132+
IMAGE_NAME=${VM_IMAGE_BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }}
127133
../publish_azure_image.sh $IMAGE_DEFINITION $IMAGE_NAME
128134
129135
build-gcp-images:
@@ -156,11 +162,11 @@ jobs:
156162
chmod +x packer
157163
- name: Run packer
158164
run: |
159-
./packer build -var-file=versions.json -var image_version=${{ inputs.image_version }} -var build_prefix=$BUILD_PREFIX gcp-image${{ matrix.variant }}.json
165+
./packer build -var-file=versions.json -var image_repo=${{ env.PREPULL_DOCKER_REPO }} -var image_version=${{ inputs.image_version }} -var build_prefix=$VM_IMAGE_BUILD_PREFIX gcp-image${{ matrix.variant }}.json
160166
- name: Publish images
161167
run: |
162168
IMAGE_VERSION=${IMAGE_VERSION//./-}
163-
gcloud compute images add-iam-policy-binding ${BUILD_PREFIX}dstack${{ matrix.variant }}-$IMAGE_VERSION --member='allAuthenticatedUsers' --role='roles/compute.imageUser'
169+
gcloud compute images add-iam-policy-binding ${VM_IMAGE_BUILD_PREFIX}dstack${{ matrix.variant }}-$IMAGE_VERSION --member='allAuthenticatedUsers' --role='roles/compute.imageUser'
164170
env:
165171
IMAGE_VERSION: ${{ inputs.image_version }}
166172

@@ -205,8 +211,9 @@ jobs:
205211
run: |
206212
./packer build \
207213
-var-file=versions.json \
214+
-var image_repo=${{ env.PREPULL_DOCKER_REPO }} \
208215
-var image_version=${{ inputs.image_version }} \
209-
-var build_prefix=$BUILD_PREFIX \
216+
-var build_prefix=$VM_IMAGE_BUILD_PREFIX \
210217
-var oci_compartment_ocid=$OCI_COMPARTMENT \
211218
-var oci_subnet_ocid=$OCI_SUBNET \
212219
-var oci_availability_domain=$OCI_AVAILABILITY_DOMAIN \
@@ -221,14 +228,14 @@ jobs:
221228
if: ${{ !inputs.staging }}
222229
run: |
223230
uv run scripts/oci_image_tools.py copy \
224-
--image ${BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }} \
231+
--image ${VM_IMAGE_BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }} \
225232
--from $OCI_REGION \
226233
--compartment $OCI_COMPARTMENT
227234
- name: Publish image in OCI Marketplace
228235
if: ${{ !inputs.staging }}
229236
run: |
230237
uv run scripts/oci_image_tools.py publish \
231-
--image ${BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }} \
238+
--image ${VM_IMAGE_BUILD_PREFIX}dstack${{ matrix.variant }}-${{ inputs.image_version }} \
232239
--compartment $OCI_COMPARTMENT \
233240
--version ${{ inputs.image_version }} \
234241
--description "Image for running workloads with dstack - https://dstack.ai/" \

.github/workflows/docs.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ jobs:
1616
python-version: 3.11
1717
- name: Install dstack
1818
run: |
19+
uv pip install examples/plugins/example_plugin_server
1920
if [ -n "${{ inputs.release_tag }}" ]; then
2021
uv pip install "dstack[server]==${{ inputs.release_tag }}"
2122
else
22-
uv sync --extra server
23+
uv pip install -e '.[server]'
2324
fi
2425
- name: Build
2526
run: |
2627
uv pip install pillow cairosvg
27-
sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
28+
sudo apt-get update && sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
2829
uv pip install mkdocs-material "mkdocs-material[imaging]" mkdocs-material-extensions mkdocs-redirects mkdocs-gen-files "mkdocstrings[python]" mkdocs-render-swagger-plugin --upgrade
2930
uv pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
3031
uv run mkdocs build -s

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ jobs:
118118
strategy:
119119
matrix:
120120
include:
121-
- { goos: "linux", goarch: "amd64", runson: "ubuntu-latest" }
121+
- { goos: "linux", goarch: "amd64" }
122+
- { goos: "linux", goarch: "arm64" }
122123
runs-on: ubuntu-latest
123124
steps:
124125
- uses: actions/checkout@v4
@@ -131,7 +132,6 @@ jobs:
131132
env:
132133
GOOS: ${{ matrix.goos }}
133134
GOARCH: ${{ matrix.goarch }}
134-
ACTIONSOS: ${{ matrix.runson }}
135135
CGO_ENABLED: 0
136136
run: |
137137
VERSION=${GITHUB_REF#refs/tags/}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ build/
2020
.DS_Store
2121
.fleet
2222
.env
23+
.envrc
24+
.vscode
2325
.aider*
2426
uv.lock
27+
.local/

.justfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Root justfile
2+
#
3+
# This justfile serves as the main entry point to recipes from different components.
4+
#
5+
# Run `just` to see all available commands.
6+
#
7+
# Components:
8+
# * runner/justfile – Building and uploading dstack runner and shim
9+
10+
default:
11+
@just --list
12+
13+
set allow-duplicate-recipes
14+
15+
import "runner/.justfile"
16+
17+
# TODO: Add frontend/justfile for managing frontend development tasks

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,22 @@ repos:
1717
rev: v5.0.0
1818
hooks:
1919
- id: end-of-file-fixer
20+
21+
# TODO(oleg): fix ESLint warnings
22+
# - repo: https://github.com/pre-commit/mirrors-eslint
23+
# rev: 'v8.31.0'
24+
# hooks:
25+
# - id: eslint
26+
# name: ESLint
27+
# entry: eslint --fix --config frontend/.eslintrc --ignore-path frontend/.eslintignore
28+
# language: node
29+
# pass_filenames: false
30+
# cwd: "frontend/"
31+
# additional_dependencies:
32+
# - eslint@8.31.0
33+
# - eslint-config-prettier@8.10.0
34+
# - eslint-plugin-i18n@2.4.0
35+
# - eslint-plugin-prettier@4.2.1
36+
# - eslint-plugin-simple-import-sort@10.0.0
37+
# - '@typescript-eslint/eslint-plugin@5.48.1'
38+
# - '@typescript-eslint/parser@5.48.1'

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ uv run pytest src/tests --runpostgres
5454

5555
If you'd like to integrate a new cloud provider to `dstack`, follow [contributing/BACKENDS.md](contributing/BACKENDS.md).
5656

57-
## Get help
57+
## What's next
58+
59+
You can find more subject-focused guides in the [contributing](contributing/) directory.
5860

5961
If you have any questions, you can always get help in our [Discord](https://discord.gg/u8SmfwPpMd) community.

0 commit comments

Comments
 (0)