Skip to content

Commit

Permalink
Adds support for command packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jsancio committed Apr 3, 2015
1 parent 85b2724 commit 5fd819b
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 40 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,14 @@ for more detailed instruction on app definitions.
#### `command.json`

This file is **optional**. Describes how to install the package's CLI.
Currently the only supported format is a Python egg.
Currently the only supported format is a Pip requirements file where each
element in the array is a line in the requirements file.

```json
{
"python": "https://pypi.python.org/packages/source/f/foo/foo-1.2.3.tar.gz"
"pip": [
"https://pypi.python.org/packages/source/f/foo/foo-1.2.3.tar.gz"
]
}
```
_Sample `command.json`._
Expand Down
4 changes: 2 additions & 2 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#! /bin/bash
#!/bin/bash
set -o errexit -o nounset -o pipefail

echo "RUNNING PRE-COMMIT";

GIT_HOOKS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
UNIVERSE_DIR=$GIT_HOOKS_DIR/../..
UNIVERSE_DIR=$GIT_HOOKS_DIR/..
SCRIPTS_DIR=$UNIVERSE_DIR/scripts

$SCRIPTS_DIR/build.sh
Expand Down
66 changes: 40 additions & 26 deletions repo/meta/index.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
{
"packages":[
{
"currentVersion":"0.1.0-SNAPSHOT",
"description":"Apache Cassandra running on Apache Mesos",
"framework":true,
"name":"cassandra",
"currentVersion":"1.564",
"description":"Jenkins is an award-winning application that monitors executions of repeated jobs, such as building a software project or jobs run by cron.",
"framework":false,
"name":"jenkins",
"tags":[],
"versions":{
"1.564":"0"
}
},
{
"currentVersion":"1.3.0-SNAPSHOT",
"description":"Spark is a fast and general cluster computing system for Big Data",
"framework":false,
"name":"spark",
"tags":[
"mesosphere",
"framework"
"framework",
"bigdata"
],
"versions":{
"0.1.0-SNAPSHOT":"0"
"1.3.0-SNAPSHOT":"0"
}
},
{
Expand All @@ -27,39 +38,43 @@
}
},
{
"currentVersion":"0.1.0",
"description":"Hadoop Distributed File System (HDFS), Highly Available",
"currentVersion":"0.1.0-SNAPSHOT",
"description":"Apache Cassandra running on Apache Mesos",
"framework":true,
"name":"hdfs",
"name":"cassandra",
"tags":[
"mesosphere",
"framework"
],
"versions":{
"0.1.0":"0"
"0.1.0-SNAPSHOT":"0"
}
},
{
"currentVersion":"1.564",
"description":"Jenkins is an award-winning application that monitors executions of repeated jobs, such as building a software project or jobs run by cron.",
"currentVersion":"0.1.0",
"description":"Example DCOS application package",
"framework":false,
"name":"jenkins",
"tags":[],
"name":"helloworld",
"tags":[
"mesosphere",
"example",
"subcommand"
],
"versions":{
"1.564":"0"
"0.1.0":"0"
}
},
{
"currentVersion":"0.8.1",
"description":"A cluster-wide init and control system for services in cgroups or Docker containers.",
"currentVersion":"0.1.0",
"description":"Hadoop Distributed File System (HDFS), Highly Available",
"framework":true,
"name":"marathon",
"name":"hdfs",
"tags":[
"mesosphere",
"framework"
],
"versions":{
"0.8.1":"0"
"0.1.0":"0"
}
},
{
Expand All @@ -75,17 +90,16 @@
}
},
{
"currentVersion":"1.3.0-SNAPSHOT",
"description":"Spark is a fast and general cluster computing system for Big Data",
"framework":false,
"name":"spark",
"currentVersion":"0.8.1",
"description":"A cluster-wide init and control system for services in cgroups or Docker containers.",
"framework":true,
"name":"marathon",
"tags":[
"mesosphere",
"framework",
"bigdata"
"framework"
],
"versions":{
"1.3.0-SNAPSHOT":"0"
"0.8.1":"0"
}
}
],
Expand Down
Binary file modified repo/meta/index.json.gz
Binary file not shown.
25 changes: 15 additions & 10 deletions repo/meta/schema/command-schema.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{
"$schema": "http://json-schema.org/schema#",
"type": {
"oneOf": [
{
"type": "object",
"properties": {
"python": {
"oneOf": [
{
"type": "object",
"properties": {
"pip": {
"type": "array",
"items": {
"type": "string"
}
},
"title": "Embedded Requirements File",
"description": "An array of strings representing of the requirements file to use for installing the subcommand for Pip. Each item is interpreted as a line in the requirements file."
}
}
]
}
},
"additionalProperties": false,
"required": ["pip"]
}
]
}
6 changes: 6 additions & 0 deletions repo/packages/H/helloworld/0/command.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pip": [
"http://downloads.mesosphere.io/dcos-cli/{{helloworld/secret}}/dcos-0.1.0-py2.py3-none-any.whl",
"git+https://github.com/mesosphere/dcos-helloworld.git#dcos-helloworld=0.1.0"
]
}
13 changes: 13 additions & 0 deletions repo/packages/H/helloworld/0/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"helloworld/secret": {
"type": "string",
"title": "Install Secret",
"description": "The temporary secret needed to download and install the DCOS CLI packages"
}
},
"additionalProperties": false,
"required": [ "helloworld/secret" ]
}
14 changes: 14 additions & 0 deletions repo/packages/H/helloworld/0/marathon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "helloworld",
"cpus": 1.0,
"mem": 512,
"instances": 1,
"cmd": "python3 -m http.server 8080",
"container": {
"type": "DOCKER",
"docker": {
"image": "python/3.4.3",
"network": "HOST"
}
}
}
8 changes: 8 additions & 0 deletions repo/packages/H/helloworld/0/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "helloworld",
"version": "0.1.0",
"website": "https://github.com/mesosphere/dcos-helloworld",
"maintainer": "[email protected]",
"description": "Example DCOS application package",
"tags": [ "mesosphere", "example", "subcommand" ]
}

0 comments on commit 5fd819b

Please sign in to comment.