There are 2 main components of dstack:
The easiest way to install
dstack in Python is by using
pip install dstack
conda install dstack -c dstack.ai
The python package comes with a command-line tool called
dstack. This command-line tool can be used to configure local profiles, credentials, and to run a local server.
If you're using R and don't need the command-line tool, you can install the client package for R via the following command:
dstack config add --token [YOUR TOKEN] --user [YOUR USERNAME]
You can read more details about Configuration and dstack.ai cloud here-
Otherwise you can also run a server locally as specified below.
After installing the
dstack Python Client package, you can access the
dstack command line tool, which you can use to run a local server.
In order to run a server locally, run this command line:
dstack server start
You'll see the following output:
To access the dstack server, open one of these URLs in the browser:http://localhost:8080/auth/verify?user=dstack&code=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&next=/or http://127.0.0.1:8080/auth/verify?user=dstack&code=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&next=/If you're using Python, use the following command line command to configure your dstack profile:pip install dstackdstack config add --token xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --user dstack --server http://localhost:8080/apiIf you're using R, use the following R command to configure your dstack profile:install.packages("dstack")dstack::configure(user = "dstack", token = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", persist = "global", server = "http://localhost:8080/api")
Note, in your case instead of
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx you'll see your personal code.
The server by default uses the
8080 port. Optionally, you can specify a custom port by using the command line option
dstack server start --port 8081
Note, by default, the server stores all the data under
.dstack in the user home directory. In case you'd like to store the
.dstack folder in a different place, use the following command:
dstack server start --home <other_directory>
In this case, the server will store all the data in
In order to send requests to the locally running server, one must run the command suggested in the output:
dstack config add --token xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --user dstack --server http://localhost:8080/api