Skip to content

[UBI8] Fix backups: Install gzip in gitlab-rails

Clemens Beck requested to merge fix-missing-gzip-ubi8 into master

What does this MR do?

Install gzip in gitlab-rails

To create/extract backups gzip is required. The package was implicitly
installed until bootsnap cache generation was changed in
  https://gitlab.com/gitlab-org/build/CNG/-/merge_requests/1546.

Changelog: fixed

How was GZIP installed previously?

  1. Dive into a known image with gzip:

    dive registry.gitlab.com/gitlab-org/build/cng/gitlab-toolbox-ee:v16.4.1-ubi8 
  2. Check /usr/bin/gzip was added in the bootsnap layer:

    Layer info for gitlab-toolbox-ee:v16.4.1-ubi8:

    Size:   67MB
    Id:     12935afcce2a21219912e681aa12cec883258ee7cd8a09f7c410aa6af9883c53                                                                                                                                                                                
    Digest: sha256:79a674c028ab658805b40091a589f09e2c68d04aa45103f38530c3a5264df7b4
  3. This layer was removed in !1546 (merged).

Related issues

This fixes the following pipeline failure:

Errno::ENOENT: No such file or directory - gzip
/srv/gitlab/lib/backup/database.rb:106:in `spawn'
/srv/gitlab/lib/backup/database.rb:106:in `block (2 levels) in restore'
/srv/gitlab/lib/backup/database.rb:240:in `with_transient_pg_env'
/srv/gitlab/lib/backup/database.rb:104:in `block in restore'
/srv/gitlab/lib/backup/database.rb:79:in `each'
/srv/gitlab/lib/backup/database.rb:79:in `restore'
/srv/gitlab/lib/backup/manager.rb:105:in `run_restore_task'
/srv/gitlab/lib/tasks/gitlab/backup.rake:33:in `block in restore_task'
/srv/gitlab/lib/tasks/gitlab/backup.rake:62:in `lock_backup'
/srv/gitlab/lib/tasks/gitlab/backup.rake:32:in `restore_task'
/srv/gitlab/lib/tasks/gitlab/backup.rake:126:in `block (4 levels) in <main>'
/srv/gitlab/vendor/bundle/ruby/3.0.0/gems/sentry-ruby-5.8.0/lib/sentry/rake.rb:26:in `execute'
/srv/gitlab/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/srv/gitlab/bin/bundle:5:in `load'
/srv/gitlab/bin/bundle:5:in `<main>'
Tasks: TOP => gitlab:backup:db:restore
(See full trace by running task with --trace)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
  • New dependencies are managed with dependencies.io
Edited by Jason Plum

Merge request reports