Commit bcf34071 authored by Nicolas Wavrant's avatar Nicolas Wavrant

slaprunner: isn't started by the development server anymore

but thanks to Gunicorn, as a wsgi software
parent 645b8b55
...@@ -92,7 +92,7 @@ mode = 0644 ...@@ -92,7 +92,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 output = ${buildout:directory}/template-runner.cfg
#md5sum = 1355283f0e79a890aeb687cedd8220ee md5sum = 8054f653b00c1fdd50e70b23c5a861a7
mode = 0644 mode = 0644
[instance-runner-import] [instance-runner-import]
...@@ -128,7 +128,7 @@ mode = 0644 ...@@ -128,7 +128,7 @@ mode = 0644
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/nginx_conf.in url = ${:_profile_base_location_}/nginx_conf.in
download-only = true download-only = true
#md5sum = 09b7677dfc6b23c1f58e67fd06a7625e md5sum = df4cf59f160b429a1eee43eea9e6aff8
filename = nginx_conf.in filename = nginx_conf.in
mode = 0644 mode = 0644
...@@ -143,7 +143,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_} ...@@ -143,7 +143,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
[slapos-cfg-template] [slapos-cfg-template]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename} url = ${:_profile_base_location_}/template/${:filename}
#md5sum = 28ceadbeaa3b687f7ba39d87cd6772f3 md5sum = fa0f89e2b68d829452edcaebde9f785d
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = slapos.cfg.in filename = slapos.cfg.in
download-only = true download-only = true
...@@ -165,7 +165,8 @@ eggs = ...@@ -165,7 +165,8 @@ eggs =
slapos.core slapos.core
xml_marshaller xml_marshaller
pytz pytz
<<<<<<< HEAD collective.recipe.environment
Gunicorn
# Add slapos.libnetworkcache to path of slapos.core so that slaprunner can build SRs using cache # Add slapos.libnetworkcache to path of slapos.core so that slaprunner can build SRs using cache
[slapos-cookbook] [slapos-cookbook]
...@@ -183,7 +184,3 @@ eggs = ...@@ -183,7 +184,3 @@ eggs =
xml_marshaller xml_marshaller
pytz pytz
slapos.libnetworkcache slapos.libnetworkcache
=======
collective.recipe.environment
>>>>>>> 3bf4e1a... slaprunner : is now deployed by buildout
...@@ -7,6 +7,8 @@ parts = ...@@ -7,6 +7,8 @@ parts =
ca-nginx ca-nginx
ca-node-frontend ca-node-frontend
ca-shellinabox ca-shellinabox
gunicorn-launcher
gunicorn-graceful
test-runner test-runner
sshkeys-dropbear-runner sshkeys-dropbear-runner
dropbear-server-add-authorized-key dropbear-server-add-authorized-key
...@@ -25,7 +27,6 @@ parts = ...@@ -25,7 +27,6 @@ parts =
shellinabox shellinabox
environ environ
slapos-cfg slapos-cfg
slaprunner-wrapper
slapos-repo-config slapos-repo-config
prepare-software prepare-software
...@@ -33,7 +34,6 @@ eggs-directory = ${buildout:eggs-directory} ...@@ -33,7 +34,6 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
# Create all needed directories # Create all needed directories
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -248,6 +248,7 @@ context = ...@@ -248,6 +248,7 @@ context =
key shellinabox_port shellinabox:port key shellinabox_port shellinabox:port
section param_nginx_frontend nginx-frontend section param_nginx_frontend nginx-frontend
section param_tempdir tempdirectory section param_tempdir tempdirectory
key socket gunicorn-frontend:socket
[nginx-launcher] [nginx-launcher]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -257,6 +258,29 @@ mode = 700 ...@@ -257,6 +258,29 @@ mode = 700
context = context =
section param_nginx_frontend nginx-frontend section param_nginx_frontend nginx-frontend
#--------------------
#--
#-- WSGI
[gunicorn-frontend]
bin_gunicorn = $${directory:bin}/gunicorn
bin_launcher = $${directory:services}/gunicorn
path_shell = ${dash:location}/bin/dash
socket = $${directory:tmp}/flaskserver.sock
path_pid = $${directory:run}/gunicorn.pid
[gunicorn-launcher]
recipe = slapos.cookbook:wrapper
command-line = $${gunicorn-frontend:bin_gunicorn} slapos.runner:app -p $${gunicorn-frontend:path_pid} -b unix:$${gunicorn-frontend:socket} -e RUNNER_CONFIG=$${slaprunner:slapos.cfg} --preload
wrapper-path = $${gunicorn-frontend:bin_launcher}
environment = PATH=$${environ:PATH}
RUNNER_CONFIG=$${slaprunner:slapos.cfg}
[gunicorn-graceful]
recipe = slapos.cookbook:wrapper
command-line = $${directory:bin}/killpidfromfile $${gunicorn-frontend:path_pid} SIGHUP
wrapper-path = $${directory:scripts}/gunicorn-graceful
#-------------------- #--------------------
#-- #--
#-- ssl certificates #-- ssl certificates
...@@ -480,14 +504,6 @@ path = ...@@ -480,14 +504,6 @@ path =
[environ] [environ]
recipe = collective.recipe.environment recipe = collective.recipe.environment
[slaprunner-wrapper]
recipe = slapos.cookbook:wrapper
command-line = $${slaprunner:slaprunner} $${slaprunner:slapos.cfg} --log_file $${:log-file}
log-file = $${slaprunner:log_dir}/slaprunner.log
wrapper-path = $${slaprunner:wrapper}
environment = PATH=$${slaprunner:git-binary}:$${environ:PATH}
GIT_SSH=$${slaprunner:ssh_client}
[slapos-repo] [slapos-repo]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = $${slap-parameter:slapos-repository} repository = $${slap-parameter:slapos-repository}
......
...@@ -57,28 +57,24 @@ http { ...@@ -57,28 +57,24 @@ http {
scgi_temp_path {{ param_tempdir['scgi_temp_path'] }}; scgi_temp_path {{ param_tempdir['scgi_temp_path'] }};
error_page 401 /login; error_page 401 /login;
location / { location / {
proxy_pass http://{{ param_nginx_frontend['runner-ip'] }}:{{ param_nginx_frontend['runner-port'] }};
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
auth_basic "Restricted"; auth_basic "Restricted";
auth_basic_user_file {{ param_nginx_frontend['etc_dir'] }}/.htpasswd; auth_basic_user_file {{ param_nginx_frontend['etc_dir'] }}/.htpasswd;
proxy_redirect off; proxy_redirect off;
proxy_buffering off; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Accel-Mapping /private/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host; proxy_pass http://unix:{{ socket }};
} }
location ~ ^(/login|/doLogin|/static|/setAccount|/configAccount|/slapgridResult) { location ~ ^(/login|/doLogin|/static|/setAccount|/configAccount|/slapgridResult) {
proxy_pass http://{{ param_nginx_frontend['runner-ip'] }}:{{ param_nginx_frontend['runner-port'] }};
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off; proxy_redirect off;
proxy_buffering off; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Accel-Mapping /private/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host; proxy_pass http://unix:{{ socket }};
} }
location /shellinabox { location /shellinabox {
proxy_pass http://[::1]:{{ shellinabox_port }}/; proxy_pass http://[::1]:{{ shellinabox_port }}/;
......
...@@ -135,3 +135,6 @@ unittest2 = 0.5.1 ...@@ -135,3 +135,6 @@ unittest2 = 0.5.1
# Required by: # Required by:
# slapos.core==0.34 # slapos.core==0.34
zope.interface = 4.0.3 zope.interface = 4.0.3
# WSGI server
gunicorn = 18.0
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