Skip to content

Commit 0f15757

Browse files
Adding contract for Pluto.jl (#49)
1 parent 37f1865 commit 0f15757

File tree

4 files changed

+361
-0
lines changed

4 files changed

+361
-0
lines changed
Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"service": {
5+
"description": "Configuration properties for the Pluto.jl notebook",
6+
"type": "object",
7+
"properties": {
8+
"name": {
9+
"description": "Display name.",
10+
"type": "string",
11+
"default": "plutojl",
12+
"x-form": {
13+
"hidden": true
14+
},
15+
"x-generated": {
16+
"type": "appID",
17+
"scope": "plutojl"
18+
}
19+
},
20+
"cpus": {
21+
"description": "CPU shares to allocate to this marathon instance.",
22+
"type": "number",
23+
"default": 0.1,
24+
"minimum": 0.1
25+
},
26+
"mem": {
27+
"description": "Memory (in MB) to allocate to this marathon instance.",
28+
"type": "number",
29+
"default": 2048,
30+
"minimum": 1024
31+
}
32+
},
33+
"required": ["name", "cpus", "mem"]
34+
},
35+
"script": {
36+
"type": "object",
37+
"description": "scripts",
38+
"properties": {
39+
"uri": {
40+
"type": "string",
41+
"description": "uri of a .sh file that will be executed at runtime",
42+
"default": ""
43+
}
44+
}
45+
},
46+
"init": {
47+
"description": "Init parameters",
48+
"type": "object",
49+
"properties": {
50+
"global": {
51+
"type": "string",
52+
"description": "initialization script",
53+
"default": "",
54+
"x-form": {
55+
"hidden": true
56+
},
57+
"x-generated": {
58+
"type": "initScript",
59+
"scope": "plutojl"
60+
}
61+
}
62+
}
63+
},
64+
"networking": {
65+
"description": "Networking-related configuration properties for Pluto.jl on DC/OS.",
66+
"type": "object",
67+
"properties": {
68+
"network-name": {
69+
"description": "Name of the container network to use",
70+
"type": "string",
71+
"default": "dcos",
72+
"x-form": {
73+
"hidden": true
74+
},
75+
"x-generated": {
76+
"type": "containerNetworkName",
77+
"scope": "plutojl"
78+
}
79+
},
80+
"virtual-host": {
81+
"description": "The virtual host address to configure for integration with Marathon-lb for port 0.",
82+
"type": "string",
83+
"x-form": {
84+
"hidden": true
85+
},
86+
"x-generated": {
87+
"type": "externalDNS",
88+
"scope": "plutojl",
89+
"name": "ihm"
90+
}
91+
},
92+
"https-redirect": {
93+
"description": "Whether Marathon-lb should redirect HTTP traffic to HTTPS. This requires 'virtual-host' to be set. By default, this is false.",
94+
"type": "boolean",
95+
"default": true
96+
},
97+
"whitelist": {
98+
"type": "object",
99+
"description": "IP protection",
100+
"properties": {
101+
"enable": {
102+
"type": "boolean",
103+
"title": "Enable IP protection",
104+
"description": "Only the configured set of IPs will be able to reach the service",
105+
"default": true
106+
},
107+
"ip": {
108+
"type": "string",
109+
"description": "the white list of IP is whitespace",
110+
"title": "Whitelist of IP",
111+
"x-form": {
112+
"value": "{{user.ip}}"
113+
}
114+
}
115+
}
116+
}
117+
},
118+
"required": ["virtual-host", "https-redirect"]
119+
},
120+
"git": {
121+
"description": "Git user configuration",
122+
"type": "object",
123+
"properties": {
124+
"name": {
125+
"type": "string",
126+
"description": "user name for git",
127+
"default": "",
128+
"x-form": {
129+
"value": "{{git.name}}",
130+
"readonly": false
131+
}
132+
},
133+
"email": {
134+
"type": "string",
135+
"description": "user email for git",
136+
"default": "",
137+
"x-form": {
138+
"value": "{{git.email}}",
139+
"readonly": false
140+
}
141+
},
142+
"cache": {
143+
"type": "string",
144+
"description": "duration in seconds of the credentials cache duration",
145+
"default": "",
146+
"x-form": {
147+
"value": "{{git.credentials_cache_duration}}",
148+
"readonly": false
149+
}
150+
}
151+
}
152+
},
153+
"vault": {
154+
"description": "Configuration of vault client",
155+
"type": "object",
156+
"properties": {
157+
"token": {
158+
"description": "token vault",
159+
"type": "string",
160+
"x-form": {
161+
"value": "{{vault.VAULT_TOKEN}}"
162+
}
163+
},
164+
"url": {
165+
"description": "url of vault server",
166+
"type": "string",
167+
"x-form": {
168+
"value": "{{vault.VAULT_ADDR}}"
169+
}
170+
},
171+
"mount": {
172+
"description": "mount of the v2 secret engine",
173+
"type": "string",
174+
"x-form": {
175+
"value": "{{vault.VAULT_MOUNT}}"
176+
}
177+
},
178+
"directory": {
179+
"description": "top level directory",
180+
"type": "string",
181+
"x-form": {
182+
"value": "{{vault.VAULT_TOP_DIR}}"
183+
}
184+
},
185+
"secret": {
186+
"description": "the path of the secret to convert into a list of environment variables",
187+
"type": "string",
188+
"default": ""
189+
}
190+
}
191+
},
192+
"s3": {
193+
"description": "Configuration of temporary identity",
194+
"type": "object",
195+
"properties": {
196+
"accessKeyId": {
197+
"description": "AWS Access Key",
198+
"type": "string",
199+
"x-form": {
200+
"value": "{{s3.AWS_ACCESS_KEY_ID}}"
201+
}
202+
},
203+
"endpoint": {
204+
"description": "AWS S3 Endpoint",
205+
"type": "string",
206+
"x-form": {
207+
"value": "{{s3.AWS_S3_ENDPOINT}}"
208+
}
209+
},
210+
"defaultRegion": {
211+
"description": "AWS S3 default region",
212+
"type": "string",
213+
"x-form": {
214+
"value": "{{s3.AWS_DEFAULT_REGION}}"
215+
}
216+
},
217+
"secretAccessKey": {
218+
"description": "AWS S3 secret access key",
219+
"type": "string",
220+
"x-form": {
221+
"value": "{{s3.AWS_SECRET_ACCESS_KEY}}"
222+
}
223+
},
224+
"sessionToken": {
225+
"description": "AWS S3 session Token",
226+
"type": "string",
227+
"x-form": {
228+
"value": "{{s3.AWS_SESSION_TOKEN}}"
229+
}
230+
},
231+
"expiration": {
232+
"description": "Temporary identity expiration date",
233+
"type": "string",
234+
"x-form": {
235+
"value": "{{s3.AWS_EXPIRATION}}"
236+
}
237+
}
238+
}
239+
}
240+
},
241+
242+
"required": ["service", "networking"]
243+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"id": "{{service.name}}",
3+
"cpus": {{service.cpus}},
4+
"mem": {{service.mem}},
5+
"instances":1,
6+
"cmd": "bash /mnt/mesos/sandbox/onyxia-init.sh julia /home/pluto/startup.jl",
7+
"container": {
8+
"type": "DOCKER",
9+
"docker": {
10+
"image": "{{resource.assets.container.docker.image}}",
11+
"forcePullImage": true,
12+
"portMappings": [
13+
{ "containerPort": 1234 , "name": "plutojl"}
14+
]
15+
}
16+
},
17+
"networks": [
18+
{
19+
"name": "{{networking.network-name}}",
20+
"mode": "container"
21+
}
22+
],
23+
"healthChecks": [{
24+
"protocol": "MESOS_TCP",
25+
"gracePeriodSeconds": 300,
26+
"intervalSeconds": 60,
27+
"portIndex": 0,
28+
"timeoutSeconds": 15,
29+
"maxConsecutiveFailures": 3
30+
}],
31+
"labels": {
32+
"HAPROXY_GROUP": "external",
33+
"HAPROXY_0_VHOST": "{{networking.virtual-host}}",
34+
"HAPROXY_0_REDIRECT_TO_HTTPS": "{{networking.https-redirect}}",
35+
"HAPROXY_0_FRONTEND_HEAD": "",
36+
"HAPROXY_0_FRONTEND_BACKEND_GLUE": "",
37+
"HAPROXY_0_ENABLED":"true",
38+
{{#networking.whitelist.enable}}
39+
"HAPROXY_0_BACKEND_NETWORK_ALLOWED_ACL": "{{networking.whitelist.ip}}",
40+
{{/networking.whitelist.enable}}
41+
"MARATHON_SINGLE_INSTANCE_APP": "true"
42+
},
43+
"fetch": [
44+
{
45+
"uri": "{{init.global}}",
46+
"extract": false,
47+
"executable": true,
48+
"cache": false,
49+
"destPath": "onyxia-init.sh"
50+
}
51+
{{#script.uri}}
52+
,
53+
{
54+
"uri": "{{script.uri}}",
55+
"extract": false,
56+
"executable": true,
57+
"cache": false,
58+
"destPath": "init-user.sh"
59+
}
60+
{{/script.uri}}
61+
],
62+
"env": {
63+
"AWS_ACCESS_KEY_ID": "{{s3.accessKeyId}}",
64+
"AWS_SECRET_ACCESS_KEY": "{{s3.secretAccessKey}}",
65+
"AWS_SESSION_TOKEN": "{{s3.sessionToken}}",
66+
"AWS_DEFAULT_REGION": "{{s3.defaultRegion}}",
67+
"AWS_S3_ENDPOINT": "{{s3.endpoint}}",
68+
"AWS_EXPIRATION": "{{s3.expiration}}",
69+
"GIT_USER_NAME": "{{git.name}}",
70+
"GIT_USER_MAIL": "{{git.email}}",
71+
"GIT_CREDENTIALS_CACHE_DURATION": "{{git.cache}}",
72+
"VAULT_ADDR": "{{vault.url}}",
73+
"VAULT_TOKEN": "{{vault.token}}",
74+
{{#vault.secret}}
75+
"VAULT_RELATIVE_PATH": "{{vault.secret}}",
76+
{{/vault.secret}}
77+
"VAULT_TOP_DIR": "{{vault.directory}}",
78+
"VAULT_MOUNT": "{{vault.mount}}"
79+
},
80+
"upgradeStrategy": {
81+
"maximumOverCapacity": 0,
82+
"minimumHealthCapacity": 0
83+
}
84+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"packagingVersion": "3.0",
3+
"name": "plutojl",
4+
"version": "1.0",
5+
"minDcosReleaseVersion": "1.8",
6+
"scm": "https://github.com/fonsp/Pluto.jl",
7+
"maintainer": "https://github.com/inseefrlab",
8+
"website": "https://github.com/fonsp/Pluto.jl",
9+
"framework": false,
10+
"description": "Pluto.jl is a notebook for Julia datascience applications",
11+
"tags": [
12+
"datascience",
13+
"notebook",
14+
"julia"
15+
],
16+
"preInstallNotes": "Warning! No data persistence is guaranteed. You must therefore make sure to save your notebooks on Gitlab or manually manage the downloading and uploading of your notebooks.",
17+
"postInstallNotes": "Your service is up.",
18+
"selected": false,
19+
"lastUpdated": 1585220308
20+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"images": {
3+
"icon-small": "https://julialang.org/assets/infra/logo.svg",
4+
"icon-medium": "https://julialang.org/assets/infra/logo.svg",
5+
"icon-large": "https://julialang.org/assets/infra/logo.svg"
6+
},
7+
"assets": {
8+
"container": {
9+
"docker": {
10+
"image": "plutojl/pluto"
11+
}
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)