Skip to content

Commit 7cb13a4

Browse files
authored
Merge pull request #14 from kkrishna/master
Here are the change list
2 parents 92c87df + 94bc499 commit 7cb13a4

27 files changed

+1201
-983
lines changed

docs/dev-build.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ Use the fat jar generated with all the dependencies.
1818
1919
> Marathon supports custom executor and you can specify a shell script (compose_executor.sh).
2020
```
21-
COMPOSE_JAR_NAME=<path to jar file>/docker-compose-executor-0.0.1-SNAPSHOT-jar-with-dependencies.jar
22-
COMPOSE_CLASS_NAME=com.paypal.mesos.executor.App
23-
java -cp ${COMPOSE_JAR_NAME} ${COMPOSE_CLASS_NAME}
21+
COMPOSE_JAR_NAME=<path to jar file>/docker-compose-executor_0.0.1.jar
22+
java -jar ${COMPOSE_JAR_NAME}
2423
```
2524
> Create a new marathon app
2625
```

docs/getting-started.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,26 @@ Marathon
2121
http://192.168.33.7:8080/
2222
```
2323

24-
Create a marathon app
25-
send a http post request to v2/apps
24+
Create a marathon app by sending a JSON payload via HTTP to Marathon's app endpoint (192.168.33.7:8080/v2/apps)
2625

2726
```
2827
{
2928
"id": "docker-compose-demo",
3029
"cmd": "echo hello world",
3130
"cpus": 1.0,
3231
"mem": 64.0,
33-
"ports":[0,0,0],
32+
"ports":[0],
3433
"instances": 1,
35-
"executor":"/home/vagrant/aurora/examples/vagrant/docker-compose-executor.sh",
34+
"executor":"/vagrant/examples/vagrant/docker-compose-executor.sh",
3635
"labels": {
37-
"fileName": "web-app/docker-compose.yml"
36+
"fileName": "sample-app/docker-compose.yml"
3837
},
39-
"uris":["https://dl.dropboxusercontent.com/u/26009359/web-app.zip"]
38+
"uris":["https://dl.bintray.com/rdelvalle/mesos-compose-executor/sample-app.tar.gz"]
4039
}
4140
```
4241

42+
Using the curl command, a docker compose job can be created on Marathon as follows:
43+
```
44+
$ curl -H "Content-Type: application/json" -X POST -d '{"id":"docker-compose-demo","cmd":"echo hello world","cpus":1.0,"mem":64.0,"ports":[0],"instances":1,"executor":"/vagrant/examples/vagrant/docker-compose-executor.sh","labels":{"fileName":"sample-app/docker-compose.yml"},"uris":["https://dl.bintray.com/rdelvalle/mesos-compose-executor/sample-app.tar.gz"]}' http://192.168.33.7:8080/v2/apps
45+
```
46+
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
COMPOSE_JAR_NAME=/home/vagrant/marathon/target/docker-compose-executor-0.0.1-SNAPSHOT-jar-with-dependencies.jar
2-
COMPOSE_CLASS_NAME=com.paypal.mesos.executor.App
3-
java -cp ${COMPOSE_JAR_NAME} ${COMPOSE_CLASS_NAME}
1+
COMPOSE_JAR_NAME=/home/vagrant/marathon/target/docker-compose-executor_0.0.1.jar
2+
java -jar ${COMPOSE_JAR_NAME}

examples/vagrant/provision-dev-cluster.sh

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15-
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
15+
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1616
echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list
17+
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E56151BF
18+
echo deb http://repos.mesosphere.com/ubuntu trusty main > /etc/apt/sources.list.d/mesosphere.list
1719

1820
apt-get update -q --fix-missing
1921
apt-get -qy install software-properties-common
@@ -37,7 +39,7 @@ apt-get -y install \
3739
zookeeperd \
3840
python-pip \
3941
maven \
40-
build-essential \
42+
build-essential \
4143
autoconf \
4244
automake \
4345
ca-certificates \
@@ -66,26 +68,26 @@ apt-get -y install \
6668
update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
6769

6870
readonly IP_ADDRESS=192.168.33.7
69-
70-
readonly MESOS_VERSION=0.25.0
71+
readonly MESOS_VERSION=0.28.2-2.0.27
72+
readonly MARATHON_VERSION=1.1.2-1.0.482
7173

7274

7375
function install_mesos {
74-
deb=mesos_${MESOS_VERSION}-0.2.70.ubuntu1404_amd64.deb
75-
wget -c http://downloads.mesosphere.io/master/ubuntu/14.04/$deb
76-
dpkg --install $deb
77-
}
76+
apt-get -y install mesos=${MESOS_VERSION}.ubuntu1404
77+
}
7878

7979
function install_marathon {
80-
sudo pip install docker-compose
81-
sudo dpkg --purge marathon
82-
wget -c https://dl.dropboxusercontent.com/u/26009359/marathon_0.11.1-1.0.432.ubuntu1404_amd64.deb
83-
sudo dpkg --install marathon_0.11.1-1.0.432.ubuntu1404_amd64.deb
80+
apt-get -y install marathon=${MARATHON_VERSION}.ubuntu1404
81+
}
82+
83+
function install_docker_compose {
84+
pip install docker-compose
8485
}
8586

87+
8688
function build_docker_compose_executor {
87-
sudo mvn -f /home/vagrant/marathon/pom.xml clean package -U
88-
sudo chmod 777 /home/vagrant/marathon/target/docker-compose-executor-0.0.1-SNAPSHOT-jar-with-dependencies.jar
89+
mvn -f /home/vagrant/marathon/pom.xml clean package -U
90+
chmod 777 /home/vagrant/marathon/target/docker-compose-executor_0.0.1.jar
8991
}
9092

9193
function install_cluster_config {
@@ -148,6 +150,8 @@ EOF
148150
}
149151

150152
install_mesos
153+
install_marathon
154+
install_docker_compose
151155
prepare_sources
152156
install_marathon
153157
install_cluster_config

examples/vagrant/provision-dev-cluster.sh_bak

Lines changed: 0 additions & 130 deletions
This file was deleted.

pom.xml

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,49 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.paypal.mesos</groupId>
55
<artifactId>docker-compose-executor</artifactId>
6-
<version>0.0.1-SNAPSHOT</version>
7-
6+
<version>0.0.1</version>
87
<dependencies>
9-
108
<dependency>
119
<groupId>org.apache.mesos</groupId>
1210
<artifactId>mesos</artifactId>
13-
<version>0.24.1</version>
11+
<version>0.28.2</version>
1412
</dependency>
15-
16-
1713
<dependency>
1814
<groupId>log4j</groupId>
1915
<artifactId>log4j</artifactId>
2016
<version>1.2.17</version>
2117
</dependency>
22-
2318
<dependency>
2419
<groupId>com.google.protobuf</groupId>
2520
<artifactId>protobuf-java</artifactId>
2621
<version>2.5.0</version>
2722
</dependency>
28-
2923
<dependency>
3024
<groupId>com.google.dagger</groupId>
3125
<artifactId>dagger</artifactId>
3226
<version>2.0</version>
3327
</dependency>
34-
3528
<dependency>
3629
<groupId>com.google.dagger</groupId>
3730
<artifactId>dagger-compiler</artifactId>
3831
<version>2.0</version>
3932
<optional>true</optional>
4033
</dependency>
41-
4234
<dependency>
4335
<groupId>org.apache.commons</groupId>
4436
<artifactId>commons-lang3</artifactId>
4537
<version>3.0</version>
4638
</dependency>
47-
4839
<dependency>
4940
<groupId>org.yaml</groupId>
5041
<artifactId>snakeyaml</artifactId>
5142
<version>1.5</version>
5243
</dependency>
53-
5444
<dependency>
5545
<groupId>com.google.code.gson</groupId>
5646
<artifactId>gson</artifactId>
5747
<version>2.3.1</version>
5848
</dependency>
59-
6049
<dependency>
6150
<groupId>io.reactivex</groupId>
6251
<artifactId>rxjava</artifactId>
@@ -67,18 +56,24 @@
6756
<artifactId>commons-exec</artifactId>
6857
<version>1.3</version>
6958
</dependency>
70-
59+
<dependency>
60+
<groupId>ro.fortsoft.pf4j</groupId>
61+
<artifactId>pf4j</artifactId>
62+
<version>0.13.1</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>junit</groupId>
66+
<artifactId>junit</artifactId>
67+
<version>4.11</version>
68+
<scope>test</scope>
69+
</dependency>
7170
</dependencies>
72-
73-
74-
75-
7671
<build>
7772
<outputDirectory>bin/classes</outputDirectory>
7873
<plugins>
7974
<plugin>
8075
<artifactId>maven-compiler-plugin</artifactId>
81-
<version>3.1</version>
76+
<version>3.5.1</version>
8277
<dependencies>
8378
<dependency>
8479
<groupId>com.google.dagger</groupId>
@@ -95,11 +90,19 @@
9590
<plugin>
9691
<groupId>org.apache.maven.plugins</groupId>
9792
<artifactId>maven-assembly-plugin</artifactId>
93+
<version>2.6</version>
9894
<configuration>
95+
<archive>
96+
<manifest>
97+
<addClasspath>true</addClasspath>
98+
<mainClass>com.paypal.mesos.executor.App</mainClass>
99+
</manifest>
100+
</archive>
99101
<descriptorRefs>
100102
<descriptorRef>jar-with-dependencies</descriptorRef>
101-
</descriptorRefs>
102-
103+
</descriptorRefs>
104+
<finalName>docker-compose-executor_${project.version}</finalName>
105+
<appendAssemblyId>false</appendAssemblyId>
103106
</configuration>
104107
<executions>
105108
<execution>
@@ -113,17 +116,10 @@
113116
</plugin>
114117
<plugin>
115118
<groupId>org.apache.maven.plugins</groupId>
116-
<artifactId>maven-jar-plugin</artifactId>
117-
<configuration>
118-
<archive>
119-
<manifest>
120-
<addClasspath>true</addClasspath>
121-
<mainClass>com.paypal.mesos.executor.App</mainClass>
122-
</manifest>
123-
</archive>
124-
</configuration>
119+
<artifactId>maven-jar-plugin</artifactId>
120+
<version>3.0.2</version>
125121
</plugin>
126-
</plugins>
122+
</plugins>
123+
<finalName>${project.artifactId}_${project.version}</finalName>
127124
</build>
128-
129125
</project>

0 commit comments

Comments
 (0)