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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Steven Gueguen
slapos
Commits
53ba5651
Commit
53ba5651
authored
Feb 29, 2024
by
Steven Gueguen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address Merge Request demands (promises, comment)
parent
f06d6f2e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
30 deletions
+76
-30
software/warp10/buildout.hash.cfg
software/warp10/buildout.hash.cfg
+2
-2
software/warp10/install-warp10.sh.in
software/warp10/install-warp10.sh.in
+3
-1
software/warp10/instance.cfg.in
software/warp10/instance.cfg.in
+71
-27
No files found.
software/warp10/buildout.hash.cfg
View file @
53ba5651
[instance.cfg]
[instance.cfg]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum =
331e87b5c619c78e93c33b44df2a1eb3
md5sum =
55d7b4ffdb4374210165c3a30e42a8fe
[install-warp10.sh]
[install-warp10.sh]
filename = install-warp10.sh.in
filename = install-warp10.sh.in
md5sum =
6a43da88ed75d9d4418c6dd713ca4d5e
md5sum =
0cee0cca541c0f7aa2654907258a43d8
software/warp10/install-warp10.sh.in
View file @
53ba5651
#!/bin/sh
#!/bin/sh
set
-eu
WARP10_HOME
={{
warp10_home
}}
WARP10_HOME
={{
warp10_home
}}
WARP10_CONFIG_DIR
=
${
WARP10_HOME
}
/etc/conf.d
WARP10_CONFIG_DIR
=
${
WARP10_HOME
}
/etc/conf.d
JAVA_HOME
={{
java_home
}}
JAVA_HOME
={{
java_home
}}
...
@@ -23,7 +25,7 @@ sed -i -e "s@^#JAVA_HOME=.*@JAVA_HOME=${JAVA_HOME}@" "${WARP10_HOME}/etc/warp10-
...
@@ -23,7 +25,7 @@ sed -i -e "s@^#JAVA_HOME=.*@JAVA_HOME=${JAVA_HOME}@" "${WARP10_HOME}/etc/warp10-
sed
-i
-e
's/\&$//g'
"
${
WARP10_HOME
}
/bin/warp10.sh"
sed
-i
-e
's/\&$//g'
"
${
WARP10_HOME
}
/bin/warp10.sh"
##
##
##
Listen to all interface, enable SensisionWarpScriptExtension and
TokenWarpScriptExtension
##
Configure host and port, enable
TokenWarpScriptExtension
##
##
sed
-i
-e
's|^#warpscript.extension.sensision|warpscript.extension.sensision|g'
"
${
WARP10_CONFIG_DIR
}
/99-init.conf"
sed
-i
-e
's|^#warpscript.extension.sensision|warpscript.extension.sensision|g'
"
${
WARP10_CONFIG_DIR
}
/99-init.conf"
{
{
...
...
software/warp10/instance.cfg.in
View file @
53ba5651
...
@@ -3,12 +3,18 @@ parts =
...
@@ -3,12 +3,18 @@ parts =
publish-connection-parameter
publish-connection-parameter
warp10-wrapper
warp10-wrapper
extends = ${monitor2-template:output}
# Define egg directories to be the one from Software Release
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
# (/opt/slapgrid/...)
eggs-directory = ${buildout:eggs-directory}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
offline = true
##
## Configure instance
##
[directory]
[directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
home = $${buildout:directory}
...
@@ -26,42 +32,44 @@ url = $${slap-connection:server-url}
...
@@ -26,42 +32,44 @@ url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
cert = $${slap-connection:cert-file}
[warp10-ip]
[warp10-instance]
ipv4 = $${instance-parameter:ipv4-random}
ipv6 = $${instance-parameter:ipv6-random}
[warp10-port]
recipe = slapos.cookbook:free_port
recipe = slapos.cookbook:free_port
minimum = 8000
minimum = 8000
maximum = 9000
maximum = 9000
ip = $${instance-parameter:ipv4-random}
ip = $${instance-parameter:ipv4-random}
ipv4 =$${:ip}
ipv6 = $${instance-parameter:ipv6-random}
##
## Instal Warp 10
##
# Extract the Warp 10 archive in the instance
[warp10-extract]
[warp10-extract]
recipe = slapos.recipe.build:download-unpacked
recipe = slapos.recipe.build:download-unpacked
url = ${warp10-download:destination}
url = ${warp10-download:destination}
md5sum = 5e16392e5718b88002251cebf13c8cc4
md5sum = 5e16392e5718b88002251cebf13c8cc4
destination = $${directory:opt}/warp10
destination = $${directory:opt}/warp10
# Configure Warp 10 installation script
[install-warp10.sh]
[install-warp10.sh]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
url = ${install-warp10.sh:destination}
url = ${install-warp10.sh:destination}
output = $${directory:opt}/$${:_buildout_section_name_}
output = $${directory:opt}/$${:_buildout_section_name_}
context =
context =
key warp10_home warp10-extract:destination
key warp10_home warp10-extract:destination
key warp10_host warp10-i
p
:ipv4
key warp10_host warp10-i
nstance
:ipv4
key warp10_port warp10-
port
:port
key warp10_port warp10-
instance
:port
raw java_home ${java:location}
raw java_home ${java:location}
# Bootstrap Warp 10 and apply some configurations
[warp10-install]
[warp10-install]
recipe =
slapos.recipe.buil
d
recipe =
plone.recipe.comman
d
warp10_home = $${warp10-extract:destination}
warp10_home = $${warp10-extract:destination}
init =
command = $${install-warp10.sh:output}
options['location'] = ''
stop-on-error = true
install =
import subprocess
subprocess.run("$${install-warp10.sh:output}", capture_output=True)
update=
# Read tokens that are generated during the installation step
[warp10-read-tokengen]
[warp10-read-tokengen]
recipe = slapos.recipe.build
recipe = slapos.recipe.build
init =
init =
...
@@ -73,16 +81,19 @@ init =
...
@@ -73,16 +81,19 @@ init =
import os
import os
if os.path.isfile("$${warp10-install:warp10_home}/tokens/tokens.txt"):
if os.path.isfile("$${warp10-install:warp10_home}/tokens/tokens.txt"):
f = open("$${warp10-install:warp10_home}/tokens/tokens.txt", "r")
f = open("$${warp10-install:warp10_home}/tokens/tokens.txt", "r")
options['read-token'] = f.readline()
options['read-token'] = f.readline()
.rstrip()
options['write-token'] = f.readline()
options['write-token'] = f.readline()
.rstrip()
options['sensision-read-token'] = f.readline()
options['sensision-read-token'] = f.readline()
.rstrip()
options['sensision-write-token'] = f.readline()
options['sensision-write-token'] = f.readline()
.rstrip()
[warp10-wrapper]
[warp10-wrapper]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = $${warp10-install:warp10_home}/bin/warp10.sh start
command-line = $${warp10-install:warp10_home}/bin/warp10.sh start
wrapper-path = $${directory:services}/warp10
wrapper-path = $${directory:services}/warp10
##
## Configure HAProxy
##
[warp10-frontend-certificate]
[warp10-frontend-certificate]
recipe = plone.recipe.command
recipe = plone.recipe.command
...
@@ -110,12 +121,13 @@ context =
...
@@ -110,12 +121,13 @@ context =
content =
content =
listen app
listen app
log global
log global
bind $${:ip}:$${:port} ssl crt $${warp10-frontend-certificate:cert-file} alpn h2,http/1.1
# bind $${:ip}:$${:port} ssl crt $${warp10-frontend-certificate:cert-file} alpn h2,http/1.1
server app $${warp10-ip:ipv4}:$${warp10-port:port}
bind $${:ip}:$${:port} alpn h2,http/1.1
server app $${warp10-instance:ipv4}:$${warp10-instance:port}
pidfile = $${directory:run}/$${:_buildout_section_name_}.pid
pidfile = $${directory:run}/$${:_buildout_section_name_}.pid
ip = $${
instance-parameter:ipv6-random
}
ip = $${
warp10-instance:ipv6
}
port =
8443
port =
9001
[warp10-frontend]
[warp10-frontend]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
...
@@ -123,14 +135,46 @@ wrapper-path = $${directory:services}/$${:_buildout_section_name_}
...
@@ -123,14 +135,46 @@ wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line =
command-line =
${haproxy:location}/sbin/haproxy -f $${warp10-frontend-config:output}
${haproxy:location}/sbin/haproxy -f $${warp10-frontend-config:output}
url = https://[$${warp10-frontend-config:ip}]:$${warp10-frontend-config:port}
# url = https://[$${warp10-frontend-config:ip}]:$${warp10-frontend-config:port}
url = http://[$${warp10-frontend-config:ip}]:$${warp10-frontend-config:port}
##
## Promises
##
# Check if Warp 10 is listening
[promise-warp10-listening]
<= monitor-promise-base
promise = check_socket_listening
name = $${:_buildout_section_name_}.py
config-host = $${warp10-instance:ipv4}
config-port = $${warp10-instance:port}
# Check if HAProxy is listening
[promise-haproxy-listening]
<= monitor-promise-base
promise = check_url_available
name = $${:_buildout_section_name_}.py
config-verify = 0
config-url =$${warp10-frontend:url}
# Check if token is correctly published
[promise-token-published]
<= monitor-promise-base
promise = check_command_execute
name = $${:_buildout_section_name_}.py
config-command = [[ "None" == "$${publish-connection-parameter:read-token}" ]]
# config-command = test -n ""
##
## Publish parameters
##
[publish-connection-parameter]
[publish-connection-parameter]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
backend-url = $${warp10-frontend:url}
backend-url = $${warp10-frontend:url}
ipv4 = $${warp10-i
p
:ipv4}
ipv4 = $${warp10-i
nstance
:ipv4}
ipv6 = $${warp10-i
p
:ipv6}
ipv6 = $${warp10-i
nstance
:ipv6}
read-token = $${warp10-read-tokengen:read-token}
read-token = $${warp10-read-tokengen:read-token}
write-token = $${warp10-read-tokengen:write-token}
write-token = $${warp10-read-tokengen:write-token}
sensision-read-token = $${warp10-read-tokengen:sensision-read-token}
sensision-read-token = $${warp10-read-tokengen:sensision-read-token}
...
...
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