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
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
07447ba1
Commit
07447ba1
authored
Jan 25, 2024
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/gitlab: allow to set parameter for unicorn worker amount
parent
2cff189e
Pipeline
#32445
passed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
19 deletions
+20
-19
software/gitlab/buildout.hash.cfg
software/gitlab/buildout.hash.cfg
+2
-2
software/gitlab/instance-gitlab.cfg.in
software/gitlab/instance-gitlab.cfg.in
+18
-2
software/gitlab/instance.cfg.in
software/gitlab/instance.cfg.in
+0
-15
No files found.
software/gitlab/buildout.hash.cfg
View file @
07447ba1
...
@@ -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 =
ebec7b64a89ef531e532a9d2b0583c0a
md5sum =
d1ca30a1b910b6b775f4f95bd91123a6
[watcher]
[watcher]
_update_hash_filename_ = watcher.in
_update_hash_filename_ = watcher.in
...
@@ -54,7 +54,7 @@ md5sum = 58e3d5bbda32583d00cd8f44ec0525b0
...
@@ -54,7 +54,7 @@ md5sum = 58e3d5bbda32583d00cd8f44ec0525b0
[instance-gitlab.cfg.in]
[instance-gitlab.cfg.in]
_update_hash_filename_ = instance-gitlab.cfg.in
_update_hash_filename_ = instance-gitlab.cfg.in
md5sum =
51e85c1e8e77bd7a872a9ddb3fabb89
3
md5sum =
9303fa3912e6eaea04add760b55521f
3
[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
...
...
software/gitlab/instance-gitlab.cfg.in
View file @
07447ba1
...
@@ -49,16 +49,32 @@ offline = true
...
@@ -49,16 +49,32 @@ offline = true
# GitLab instance parameters #
# GitLab instance parameters #
##################################
##################################
[worker-processes]
recipe = slapos.recipe.build
unicorn-worker-processes = {{ instance_parameter_dict['configuration.unicorn_worker_processes'] }}
init =
import multiprocessing
worker_count = int(options['unicorn-worker-processes'])
if worker_count == 0:
# automatically load all available CPUs
worker_count = multiprocessing.cpu_count() + 1
worker_count = 2 if worker_count < 2 else worker_count
options['unicorn-worker-processes'] = worker_count
options['nginx-worker-processes'] = worker_count -1
[instance-parameter]
[instance-parameter]
{#- There are dangerous keys like recipe, etc #}
{#- There are dangerous keys like recipe, etc #}
{#- XXX: Some other approach would be useful #}
{#- XXX: Some other approach would be useful #}
{%- set DROP_KEY_LIST = ['recipe', '__buildout_signature__', 'computer', 'partition', 'url', 'key', 'cert'] %}
{%- set DROP_KEY_LIST = ['recipe', '__buildout_signature__', 'computer', 'partition', 'url', 'key', 'cert',
'configuration.unicorn_worker_processes', 'configuration.nginx_worker_processes'] %}
{%- for key, value in instance_parameter_dict.items() -%}
{%- for key, value in instance_parameter_dict.items() -%}
{%- if key not in DROP_KEY_LIST %}
{%- if key not in DROP_KEY_LIST %}
{{ key }} = {{ value }}
{{ key }} = {{ value }}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{%- endfor %}
# settings for worker processes:
configuration.unicorn_worker_processes = ${worker-processes:unicorn-worker-processes}
configuration.nginx_worker_processes = ${worker-processes:nginx-worker-processes}
# for convenience
# for convenience
...
...
software/gitlab/instance.cfg.in
View file @
07447ba1
...
@@ -19,16 +19,6 @@ RootSoftwareInstance = $${:gitlab}
...
@@ -19,16 +19,6 @@ 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]
[slap-configuration]
# std stuff to fetch slapos instance parameters
# std stuff to fetch slapos instance parameters
recipe = slapos.cookbook:slapconfiguration
recipe = slapos.cookbook:slapconfiguration
...
@@ -41,11 +31,6 @@ cert = $${slap-connection:cert-file}
...
@@ -41,11 +31,6 @@ cert = $${slap-connection:cert-file}
# autogenerated gitlab instance parameters
# autogenerated gitlab instance parameters
<= gitlab-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
# gitlab non-native parameters
configuration.icp_license =
configuration.icp_license =
...
...
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