Commit e24602f5 authored by Alain Takoudjou's avatar Alain Takoudjou

repman: cleanup and optimise software release

parent 80b39d99
......@@ -3,7 +3,7 @@ extends =
../../component/golang/buildout.cfg
parts =
repman
gowork
[gowork]
golang = ${golang1.12:location}
......@@ -22,23 +22,9 @@ command = . ${gowork:env.sh} &&
go build ${gowork:buildflags} -o ${gowork:bin}/replication-manager &&
chmod -R u+w .
# export VERSION=$(git describe --abbrev=0 --tags) &&
[git.signal18.io_signal18_repman]
<= go-git-package
go.importpath = github.com/signal18/replication-manager
repository = https://github.com/signal18/replication-manager
branch = 2.1
[repman]
# revision and repository can be used to control which repman version is used
depend = ${gowork:recipe}
recipe = collective.recipe.template
# Do something useless to pass
output = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 0755
input = inline:
#!/bin/sh
${gowork:bin}/replication-manager
--monitoring-basedir=system --monitoring-sharedir=software_release/src/share --http-root=software_release/src/dashboard monitor
# --monitoring-datadir=$${directory:var}/lib --config=$${directory:etc}/config.toml --log-file=$${:logfile}
branch = 2.1
\ No newline at end of file
......@@ -14,12 +14,12 @@
# not need these here).
[instance.cfg]
filename = instance.cfg.in
md5sum = 704e79c3e6bb0c5c8081f1438e85bba3
md5sum = 2f542e132b56e4010c30a72665c196f9
[instance-repman.cfg]
_update_hash_filename_ = instance-repman.cfg.jinja2.in
md5sum = 1a4f2657c4f606406024a77b1c97b6ea
md5sum = 6e58a2b75429a285c4297996e702cbf4
[config-toml.in]
_update_hash_filename_ = templates/config.toml.in
md5sum = 2f3d76fc9bd201fb32cc13972be72685
\ No newline at end of file
md5sum = 954b8c63b7a15915f21bac1858df4b8e
\ No newline at end of file
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
data = ${:var}/lib
[instance-parameter]
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
......@@ -7,87 +17,80 @@ url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
[instance-parameter]
<= slap-configuration
# repman monitor seems to use a fixed port
repman-port = 10005
[slap-configuration]
# apache-frontend reads from a part named [slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
# Create all needed directories, depending on your needs
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
promise = ${:etc}/promise/
log = ${:var}/log
data = ${:var}/lib
[repman]
recipe = slapos.cookbook:mkdirectory
etc = ${directory:etc}/repman
data-dir = ${directory:var}/lib
root-dir = ${directory:srv}/repman
[replication-manager-credential]
[repman-password]
recipe = slapos.cookbook:generate.password
username = admin
bytes = 12
[replication-manager]
recipe = slapos.cookbook:wrapper
# repman service is listening on:
# - global IPv6 address, and
# - fixed port
#
# NOTE because every computer partition is allocated its own global IPv6
# address, it is ok to fix the port - different hello-world instances will have
# different IPv6 addresses and they all will be accessible at the same time.
[repman-parameter]
log = ${directory:log}/repman.log
http-root = ${repman:root-dir}/dashboard
share-dir = ${repman:root-dir}/share
port = ${instance-parameter:repman-port}
ipv6 = ${instance-parameter:ipv6-random}
# full URL - for convenience
url = https://[${:ipv6}]:${:port}
logfile = ${directory:log}/repman.log
username = admin
password = ${repman-password:passwd}
[repman-config-folder]
recipe = plone.recipe.command
repman-location = {{ repman_src_location }}
command =
cd ${:repman-location}
cp -r share ${repman-parameter:share-dir}
cp -r dashboard ${repman-parameter:http-root}
[replication-manager]
recipe = slapos.cookbook:wrapper
command-line =
{{ gowork_bin }}/replication-manager
--monitoring-basedir=system
--monitoring-sharedir=software_release/src/share
--http-root=software_release/src/dashboard
--monitoring-datadir=${directory:var}/lib
--config=${directory:etc}/config.toml
--log-file=${:logfile} monitor
--monitoring-basedir=${repman:root-dir}
--monitoring-sharedir=${repman-parameter:share-dir}
--http-root=${repman-parameter:http-root}
--monitoring-datadir=${repman:data-dir}
--config=${repman-config.toml:rendered}
--log-file=${repman-parameter:log}
monitor
wrapper-path = ${directory:service}/replication-manager
# setup repman instance folder
depends =
${repman-config-folder:recipe}
[template-jinja2-base]
[repman-config.toml]
recipe = slapos.recipe.template:jinja2
template = {{ config_toml_in }}
rendered =${directory:etc}/config.toml
rendered = ${repman:etc}/config.toml
extra-context =
context =
key service_ipv6 replication-manager:ipv6
key service_user replication-manager-credential:username
key service_pwd replication-manager-credential:passwd
section parameter_dict repman-parameter
[repman-listen-promise]
<= monitor-promise-base
module = check_port_listening
name = repman_service_listen.py
config-hostname = ${replication-manager:ipv6}
config-port = ${instance-parameter:repman-port}
config-hostname = ${repman-parameter:ipv6}
config-port = ${repman-parameter:port}
[publish-connection-parameter]
<= monitor-publish
recipe = slapos.cookbook:publish
url = ${replication-manager:url}
username = ${replication-manager-credential:username}
password = ${replication-manager-credential:passwd}
url = url = https://[${repman-parameter:ipv6}]:${repman-parameter:port}
username = ${repman-parameter:username}
password = ${repman-parameter:password}
#############################
......@@ -99,13 +102,10 @@ password = ${replication-manager-credential:passwd}
extends =
{{ template_monitor_cfg }}
parts =
directory
publish-connection-parameter
instance-parameter
template-jinja2-base
replication-manager
repman-listen-promise
monitor-base
publish-connection-parameter
eggs-directory = {{ eggs_directory }}
......
......@@ -28,6 +28,7 @@ context =
# program binaries
raw bash_bin ${bash:location}/bin/bash
raw gowork_bin ${gowork:bin}
raw repman_src_location ${git.signal18.io_signal18_repman:location}
raw template_monitor_cfg ${monitor2-template:rendered}
# config files
......
......@@ -5,7 +5,6 @@ extends =
../../stack/monitor/buildout.cfg
../../component/replication-manager/buildout.cfg
../../component/mariadb/buildout.cfg
../../component/git/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
......@@ -13,8 +12,6 @@ parts =
slapos-cookbook
instance.cfg
mariadb
repman
repman-repository
[instance.cfg]
......@@ -22,7 +19,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
[repman-repository]
[XXX-repman-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
location = ${buildout:directory}/src
......
[Default]
api-bind = "[{{service_ipv6}}]"
http-bind-address = "[{{service_ipv6}}]"
api-bind = "[{{ parameter_dict['ipv6'] }}]"
http-bind-address = "[{{ parameter_dict['ipv6'] }}]"
monitoring-save-config = true
api-https-bind = true
api-credentials = "{{service_user}}:{{service_pwd}}"
api-credentials = "{{ parameter_dict['username'] }}:{{ parameter_dict['password'] }}"
[cluster1]
title = "cluster1"
......
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