8 min read
- In this first part, "A Developer's Guide to the Universe" we will develop a simple package that deploys just one container and make it available via a local Universe in our DC/OS cluster.
- In the second part, "Add Another Thing…", we will explore a more complex multi container service and show how we can utilize DC/OS features for connecting these containers. We will also discuss what it takes to contribute a package to the official Universe.
- In the third part, "Frameworks, the Universe and Everything Else" we will take a look at the Mesos concept of a 2-level scheduler, which allows us to encode logic beyond a simple container for our services. As part of this, we will develop a simple stateless Mesos framework.
- The fourth part, "Stateful, and Thanks for the SDK" will enter the complex world of stateful services and explore the DC/OS SDK, which relieves us of much of the complexity involved in writing frameworks.
- The fifth part, "Well, it works but wouldn't it be better if… (mostly testing)" will explore different options for testing your service.
- The sixth part, "The CLI at the End of the Universe" will demonstrate how to add a custom CLI for your package.
- Warning and Prerequisites
- First Package
- Clone the universe
- Create the universe package
- Folder structure
- marathon.json.mustache and config.json
- resources.json
- package.json
- Webui
- Build and deploy a local Universe Server
- Deploy the universe server on your cluster
- Install Neo4j package
- Pitfalls with Neo4j Dashboard
- So Long, and Thanks for All the Introduction
dcos marathon app add https://raw.githubusercontent.com/joerg84/developers-guide-to-the-universe/master/neo4j-app.json

- id: the id needs to be unique, making it configurable allows users to install multiple instances of the app on the same cluster.
- cpu and mem: making resource parameters like CPU shares and memory allocation configurable allows users to change these at install time depending on their needs.
"id": "{{service.name}}", "instances": 1, "cpus": {{neo4j.cpus}}, "mem": {{neo4j.mem}},{ "type": "object", "properties": { "service": { "type": "object", "description": "DC/OS service configuration properties", "properties": { "name": { "description": "Name of this service instance.", "type": "string", "default": "neo4j" } } }, "neo4j": { "type": "object", "description": "Neo4J instance configuration properties", "properties": { "cpus": { "description": "CPU shares to allocate to the Neo4J instance.", "type": "number", "default": 2, "minimum": 1 }, "mem": { "description": "Memory to allocate to the Neo4J instance.", "type": "number", "default": 2048, "minimum": 2048 } }, "required": [ "cpus", "mem" ] } } }"docker":{ "image":"{{resource.assets.container.docker.neo4j}}","assets": { "container": { "docker": { "neo4j": "mesosphere/neo4j:3.1.1-RC1" } } }"images": { "icon-small": "https://s3.amazonaws.com/downloads.mesosphere.io/universe/assets/icon-service-neo4j-small.png", "icon-medium": "https://s3.amazonaws.com/downloads.mesosphere.io/universe/assets/icon-service-neo4j-medium.png", "icon-large": "https://s3.amazonaws.com/downloads.mesosphere.io/universe/assets/icon-service-neo4j-large.png" }{ "packagingVersion": "3.0", "name": "neo4j", "version": "3.1-0.0.1", "maintainer": "joerg@mesosphere.io", "description": "This is a single Neo4j container, which is not suited for HA setups. Neo4J is a popular graph database. See documentation for details: https://github.com/dcos/examples/tree/master/1.8/neo4j", "website": "http://www.neo4j.com", "framework": false, "tags": [ "mesosphere", "service", "neo4j", "storage" ], "licenses": [ { "name": "GPL v3 license or Neo4j Commercial/Evaluation/Education License", "url": "https://neo4j.com/licensing/" } ], "postInstallNotes": "Neo4J installed!", "preInstallNotes": "This DC/OS Service is currently EXPERIMENTAL. There may be bugs, incomplete features, incorrect documentation, or other discrepancies. Neo4J requires a single node with 2GB of RAM and 1 CPU. ", "postUninstallNotes": "Thank you for using Redis" }"labels": { "DCOS_SERVICE_NAME": "{{service.name}}", "DCOS_SERVICE_PORT_INDEX": "0", "DCOS_SERVICE_SCHEME": "http" }DOCKER_TAG="your_name-neo4jtutorial-1" docker/server/build.bash
DOCKER_TAG="your_name-neo4jtutorial-1" docker/server/build.bash publish
dcos marathon app add docker/server/target/marathon.json
dcos marathon app list
dcos package repo add --index=0 dev-universe http://universe.marathon.mesos:8085/repo
dcos package search neo4j
dcos package install neo4j
