Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Start gunicorn-visualizer on boot
· 0a0b0144
kpcyrd
authored
Nov 05, 2018
0a0b0144
Refactor accumulator deployment
· beae8c31
kpcyrd
authored
Nov 05, 2018
beae8c31
Show whitespace changes
Inline
Side-by-side
builder/srebuild
View file @
beae8c31
...
...
@@ -451,7 +451,7 @@ system_fatal "cat", $lnk;
system_fatal
"
cat
",
$buildinfo_file
;
foreach
my
$visualizer
(
@ARGV
)
{
system_fatal
"
curl
",
"
-F
",
"
metadata=
\@
$lnk
",
"
-F
",
"
buildinfo=
\@
$buildinfo_file
",
"
$visualizer
";
system_fatal
"
curl
",
"
-
f
F
",
"
metadata=
\@
$lnk
",
"
-F
",
"
buildinfo=
\@
$buildinfo_file
",
"
$visualizer
";
}
say
STDOUT
"
everything is okay!
";
...
...
external_vars.yml
View file @
beae8c31
...
...
@@ -4,3 +4,6 @@ build_gpg_realname: "foo bar"
build_gpg_email
:
"
foo@localhost"
main_template_enable
:
true
http_template_enable
:
true
rebuilder_publish
:
-
http://127.0.0.1/new_build
roles/builders/tasks/main.yml
View file @
beae8c31
...
...
@@ -16,6 +16,11 @@
-
in-toto
-
colorama
-
name
:
Write endpoints that collect build data
template
:
src
:
srebuild-endpoints.j2
dest
:
/etc/srebuild-endpoints
-
name
:
Copy srebuild
copy
:
src
:
../../../builder/srebuild
...
...
@@ -26,16 +31,10 @@
src
:
../../../builder/srebuild-hook
dest
:
/usr/lib/srebuild-hook
-
name
:
Copy template
template
:
src
:
srebuild-runner.j2
dest
:
/usr/bin/srebuild-runner
-
name
:
Set permissions
file
:
path
:
"
{{
item
}}"
mode
:
0755
with_items
:
-
/usr/bin/srebuild
-
/usr/bin/srebuild-runner
-
/usr/lib/srebuild-hook
roles/builders/templates/srebuild-endpoints.j2
0 → 100644
View file @
beae8c31
{% for endpoint in rebuilder_publish %}
{{ endpoint }}
{% endfor %}
roles/builders/templates/srebuild-runner.j2
deleted
100644 → 0
View file @
a70d2eea
#!/usr/bin/env bash
srebuild
$1
{
%
for
host
in
groups
[
'visualizers'
]
%
}
"{{ hostvars[host]['ansible_default_ipv4']['address'] }}"
{
% endfor %
}
roles/visualizers/files/default.conf
View file @
beae8c31
...
...
@@ -7,7 +7,7 @@ server {
error_log
/
var
/
log
/
nginx
/
error
.
log
;
location
/ {
proxy_pass
http
://
127
.
0
.
0
.
1
:
8000
/
;
proxy_pass
http
://
127
.
0
.
0
.
1
:
8000
;
proxy_redirect
off
;
proxy_set_header
Host
$
host
;
...
...
@@ -15,4 +15,17 @@ server {
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
X
-
Forwarded
-
Proto
$
scheme
;
}
location
/
new_build
{
proxy_pass
http
://
127
.
0
.
0
.
1
:
4000
;
proxy_redirect
off
;
allow
127
.
0
.
0
.
1
;
deny
all
;
proxy_set_header
Host
$
host
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
X
-
Forwarded
-
Proto
$
scheme
;
}
}
roles/visualizers/tasks/main.yml
View file @
beae8c31
...
...
@@ -40,3 +40,12 @@
-
name
:
Copy nginx config
copy
:
src=default.conf dest=/etc/nginx/conf.d/default.conf
notify
:
"
(Handler:
All
OSs)
Reload
NGINX"
-
name
:
enable systemd services
systemd
:
name
:
"
{{
item
}}"
state
:
started
enabled
:
yes
with_items
:
-
gunicorn-visualizer
-
gunicorn-accumulator
scheduler/srebuild-worker
View file @
beae8c31
...
...
@@ -5,9 +5,12 @@ import subprocess
def
rebuild
(
buildinfo
):
with
open
(
'
/etc/srebuild-endpoints
'
)
as
f
:
endpoints
=
filter
(
None
,
(
x
.
strip
()
for
x
in
f
))
with
tempfile
.
NamedTemporaryFile
()
as
f
:
f
.
write
(
buildinfo
)
cmd
=
[
'
srebuild
-runner
'
,
f
.
name
]
cmd
=
[
'
srebuild
'
,
f
.
name
]
+
endpoints
print
(
'
[+] invoking %r
'
%
cmd
)
rc
=
subprocess
.
call
(
cmd
)
if
rc
!=
0
:
...
...