2022年11月12日土曜日

GitLabバージョンアップ手順

GitLabはかなりの頻度でバージョンアップが繰り返しており、月1回新しいマイナーバージョンのリリースがされている状況となる。

例えば、直近(2022/11月時点)のバージョンリリースのタイミングは以下となる。毎月20日前後で新しいバージョンがリリースされていることがわかる。

バージョン リリース日
15.5 2022/10/21
15.4 2022/9/21
15.3 2022/8/19
15.2 2022/7/21
15.1 2022/6/21

以下サイトによると、GitLabのサポート期限はリリースから1年となっているようなので、定期的なバージョンアップ計画が必要となりそうだ。

上記をふまえ、本記事ではGitLabをバージョンアップする手順を記載する。

環境

今回の動作検証はAlmaLinux 8に対して実施した。ただし、Red Hat系のディストリビューションであるCentOSやRocky Linuxなどでも同様の手順で実施できるだろう。

  • OS : AlmaLinux 8.5
  • 旧バージョン : gitlab-ee-15.3.4-ee.0.el8.x86_64
  • 新バージョン : gitlab-ee-15.4.4-ee.0.el8.x86_64

また、GitLabのインストールは、以下記事の手順にてインストールを実施済みであることを前提とする。

GitLabバージョンアップ手順

1. バージョン選定

バージョンアップするにあたり、バージョンアップ対象バージョンの選定を行う。

パッチのリリース情報は、以下URLから確認することができる。

また、バージョンアップ時のアップグレードパスは、以下マニュアルに記載されている。

マニュアルでは以下の通りアップグレードパスが記載されており、例えば、15.0から最新版にバージョンアップする場合は、一度15.4.0を経由させてバージョンアップする必要がある。

8.11.Z -> 8.12.0 -> 8.17.7 -> 9.5.10 -> 10.8.7
-> 11.11.8 -> 12.0.12 -> 12.1.17 -> 12.10.14
-> 13.0.14 -> 13.1.11 -> 13.8.8 -> 13.12.15
-> 14.0.12 -> 14.3.6 -> 14.9.5 -> 14.10.Z
-> 15.0.Z -> 15.4.0 -> latest 15.Y.Z

今回は、15.3.4から15.4.4へのバージョンアップとなるため、直接バージョンアップが可能となる。

2. リポジトリ上に存在するGitLabのバージョン確認

dnfでそのままバージョンアップすると、最新版にバージョンアップされてしまう。特に確認せず最新版にバージョンアップする場合は本手順は不要だが、今回は特定のバージョンにバージョンアップするため、事前にGitLabのリポジトリに存在するGitLabのバージョン確認を行う。

バージョン確認は、dnf search時に--showduplicatesのオプションを付与して実行する。並び順がバージョン順とならない場合があるため、sortコマンドを使って表示をさせている。

実行結果は以下の通り。ターゲットバージョンであるgitlab-ee-15.4.4-ee.0.el8.x86_64が存在することが確認できた。

# dnf search --showduplicates gitlab-ee | sort
=========================== 名前 完全一致: gitlab-ee ===========================
gitlab-ee-12.10.0-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-12.10.1-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-12.10.10-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)

~(中略)~

gitlab-ee-15.3.0-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.3.1-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.3.2-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.3.3-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.3.4-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.3.4-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.3.5-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.4.0-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.4.1-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.4.2-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.4.3-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.4.4-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.5.0-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.5.1-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)
gitlab-ee-15.5.2-ee.0.el8.x86_64 : GitLab Enterprise Edition (including NGINX, Postgres, Redis)

3. バージョンを指定してバージョンアップ

GitLabのバージョンを指定する場合は、dnfのパッケージ名の指定時に、バージョンまで含めた名称で指定すればよい。GitLab 15.xは1.2GBほどの容量があるため、そこそこダウンロードとインストールに時間を要するので気長に待とう。

# dnf update gitlab-ee-15.4.4-ee.0.el8.x86_64
メタデータの期限切れの最終確認: 0:02:03 時間前の 2022年11月03日 14時48分39秒 に実施しました。
依存関係が解決しました。
====================================================================================================================================
 パッケージ                  アーキテクチャー         バージョン                           リポジトリー                       サイズ
====================================================================================================================================
アップグレード:
 gitlab-ee                   x86_64                   15.4.4-ee.0.el8                      gitlab_gitlab-ee                   1.2 G

トランザクションの概要
====================================================================================================================================
アップグレード  1 パッケージ

ダウンロードサイズの合計: 1.2 G

~(中略)~

ok: run: redis: (pid 1602) 456972s
ok: run: redis-exporter: (pid 832200) 0s
ok: run: sidekiq: (pid 832207) 1s

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


Upgrade complete! If your GitLab server is misbehaving try running
  sudo gitlab-ctl restart
before anything else.
If you need to roll back to the previous version you can use the database
backup made during the upgrade (scroll up for the filename).


  検証             : gitlab-ee-15.4.4-ee.0.el8.x86_64                                                                           1/2
  検証             : gitlab-ee-15.3.4-ee.0.el8.x86_64                                                                           2/2

アップグレード済み:
  gitlab-ee-15.4.4-ee.0.el8.x86_64

完了しました!

なお、バージョンアップ対象のGitLabのバージョンによっては、本体以外にも関連するパッケージのアップグレードや追加インストールが発生する。以下は、15.1.2 -> 15.3.4へバージョンアップした際のdnfの実行結果となり、本体以外にさまざまなパッケージが追加インストールされていることがわかる。

# dnf update gitlab-ee-15.3.4-ee.0.el8.x86_64
gitlab_gitlab-ee                                648  B/s | 862  B     00:01
gitlab_gitlab-ee-source                         316  B/s | 862  B     00:02
依存関係が解決しました。
================================================================================
 パッケージ                   Arch   バージョン          リポジトリー     サイズ
================================================================================
アップグレード:
 gitlab-ee                    x86_64 15.3.4-ee.0.el8     gitlab_gitlab-ee 1.1 G
 glibc                        x86_64 2.28-189.5.el8_6    baseos           2.2 M
 glibc-all-langpacks          x86_64 2.28-189.5.el8_6    baseos            25 M
 glibc-common                 x86_64 2.28-189.5.el8_6    baseos           1.3 M
依存関係のインストール:
 dwz                          x86_64 0.12-10.el8         appstream        108 k
 efi-srpm-macros              noarch 3-3.el8             appstream         21 k
 ghc-srpm-macros              noarch 1.4.2-7.el8         appstream        9.2 k
 glibc-gconv-extra            x86_64 2.28-189.5.el8_6    baseos           1.5 M

~(中略)~

 unzip                        x86_64 6.0-46.el8          baseos           195 k
 zip                          x86_64 3.0-23.el8          baseos           270 k
弱い依存関係のインストール:
 perl-Encode-Locale           noarch 1.05-10.module_el8.5.0+2812+ed912d05
                                                         appstream         20 k

トランザクションの概要
================================================================================
インストール    117 パッケージ
アップグレード    4 パッケージ

ダウンロードサイズの合計: 1.2 G

~(以下略)~

4. バージョンアップ後の確認

バージョンアップ後にGitLabにログインして、Adminの画面からバージョン確認をしてみよう。問題なくバージョンアップされていれば作業は完了となる。

以上で、GitLabをバージョンアップする手順は完了となる。

0 件のコメント:

コメントを投稿

人気の投稿