0.12.0
Server configuration
Previously, the only way to configure clouds for a project was through the UI. Additionally, you had to specify not only the credentials but also set up a storage bucket for each cloud to store metadata.
Now, you can configure clouds for a project via ~/.dstack/server/config.yml
. Example:
projects:
- name: main
backends:
- type: aws
creds:
type: access_key
access_key: AIZKISCVKUKO5AAKLAEH
secret_key: QSbmpqJIUBn1V5U3pyM9S6lwwiu8/fOJ2dgfwFdW
Enhanced Python API
The earlier introduced Python API is now greatly refined.
Creating a dstack
client is as easy as this:
from dstack.api import Client, ClientError
try:
client = Client.from_config()
except ClientError:
print("Can't connect to the server")
Now, you can submit a task or a service:
from dstack.api import Task, Resources, GPU
task = Task(
image="ghcr.io/huggingface/text-generation-inference:latest",
env={"MODEL_ID": "TheBloke/Llama-2-13B-chat-GPTQ"},
commands=[
"text-generation-launcher --trust-remote-code --quantize gptq",
],
ports=["80"],
)
run = client.runs.submit(
run_name="my-awesome-run",
configuration=task,
resources=Resources(gpu=GPU(memory="24GB")),
)
The dstack.api.Run
instance provides methods for various operations including attaching to the run,
forwarding ports to localhost
, retrieving status, stopping, and accessing logs. For more details, refer to
the example and reference.
Other changes
- Because we've prioritized CLI and API UX over the UI, the UI is no longer bundled.
Please inform us if you experience any significant inconvenience related to this. - Gateways should now be configured using the
dstack gateway
command, and their usage requires you to specify a domain.
Learn more about how to set up a gateway. - The
dstack start
command is nowdstack server
. - The Python API classes were moved from the
dstack
package todstack.api
.
Migration
Unfortunately, when upgrading to 0.12.0, there is no automatic migration for data.
This means you'll need to delete ~/.dstack
and configure dstack
from scratch.
pip install "dstack[all]==0.12.0"
- Delete
~/.dstack
- Configure clouds via
~/.dstack/server/config.yml
(see the new guide) - Run
dstack server