dstack Server Base

A base version of the dstack server

License

License

GroupId

GroupId

ai.dstack
ArtifactId

ArtifactId

server-base
Last Version

Last Version

0.1.15
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

dstack Server Base
A base version of the dstack server

Download server-base

Dependencies

compile (16)

Group / Artifact Type Version
org.slf4j : jcl-over-slf4j jar 1.8.0-beta2
org.slf4j : slf4j-log4j12 jar 1.8.0-beta2
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.72
io.github.microutils : kotlin-logging jar 1.5.3
commons-codec : commons-codec jar 1.14
jakarta.servlet : jakarta.servlet-api jar 4.0.3
org.glassfish.jersey.core : jersey-server jar 2.26
org.springframework : spring-context jar 5.2.5.RELEASE
org.glassfish.hk2 : spring-bridge jar 2.6.1
com.fasterxml.jackson.core : jackson-databind jar 2.9.9.2
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar 2.9.9
org.glassfish.jersey.media : jersey-media-json-jackson jar 2.26
org.glassfish.jersey.inject : jersey-hk2 jar 2.26
javax.xml.bind : jaxb-api jar 2.3.0
javax.activation : activation jar 1.1.1
com.fasterxml.jackson.module : jackson-module-kotlin jar 2.9.9

Project Modules

There are no modules declared in this project.

dstack is an open-source platform to build and share data and ML applications within hours

Discord Chat

Installation

Installing and running dstack is very easy:

pip install --index-url https://test.pypi.org/simple/ --upgrade --no-cache-dir --extra-index-url=https://pypi.org/simple/ dstack==0.6.1.dev3
dstack server start

If you run it for the first time, it may take a while. Once it's done, you'll see the following output:

To access the application, open this URL in the browser: http://localhost:8080/auth/verify?user=dstack&code=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&next=/

The default profile in "~/.dstack/config.yaml" is already configured. You are welcome to push your applications using Python package.

To access dstack, click the URL provided in the output. If you try to access dstack without using this URL, it will require you to sign up using a username and a password.

If you open the URL, you'll see the following interface:

You'll be logged as the dstack user. The page you'll see is Applications. It shows you all published applications which you have access to. The sidebar on the left lets you open other pages: ML Models, Settings, Documentation, and Chat.

Minimal Application

Here's an elementary example of using dstack. The application takes real-time stock exchange data from Yahoo Finance for the FAANG companies and renders it for a selected symbol. Here's the Python code that you have to run to make such an application:

from datetime import datetime, timedelta

import dstack.controls as ctrl
import dstack as ds
import plotly.graph_objects as go
import pandas_datareader.data as web


def output_handler(self: ctrl.Output, symbols: ctrl.ComboBox):
    start = datetime.today() - timedelta(days=30)
    end = datetime.today()
    df = web.DataReader(symbols.value(), 'yahoo', start, end)
    fig = go.Figure(
        data=[go.Candlestick(x=df.index, open=df['Open'], high=df['High'], low=df['Low'], close=df['Close'])])
    self.data = fig


app = ds.app(controls=[ctrl.ComboBox(items=["FB", "AMZN", "AAPL", "NFLX", "GOOG"])],
             outputs=[ctrl.Output(handler=output_handler)])

result = ds.push("minimal_app", app)
print(result.url)

If you run it and click the provided URL, you'll see the application:

To learn about how this application works and to see other examples, please check out the Tutorials documentation page.

To learn in more detail about what applications consist of and how to use all their features, check out the Concepts documentation page.

ML Models

dstack decouples the development of applications from the development of ML models by offering an ML registry. This way, one can develop ML models, push them to the registry, and then later pull these models from applications.

dstack's ML Registry supports Tensorflow, PyTorch, or Scikit-Learn models.

Here's a very simple example of how to push a model to dstack:

from sklearn import datasets
from sklearn import svm
import dstack as ds

digits = datasets.load_digits()
clf = svm.SVC(gamma=0.001, C=100.)
clf.fit(digits.data[:-1], digits.target[:-1])

url = ds.push("clf_app", clf)
print(url)

Now, if you click the URL, it will open the following page:

Here you can see the snippet of how to pull the model from an application or from anywhere else:

import dstack as ds

model = ds.pull('/dstack/clf_app')

To learn how to build an application that uses a simple ML model, check out the corresponding tutorial.

Feedback

Do you have any feedback either minor or critical? Please, file an issue in our GitHub repo or write to us on our Discord Channel.

Have you tried dstack? Please share your feedback with us using this form!

Documentation

For more details on the API and code samples, check out the docs.

Contribution

The instructions on how to build dstack from sources can be found here.

License

dstack is an open-source library licensed under the Apache 2.0 license

ai.dstack

dstack.ai

An open-source tool for building data and ML applications using Python

Versions

Version
0.1.15
0.1.14
0.1.12
0.1.11
0.1.8
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1
0.0.12