Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
Commits
c4b66eb1
Commit
c4b66eb1
authored
Jun 28, 2021
by
Lisa Casino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
html5as: switch to switch-softwaretype
parent
b10757c4
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
49 deletions
+71
-49
software/html5as-base/instance.cfg.in
software/html5as-base/instance.cfg.in
+11
-2
software/html5as-base/instance_html5as.cfg.in
software/html5as-base/instance_html5as.cfg.in
+1
-1
software/html5as-base/software.cfg
software/html5as-base/software.cfg
+2
-7
software/html5as/buildout.hash.cfg
software/html5as/buildout.hash.cfg
+3
-3
software/html5as/instance.cfg.in
software/html5as/instance.cfg.in
+24
-7
software/html5as/instance_html5as.cfg.in
software/html5as/instance_html5as.cfg.in
+9
-11
software/html5as/instance_replicate.cfg.in
software/html5as/instance_replicate.cfg.in
+21
-14
software/html5as/software.cfg
software/html5as/software.cfg
+0
-4
No files found.
software/html5as-base/instance.cfg.in
View file @
c4b66eb1
...
@@ -21,7 +21,16 @@ filename = instance-html5as.cfg
...
@@ -21,7 +21,16 @@ filename = instance-html5as.cfg
context =
context =
section buildout buildout
section buildout buildout
section parameter_list profile-common
section parameter_list profile-common
# partition_ipv6 is the random ipv6 allocated to the local partition
key partition_ipv6 slap-configuration:ipv6-random
[switch-softwaretype]
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
recipe = slapos.cookbook:switch-softwaretype
default = ${instance-html5as:rendered}
RootSoftwareInstance = ${:default}
default = instance-html5as:rendered
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
software/html5as-base/instance_html5as.cfg.in
View file @
c4b66eb1
...
@@ -70,7 +70,7 @@ scgi_temp_path = ${:tmp}/scgi_temp_path
...
@@ -70,7 +70,7 @@ scgi_temp_path = ${:tmp}/scgi_temp_path
nb_workers = 2
nb_workers = 2
# Network
# Network
ip =
${slap-network-information:global-ipv6
}
ip =
{{ partition_ipv6 }
}
port = 8081
port = 8081
access_url = http://[${:ip}]:${:port}
access_url = http://[${:ip}]:${:port}
...
...
software/html5as-base/software.cfg
View file @
c4b66eb1
...
@@ -27,7 +27,7 @@ recipe = slapos.recipe.template:jinja2
...
@@ -27,7 +27,7 @@ recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/template.cfg
rendered = ${buildout:directory}/template.cfg
template = ${:_profile_base_location_}/${:filename}
template = ${:_profile_base_location_}/${:filename}
filename = instance.cfg.in
filename = instance.cfg.in
md5sum =
5a6ebc126bcad3cdff1b51fb51f82a35
md5sum =
9bff013ed8b610f7cc5452c1582eccf2
mode = 0644
mode = 0644
context =
context =
section buildout buildout
section buildout buildout
...
@@ -43,7 +43,7 @@ context =
...
@@ -43,7 +43,7 @@ context =
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
url = ${:_profile_base_location_}/${:_update_hash_filename_}
_update_hash_filename_ = instance_html5as.cfg.in
_update_hash_filename_ = instance_html5as.cfg.in
md5sum =
4a8c98cc5ca141f78f14fb9cec203cb8
md5sum =
9b7ed68551cac5967915979383238669
mode = 0644
mode = 0644
[template_nginx_conf]
[template_nginx_conf]
...
@@ -71,8 +71,3 @@ mode = 0644
...
@@ -71,8 +71,3 @@ mode = 0644
recipe = zc.recipe.egg
recipe = zc.recipe.egg
eggs =
eggs =
plone.recipe.command
plone.recipe.command
# Pin versions of eggs used that are not already pinned by stack/slapos.cfg
[versions]
slapos.recipe.template = 4.4
plone.recipe.command = 1.1
software/html5as/buildout.hash.cfg
View file @
c4b66eb1
...
@@ -17,11 +17,11 @@
...
@@ -17,11 +17,11 @@
[template-cfg]
[template-cfg]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum =
0a7aceffa5222e88125b72da42ddedd7
md5sum =
1b6d628b3a04497f525f860dd0003d84
[instance_html5as]
[instance_html5as]
_update_hash_filename_ = instance_html5as.cfg.in
_update_hash_filename_ = instance_html5as.cfg.in
md5sum =
96fe1540aa458db434abc20353e034c8
md5sum =
2aee5fede6e804c1b9c1400f41f2f51e
[template_nginx_conf]
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
_update_hash_filename_ = templates/nginx_conf.in
...
@@ -45,4 +45,4 @@ md5sum = 1c0ee16966e1fcdb3fd11c09f12ee2b2
...
@@ -45,4 +45,4 @@ md5sum = 1c0ee16966e1fcdb3fd11c09f12ee2b2
[template_instance_replicate]
[template_instance_replicate]
_update_hash_filename_ = instance_replicate.cfg.in
_update_hash_filename_ = instance_replicate.cfg.in
md5sum =
38d1d352307f79c9c99bf2a80a5c76b8
md5sum =
aef3b91f4cbaf6f7a14986bc8d1aba65
software/html5as/instance.cfg.in
View file @
c4b66eb1
...
@@ -26,24 +26,41 @@ filename = instance-html5as.cfg
...
@@ -26,24 +26,41 @@ filename = instance-html5as.cfg
context =
context =
section buildout buildout
section buildout buildout
section parameter_list profile-common
section parameter_list profile-common
# partition_ipv6 is the random ipv6 allocated to the local partition
key partition_ipv6 slap-configuration:ipv6-random
key slapparameter_dict slap-configuration:configuration
jsonkey default_parameter_dict :default-parameters
default-parameters =
{
"title": "",
"download_url": "",
"port": 8081
}
[instance-replicate]
[instance-replicate]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
template = {{ template_instance_replicate }}
template = {{ template_instance_replicate }}
rendered = ${buildout:directory}/${:filename}
rendered = ${buildout:directory}/${:filename}
filename = instance-replicate-html5as.cfg
filename = instance-replicate-html5as.cfg
context =
context =
section buildout buildout
section buildout buildout
section parameter_list profile-common
section parameter_list profile-common
key slapparameter_dict slap-parameters:configuration
key slapparameter_dict slap-configuration:configuration
jsonkey default_parameter_dict :default-parameters
default-parameters =
{
"download_url": "",
"replicate-quantity": 1
}
[switch-softwaretype]
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
recipe = slapos.cookbook:switch-softwaretype
default = ${instance-html5as:rendered}
RootSoftwareInstance = ${:default}
replicate = ${instance-replicate:rendered}
default = instance-html5as:rendered
replicate = instance-replicate:rendered
# Section needed to be added manually here to retrieve parameters
[slap-configuration]
[slap-parameters]
recipe = slapos.cookbook:slapconfiguration
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
partition = ${slap-connection:partition-id}
...
...
software/html5as/instance_html5as.cfg.in
View file @
c4b66eb1
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
# Deploy html5as instance
# Deploy html5as instance
#
#
#############################
#############################
{% set parameter_dict = dict(default_parameter_dict, **slapparameter_dict) %}
[buildout]
[buildout]
parts =
parts =
nginx_conf
nginx_conf
...
@@ -76,8 +78,8 @@ scgi_temp_path = ${:tmp}/scgi_temp_path
...
@@ -76,8 +78,8 @@ scgi_temp_path = ${:tmp}/scgi_temp_path
nb_workers = 2
nb_workers = 2
# Network
# Network
ip =
${slap-network-information:global-ipv6
}
ip =
{{ partition_ipv6 }
}
port =
${slap-parameter:port
}
port =
{{ parameter_dict['port'] }
}
access_url = http://[${:ip}]:${:port}
access_url = http://[${:ip}]:${:port}
# Paths
# Paths
...
@@ -138,7 +140,7 @@ stop-on-error = true
...
@@ -138,7 +140,7 @@ stop-on-error = true
# If the parameter is not provided it fallback to the default template
# If the parameter is not provided it fallback to the default template
command =
command =
rm -rf ${html5as:docroot}/*;
rm -rf ${html5as:docroot}/*;
URL
="${slap-parameter:download_url}";
URL
= {{ parameter_dict['download_url'] }};
if [ -n "$URL" ];
if [ -n "$URL" ];
then
then
${html5as:curl-binary} -Lks $URL | ${html5as:tar-binary} xzv -C ${html5as:docroot} --strip-components 1;
${html5as:curl-binary} -Lks $URL | ${html5as:tar-binary} xzv -C ${html5as:docroot} --strip-components 1;
...
@@ -150,8 +152,9 @@ command =
...
@@ -150,8 +152,9 @@ command =
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
template = {{ parameter_list['template_index_html'] }}
template = {{ parameter_list['template_index_html'] }}
rendered = ${directory:srv}/index.html
rendered = ${directory:srv}/index.html
title = {{ parameter_dict['title'] }}
context =
context =
key title
slap-parameter
:title
key title :title
### Nginx Graceful
### Nginx Graceful
[nginx-graceful]
[nginx-graceful]
...
@@ -191,7 +194,7 @@ recipe = slapos.cookbook:publish
...
@@ -191,7 +194,7 @@ recipe = slapos.cookbook:publish
# be deployed. The parameters needed for accessing monitoring will be published
# be deployed. The parameters needed for accessing monitoring will be published
<= monitor-publish
<= monitor-publish
server_url = ${html5as:access_url}
server_url = ${html5as:access_url}
title = Title
${slap-parameter:title
}!
title = Title
{{ parameter_dict['title'] }
}!
# Add dependency to the promise so that frontend sections are processed
# Add dependency to the promise so that frontend sections are processed
# and there is no need to declare the new part in buildout:parts
# and there is no need to declare the new part in buildout:parts
server-cdn-url = ${html5as-frontend-promise:url}
server-cdn-url = ${html5as-frontend-promise:url}
...
@@ -220,8 +223,3 @@ name = html5as-http-frontend.py
...
@@ -220,8 +223,3 @@ name = html5as-http-frontend.py
url = ${html5as-frontend:connection-secure_access}
url = ${html5as-frontend:connection-secure_access}
config-url = ${:url}
config-url = ${:url}
config-check-secure = 1
config-check-secure = 1
[slap-parameter]
title =
download_url =
port = 8081
software/html5as/instance_replicate.cfg.in
View file @
c4b66eb1
{% set replicate_quantity = slapparameter_dict.pop('replicate-quantity', '1') | int %}
{%- set parameter_dict = dict(default_parameter_dict, **slapparameter_dict) %}
{%- set replicate_quantity = int(parameter_dict['replicate-quantity']) %}
# Set default title and port for each replicate based on requested quantity
{%- for i in range(1, replicate_quantity + 1) %}
{%- do parameter_dict.setdefault("title-%d" % i, "") %}
{%- do parameter_dict.setdefault("port-%d" % i, 8081 + i) %}
{%- endfor %}
# Standard buildout section
[buildout]
[buildout]
parts =
parts =
publish-connection-information
publish-connection-information
...
@@ -7,6 +15,11 @@ eggs-directory = {{ buildout['eggs-directory'] }}
...
@@ -7,6 +15,11 @@ eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
offline = true
################################
# Sections to Request instances
################################
# Macro section sharing request parameters
[instance-request-base]
[instance-request-base]
<= slap-connection
<= slap-connection
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
...
@@ -17,29 +30,23 @@ software-type = default
...
@@ -17,29 +30,23 @@ software-type = default
# What parameter are neede to be retrieved
# What parameter are neede to be retrieved
return = server_url server-cdn-url monitor-setup-url
return = server_url server-cdn-url monitor-setup-url
# Provided parameters
# Provided parameters
config-title = ${slap-parameter:title}
config-download_url = {{ parameter_dict['download_url'] }}
config-download_url = ${slap-parameter:download_url}
# Create request section in a loop.
{% for i in range(1, replicate_quantity + 1) %}
{% for i in range(1, replicate_quantity + 1) %}
# Request a normal html5as instance
# Request a normal html5as instance
[instance-{{ i }}]
[instance-{{ i }}]
<= instance-request-base
<= instance-request-base
# Name of the instance
# Name of the instance
name = instance-html5as-{{ i }}
name = instance-html5as-{{ i }}
config-port =
${slap-parameter:port-{{ i }
}}
config-port =
{{ parameter_dict["port-%s" % i]
}}
config-title =
${slap-parameter:title-{{ i }
}}
config-title =
{{ parameter_dict["title-%s" % i]
}}
{% if "sla-%s-computer-guid" % i in
slap
parameter_dict -%}
{% if "sla-%s-computer-guid" % i in parameter_dict -%}
sla-computer_guid = {{
slap
parameter_dict["sla-%s-computer-guid" % i] }}
sla-computer_guid = {{ parameter_dict["sla-%s-computer-guid" % i] }}
{% endif -%}
{% endif -%}
{% endfor %}
{% endfor %}
[slap-parameter]
# Publish information to connect to the two instances
download_url =
{% for i in range(1, replicate_quantity + 1) %}
title-{{ i }} =
port-{{ i }} = 808{{ i }}
{% endfor %}
[publish-connection-information]
[publish-connection-information]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
{% for i in range(1, replicate_quantity + 1) %}
{% for i in range(1, replicate_quantity + 1) %}
...
...
software/html5as/software.cfg
View file @
c4b66eb1
...
@@ -79,7 +79,3 @@ mode = 0644
...
@@ -79,7 +79,3 @@ mode = 0644
[template_instance_replicate]
[template_instance_replicate]
<= download-base
<= download-base
# Pin versions of eggs used that are not already pinned by stack/slapos.cfg
[versions]
slapos.recipe.template = 4.4
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