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
Hide 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]
filename = instance.cfg.in
md5sum =
331e87b5c619c78e93c33b44df2a1eb3
md5sum =
55d7b4ffdb4374210165c3a30e42a8fe
[install-warp10.sh]
filename = install-warp10.sh.in
md5sum =
6a43da88ed75d9d4418c6dd713ca4d5e
md5sum =
0cee0cca541c0f7aa2654907258a43d8
software/warp10/install-warp10.sh.in
View file @
53ba5651
#!/bin/sh
set
-eu
WARP10_HOME
={{
warp10_home
}}
WARP10_CONFIG_DIR
=
${
WARP10_HOME
}
/etc/conf.d
JAVA_HOME
={{
java_home
}}
...
...
@@ -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"
##
##
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"
{
...
...
software/warp10/instance.cfg.in
View file @
53ba5651
...
...
@@ -3,12 +3,18 @@ parts =
publish-connection-parameter
warp10-wrapper
extends = ${monitor2-template:output}
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
##
## Configure instance
##
[directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
...
...
@@ -26,42 +32,44 @@ url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[warp10-ip]
ipv4 = $${instance-parameter:ipv4-random}
ipv6 = $${instance-parameter:ipv6-random}
[warp10-port]
[warp10-instance]
recipe = slapos.cookbook:free_port
minimum = 8000
maximum = 9000
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]
recipe = slapos.recipe.build:download-unpacked
url = ${warp10-download:destination}
md5sum = 5e16392e5718b88002251cebf13c8cc4
destination = $${directory:opt}/warp10
# Configure Warp 10 installation script
[install-warp10.sh]
recipe = slapos.recipe.template:jinja2
url = ${install-warp10.sh:destination}
output = $${directory:opt}/$${:_buildout_section_name_}
context =
key warp10_home warp10-extract:destination
key warp10_host warp10-i
p
:ipv4
key warp10_port warp10-
port
:port
key warp10_host warp10-i
nstance
:ipv4
key warp10_port warp10-
instance
:port
raw java_home ${java:location}
# Bootstrap Warp 10 and apply some configurations
[warp10-install]
recipe =
slapos.recipe.buil
d
recipe =
plone.recipe.comman
d
warp10_home = $${warp10-extract:destination}
init =
options['location'] = ''
install =
import subprocess
subprocess.run("$${install-warp10.sh:output}", capture_output=True)
update=
command = $${install-warp10.sh:output}
stop-on-error = true
# Read tokens that are generated during the installation step
[warp10-read-tokengen]
recipe = slapos.recipe.build
init =
...
...
@@ -73,16 +81,19 @@ init =
import os
if os.path.isfile("$${warp10-install:warp10_home}/tokens/tokens.txt"):
f = open("$${warp10-install:warp10_home}/tokens/tokens.txt", "r")
options['read-token'] = f.readline()
options['write-token'] = f.readline()
options['sensision-read-token'] = f.readline()
options['sensision-write-token'] = f.readline()
options['read-token'] = f.readline()
.rstrip()
options['write-token'] = f.readline()
.rstrip()
options['sensision-read-token'] = f.readline()
.rstrip()
options['sensision-write-token'] = f.readline()
.rstrip()
[warp10-wrapper]
recipe = slapos.cookbook:wrapper
command-line = $${warp10-install:warp10_home}/bin/warp10.sh start
wrapper-path = $${directory:services}/warp10
##
## Configure HAProxy
##
[warp10-frontend-certificate]
recipe = plone.recipe.command
...
...
@@ -110,12 +121,13 @@ context =
content =
listen app
log global
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} ssl crt $${warp10-frontend-certificate:cert-file} alpn h2,http/1.1
bind $${:ip}:$${:port} alpn h2,http/1.1
server app $${warp10-instance:ipv4}:$${warp10-instance:port}
pidfile = $${directory:run}/$${:_buildout_section_name_}.pid
ip = $${
instance-parameter:ipv6-random
}
port =
8443
ip = $${
warp10-instance:ipv6
}
port =
9001
[warp10-frontend]
recipe = slapos.cookbook:wrapper
...
...
@@ -123,14 +135,46 @@ wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line =
${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]
recipe = slapos.cookbook:publish
backend-url = $${warp10-frontend:url}
ipv4 = $${warp10-i
p
:ipv4}
ipv6 = $${warp10-i
p
:ipv6}
ipv4 = $${warp10-i
nstance
:ipv4}
ipv6 = $${warp10-i
nstance
:ipv6}
read-token = $${warp10-read-tokengen:read-token}
write-token = $${warp10-read-tokengen:write-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