Skip to content

Commit 1b7d436

Browse files
Updated runner and shim contributing guide #2534 (use env vars)
1 parent 4b4e731 commit 1b7d436

3 files changed

Lines changed: 19 additions & 12 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ build/
2020
.DS_Store
2121
.fleet
2222
.env
23+
.envrc
2324
.aider*
2425
uv.lock

runner/.justfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
#
33
# Run `just` to see all available commands
44
#
5-
# IMPORTANT: Change the s3_bucket and version variables below before running any commands.
5+
# Configuration:
6+
# - DSTACK_SHIM_UPLOAD_VERSION: Version of the runner and shim to upload
7+
# - DSTACK_SHIM_UPLOAD_S3_BUCKET: S3 bucket to upload binaries to
68
#
79
# Build Process:
810
# - Runner is always built for linux/amd64
@@ -23,12 +25,11 @@
2325
default:
2426
@just --list
2527

26-
# Export version variable
27-
# Must be changed to a unique value to avoid conflicts with other developers using the same bucket
28-
export version := "0.0.0"
28+
# Version of the runner and shim to upload
29+
export version := env_var("DSTACK_SHIM_UPLOAD_VERSION")
2930

30-
# S3 bucket name - must be set to a bucket that the developer has access to
31-
export s3_bucket := "dstack-runner-downloads-stgn"
31+
# S3 bucket to upload binaries to
32+
export s3_bucket := env_var("DSTACK_SHIM_UPLOAD_S3_BUCKET")
3233

3334
# Download URLs
3435
export runner_download_url := "s3://" + s3_bucket + "/" + version + "/binaries/dstack-runner-linux-amd64"

runner/README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,24 @@ You can also test the built shim and runner using standard backends (including S
8888
Build the runner and shim, and upload them to S3 automatically using `just` (see [`justfile`](justfile)).
8989

9090
> [!IMPORTANT]
91-
> Before running any `just` commands that upload to S3, make sure to modify the `s3_bucket` and `version`
92-
> variables in the [`justfile`](justfile).
91+
> Before running any `just` commands that upload to S3, you must set the following environment variables:
92+
>
93+
> ```shell
94+
> export DSTACK_SHIM_UPLOAD_VERSION="your-version"
95+
> export DSTACK_SHIM_UPLOAD_S3_BUCKET="your-bucket"
96+
> ```
97+
>
98+
> These variables are required and must be set before running any upload commands.
9399

94100
```shell
95101
just upload
96102
```
97103

98-
To use the built shim and runner with the dstack server, pass the URLs via `DSTACK_SHIM_DOWNLOAD_URL` and `DSTACK_RUNNER_DOWNLOAD_URL`. Make sure to use the same `s3_bucket` and `version` values that you set in the [`justfile`](justfile).
104+
To use the built shim and runner with the dstack server, pass the URLs via `DSTACK_SHIM_DOWNLOAD_URL` and `DSTACK_RUNNER_DOWNLOAD_URL`:
99105

100106
```shell
101-
DSTACK_SHIM_DOWNLOAD_URL=https://<s3_bucket>.s3.<s3_bucket_region>.amazonaws.com/<version>/binaries/dstack-shim-linux-amd64
102-
103-
DSTACK_RUNNER_DOWNLOAD_URL=https://<s3_bucket>.s3.<s3_bucket_region>.amazonaws.com/<version>/binaries/dstack-runner-linux-amd64
107+
export DSTACK_SHIM_DOWNLOAD_URL="https://${DSTACK_SHIM_UPLOAD_S3_BUCKET}.s3.amazonaws.com/${DSTACK_SHIM_UPLOAD_VERSION}/binaries/dstack-shim-linux-amd64"
108+
export DSTACK_RUNNER_DOWNLOAD_URL="https://${DSTACK_SHIM_UPLOAD_S3_BUCKET}.s3.amazonaws.com/${DSTACK_SHIM_UPLOAD_VERSION}/binaries/dstack-runner-linux-amd64"
104109
105110
dstack server --log-level=debug
106111
```

0 commit comments

Comments
 (0)