Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Iliya Manolov
slapos
Commits
d5da3e5f
Commit
d5da3e5f
authored
Jun 05, 2014
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: update resilient monitor and move import/export scripts outside recipe
parent
d1ad5f26
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
37 deletions
+102
-37
software/slaprunner/common.cfg
software/slaprunner/common.cfg
+16
-0
software/slaprunner/instance-runner-export.cfg.in
software/slaprunner/instance-runner-export.cfg.in
+20
-19
software/slaprunner/instance-runner-import.cfg.in
software/slaprunner/instance-runner-import.cfg.in
+24
-18
software/slaprunner/template/runner-export.sh.jinja2
software/slaprunner/template/runner-export.sh.jinja2
+23
-0
software/slaprunner/template/runner-import.sh.jinja2
software/slaprunner/template/runner-import.sh.jinja2
+19
-0
No files found.
software/slaprunner/common.cfg
View file @
d5da3e5f
...
@@ -47,6 +47,14 @@ output = ${buildout:directory}/template-runner.cfg.in
...
@@ -47,6 +47,14 @@ output = ${buildout:directory}/template-runner.cfg.in
md5sum = b30d71f2f0abfecc2638fe6b804f3c43
md5sum = b30d71f2f0abfecc2638fe6b804f3c43
mode = 0644
mode = 0644
[template-runner-import-script]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/runner-import.sh.jinja2
download-only = true
#md5sum = 7c0608eafb5c6998846851744a70b3de
filename = runner-import.sh.jinja2
mode = 0644
[instance-runner-import]
[instance-runner-import]
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
...
@@ -54,6 +62,14 @@ output = ${buildout:directory}/instance-runner-import.cfg
...
@@ -54,6 +62,14 @@ output = ${buildout:directory}/instance-runner-import.cfg
md5sum = 202c40bcca67d70a3c79d218be853b10
md5sum = 202c40bcca67d70a3c79d218be853b10
mode = 0644
mode = 0644
[template-runner-export-script]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/runner-export.sh.jinja2
download-only = true
#md5sum = 7c0608eafb5c6998846851744a70b3de
filename = runner-export.sh.jinja2
mode = 0644
[instance-runner-export]
[instance-runner-export]
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
...
...
software/slaprunner/instance-runner-export.cfg.in
View file @
d5da3e5f
...
@@ -26,40 +26,41 @@ parts +=
...
@@ -26,40 +26,41 @@ parts +=
cron-entry-backup
cron-entry-backup
cron-entry-prepare-software
cron-entry-prepare-software
deploy-instance-parameters
deploy-instance-parameters
## Monitoring part
###Parts to add for monitoring
###Parts to add for monitoring
slap-parameters
certificate-authority
certificate-authority
cron
cron-entry-monitor
cron-entry-monitor
cron-entry-rss
cron-entry-rss
deploy-index
deploy-index
deploy-index-template
deploy-monitor-script
deploy-rss-script
deploy-settings-cgi
deploy-settings-cgi
deploy-status-cgi
deploy-status-cgi
make-rss
monitor-frontend
monitor-promise
setup-static-files
setup-static-files
certificate-authority
certificate-authority
public
zero-parameters
zero-parameters
cgi-httpd-wrapper
public-symlink
public-symlink
cgi-httpd-wrapper
cgi-httpd-graceful-wrapper
monitor-promise
monitor-instance-log-access
## Monitor for runner
monitor-current-log-access
[exporter]
[exporter]
recipe = slapos.cookbook:slaprunner.export
recipe = slapos.recipe.template:jinja2
wrapper = $${directory:bin}/$${slap-parameter:namebase}-exporter
template = ${template-runner-export-script:location}/${template-runner-export-script:filename}
srv-directory = $${directory:srv}
rendered = $${directory:bin}/$${slap-parameter:namebase}-exporter
etc-directory = $${directory:etc}
# backward compatibility for resilient stack
backup-directory = $${directory:backup}
wrapper = $${:rendered}
shell-binary = ${dash:location}/bin/dash
mode = 700
rsync-binary = ${rsync:location}/bin/rsync
context =
section directory directory
raw shell_binary ${dash:location}/bin/dash
raw rsync_binary ${rsync:location}/bin/rsync
[monitor-promise]
[monitor-promise]
url = $${monitor-frontend:config-url}/$${deploy-index:filename}
url = $${monitor-frontend:config-url}/$${deploy-index
-template
:filename}
# Extends publish section with resilient parameters
# Extends publish section with resilient parameters
[publish-connection-informations]
[publish-connection-informations]
<= resilient-publish-connection-parameter
<= resilient-publish-connection-parameter
\ No newline at end of file
software/slaprunner/instance-runner-import.cfg.in
View file @
d5da3e5f
...
@@ -25,37 +25,43 @@ parts +=
...
@@ -25,37 +25,43 @@ parts +=
deploy-instance-parameters
deploy-instance-parameters
# have to repeat the next one, as it's not inherited from pbsready-import
# have to repeat the next one, as it's not inherited from pbsready-import
import-on-notification
import-on-notification
## Monitoring part
###Parts to add for monitoring
###Parts to add for monitoring
slap-parameters
certificate-authority
certificate-authority
cron
cron-entry-monitor
cron-entry-monitor
cron-entry-rss
cron-entry-rss
deploy-index
deploy-index
deploy-index-template
deploy-monitor-script
deploy-rss-script
deploy-settings-cgi
deploy-settings-cgi
deploy-status-cgi
deploy-status-cgi
make-rss
monitor-promise
setup-static-files
setup-static-files
certificate-authority
certificate-authority
public
zero-parameters
zero-parameters
cgi-httpd-wrapper
public-symlink
public-symlink
cgi-httpd-wrapper
cgi-httpd-graceful-wrapper
monitor-promise
monitor-instance-log-access
## Monitor for runner
monitor-current-log-access
monitor-backup-log-access
[importer]
[importer]
recipe = slapos.cookbook:slaprunner.import
recipe = slapos.recipe.template:jinja2
wrapper = $${directory:bin}/$${slap-parameter:namebase}-importer
template = ${template-runner-import-script:location}/${template-runner-import-script:filename}
srv-directory = $${directory:srv}
rendered = $${directory:bin}/$${slap-parameter:namebase}-importer
etc-directory = $${directory:etc}
# backward compatibility for resilient stack
backup-directory = $${directory:backup}
wrapper = $${:rendered}
shell-binary = ${dash:location}/bin/dash
mode = 700
rsync-binary = ${rsync:location}/bin/rsync
context =
curl-binary = ${curl:location}/bin/curl
key backend_url slaprunner:access-url
backend-url = $${slaprunner:access-url}
section directory directory
raw shell_binary ${dash:location}/bin/dash
raw rsync_binary ${rsync:location}/bin/rsync
raw curl_binary ${curl:location}/bin/curl
[slap-parameter]
[slap-parameter]
auto-deploy-instance = false
auto-deploy-instance = false
[monitor-backup-log-access]
< = monitor-directory-access
source = $${directory:logrotate-backup}
software/slaprunner/template/runner-export.sh.jinja2
0 → 100644
View file @
d5da3e5f
#!{{ shell_binary }}
umask 077
sync_element () {
path=$1
backup_path=$2
shift 2
element_list=$*
for element in $element_list
do
cd $path;
if [ -f $element ] || [ -d $element ]; then
{{ rsync_binary }} -avz --safe-links --delete $element $backup_path;
fi
done
}
sync_element {{ directory['srv'] }}/runner {{ directory['backup'] }}/runner/ instance project proxy.db
# We sync .* appart
date +%s -u > {{ directory['etc'] }}/.resilient-timestamp
cp -r {{ directory['etc'] }}/.??* {{ directory['backup'] }}/etc/
sync_element {{ directory['etc'] }} {{ directory['backup'] }}/etc/ config.json ssh
if [ -d {{ directory['backup'] }}/runner/software ]; then
rm {{ directory['backup'] }}/runner/software/*
fi
software/slaprunner/template/runner-import.sh.jinja2
0 → 100644
View file @
d5da3e5f
#!{{ shell_binary }}
umask 077
restore_element () {
backup_path=$1
restore_path=$2
shift 2
element_list=$*
for element in $element_list
do
cd $backup_path;
if [ -f $element ] || [ -d $element ]; then
{{ rsync_binary }} -avz --delete $backup_path/$element $restore_path;
fi
done
}
restore_element {{ directory['backup'] }}/runner/ {{ directory['srv'] }}/runner instance project proxy.db
restore_element {{ directory['backup'] }}/etc/ {{ directory['etc'] }} config.json ssh
cp -r {{ directory['backup'] }}/etc/.??* {{ directory['etc'] }};
{{ curl_binary }} --insecure -vg6L --max-time 5 {{ backend_url }}/isSRReady;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment