Simplifying stateful services
Switch branches/tags
kibana-2.1.2-5.6.5-beta kibana-2.1.1-5.6.5 kibana-2.0.0-5.5.1 kibana-1.0.16-5.5.1-beta kafka-auto kafka-2.3.0-1.1.0 kafka-2.3.0-1.1.0-rc1 kafka-2.3.0-1.0.0 kafka-2.2.0-1.0.0 kafka-2.2.0-1.0.0-rc2 kafka-2.2.0-1.0.0-rc1 kafka-2.1.2-1.0.0-beta kafka-2.1.1-1.0.0 kafka-2.1.1-1.0.0-beta kafka-2.1.0-1.0.0 kafka-2.1.0-1.0.0-beta kafka-2.0.4-1.0.0 kafka-2.0.3-0.11.0 kafka-2.0.2-0.11.0 kafka-2.0.1-0.11.0 kafka-2.0.0-0.11.0 kafka-1.1.27-0.11.0-beta kafka-1.1.26-0.10.1.0-beta kafka-1.1.24-0.10.1.0beta helloworld-3.0.0-0.54.3 helloworld-2.3.0-0.42.2 helloworld-2.3.0-0.42.2-rc1 helloworld-2.2.0-0.42.2 hello-world-2.0.3-0.30.3 hello-world-2.0.1-0.30.1 hello-world-1.3.0-0.20.1 hello-world-1.3.0-0.20.0 hdfs-2.4.0-2.6.0-cdh5.11.0 hdfs-2.3.0-2.6.0-cdh5.11.0 hdfs-2.2.0-2.6.0-cdh5.11.0 hdfs-2.2.0-2.6.0-cdh5.11.0-rc2 hdfs-2.2.0-2.6.0-cdh5.11.0-rc1 hdfs-2.1.2-2.6.0-cdh5.11.0-beta hdfs-2.1.1-2.6.0-cdh5.11.0 hdfs-2.1.1-2.6.0-cdh5.11.0-beta hdfs-2.1.0-2.6.0-cdh5.11.0 hdfs-2.1.0-2.6.0-cdh5.11.0-beta hdfs-2.0.4-2.6.0-cdh5.11.0 hdfs-2.0.3-2.6.0-cdh5.11.0 hdfs-2.0.2-2.6.0-cdh5.11.0 hdfs-2.0.1-2.6.0-cdh5.11.0 hdfs-2.0.0-2.6.0-cdh5.11.0 hdfs-2.0.0-2.6.0-cdh5.9.1 hdfs-1.3.4-2.6.0-cdh5.11.0-beta hdfs-1.3.3-2.6.0-cdh5.11.0-beta hdfs-1.3.3-2.6.0-cdh5.9.1beta hdfs-1.3.3-2.6.0-cdh5.9.1-beta elastic-2.4.0-5.6.9 elastic-2.3.1-5.6.5 elastic-2.3.0-5.6.5-rc2 elastic-2.3.0-5.6.5-rc1 elastic-2.2.1-5.6.5 elastic-2.2.0-5.6.5 elastic-2.1.2-5.6.5-beta elastic-2.1.1-5.6.5 elastic-2.1.1-5.6.5-beta elastic-2.1.0-5.6.4-beta elastic-2.1.0-5.6.2 elastic-2.0.2-5.6.2 elastic-2.0.2-5.5.1 elastic-2.0.1-5.5.1 elastic-2.0.0-5.5.1 elastic-1.0.16-5.5.1-beta elastic-1.0.15-5.5.1-beta elastic-1.0.14-5.4.1-beta elastic-1.0.13-5.4.1-beta elastic-1.0.11-5.4.0-beta cassandra-2.4.0-3.0.16 cassandra-2.3.0-3.0.16 cassandra-2.3.0-3.0.16-rc3 cassandra-2.3.0-3.0.16-rc2 cassandra-2.3.0-3.0.16-rc1 cassandra-2.2.1-3.0.16 cassandra-2.2.0-3.0.16-rc2 cassandra-2.2.0-3.0.16-rc1 cassandra-2.1.2-3.0.15-beta cassandra-2.1.1-3.0.16 cassandra-2.1.1-3.0.15-beta cassandra-2.1.0-3.0.16 cassandra-2.1.0-3.0.15-beta cassandra-2.0.3-3.0.14 cassandra-2.0.2-3.0.14 cassandra-2.0.1-3.0.14 cassandra-2.0.0-3.0.14 cassandra-1.0.32-3.0.14-beta cassandra-1.0.31-3.0.13-beta cassandra-1.0.30-3.0.13-beta cassandra-1.0.29-3.0.13beta before_default_executor VERSION KAFKA_1.1.23-0.10.1.0-beta KAFKA_1.1.22-0.10.1.0-beta HELLOWORLD_1.1.4 HDFS_1.3.2-2.6.0-cdh5.9.1-beta HDFS_1.3.1-2.6.0-cdh5.9.1
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
cli [DCOS-42966] Fix potential segfault on empty response in CLI (#2776) Nov 16, 2018
dep-snapshots [DCOS-43953] Use a stable snapshot of dcos CLI. (#2729) Oct 23, 2018
docs Document the `profiles` field on `VolumeSpec`. (#2709) Oct 3, 2018
frameworks Add file name to ClassicRPCAuthenticatee module (#2777) Nov 15, 2018
govendor Spring cleaning of docs (#2450) Apr 4, 2018
gradle [DCOS-43952] [TOOLS] Install readwrite registry from bootstrap regist… Nov 16, 2018
hooks Add post_push hook to add additional docker tags (#2574) Jul 7, 2018
sdk DCOS-42539 Fix how TaskInfos are updated with sidecar tasks and resou… Nov 11, 2018
testing [DCOS-43952] [TOOLS] Install readwrite registry from bootstrap regist… Nov 16, 2018
tools Update .dcos publish tooling to reuse s3_urls_from_env from publish_a… Nov 13, 2018
.dockerignore [DCOS-43889] Freeze all pip depencies to recover from build breakage. ( Oct 23, 2018
.flake8 Enable black formatting checks in code checks (#2597) Aug 2, 2018
.gitignore [DCOS-37660] Add initial diagnostics script. (#2511) Oct 11, 2018
.pre-commit-config.yaml [TOOLS] Preheat docker image with jar dependencies + pre-commit env (#… Aug 13, 2018
.pylintrc [DCOS-37660] Add initial diagnostics script. (#2511) Oct 11, 2018
CONTRIBUTING.md [TOOLS][TESTS] Add tooling for running flake8 as a pre-commit hook an… Jul 3, 2018
Dockerfile [DCOS-42575][DCOS-44511][DCOS-44509] Verify that frozen_requirements.… Nov 6, 2018
Dockerfile.base [DCOS-42575] Turn on renovatebot support. (#2742) Nov 6, 2018
LICENSE Initial commit Jun 2, 2016
README.md [WIP] [INFINITY-3440] Initial cleanup of various markdown files and o… Apr 2, 2018
TESTING.md [DCOS-40636][TOOLS] Add interactive testing note to TESTING.md (#2631) Aug 21, 2018
__init__.py Use pre-commit run black to fix the black linter errors Aug 8, 2018
build.gradle Bump snapshot version following release of 0.54.0 (#2710) Oct 4, 2018
build.sh Drop custom executor (#2472) Apr 12, 2018
conftest.py DCOS-39843 Remove shakedown, deflake tests, reenable disabled deflake… Aug 23, 2018
frozen_requirements.txt [DCOS-42575][DCOS-44511][DCOS-44509] Verify that frozen_requirements.… Nov 6, 2018
gradle.properties [INFINITY-2379] Extend state store API to get/set files (#1570) Sep 14, 2017
gradlew [DCOS-41388] Fix bug where v1 mesos client instantiation defaults to … Sep 25, 2018
pyproject.toml Enable black formatting checks in code checks (#2597) Aug 2, 2018
release.sh Drop custom executor (#2472) Apr 12, 2018
renovate.json [DCOS-42575] Turn on renovatebot support. (#2742) Nov 6, 2018
settings.gradle [DCOS-41388] Fix bug where v1 mesos client instantiation defaults to … Sep 25, 2018
test.sh [tools] Add missing " causing syntax error in test.sh (#2783) Nov 16, 2018
test_requirements.txt [DCOS-43889] Freeze all pip depencies to recover from build breakage. ( Oct 23, 2018

README.md

Quick Start | Developer Guide | FAQ | Javadocs | Contributing | Slack


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.


Understanding the Hello World Service Specification

The service specification declaratively defines the helloworld service:

name: "helloworld"
pods:
  helloworld:
    count: {{COUNT}}
    tasks:
      server:
        goal: RUNNING
        cmd: "echo 'Hello World!' >> helloworld-container-volume/output && sleep 10"
        cpus: {{SERVER_CPU}}
        memory: 32
        volume:
          path: "helloworld-container-volume"
          type: ROOT
          size: 64

In the above YAML file, we have:

  • Defined a service with the name helloworld
  • 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:
volume:
  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.