Commit 4305eb41 authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Add autorun option

`autorun` controls the `slapos-node-auto` service:
  - `running`: start `slapos-node-auto`
  - `stopped`: stop `slapos-node-auto`
  - ( else ) : leave `slapos-node-auto` as it is
parent abce372e
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
[instance] [instance]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = a3e4cb7d28daa7816f04359c8aa3445b md5sum = 524c0b40d6ee49841fdbb2cf26fd1833
[yarn.lock] [yarn.lock]
filename = yarn.lock filename = yarn.lock
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Parameters to instantiate Theia",
"additionalProperties": false,
"properties": {
"autorun": {
"title": "autorun",
"description": "State of the autorun service",
"type": "string",
"enum": ["running", "stopped", "disabled"],
"default": "running"
}
}
}
...@@ -338,6 +338,7 @@ instance-promises = ...@@ -338,6 +338,7 @@ instance-promises =
$${frontend-listen-promise:name} $${frontend-listen-promise:name}
$${apache-frontend-url-available-promise:name} $${apache-frontend-url-available-promise:name}
$${slapos-standalone-listen-promise:name} $${slapos-standalone-listen-promise:name}
$${slapos-autorun-promise:name}
[theia-listen-promise] [theia-listen-promise]
<= monitor-promise-base <= monitor-promise-base
...@@ -368,6 +369,14 @@ name = standalone-listen-promise.py ...@@ -368,6 +369,14 @@ name = standalone-listen-promise.py
config-hostname = $${slapos-standalone-instance:hostname} config-hostname = $${slapos-standalone-instance:hostname}
config-port = $${slapos-standalone-instance:port} config-port = $${slapos-standalone-instance:port}
[slapos-autorun-promise]
<= monitor-promise-base
module = check_service_state
# XXX promise plugins can not contain "slapos" in their names
name = autorun-state-promise.py
config-service = $${slapos-autorun:service-name}
config-expect = $${slapos-autorun:autorun}
[apache-frontend] [apache-frontend]
<= slap-connection <= slap-connection
recipe = slapos.cookbook:requestoptional recipe = slapos.cookbook:requestoptional
...@@ -394,6 +403,19 @@ partition = $${slap-connection:partition-id} ...@@ -394,6 +403,19 @@ partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url} url = $${slap-connection:server-url}
key = $${slap-connection:key-file} key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file} cert = $${slap-connection:cert-file}
configuration.autorun = running
[slapos-autorun]
recipe = plone.recipe.command
command =
case $${:autorun} in
( running ) ${buildout:bin-directory}/supervisorctl -c $${:supervisor-conf} start $${:service-name};;
( stopped ) ${buildout:bin-directory}/supervisorctl -c $${:supervisor-conf} stop $${:service-name};;
esac
update-command = $${:command}
service-name = slapos-node-auto
supervisor-conf = $${directory:runner}/etc/supervisord.conf
autorun = $${instance-parameter:configuration.autorun}
[slapos-repository] [slapos-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
......
...@@ -20,10 +20,47 @@ extends = ...@@ -20,10 +20,47 @@ extends =
./buildout.hash.cfg ./buildout.hash.cfg
parts = parts =
# >>>>>>>>>>>>
# Use unreleased versions of slapos.core and slapos.toolbox
slapos.core-dev
slapos.toolbox-dev
# <<<<<<<<<<<<
theia-wrapper theia-wrapper
slapos-cookbook slapos-cookbook
instance instance
# >>>>>>>>>>>>
# Use unreleased versions of slapos.core and slapos.toolbox
[slapos.core-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/xavier_thompson/slapos.core.git
branch = standalone_node_auto
git-executable = ${git:location}/bin/git
develop = true
[slapos.core-dev]
recipe = zc.recipe.egg:develop
egg = slapos.core
setup = ${slapos.core-repository:location}
[slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/xavier_thompson/slapos.toolbox.git
branch = service_state_promise
git-executable = ${git:location}/bin/git
develop = true
[slapos.toolbox-dev]
recipe = zc.recipe.egg:develop
egg = slapos.toolbox
setup = ${slapos.toolbox-repository:location}
depends = ${slapos-toolbox-dependencies:eggs}
[versions]
slapos.core =
slapos.toolbox =
# <<<<<<<<<<<<
# default for slapos-standalone # default for slapos-standalone
shared-part-list = shared-part-list =
......
{
"name": "Theia",
"description": "Theia",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"software-type": "default",
"description": "Default",
"request": "instance-input-schema.json",
"response": "instance-ouput-schema.json",
"index": 1
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment