Commit c9fc6c47 authored by Nicolas Wavrant's avatar Nicolas Wavrant

slaprunner: more ports are choosen dynamically

This makes easier the development of the webrunner, as it can be deployed within a webrunner
parent 46d1df80
...@@ -54,7 +54,7 @@ mode = 0644 ...@@ -54,7 +54,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg.in output = ${buildout:directory}/template-runner.cfg.in
#md5sum = e62a9604cb10c6b743056294004b95cc md5sum = fe8626980860002cd1044669cf7c2181
mode = 0644 mode = 0644
[template-runner-import-script] [template-runner-import-script]
...@@ -70,7 +70,7 @@ mode = 0644 ...@@ -70,7 +70,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-import.cfg.in url = ${:_profile_base_location_}/instance-runner-import.cfg.in
output = ${buildout:directory}/instance-runner-import.cfg output = ${buildout:directory}/instance-runner-import.cfg
#md5sum = 22d958bd271a378b84f04e36010ee689 md5sum = 341e1273f9489d60520c3bbaef72e1f4
mode = 0644 mode = 0644
[template-runner-export-script] [template-runner-export-script]
...@@ -86,7 +86,7 @@ mode = 0644 ...@@ -86,7 +86,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-export.cfg.in url = ${:_profile_base_location_}/instance-runner-export.cfg.in
output = ${buildout:directory}/instance-runner-export.cfg output = ${buildout:directory}/instance-runner-export.cfg
#md5sum = 38a2b6e9ebb65457c1f477455b205328 md5sum = c4c1c2059666e30b715e87509d2a0db7
mode = 0644 mode = 0644
[template-resilient] [template-resilient]
......
...@@ -36,6 +36,31 @@ parts += ...@@ -36,6 +36,31 @@ parts +=
monitor-check-resilient-feed-file monitor-check-resilient-feed-file
monitor-check-webrunner-internal-instance monitor-check-webrunner-internal-instance
[proxy-free-port]
recipe = slapos.cookbook:free_port
minimum = 49980
maximum = 49989
ip = $${slap-network-information:global-ipv6}
[runner-free-port]
recipe = slapos.cookbook:free_port
minimum = 50005
maximum = 50014
ip = $${slap-network-information:global-ipv6}
[slaprunner]
proxy_port = $${proxy-free-port:port}
runner_port = $${runner-free-port:port}
[supervisord-free-port]
recipe = slapos.cookbook:free_port
minimum = 39986
maximum = 39995
ip = $${slaprunner:ipv4}
[supervisord]
port = $${supervisord-free-port:port}
[exporter] [exporter]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${template-runner-export-script:location}/${template-runner-export-script:filename} template = ${template-runner-export-script:location}/${template-runner-export-script:filename}
...@@ -48,8 +73,14 @@ context = ...@@ -48,8 +73,14 @@ context =
raw shell_binary ${dash:location}/bin/dash raw shell_binary ${dash:location}/bin/dash
raw rsync_binary ${rsync:location}/bin/rsync raw rsync_binary ${rsync:location}/bin/rsync
[monitor-httpd-free-port]
recipe = slapos.cookbook:free_port
minimum = 8437
maximum = 8446
ip = $${slap-network-information:global-ipv6}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = 8437 monitor-httpd-port = $${monitor-httpd-free-port:port}
# Pass some parameter to dispay in monitoring interface # Pass some parameter to dispay in monitoring interface
instance-configuration = instance-configuration =
httpdcors cors-domain $${slaprunner-httpd-cors:location} $${httpd-graceful-wrapper:output} httpdcors cors-domain $${slaprunner-httpd-cors:location} $${httpd-graceful-wrapper:output}
......
...@@ -34,9 +34,30 @@ parts += ...@@ -34,9 +34,30 @@ parts +=
# In case both exporter and importer (aka main instance and clone instance) # In case both exporter and importer (aka main instance and clone instance)
# run with the same IP (usually for testing purposes), # run with the same IP (usually for testing purposes),
# run slaprunner using different ports. # run slaprunner using different ports.
[proxy-free-port]
recipe = slapos.cookbook:free_port
minimum = 49990
maximum = 49999
ip = $${slap-network-information:global-ipv6}
[runner-free-port]
recipe = slapos.cookbook:free_port
minimum = 50015
maximum = 50024
ip = $${slap-network-information:global-ipv6}
[slaprunner] [slaprunner]
proxy_port = 50000 proxy_port = $${proxy-free-port:port}
runner_port = 50005 runner_port = $${runner-free-port:port}
[supervisord-free-port]
recipe = slapos.cookbook:free_port
minimum = 39996
maximum = 40005
ip = $${slaprunner:ipv4}
[supervisord]
port = $${supervisord-free-port:port}
# Idem for some other services # Idem for some other services
[runner-sshd-port] [runner-sshd-port]
......
...@@ -685,7 +685,8 @@ no_logfile = NONE ...@@ -685,7 +685,8 @@ no_logfile = NONE
numprocs = 1 numprocs = 1
path = $${shell:path} path = $${shell:path}
pidfile = $${directory:run}/supervisord.pid pidfile = $${directory:run}/supervisord.pid
server = $${slaprunner:ipv4}:$${:port} ip = $${slaprunner:ipv4}
server = $${:ip}:$${:port}
port = 39986 port = 39986
slapgrid-cp = slapgrid-cp slapgrid-cp = slapgrid-cp
slapgrid-cp-command = $${slaprunner:slapos} node instance --all --cfg $${:slapos-cfg} --pidfile $${:slapgrid-cp-pid} --verbose --logfile $${:slapgrid-cp-log} slapgrid-cp-command = $${slaprunner:slapos} node instance --all --cfg $${:slapos-cfg} --pidfile $${:slapgrid-cp-pid} --verbose --logfile $${:slapgrid-cp-log}
......
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