Skip to content

Commit e87f29c

Browse files
authored
Upgrade to 12.9.0 (#2117)
* Upgrade GitLab CE to 12.9.0 * Update gitlab-shell to 12.0.0 Signed-off-by: solidnerd <[email protected]> * Update gitlab-workhorse to 8.25.0 Signed-off-by: solidnerd <[email protected]> * Update gitlab-pages to 1.17.0 Signed-off-by: solidnerd <[email protected]> * Update gitaly to 12.9.0-rc42 Signed-off-by: solidnerd <[email protected]> * feat: replace unicorn with puma as webserver Signed-off-by: solidnerd <[email protected]>
1 parent 5f1c512 commit e87f29c

File tree

12 files changed

+164
-190
lines changed

12 files changed

+164
-190
lines changed

Changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
This file only reflects the changes that are made in this image. Please refer to the upstream GitLab [CHANGELOG](
44
https://gitlab.com/gitlab-org/gitlab-foss/blob/master/CHANGELOG.md) for the list of changes in GitLab.
55

6+
**12.9.0**
7+
- gitlab: upgrade CE to v12.9.0
8+
- replaced unicorn with puma
9+
- Removed `UNICORN_WORKERS`
10+
- Removed `UNICORN_TIMEOUT`
11+
- Added `PUMA_THREADS_MIN`
12+
- Added `PUMA_THREADS_MAX`
13+
- Added `PUMA_WORKERS`
14+
- Added `PUMA_TIMEOUT`
15+
616
**12.8.8**
717
- gitlab: upgrade CE to v12.8.8
818

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ FROM ubuntu:bionic-20200219
22

33
ARG BUILD_DATE
44
ARG VCS_REF
5-
ARG VERSION=12.8.8
5+
ARG VERSION=12.9.0
66

77
ENV GITLAB_VERSION=${VERSION} \
88
RUBY_VERSION=2.6 \
99
GOLANG_VERSION=1.13.7 \
10-
GITLAB_SHELL_VERSION=11.0.0 \
11-
GITLAB_WORKHORSE_VERSION=8.21.1 \
12-
GITLAB_PAGES_VERSION=1.16.0 \
13-
GITALY_SERVER_VERSION=12.8.8 \
10+
GITLAB_SHELL_VERSION=12.0.0 \
11+
GITLAB_WORKHORSE_VERSION=8.25.0 \
12+
GITLAB_PAGES_VERSION=1.17.0 \
13+
GITALY_SERVER_VERSION=12.9.0-rc42 \
1414
GITLAB_USER="git" \
1515
GITLAB_HOME="/home/git" \
1616
GITLAB_LOG_DIR="/var/log/gitlab" \

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Docker Repository on Quay.io](https://quay.io/repository/sameersbn/gitlab/status "Docker Repository on Quay.io")](https://quay.io/repository/sameersbn/gitlab)
22
[![](https://images.microbadger.com/badges/image/sameersbn/gitlab.svg)](http://microbadger.com/images/sameersbn/gitlab "Get your own image badge on microbadger.com")
33

4-
# sameersbn/gitlab:12.8.8
4+
# sameersbn/gitlab:12.9.0
55

66
- [Introduction](#introduction)
77
- [Changelog](Changelog.md)
@@ -125,7 +125,7 @@ Automated builds of the image are available on [Dockerhub](https://hub.docker.co
125125
> **Note**: Builds are also available on [Quay.io](https://quay.io/repository/sameersbn/gitlab)
126126
127127
```bash
128-
docker pull sameersbn/gitlab:12.8.8
128+
docker pull sameersbn/gitlab:12.9.0
129129
```
130130

131131
You can also pull the `latest` tag which is built from the repository *HEAD*
@@ -194,7 +194,7 @@ docker run --name gitlab -d \
194194
--env 'GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alpha-numeric-string' \
195195
--env 'GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alpha-numeric-string' \
196196
--volume /srv/docker/gitlab/gitlab:/home/git/data \
197-
sameersbn/gitlab:12.8.8
197+
sameersbn/gitlab:12.9.0
198198
```
199199

200200
*Please refer to [Available Configuration Parameters](#available-configuration-parameters) to understand `GITLAB_PORT` and other configuration options*
@@ -229,7 +229,7 @@ Volumes can be mounted in docker by specifying the `-v` option in the docker run
229229
```bash
230230
docker run --name gitlab -d \
231231
--volume /srv/docker/gitlab/gitlab:/home/git/data \
232-
sameersbn/gitlab:12.8.8
232+
sameersbn/gitlab:12.9.0
233233
```
234234

235235
## Database
@@ -262,7 +262,7 @@ docker run --name gitlab -d \
262262
--env 'DB_NAME=gitlabhq_production' \
263263
--env 'DB_USER=gitlab' --env 'DB_PASS=password' \
264264
--volume /srv/docker/gitlab/gitlab:/home/git/data \
265-
sameersbn/gitlab:12.8.8
265+
sameersbn/gitlab:12.9.0
266266
```
267267

268268
#### Linking to PostgreSQL Container
@@ -306,7 +306,7 @@ We are now ready to start the GitLab application.
306306
```bash
307307
docker run --name gitlab -d --link gitlab-postgresql:postgresql \
308308
--volume /srv/docker/gitlab/gitlab:/home/git/data \
309-
sameersbn/gitlab:12.8.8
309+
sameersbn/gitlab:12.9.0
310310
```
311311

312312
Here the image will also automatically fetch the `DB_NAME`, `DB_USER` and `DB_PASS` variables from the postgresql container as they are specified in the `docker run` command for the postgresql container. This is made possible using the magic of docker links and works with the following images:
@@ -333,7 +333,7 @@ The image can be configured to use an external redis server. The configuration s
333333
```bash
334334
docker run --name gitlab -it --rm \
335335
--env 'REDIS_HOST=192.168.1.100' --env 'REDIS_PORT=6379' \
336-
sameersbn/gitlab:12.8.8
336+
sameersbn/gitlab:12.9.0
337337
```
338338

339339
### Linking to Redis Container
@@ -360,7 +360,7 @@ We are now ready to start the GitLab application.
360360

361361
```bash
362362
docker run --name gitlab -d --link gitlab-redis:redisio \
363-
sameersbn/gitlab:12.8.8
363+
sameersbn/gitlab:12.9.0
364364
```
365365

366366
### Mail
@@ -373,7 +373,7 @@ If you are using Gmail then all you need to do is:
373373
docker run --name gitlab -d \
374374
--env '[email protected]' --env 'SMTP_PASS=PASSWORD' \
375375
--volume /srv/docker/gitlab/gitlab:/home/git/data \
376-
sameersbn/gitlab:12.8.8
376+
sameersbn/gitlab:12.9.0
377377
```
378378

379379
Please refer the [Available Configuration Parameters](#available-configuration-parameters) section for the list of SMTP parameters that can be specified.
@@ -393,7 +393,7 @@ docker run --name gitlab -d \
393393
--env '[email protected]' --env 'IMAP_PASS=PASSWORD' \
394394
--env 'GITLAB_INCOMING_EMAIL_ADDRESS=USER+%{key}@gmail.com' \
395395
--volume /srv/docker/gitlab/gitlab:/home/git/data \
396-
sameersbn/gitlab:12.8.8
396+
sameersbn/gitlab:12.9.0
397397
```
398398

399399
Please refer the [Available Configuration Parameters](#available-configuration-parameters) section for the list of IMAP parameters that can be specified.
@@ -470,7 +470,7 @@ docker run --name gitlab -d \
470470
--env 'GITLAB_SSH_PORT=10022' --env 'GITLAB_PORT=10443' \
471471
--env 'GITLAB_HTTPS=true' --env 'SSL_SELF_SIGNED=true' \
472472
--volume /srv/docker/gitlab/gitlab:/home/git/data \
473-
sameersbn/gitlab:12.8.8
473+
sameersbn/gitlab:12.9.0
474474
```
475475

476476
In this configuration, any requests made over the plain http protocol will automatically be redirected to use the https protocol. However, this is not optimal when using a load balancer.
@@ -486,7 +486,7 @@ docker run --name gitlab -d \
486486
--env 'GITLAB_HTTPS=true' --env 'SSL_SELF_SIGNED=true' \
487487
--env 'NGINX_HSTS_MAXAGE=2592000' \
488488
--volume /srv/docker/gitlab/gitlab:/home/git/data \
489-
sameersbn/gitlab:12.8.8
489+
sameersbn/gitlab:12.9.0
490490
```
491491

492492
If you want to completely disable HSTS set `NGINX_HSTS_ENABLED` to `false`.
@@ -509,7 +509,7 @@ docker run --name gitlab -d \
509509
--env 'GITLAB_SSH_PORT=10022' --env 'GITLAB_PORT=443' \
510510
--env 'GITLAB_HTTPS=true' --env 'SSL_SELF_SIGNED=true' \
511511
--volume /srv/docker/gitlab/gitlab:/home/git/data \
512-
sameersbn/gitlab:12.8.8
512+
sameersbn/gitlab:12.9.0
513513
```
514514

515515
Again, drop the `--env 'SSL_SELF_SIGNED=true'` option if you are using CA certified SSL certificates.
@@ -557,7 +557,7 @@ Let's assume we want to deploy our application to '/git'. GitLab needs to know t
557557
docker run --name gitlab -it --rm \
558558
--env 'GITLAB_RELATIVE_URL_ROOT=/git' \
559559
--volume /srv/docker/gitlab/gitlab:/home/git/data \
560-
sameersbn/gitlab:12.8.8
560+
sameersbn/gitlab:12.9.0
561561
```
562562

563563
GitLab will now be accessible at the `/git` path, e.g. `http://www.example.com/git`.
@@ -738,14 +738,14 @@ Also the container processes seem to be executed as the host's user/group `1000`
738738
```bash
739739
docker run --name gitlab -it --rm [options] \
740740
--env "USERMAP_UID=$(id -u git)" --env "USERMAP_GID=$(id -g git)" \
741-
sameersbn/gitlab:12.8.8
741+
sameersbn/gitlab:12.9.0
742742
```
743743

744744
When changing this mapping, all files and directories in the mounted data volume `/home/git/data` have to be re-owned by the new ids. This can be achieved automatically using the following command:
745745

746746
```bash
747747
docker run --name gitlab -d [OPTIONS] \
748-
sameersbn/gitlab:12.8.8 app:sanitize
748+
sameersbn/gitlab:12.9.0 app:sanitize
749749
```
750750

751751
### Piwik
@@ -1122,7 +1122,7 @@ Execute the rake task to create a backup.
11221122

11231123
```bash
11241124
docker run --name gitlab -it --rm [OPTIONS] \
1125-
sameersbn/gitlab:12.8.8 app:rake gitlab:backup:create
1125+
sameersbn/gitlab:12.9.0 app:rake gitlab:backup:create
11261126
```
11271127

11281128
A backup will be created in the backups folder of the [Data Store](#data-store). You can change the location of the backups using the `GITLAB_BACKUP_DIR` configuration parameter.
@@ -1157,14 +1157,14 @@ you need to prepare the database:
11571157

11581158
```bash
11591159
docker run --name gitlab -it --rm [OPTIONS] \
1160-
sameersbn/gitlab:12.8.8 app:rake db:setup
1160+
sameersbn/gitlab:12.9.0 app:rake db:setup
11611161
```
11621162

11631163
Execute the rake task to restore a backup. Make sure you run the container in interactive mode `-it`.
11641164

11651165
```bash
11661166
docker run --name gitlab -it --rm [OPTIONS] \
1167-
sameersbn/gitlab:12.8.8 app:rake gitlab:backup:restore
1167+
sameersbn/gitlab:12.9.0 app:rake gitlab:backup:restore
11681168
```
11691169

11701170
The list of all available backups will be displayed in reverse chronological order. Select the backup you want to restore and continue.
@@ -1173,7 +1173,7 @@ To avoid user interaction in the restore operation, specify the timestamp of the
11731173

11741174
```bash
11751175
docker run --name gitlab -it --rm [OPTIONS] \
1176-
sameersbn/gitlab:12.8.8 app:rake gitlab:backup:restore BACKUP=1417624827
1176+
sameersbn/gitlab:12.9.0 app:rake gitlab:backup:restore BACKUP=1417624827
11771177
```
11781178

11791179
When using `docker-compose` you may use the following command to execute the restore.
@@ -1223,7 +1223,7 @@ The `app:rake` command allows you to run gitlab rake tasks. To run a rake task s
12231223

12241224
```bash
12251225
docker run --name gitlab -it --rm [OPTIONS] \
1226-
sameersbn/gitlab:12.8.8 app:rake gitlab:env:info
1226+
sameersbn/gitlab:12.9.0 app:rake gitlab:env:info
12271227
```
12281228

12291229
You can also use `docker exec` to run raketasks on running gitlab instance. For example,
@@ -1236,7 +1236,7 @@ Similarly, to import bare repositories into GitLab project instance
12361236

12371237
```bash
12381238
docker run --name gitlab -it --rm [OPTIONS] \
1239-
sameersbn/gitlab:12.8.8 app:rake gitlab:import:repos
1239+
sameersbn/gitlab:12.9.0 app:rake gitlab:import:repos
12401240
```
12411241

12421242
Or
@@ -1267,7 +1267,7 @@ Copy all the **bare** git repositories to the `repositories/` directory of the [
12671267

12681268
```bash
12691269
docker run --name gitlab -it --rm [OPTIONS] \
1270-
sameersbn/gitlab:12.8.8 app:rake gitlab:import:repos
1270+
sameersbn/gitlab:12.9.0 app:rake gitlab:import:repos
12711271
```
12721272

12731273
Watch the logs and your repositories should be available into your new gitlab container.
@@ -1289,12 +1289,12 @@ To upgrade to newer gitlab releases, simply follow this 4 step upgrade procedure
12891289

12901290
> **Note**
12911291
>
1292-
> Upgrading to `sameersbn/gitlab:12.8.8` from `sameersbn/gitlab:7.x.x` can cause issues. It is therefore required that you first upgrade to `sameersbn/gitlab:8.0.5-1` before upgrading to `sameersbn/gitlab:8.1.0` or higher.
1292+
> Upgrading to `sameersbn/gitlab:12.9.0` from `sameersbn/gitlab:7.x.x` can cause issues. It is therefore required that you first upgrade to `sameersbn/gitlab:8.0.5-1` before upgrading to `sameersbn/gitlab:8.1.0` or higher.
12931293
12941294
- **Step 1**: Update the docker image.
12951295

12961296
```bash
1297-
docker pull sameersbn/gitlab:12.8.8
1297+
docker pull sameersbn/gitlab:12.9.0
12981298
```
12991299

13001300
- **Step 2**: Stop and remove the currently running image
@@ -1320,7 +1320,7 @@ Replace `x.x.x` with the version you are upgrading from. For example, if you are
13201320
> **Note**: Since GitLab `8.11.0` you need to provide the `GITLAB_SECRETS_SECRET_KEY_BASE` and `GITLAB_SECRETS_OTP_KEY_BASE` parameters while starting the image. These should initially both have the same value as the contents of the `/home/git/data/.secret` file. See [Available Configuration Parameters](#available-configuration-parameters) for more information on these parameters.
13211321
13221322
```bash
1323-
docker run --name gitlab -d [OPTIONS] sameersbn/gitlab:12.8.8
1323+
docker run --name gitlab -d [OPTIONS] sameersbn/gitlab:12.9.0
13241324
```
13251325

13261326
## Shell Access

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.8.8
1+
12.9.0

assets/build/install.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,12 @@ ${GITLAB_LOG_DIR}/nginx/*.log {
287287
}
288288
EOF
289289

290-
# configure supervisord to start unicorn
291-
cat > /etc/supervisor/conf.d/unicorn.conf <<EOF
292-
[program:unicorn]
290+
cat > /etc/supervisor/conf.d/puma.conf <<EOF
291+
[program:puma]
293292
priority=10
294293
directory=${GITLAB_INSTALL_DIR}
295294
environment=HOME=${GITLAB_HOME}
296-
command=bundle exec unicorn_rails -c ${GITLAB_INSTALL_DIR}/config/unicorn.rb -E ${RAILS_ENV}
295+
command=bundle exec puma --config ${GITLAB_INSTALL_DIR}/config/puma.rb --environment ${RAILS_ENV}
297296
user=git
298297
autostart=true
299298
autorestart=true
@@ -415,7 +414,7 @@ cat > /etc/supervisor/conf.d/groups.conf <<EOF
415414
programs=gitaly
416415
priority=5
417416
[group:gitlab]
418-
programs=unicorn,gitlab-workhorse
417+
programs=puma,gitlab-workhorse
419418
priority=10
420419
[group:gitlab_extensions]
421420
programs=sshd,nginx,mail_room,cron
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
2+
# Relative URL support
3+
# WARNING: We recommend using an FQDN to host GitLab in a root path instead
4+
# of using a relative URL.
5+
# Documentation: http://doc.gitlab.com/ce/install/relative_url.html
6+
# Uncomment and customize the following line to run in a non-root path
7+
#
8+
ENV['RAILS_RELATIVE_URL_ROOT'] = "{{GITLAB_RELATIVE_URL_ROOT}}"
9+
10+
# frozen_string_literal: true
11+
12+
# Load "path" as a rackup file.
13+
#
14+
# The default is "config.ru".
15+
#
16+
rackup 'config.ru'
17+
pidfile '{{GITLAB_INSTALL_DIR}}/tmp/pids/puma.pid'
18+
state_path '{{GITLAB_INSTALL_DIR}}/tmp/pids/puma.state'
19+
20+
stdout_redirect '{{GITLAB_INSTALL_DIR}}/log/puma.stdout.log',
21+
'{{GITLAB_INSTALL_DIR}}/log/puma.stderr.log',
22+
true
23+
24+
# Configure "min" to be the minimum number of threads to use to answer
25+
# requests and "max" the maximum.
26+
#
27+
# The default is "0, 16".
28+
#
29+
threads {{PUMA_THREADS_MIN}}, {{PUMA_THREADS_MAX}}
30+
31+
# By default, workers accept all requests and queue them to pass to handlers.
32+
# When false, workers accept the number of simultaneous requests configured.
33+
#
34+
# Queueing requests generally improves performance, but can cause deadlocks if
35+
# the app is waiting on a request to itself. See https://github.com/puma/puma/issues/612
36+
#
37+
# When set to false this may require a reverse proxy to handle slow clients and
38+
# queue requests before they reach puma. This is due to disabling HTTP keepalive
39+
queue_requests false
40+
41+
# Bind the server to "url". "tcp://", "unix://" and "ssl://" are the only
42+
# accepted protocols.
43+
bind 'unix:///home/git/gitlab/tmp/sockets/gitlab.socket'
44+
bind 'tcp://127.0.0.1:8080'
45+
46+
workers {{PUMA_WORKERS}}
47+
48+
require_relative "{{GITLAB_INSTALL_DIR}}/lib/gitlab/cluster/lifecycle_events"
49+
require_relative "{{GITLAB_INSTALL_DIR}}/lib/gitlab/cluster/puma_worker_killer_initializer"
50+
51+
on_restart do
52+
# Signal application hooks that we're about to restart
53+
Gitlab::Cluster::LifecycleEvents.do_before_master_restart
54+
end
55+
56+
before_fork do
57+
# Signal to the puma killer
58+
Gitlab::Cluster::PumaWorkerKillerInitializer.start @config.options unless ENV['DISABLE_PUMA_WORKER_KILLER']
59+
60+
# Signal application hooks that we're about to fork
61+
Gitlab::Cluster::LifecycleEvents.do_before_fork
62+
end
63+
64+
Gitlab::Cluster::LifecycleEvents.set_puma_options @config.options
65+
on_worker_boot do
66+
# Signal application hooks of worker start
67+
Gitlab::Cluster::LifecycleEvents.do_worker_start
68+
end
69+
70+
# Preload the application before starting the workers; this conflicts with
71+
# phased restart feature. (off by default)
72+
preload_app!
73+
74+
tag 'gitlab-puma-worker'
75+
76+
# Verifies that all workers have checked in to the master process within
77+
# the given timeout. If not the worker process will be restarted. Default
78+
# value is 60 seconds.
79+
#
80+
worker_timeout {{PUMA_TIMEOUT}}
81+
82+
# Use json formatter
83+
require_relative "{{GITLAB_INSTALL_DIR}}/lib/gitlab/puma_logging/json_formatter"
84+
85+
json_formatter = Gitlab::PumaLogging::JSONFormatter.new
86+
log_formatter do |str|
87+
json_formatter.call(str)
88+
end

0 commit comments

Comments
 (0)