Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
/ dcos-commons Public archive

DC/OS SDK is a collection of tools, libraries, and documentation for easy integration of technologies such as Kafka, Cassandra, HDFS, Spark, and TensorFlow with DC/OS.

License

Notifications You must be signed in to change notification settings

d2iq-archive/dcos-commons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cbea99c · Jan 5, 2017
Dec 23, 2016
Dec 27, 2016
Jan 4, 2017
Jan 4, 2017
Jan 4, 2017
Dec 28, 2016
Dec 1, 2016
Dec 22, 2016
Jun 2, 2016
Dec 27, 2016
Jan 5, 2017
Nov 21, 2016
Nov 23, 2016
Nov 18, 2016
Nov 18, 2016
Dec 1, 2016
Nov 18, 2016
Nov 8, 2016
Dec 14, 2016
Dec 14, 2016

Repository files navigation

Quick Start | FAQ | Javadocs | Contributing | Slack

========= DC/OS SDK is a collection of tools, libraries, and documentation for easy integration and automation of stateful services, such as databases, message brokers, and caching services.

Status

DC/OS SDK is currently in alpha stage: it can run services, but APIs change regularly, and features are under active development.

Benefits

  • Simple and Flexible: The SDK provides the simplicity of a declarative YAML API as well as the flexibility to use the full Java programming language.

  • Automate Maintenance: Stateful services need to be maintained. With the SDK, you can automate maintenance routines, such as backup and restore, to simplify operations.

  • Available and Durable: When servers fail, you need to reschedule the tasks without data loss or performance impact. With the SDK, you develop automated recovery strategies so services heal themselves.

  • Production-Proven: Building reliable services is hard. Uber and Bing platform teams use the SDK for mission-critical databases and message brokers.

===============

Quick Start

From a workstation with 8G Memory, Git, VirtualBox 5.0.x, and Vagrant 1.8.4, run:

  1. Download the DC/OS SDK.
git clone https://github.com/mesosphere/dcos-commons.git
  1. Create your local development environment.
cd dcos-commons/ && ./get-dcos-docker.sh
  • Visit the DC/OS cluster dashboard to verify your development environment is running.
  1. Enter your development environment.
cd tools/vagrant/ && vagrant ssh
  1. Build your hello-world example project.
cd /dcos-commons/frameworks/helloworld/ && ./build.sh local
  1. Start your hello-world DC/OS service.
dcos package install hello-world
  1. Explore your hello-world service.
  • Visit the dashboard to see your hello-world service running.
  • Click through to one of your tasks (e.g. world-server-1-<uuid>), select the Files tab, select world-container-path, and finally select the output file.

===============

Understanding the Hello World Service Specification

The service specification declaratively defines the helloworld service:

name: "helloworld"
principal: "helloworld-principal"
zookeeper: master.mesos:2181
api-port: 8080
pods:
  helloworld:
    count: {{COUNT}}
    tasks:
      server:
        goal: RUNNING
        cmd: "echo 'Hello World!' >> helloworld-container-volume/output && sleep 10"
        cpus: {{SERVER_CPU}}
        memory: 32
        volumes:
          - path: "helloworld-container-volume"
            type: ROOT
            size: 64

In above yaml file, we have:

  • Defined a service with the name helloworld
  • Configured the service to use ZooKeeper at master.mesos:2181 for storing framework state and configuration.
  • Configured the API port using api-port: 8080. By default, each service comes with a default set of useful APIs to enable operationalization.
  • Defined a pod specification for our helloworld pod using:
pods:
  helloworld:
    count: {{COUNT}}
    tasks:
      ...
  • Declared that we need atleast {{COUNT}} instances of the helloworld pod running at all times, where COUNT is the environment variable that is injected into the scheduler process at launch time via Marathon. It defaults to 1 for this example.
  • Defined a task specification for our server task using:
tasks:
  server:
    goal: RUNNING
    cmd: "echo 'Hello World!' >> helloworld-container-volume/output && sleep 10"
    cpus: {{SERVER_CPU}}
    memory: 32

We have configured it to use {{SERVER_CPU}} CPUs (which defaults to 0.5 for this example) and 32 MB of memory.

  • And finally, configured a 64 MB persistent volume for our server task where the task data can be persisted using:
volumes:
  - path: "helloworld-container-volume"
    type: ROOT
    size: 64

===============

References

===============

Contributions

Contributions are welcome! See CONTRIBUTING.

===============

License

DC/OS SDK is licensed under the Apache License, Version 2.0.