Commit 62265b68 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

software/gitlab: switch to switch-softwaretype

parent c868f7cf
Pipeline #17017 failed with stage
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[instance.cfg] [instance.cfg]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = dc3f318e8a3aa7a59f9394118543e9e3 md5sum = 47e8092404feaf3f28ee6469523689ac
[watcher] [watcher]
_update_hash_filename_ = watcher.in _update_hash_filename_ = watcher.in
...@@ -54,7 +54,7 @@ md5sum = 0f1ec4077dab586cc003ae13f689eda2 ...@@ -54,7 +54,7 @@ md5sum = 0f1ec4077dab586cc003ae13f689eda2
[instance-gitlab.cfg.in] [instance-gitlab.cfg.in]
_update_hash_filename_ = instance-gitlab.cfg.in _update_hash_filename_ = instance-gitlab.cfg.in
md5sum = 64ec65b2daa0648453022f3afcbc4da3 md5sum = 6b34d4b96ae0067977fa509046d71231
[instance-gitlab-export.cfg.in] [instance-gitlab-export.cfg.in]
_update_hash_filename_ = instance-gitlab-export.cfg.in _update_hash_filename_ = instance-gitlab-export.cfg.in
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
# throughput compared to tcp over loopback). # throughput compared to tcp over loopback).
[buildout] [buildout]
extends = extends =
{{ gitlab_parameters_cfg }}
{{ monitor_template }} {{ monitor_template }}
parts = parts =
directory directory
...@@ -50,26 +49,15 @@ offline = true ...@@ -50,26 +49,15 @@ offline = true
################################## ##################################
[instance-parameter] [instance-parameter]
# std stuff to fetch slapos instance parameters {#- There are dangerous keys like recipe, etc #}
recipe = slapos.cookbook:slapconfiguration {#- XXX: Some other approach would be useful #}
computer= ${slap-connection:computer-id} {%- set DROP_KEY_LIST = ['recipe', '__buildout_signature__', 'computer', 'partition', 'url', 'key', 'cert'] %}
partition=${slap-connection:partition-id} {%- for key, value in instance_parameter_dict.iteritems() -%}
url = ${slap-connection:server-url} {%- if key not in DROP_KEY_LIST %}
key = ${slap-connection:key-file} {{ key }} = {{ value }}
cert = ${slap-connection:cert-file} {%- endif -%}
{%- endfor %}
# autogenerated gitlab instance parameters
<= gitlab-parameters
# adjust/override some default settings:
# automatically load all available CPUs
configuration.unicorn_worker_processes = {{ multiprocessing.cpu_count() + 1 }}
configuration.nginx_worker_processes = {{ multiprocessing.cpu_count() }}
# gitlab non-native parameters
configuration.icp_license =
# for convenience # for convenience
......
# GitLab "switch-softwaretype" instance # GitLab "switch-softwaretype" instance
[buildout] [buildout]
parts = switch-softwaretype extends =
${gitlab-parameters.cfg:target}
parts =
switch-softwaretype
# std stuff for slapos instance # std stuff for slapos instance
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
...@@ -9,14 +12,46 @@ offline = true ...@@ -9,14 +12,46 @@ offline = true
[switch-softwaretype] [switch-softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:switch-softwaretype
gitlab = $${instance-gitlab.cfg:rendered} gitlab = instance-gitlab.cfg:rendered
gitlab-export = $${instance-gitlab-export.cfg:rendered} gitlab-export = instance-gitlab-export.cfg:rendered
gitlab-test = $${instance-gitlab-test.cfg:rendered} gitlab-test = instance-gitlab-test.cfg:rendered
default = $${:gitlab} RootSoftwareInstance = $${:gitlab}
# TODO -import, -pull-backup # TODO -import, -pull-backup
[worker-processes]
recipe = slapos.recipe.build
init =
import multiprocessing
cpu_count = multiprocessing.cpu_count()
# automatically load all available CPUs
options['unicorn-worker-processes'] = cpu_count + 1
options['nginx-worker-processes'] = cpu_count
[slap-configuration]
# std stuff to fetch slapos instance parameters
recipe = slapos.cookbook:slapconfiguration
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}
# autogenerated gitlab instance parameters
<= gitlab-parameters
# adjust/override some default settings:
configuration.unicorn_worker_processes = $${worker-processes:unicorn-worker-processes}
configuration.nginx_worker_processes = $${worker-processes:nginx-worker-processes}
# gitlab non-native parameters
configuration.icp_license =
# macro: render instance-*.cfg from instance-*.cfg.in # macro: render instance-*.cfg from instance-*.cfg.in
[instance-cfg] [instance-cfg]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -25,13 +60,13 @@ rendered= $${buildout:directory}/$${:_buildout_section_name_} ...@@ -25,13 +60,13 @@ rendered= $${buildout:directory}/$${:_buildout_section_name_}
context = context =
import os os import os os
import pwd pwd import pwd pwd
import multiprocessing multiprocessing
key bin_directory buildout:bin-directory key bin_directory buildout:bin-directory
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
raw gitlab_repository_location ${gitlab-repository:location} raw gitlab_repository_location ${gitlab-repository:location}
raw gitlab_shell_repository_location ${gitlab-shell-repository:location} raw gitlab_shell_repository_location ${gitlab-shell-repository:location}
section instance_parameter_dict slap-configuration
# program binaries # program binaries
raw bash_bin ${bash:location}/bin/bash raw bash_bin ${bash:location}/bin/bash
...@@ -67,7 +102,6 @@ context = ...@@ -67,7 +102,6 @@ context =
# config files # config files
raw database_yml_in ${database.yml.in:target} raw database_yml_in ${database.yml.in:target}
raw gitconfig_in ${gitconfig.in:target} raw gitconfig_in ${gitconfig.in:target}
raw gitlab_parameters_cfg ${gitlab-parameters.cfg:target}
raw monitor_template ${monitor2-template:rendered} raw monitor_template ${monitor2-template:rendered}
raw gitlab_shell_config_yml_in ${gitlab-shell-config.yml.in:target} raw gitlab_shell_config_yml_in ${gitlab-shell-config.yml.in:target}
raw gitlab_unicorn_startup_in ${gitlab-unicorn-startup.in:target} raw gitlab_unicorn_startup_in ${gitlab-unicorn-startup.in:target}
......
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