Commit 8d3e4b27 authored by Alain Takoudjou's avatar Alain Takoudjou

software/gitlab: fixes

parent 85a7100a
...@@ -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 = ef827795ea729358c54292714da1c554 md5sum = 41c09866811d714d48cd0f4a50039e0c
[watcher] [watcher]
_update_hash_filename_ = watcher.in _update_hash_filename_ = watcher.in
...@@ -38,7 +38,7 @@ md5sum = cfda6d959bb90bf0b9c947383f45ce0a ...@@ -38,7 +38,7 @@ md5sum = cfda6d959bb90bf0b9c947383f45ce0a
[gitlab-shell-config.yml.in] [gitlab-shell-config.yml.in]
_update_hash_filename_ = template/gitlab-shell-config.yml.in _update_hash_filename_ = template/gitlab-shell-config.yml.in
md5sum = 69e8ed76b06233d11932a5c0ef16f03b md5sum = c57a64fd4940c18a5c325da1da8d2f7c
[gitlab-unicorn-startup.in] [gitlab-unicorn-startup.in]
_update_hash_filename_ = gitlab-unicorn-startup.in _update_hash_filename_ = gitlab-unicorn-startup.in
...@@ -46,19 +46,19 @@ md5sum = 705825e6d8c6b37699f1321805d09de3 ...@@ -46,19 +46,19 @@ md5sum = 705825e6d8c6b37699f1321805d09de3
[gitlab.yml.in] [gitlab.yml.in]
_update_hash_filename_ = template/gitlab.yml.in _update_hash_filename_ = template/gitlab.yml.in
md5sum = 673c393e6728a8d82e6b9a44886785a8 md5sum = 671604bb2aee6fdf2238e7df61aea3be
[gitaly-config.toml.in] [gitaly-config.toml.in]
_update_hash_filename_ = template/gitaly-config.toml.in _update_hash_filename_ = template/gitaly-config.toml.in
md5sum = 58e3d5bbda32583d00cd8f44ec0525b0 md5sum = b0d37a41f280089f83afac0347ad5671
[instance-gitlab.cfg.in] [instance-gitlab.cfg.in]
_update_hash_filename_ = instance-gitlab.cfg.in _update_hash_filename_ = instance-gitlab.cfg.in
md5sum = 9303fa3912e6eaea04add760b55521f3 md5sum = 6ff84acc8bcc1571ee5b5b380f73766c
[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
md5sum = b8dea5ca4c6f9fc1ca54eb0265e1fdee md5sum = b1921bebb75f71c8d3a25386eea6f878
[macrolib.cfg.in] [macrolib.cfg.in]
_update_hash_filename_ = macrolib.cfg.in _update_hash_filename_ = macrolib.cfg.in
...@@ -90,4 +90,4 @@ md5sum = 87f16b4f4a2370acada46b2751ef3366 ...@@ -90,4 +90,4 @@ md5sum = 87f16b4f4a2370acada46b2751ef3366
[unicorn.rb.in] [unicorn.rb.in]
_update_hash_filename_ = template/unicorn.rb.in _update_hash_filename_ = template/unicorn.rb.in
md5sum = b4758129a8d0c47b2c3adb10fefb8275 md5sum = c2a0f5c50ba2198baea9d764cd119d97
...@@ -186,16 +186,18 @@ mode = 0700 ...@@ -186,16 +186,18 @@ mode = 0700
[gitaly-dir] [gitaly-dir]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
gitaly = ${directory:var}/gitaly gitaly = ${directory:var}/gitaly
sockets = ${:gitaly}/sockets sockets = ${:gitaly}/s
internal = ${directory:var}/int internal = ${:sockets}/int
log = ${directory:log}/gitaly log = ${directory:log}/gitaly
[gitaly] [gitaly]
socket = ${directory:var}/gitaly.socket socket = ${gitaly-dir:sockets}/gitaly.socket
log = ${gitaly-dir:log} logdir = ${gitaly-dir:log}
location = {{ gitaly_location }} location = {{ gitaly_location }}
pid = ${directory:run}/gitaly.pid pid = ${directory:run}/gitaly.pid
internal_socket = ${gitaly-dir:internal} internal_socket = ${gitaly-dir:internal}
basedir = ${gitaly-dir:gitaly}
num_workers = 2
[gitaly-socket-listening-promise] [gitaly-socket-listening-promise]
<= monitor-promise-base <= monitor-promise-base
...@@ -288,7 +290,8 @@ context-extra = ...@@ -288,7 +290,8 @@ context-extra =
import urllib urllib import urllib urllib
section gitlab gitlab section gitlab gitlab
section gitlab_shell_work gitlab-shell-work section gitlab_shell_work gitlab-shell-work
section gitlab_workhorse gitlab_workhorse section gitlab_shell gitlab-shell
section gitlab_workhorse gitlab-workhorse
section gitaly gitaly section gitaly gitaly
[rack_attack.rb] [rack_attack.rb]
...@@ -429,7 +432,8 @@ tune-command = ...@@ -429,7 +432,8 @@ tune-command =
ln -sf ${secrets:secrets}/gitlab_secrets.yml secrets.yml && ln -sf ${secrets:secrets}/gitlab_secrets.yml secrets.yml &&
# config/initializers/ # config/initializers/
cd initializers && cd initializers &&
ln -sf ${rack_attack.rb:output} rack_attack.rb && # rack_attack.rb is not present in gitlab13 config
# ln -sf ${rack_attack.rb:output} rack_attack.rb &&
ln -sf ${smtp_settings.rb:output} smtp_settings.rb && ln -sf ${smtp_settings.rb:output} smtp_settings.rb &&
# public/ # public/
cd ../../public && cd ../../public &&
...@@ -683,8 +687,8 @@ copytruncate = true ...@@ -683,8 +687,8 @@ copytruncate = true
[logrotate-entry-gitlab-workhorse] [logrotate-entry-gitlab-workhorse]
<= logrotate-entry-base <= logrotate-entry-base
log = ${gitlab-workhorse-dir:log}//*.log log = ${gitlab-workhorse-dir:log}/*.log
name = gitlab-shell name = gitlab-workhorse
copytruncate = true copytruncate = true
####################################### #######################################
...@@ -833,7 +837,8 @@ wrapper-path = ${directory:service}/gitaly ...@@ -833,7 +837,8 @@ wrapper-path = ${directory:service}/gitaly
command-line = {{ gitaly_location }}/gitaly ${gitaly-config.toml:output} command-line = {{ gitaly_location }}/gitaly ${gitaly-config.toml:output}
environment = environment =
PATH={{ bundler_1_17_3_dir }}:{{ ruby_location }}/bin:/bin:/usr/bin PATH={{ buildout_bin_directory }}:{{ ruby_location }}/bin:/bin:/usr/bin
# PATH={{ bundler_1_17_3_dir }}:{{ ruby_location }}/bin:/bin:/usr/bin
# 6. on-reinstantiate actions # 6. on-reinstantiate actions
......
...@@ -53,6 +53,7 @@ context = ...@@ -53,6 +53,7 @@ context =
section instance_parameter_dict slap-configuration section instance_parameter_dict slap-configuration
# program binaries # program binaries
raw buildout_bin_directory ${buildout:bin-directory}
raw bash_bin ${bash:location}/bin/bash raw bash_bin ${bash:location}/bin/bash
raw bzip2_location ${bzip2:location} raw bzip2_location ${bzip2:location}
raw bundler_4gitlab ${bundler-4gitlab:bundle} raw bundler_4gitlab ${bundler-4gitlab:bundle}
......
...@@ -5,6 +5,7 @@ extends = ...@@ -5,6 +5,7 @@ extends =
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/nodejs.cfg ../../stack/nodejs.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
../../component/libgit2/buildout.cfg
../../component/ruby/buildout.cfg ../../component/ruby/buildout.cfg
../../component/golang/buildout.cfg ../../component/golang/buildout.cfg
../../component/postgresql/buildout.cfg ../../component/postgresql/buildout.cfg
...@@ -67,12 +68,10 @@ revision = 571d6514f7290e8faa9439c4b86aa2f6c87df261 ...@@ -67,12 +68,10 @@ revision = 571d6514f7290e8faa9439c4b86aa2f6c87df261
[yarn] [yarn]
<= yarn-1.16.0 <= yarn-1.16.0
# Gitlab backup (git-backup) is failing (segfault) with recent git version > 2.30.9 [libgit2]
# We will use git 2.30.9 version for production upgrade # This version is for rugged 1.1.0 needed by gitlab and gitaly 13.12.15,
# TODO: fix the issue with git and use latest version # see: https://github.com/libgit2/rugged/tree/v1.1.0/vendor
[git] version = 1.1.0
url = https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.9.tar.xz
md5sum = c1d42936036cc44a448738329c821569
############################ ############################
# Software compilation # # Software compilation #
...@@ -120,7 +119,7 @@ url = https://rubygems.org/rubygems/rubygems-3.1.2.zip ...@@ -120,7 +119,7 @@ url = https://rubygems.org/rubygems/rubygems-3.1.2.zip
# - run gitlab services / jobs (via `bundle exec ...`) # - run gitlab services / jobs (via `bundle exec ...`)
[bundler-4gitlab] [bundler-4gitlab]
<= rubygemsrecipe <= rubygemsrecipe
ruby-location = ${ruby2.6:location} ruby-location = ${ruby:location}
ruby-executable = ${:ruby-location}/bin/ruby ruby-executable = ${:ruby-location}/bin/ruby
gems = gems =
bundler==1.17.3 bundler==1.17.3
...@@ -174,11 +173,6 @@ repository = https://gitlab.com/gitlab-org/gitaly.git ...@@ -174,11 +173,6 @@ repository = https://gitlab.com/gitlab-org/gitaly.git
revision = v13.12.15 revision = v13.12.15
location = ${buildout:parts-directory}/gitaly location = ${buildout:parts-directory}/gitaly
#[gitlab-workhorse-repository]
#<= git-repository
#repository = https://lab.nexedi.com/nexedi/gitlab-workhorse.git
#revision = v8.30.3-19-g919c9b532c
# build needed-by-gitlab gems via bundler # build needed-by-gitlab gems via bundler
[gitlab/vendor/bundle] [gitlab/vendor/bundle]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
...@@ -190,13 +184,14 @@ configure-command = cd ${:path} && ...@@ -190,13 +184,14 @@ configure-command = cd ${:path} &&
${:bundle} config --local build.pg --with-pg-config=${postgresql:location}/bin/pg_config && ${:bundle} config --local build.pg --with-pg-config=${postgresql:location}/bin/pg_config &&
${:bundle} config --local build.re2 --with-re2-dir=${re2:location} && ${:bundle} config --local build.re2 --with-re2-dir=${re2:location} &&
${:bundle} config --local build.nokogiri --with-zlib-dir=${zlib:location} --with-cflags=-I${xz-utils:location}/include --with-ldflags="-L${xz-utils:location}/lib -Wl,-rpath=${xz-utils:location}/lib" ${:bundle} config --local build.nokogiri --with-zlib-dir=${zlib:location} --with-cflags=-I${xz-utils:location}/include --with-ldflags="-L${xz-utils:location}/lib -Wl,-rpath=${xz-utils:location}/lib"
${:bundle} config --local build.rugged --use-system-libraries --with-git2-dir=${libgit2:location}
${:bundle} config set without 'development test mysql aws kerberos' ${:bundle} config set without 'development test mysql aws kerberos'
${:bundle} config set deployment 'true' ${:bundle} config set deployment 'true'
make-binary = make-binary =
make-targets= cd ${:path} && ${:bundle} install make-targets= cd ${:path} && ${:bundle} install
environment = environment =
PKG_CONFIG_PATH=${openssl-1.0:location}/lib/pkgconfig:${re2:location}/lib/pkgconfig:${icu:location}/lib/pkgconfig:${xz-utils:location}/lib/pkgconfig PKG_CONFIG_PATH=${openssl-1.0:location}/lib/pkgconfig:${re2:location}/lib/pkgconfig:${icu:location}/lib/pkgconfig:${xz-utils:location}/lib/pkgconfig:${libgit2:location}/lib/pkgconfig
PATH=${pkgconfig:location}/bin:%(PATH)s PATH=${pkgconfig:location}/bin:%(PATH)s
CFLAGS=-I${xz-utils:location}/include CFLAGS=-I${xz-utils:location}/include
...@@ -237,7 +232,7 @@ environment = ...@@ -237,7 +232,7 @@ environment =
[gowork.goinstall] [gowork.goinstall]
git2go = ${go_github.com_libgit2_git2go_prepare:path}/vendor/libgit2/install git2go = ${go_github.com_libgit2_git2go_prepare:path}/vendor/libgit2/install
command = bash -c ". ${gowork:env.sh} && CGO_CFLAGS=-I${:git2go}/include CGO_LDFLAGS='-L${:git2go}/lib -lgit2' go install ${gowork:buildflags} -v $(echo -n '${gowork:install}' |tr '\n' ' ') && go test -v lab.nexedi.com/kirr/git-backup" command = bash -c ". ${gowork:env.sh} && CGO_CFLAGS=-I${:git2go}/include CGO_LDFLAGS='-L${:git2go}/lib -lgit2' go install ${gowork:buildflags} -v $(echo -n '${gowork:install}' |tr '\n' ' ')"
[gowork] [gowork]
golang = ${golang1.15:location} golang = ${golang1.15:location}
...@@ -271,6 +266,7 @@ bundle = ${bundler-4gitlab:bundle} ...@@ -271,6 +266,7 @@ bundle = ${bundler-4gitlab:bundle}
configure-command = cd ${:path}/ruby && configure-command = cd ${:path}/ruby &&
${:bundle} config --local build.charlock_holmes --with-icu-dir=${icu:location} ${:bundle} config --local build.charlock_holmes --with-icu-dir=${icu:location}
${:bundle} config --local build.rugged --use-system-libraries --with-git2-dir=${libgit2:location}
make-binary = make-binary =
make-targets = make-targets =
. ${gowork:env.sh} && . ${gowork:env.sh} &&
...@@ -280,8 +276,8 @@ post-install = ...@@ -280,8 +276,8 @@ post-install =
# solve the problem error="not executable: ruby/git-hooks/pre-receive" # solve the problem error="not executable: ruby/git-hooks/pre-receive"
chmod 755 ${:path}/ruby/git-hooks/gitlab-shell-hook chmod 755 ${:path}/ruby/git-hooks/gitlab-shell-hook
environment = environment =
PKG_CONFIG_PATH=${openssl-1.0:location}/lib/pkgconfig:${icu:location}/lib/pkgconfig PKG_CONFIG_PATH=${openssl-1.0:location}/lib/pkgconfig:${icu:location}/lib/pkgconfig:${libgit2:location}/lib/pkgconfig
PATH=${cmake:location}/bin:${pkgconfig:location}/bin:${ruby2.6:location}/bin:%(PATH)s PATH=${cmake:location}/bin:${pkgconfig:location}/bin:${ruby:location}/bin:%(PATH)s
OPENSSL_ROOT_DIR=${openssl-1.0:location} OPENSSL_ROOT_DIR=${openssl-1.0:location}
[xnice-repository] [xnice-repository]
...@@ -307,7 +303,7 @@ make-targets= cd ${:path} && ...@@ -307,7 +303,7 @@ make-targets= cd ${:path} &&
. ${gowork:env.sh} && make build && . ${gowork:env.sh} && make build &&
${:bundle} install --deployment --without development test ${:bundle} install --deployment --without development test
environment = environment =
PATH=${ruby2.6:location}/bin:%(PATH)s PATH=${ruby:location}/bin:%(PATH)s
############################### ###############################
# Trampoline for instance # # Trampoline for instance #
......
...@@ -10,7 +10,7 @@ bin_dir = "{{ gitaly.location }}" ...@@ -10,7 +10,7 @@ bin_dir = "{{ gitaly.location }}"
# # Optional. The directory where Gitaly can create all files required to # # Optional. The directory where Gitaly can create all files required to
# # properly operate at runtime. If not set, Gitaly will create a directory in # # properly operate at runtime. If not set, Gitaly will create a directory in
# # the global temporary directory. This directory must exist. # # the global temporary directory. This directory must exist.
# runtime_dir = "/home/git/gitaly/run" runtime_dir = "{{ gitaly.basedir }}"
# # Optional if socket_path is set. TCP address for Gitaly to listen on. This is insecure (unencrypted connection). # # Optional if socket_path is set. TCP address for Gitaly to listen on. This is insecure (unencrypted connection).
# listen_addr = "localhost:9999" # listen_addr = "localhost:9999"
...@@ -60,9 +60,9 @@ path = "{{ gitlab.repositories }}" ...@@ -60,9 +60,9 @@ path = "{{ gitlab.repositories }}"
# You can optionally configure Gitaly to output JSON-formatted log messages to stdout # You can optionally configure Gitaly to output JSON-formatted log messages to stdout
[logging] [logging]
# The directory where Gitaly stores extra log files # The directory where Gitaly stores extra log files
dir = "{{ gitaly.log }}" dir = "{{ gitaly.logdir }}"
# format = "json" # format = "text"
# format = "json" format = "json"
# # Optional: Set log level to only log entries with that severity or above # # Optional: Set log level to only log entries with that severity or above
# # One of, in order: debug, info, warn, errror, fatal, panic # # One of, in order: debug, info, warn, errror, fatal, panic
# # Defaults to "info" # # Defaults to "info"
...@@ -92,7 +92,7 @@ dir = "{{ gitaly.location }}/ruby" ...@@ -92,7 +92,7 @@ dir = "{{ gitaly.location }}/ruby"
# restart_delay = "5m" # restart_delay = "5m"
# #
# # Number of gitaly-ruby worker processes # # Number of gitaly-ruby worker processes
# num_workers = 2 num_workers = {{ gitaly.num_workers }}
# #
# # Search path for system gitconfig file (e.g. /etc, /opt/gitlab/embedded/etc) # # Search path for system gitconfig file (e.g. /etc, /opt/gitlab/embedded/etc)
# # NOTE: This only affects RPCs that use Rugged. # # NOTE: This only affects RPCs that use Rugged.
......
...@@ -43,6 +43,9 @@ preload_app true ...@@ -43,6 +43,9 @@ preload_app true
check_client_connection false check_client_connection false
require_relative '{{ gitlab_work.location }}/lib/gitlab/cluster/lifecycle_events' require_relative '{{ gitlab_work.location }}/lib/gitlab/cluster/lifecycle_events'
require_relative '{{ gitlab_work.location }}/lib/gitlab/log_timestamp_formatter.rb'
before_exec do |server| before_exec do |server|
# Signal application hooks that we're about to restart # Signal application hooks that we're about to restart
......
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