Commit 9272d81e authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'master' into x/lte-multiru

* master:
  Gitlab resiliency test: gitlab SR now setup https by default
  software/gitlab: use https by default to setup nginx
  Do not created uneeded folders. Fix double trailing "/". Add sane defaults.
  software/gitlab: allow to set parameter for unicorn worker amount
  software/ors-amarisoft: Merge instance-ue-lte.jinja2.cfg + instance-ue-nr.jinja2.cfg  -> into instance-ue.jinja2.cfg
  software/ors-amarisoft: ue.jinja2.cfg: Fix thinko regarding LTE bandwidth
  software/ors-amarisoft: enb.jinja2.cfg: Stop using C Preprocessor and switch to Jinja2 completely
  software/ors-amarisoft: enb.jinja2.cfg: Switch ru to be a namespace to hold Radio Unit parameters
  software/gitlab: update gitlab-ce to use gpgme 2.0.23
  software/gitlab: use shorter paths for gitaly sockets
  component/coreutils: backport a fix for a crash with split
parents 34c0b83c b2c52fbb
[buildout]
extends =
../gmp/buildout.cfg
../patch/buildout.cfg
../perl/buildout.cfg
../xz-utils/buildout.cfg
parts =
......@@ -16,15 +17,11 @@ configure-options =
--without-selinux
--prefix=@@LOCATION@@
environment =
PATH=${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s
PATH=${patch:location}/bin:${perl:location}/bin:${xz-utils:location}/bin:%(PATH)s
LDFLAGS=-Wl,--as-needed -L${gmp:location}/lib -Wl,-rpath=${gmp:location}/lib
# Latest version of command split in coreutils is not working in gitlab backup
# For more details, see: https://lab.nexedi.com/nexedi/slapos/merge_requests/1503/diffs#note_197515
[coreutils-9.1]
<= coreutils
url = https://ftp.gnu.org/gnu/coreutils/coreutils-9.1.tar.xz
md5sum = 8b1ca4e018a7dce9bb937faec6618671
patches =
https://github.com/coreutils/coreutils/commit/c4c5ed8f4e9cd55a12966d4f520e3a13101637d9.patch#b6810d7559ffbc5e24636a860f02e836
patch-options = -p1
[coreutils-output]
# Shared binary location to ease migration
......
......@@ -14,7 +14,7 @@
# not need these here).
[instance.cfg]
filename = instance.cfg.in
md5sum = ea1d4fb7b2330ae9d94df07f74b934b4
md5sum = d1ca30a1b910b6b775f4f95bd91123a6
[watcher]
_update_hash_filename_ = watcher.in
......@@ -34,7 +34,7 @@ md5sum = eb1230fee50067924ba89f4dc6e82fa9
[gitlab-parameters.cfg]
_update_hash_filename_ = gitlab-parameters.cfg
md5sum = c2e23c0f7baa1633df0436ca4e728424
md5sum = cfda6d959bb90bf0b9c947383f45ce0a
[gitlab-shell-config.yml.in]
_update_hash_filename_ = template/gitlab-shell-config.yml.in
......@@ -54,7 +54,7 @@ md5sum = 58e3d5bbda32583d00cd8f44ec0525b0
[instance-gitlab.cfg.in]
_update_hash_filename_ = instance-gitlab.cfg.in
md5sum = 8e5b0ddb1b79679b4162f302aa438b62
md5sum = 9303fa3912e6eaea04add760b55521f3
[instance-gitlab-export.cfg.in]
_update_hash_filename_ = instance-gitlab-export.cfg.in
......
......@@ -9,7 +9,7 @@
# (last updated for omnibus-gitlab 8.8.9+ce.0-g25376053)
[gitlab-parameters]
configuration.external_url = http://lab.example.com
configuration.external_url = https://lab.example.com
# db advanced
configuration.db_pool = 10
......
......@@ -49,16 +49,32 @@ offline = true
# 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]
{#- There are dangerous keys like recipe, etc #}
{#- 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() -%}
{%- if key not in DROP_KEY_LIST %}
{{ key }} = {{ value }}
{%- endif -%}
{%- 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
......@@ -171,7 +187,7 @@ mode = 0700
recipe = slapos.cookbook:mkdirectory
gitaly = ${directory:var}/gitaly
sockets = ${:gitaly}/sockets
internal = ${:sockets}/internal
internal = ${directory:var}/int
log = ${directory:log}/gitaly
[gitaly]
......
......@@ -19,16 +19,6 @@ RootSoftwareInstance = $${:gitlab}
# 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
......@@ -41,11 +31,6 @@ 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 =
......@@ -72,7 +57,7 @@ context =
raw bzip2_location ${bzip2:location}
raw bundler_4gitlab ${bundler-4gitlab:bundle}
raw bundler_1_17_3_dir ${bundler-4gitlab:bundle1.17.3}
raw coreutils_location ${coreutils-9.1:location}
raw coreutils_location ${coreutils:location}
raw curl_bin ${curl:location}/bin/curl
raw dcron_bin ${dcron-output:crond}
raw git ${git:location}/bin/git
......
......@@ -161,7 +161,7 @@ git-executable = ${git:location}/bin/git
[gitlab-repository]
<= git-repository
repository = https://lab.nexedi.com/nexedi/gitlab-ce.git
revision = v12.10.14-8-gd7e78e9013
revision = v12.10.14-11-gdf89aa7e6bf
location = ${buildout:parts-directory}/gitlab
[gitlab-shell-repository]
......
[instance-profile]
filename = instance.cfg.in
md5sum = 6610ce91964dda42edbcb5b7837777c2
md5sum = cf6c11bc335c75139695008128f1565a
......@@ -32,8 +32,8 @@ cert = ${slap-connection:cert-file}
configuration.coupler_block_device = /dev/i2c-1
configuration.coupler_i2c_slave_list = 0x58
configuration.mode = 0
configuration.username =
configuration.password =
configuration.username = ""
configuration.password = ""
configuration.interface = 0.0.0.0
configuration.opc_ua_port = 4840
configuration.id = 0
......@@ -42,7 +42,7 @@ configuration.heart_beat_interval = 50
configuration.heart_beat_id_list =
configuration.network_address_url_data_type = opc.udp://224.0.0.22:4840/
configuration.heart_beat_timeout_interval = 100
configuration.network_interface =
configuration.network_interface = ""
[directory]
recipe = slapos.cookbook:mkdirectory
......@@ -51,7 +51,6 @@ etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
log = ${:var}/log
[publish-connection-parameter]
recipe = slapos.cookbook:publish
......
......@@ -44,11 +44,11 @@ environment +=
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/osie.git
revision = a40573897e1ee9de7b3536daa58c6904384c10f9
revision = 5d193e57b50a7ebb3df147e403917201eb9cb6c6
[compile-coupler]
recipe = slapos.recipe.cmmi
path = ${osie-repository:location}/coupler/
path = ${osie-repository:location}/coupler
bin_dir = ${:path}/bin/
environment =
OPEN62541_HOME = ${open62541:location}
......
......@@ -520,17 +520,17 @@ class TestTheiaResilienceGitlab(test_resiliency.TestTheiaResilience):
# The project name is sample-test, which we created above.
self.assertIn("sample-test", projects[0]['name_with_namespace'])
# Get repo url, default one is http://lab.example.com/root/sample-test.git
# We need the path like http://[2001:67c:1254:e:c4::5041]:7777/root/sample-test
# Get repo url, default one is https://lab.example.com/root/sample-test.git
# We need the path like https://[2001:67c:1254:e:c4::5041]:7777/root/sample-test
project_1 = projects[0]
repo_url = backend_url.replace("http://", "") + "/" + project_1['path_with_namespace']
repo_url = backend_url.replace("https://", "") + "/" + project_1['path_with_namespace']
# Clone the repo with token
clone_url = 'http://oauth2:' + 'SLurtnxPscPsU-SDm4oN@' + repo_url
clone_url = 'https://oauth2:' + 'SLurtnxPscPsU-SDm4oN@' + repo_url
repo_path = os.path.join(os.getcwd(), project_1['name'])
print(repo_path)
if os.path.exists(repo_path):
shutil.rmtree(repo_path, ignore_errors=True)
output = subprocess.check_output(('git', 'clone', clone_url), universal_newlines=True)
output = subprocess.check_output(('git', 'clone', '-c', 'http.sslVerify=false', clone_url), universal_newlines=True)
# Create a new file and push the commit
f = open(os.path.join(repo_path, 'file.txt'), 'x')
......@@ -566,7 +566,7 @@ class TestTheiaResilienceGitlab(test_resiliency.TestTheiaResilience):
print(repo_path)
if os.path.exists(repo_path):
shutil.rmtree(repo_path, ignore_errors=True)
output = subprocess.check_output(('git', 'clone', clone_url), universal_newlines=True)
output = subprocess.check_output(('git', 'clone', '-c', 'http.sslVerify=false', clone_url), universal_newlines=True)
# Check the file we committed in exist and the content is matching.
output = subprocess.check_output(('git', 'show', 'origin/master:file.txt'), cwd=repo_path, universal_newlines=True)
......@@ -596,8 +596,8 @@ class TestTheiaResilienceGitlab(test_resiliency.TestTheiaResilience):
# The project name is sample-test, which we created above.
self.assertIn("sample-test", projects[0]['name_with_namespace'])
project_1 = projects[0]
repo_url = backend_url.replace("http://", "") + "/" + project_1['path_with_namespace']
clone_url = 'http://oauth2:' + 'SLurtnxPscPsU-SDm4oN@' + repo_url
repo_url = backend_url.replace("https://", "") + "/" + project_1['path_with_namespace']
clone_url = 'https://oauth2:' + 'SLurtnxPscPsU-SDm4oN@' + repo_url
repo_path = os.path.join(os.getcwd(), project_1['name'])
# Check the file we committed in the original theia is exist and the content is matching.
......
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