From a3f96bddb874901083a2af8edcacfa3f2a5618ab Mon Sep 17 00:00:00 2001 From: Alain Takoudjou Date: Thu, 2 Jan 2020 11:29:31 +0100 Subject: [PATCH 1/3] gitlab: fix git-backup installation --- software/gitlab/gowork.cfg | 4 ++-- software/gitlab/software.cfg | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/software/gitlab/gowork.cfg b/software/gitlab/gowork.cfg index 8f8f57a4d6..73a8793c4c 100644 --- a/software/gitlab/gowork.cfg +++ b/software/gitlab/gowork.cfg @@ -14,7 +14,7 @@ depends_gitfetch = go.importpath = github.com/libgit2/git2go repository = https://github.com/libgit2/git2go.git # branch 'next' is required by git-backup -revision = next-g53594d7581617dbae7bb5960b4ac5f0ff513c184 +revision = next-g5d0a4c752a74258a5f42e40fccd2908ac4e336b8 [go_github.com_pkg_errors] <= go-git-package @@ -26,7 +26,7 @@ revision = v0.8.0-12-g816c908556 <= go-git-package go.importpath = lab.nexedi.com/kirr/git-backup repository = https://lab.nexedi.com/kirr/git-backup.git -revision = cc6ac54f451dfa6e343d6340dcfa25aa6eac9565 +revision = 9791c04ecc2555a519321905efa734a1b5f3c4e6 [go_lab.nexedi.com_kirr_go123] <= go-git-package diff --git a/software/gitlab/software.cfg b/software/gitlab/software.cfg index 3b1db31132..3e8b425da4 100644 --- a/software/gitlab/software.cfg +++ b/software/gitlab/software.cfg @@ -30,7 +30,7 @@ extends = parts = ruby2.1 - golang19 + golang1.12 git postgresql92 redis28 @@ -158,7 +158,7 @@ bundle = ${bundler-4gitlab:bundle} configure-command = cd ${:path} && ${:bundle} config --local build.charlock_holmes --with-icu-dir=${icu:location} && - ${:bundle} config --local build.pg --with-pg-config=${postgresql92:location}/bin/pg_config + ${:bundle} config --local build.pg --with-pg-config=${postgresql92:location}/bin/pg_config make-binary = make-targets= cd ${:path} && @@ -184,25 +184,29 @@ configure-command = : make-binary = make-targets= cd ${go_github.com_libgit2_git2go:location} && git submodule update --init + && sed -i 's/.*--build.*/cmake --build . --target install/' script/build-libgit2-static.sh && make install environment = - PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig - PATH=${cmake:location}/bin:${pkgconfig:location}/bin:${git:location}/bin:${golang19:location}/bin:${buildout:bin-directory}:%(PATH)s + PKG_CONFIG_PATH=${openssl-1.0:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig + PATH=${cmake:location}/bin:${pkgconfig:location}/bin:${git:location}/bin:${golang1.12:location}/bin:${buildout:bin-directory}:%(PATH)s GOPATH=${gowork:directory} +[gowork.goinstall] +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 go install ${gowork:buildflags} -v $(echo -n '${gowork:install}' |tr '\n' ' ')" + [gowork] -golang = ${golang19:location} -install = +golang = ${golang1.12:location} +install = lab.nexedi.com/kirr/git-backup gitlab.com/gitlab-org/gitlab-workhorse gitlab.com/gitlab-org/gitlab-workhorse/cmd/gitlab-zip-cat gitlab.com/gitlab-org/gitlab-workhorse/cmd/gitlab-zip-metadata - cpkgpath = - ${openssl:location}/lib/pkgconfig + ${openssl-1.0:location}/lib/pkgconfig ${zlib:location}/lib/pkgconfig -before-install = - ${go_github.com_libgit2_git2go_prepare:recipe} + ${go_github.com_libgit2_git2go_prepare:path}/vendor/libgit2/install/lib/pkgconfig +buildflags = --tags "static" [gitlab-backup] recipe = plone.recipe.command -- 2.30.9 From 7e1b12d4b7116858d0a7a5ffa78ce50a1cae0df9 Mon Sep 17 00:00:00 2001 From: Alain Takoudjou Date: Thu, 2 Jan 2020 17:39:10 +0100 Subject: [PATCH 2/3] gitlab: fix promises after commit dddedb4fd ~ Switch to monitor-promise-base --- software/gitlab/buildout.hash.cfg | 2 +- software/gitlab/instance-gitlab.cfg.in | 29 ++++++++++++++++---------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/software/gitlab/buildout.hash.cfg b/software/gitlab/buildout.hash.cfg index 7bfb23b535..9392681170 100644 --- a/software/gitlab/buildout.hash.cfg +++ b/software/gitlab/buildout.hash.cfg @@ -50,7 +50,7 @@ md5sum = 0ddf4093dcf4427e5a160707e6017950 [instance-gitlab.cfg.in] _update_hash_filename_ = instance-gitlab.cfg.in -md5sum = d794631233626d03b04894ca6b6d8496 +md5sum = 9dd764b3c90b3425b19b40da029b759c [instance-gitlab-export.cfg.in] _update_hash_filename_ = instance-gitlab-export.cfg.in diff --git a/software/gitlab/instance-gitlab.cfg.in b/software/gitlab/instance-gitlab.cfg.in index a669860832..8ba6ed66b7 100644 --- a/software/gitlab/instance-gitlab.cfg.in +++ b/software/gitlab/instance-gitlab.cfg.in @@ -30,6 +30,7 @@ parts = service-nginx service-postgresql service-redis + promise-redis service-cron @@ -107,7 +108,7 @@ srv = ${:home}/srv # slapos startup/service/promise scripts live here: startup = ${:etc}/run service = ${:etc}/service -promise.slow = ${:promise}.slow +promise.slow = ${:etc}/promise.slow # gitlab: etc/ log/ ... [gitlab-dir] @@ -405,8 +406,8 @@ tune-command = # [promise-] to check by url [promise-byurl] <= monitor-promise-base -module = check_url_available -name = !py! '${:_buildout_section_name_}'[8:] + '.py' +module = check_command_execute +name = ${:_buildout_section_name_}.py config-http_code = 200 @@ -447,14 +448,14 @@ depend = ${promise-postgresql:recipe} [promise-postgresql] -<= monitor-base-promise +<= monitor-promise-base module = check_command_execute name = promise-postgresql.py config-command = - {{ postgresql_location }}/bin/psql - -h ${service-postgresql:pgdata-directory} - -U ${service-postgresql:superuser} - -d ${service-postgresql:dbname} + {{ postgresql_location }}/bin/psql \ + -h ${service-postgresql:pgdata-directory} \ + -U ${service-postgresql:superuser} \ + -d ${service-postgresql:dbname} \ -c '\q' # postgresql logs to stdout/stderr - logs are handled by slapos not us @@ -473,7 +474,7 @@ log = ${directory:log}/redis [service-redis] recipe = slapos.cookbook:redis.server wrapper = ${directory:service}/redis -promise_wrapper = ${directory:promise}/redis +promise_wrapper = ${directory:bin}/redis-promise server_dir = ${redis:srv} config_file = ${directory:etc}/redis.conf @@ -489,6 +490,11 @@ server_bin = {{ redis_binprefix }}/redis-server depend = ${logrotate-entry-redis:recipe} +[promise-redis] +<= monitor-promise-base +module = check_command_execute +name = promise-redis.py +config-command = ${service-redis:promise_wrapper} # NOTE slapos.cookbook:redis.server setups promise automatically @@ -536,7 +542,7 @@ depend = <= promise-byurl # http://localhost/users/statics.css will not redirect to /users/sign_in anymore because of this commit: # https://lab.nexedi.com/nexedi/gitlab-workhorse/commit/c81f109a62fecf2a847fb17ceed012b380dab49f#c1215002e6d745f05eaaf9ee1dad7752e85d866f_318_331 -config-url = --unix-socket ${gitlab-workhorse:socket} http://localhost/users/sign_in +config-command = {{ curl_bin }} --unix-socket ${gitlab-workhorse:socket} http://localhost/users/sign_in # gitlab-workhorse logs to stdout/stderr - logs are handled by slapos not us @@ -578,7 +584,7 @@ depend = [promise-unicorn] <= promise-byurl -config-url = --unix-socket ${unicorn:socket} http://localhost/ +config-command = {{ curl_bin }} --unix-socket ${unicorn:socket} http://localhost/ [promise-rakebase] recipe = slapos.cookbook:wrapper @@ -726,6 +732,7 @@ depend = # XXX this depends on gitlab-workhorse being up # (nginx is configured to proxy all requests to gitlab-workhorse) config-url = ${backend-info:url}/users/sign_in +module = check_url_available [logrotate-entry-nginx] <= logrotate-entry -- 2.30.9 From 9a079919f2fc2c782733ef25d4de51cc783c0614 Mon Sep 17 00:00:00 2001 From: Alain Takoudjou Date: Thu, 2 Jan 2020 17:40:28 +0100 Subject: [PATCH 3/3] gitlab: update gitlab-ce repository revision --- software/gitlab/software.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/gitlab/software.cfg b/software/gitlab/software.cfg index 3e8b425da4..2cbc49cce7 100644 --- a/software/gitlab/software.cfg +++ b/software/gitlab/software.cfg @@ -123,7 +123,7 @@ git-executable = ${git:location}/bin/git #repository = https://gitlab.com/gitlab-org/gitlab-ce.git repository = https://lab.nexedi.com/nexedi/gitlab-ce.git # 8.17.X + NXD patches: -revision = v8.17.8-12-g611cf13b90 +revision = v8.17.8-12-g37ad282870 location = ${buildout:parts-directory}/gitlab [gitlab-shell-repository] -- 2.30.9