Skip to content
Snippets Groups Projects

Document requirement for ZStandard compression

Merged Philipp Hahn requested to merge univention/gitlab:zstd into master
All threads resolved!

What does this MR do and why?

Document requirement to support ZStandard compression for Debian binary packages.

Since dpkg 1.21.18 compression zstd is supported. It is used by default since Ubuntu 21.10. The Gitlab Debian package registry will not recognize such binary packages as valid and fails with

Invalid Package: failed metadata extraction

Document requirement to support zstd.

#422584

Screenshots or screen recordings

How to set up and validate locally

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Philipp Hahn

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • changed milestone to %16.4

    • Author Contributor
      Resolved by Philipp Hahn

      Actually my patch is wrong (or incomplete):

      • I changed app/services/packages/debian/extract_metadata_service.rb # file_type_source, which allows ZStandard for source packages. The compression algorithm for source packages is controlled by dpkg-source -Z….
      • but app/services/packages/debian/extract_deb_metadata_service.rb # cmd uses Popen(…) to invoke the external dpkg --field binary to extract the fields from any binary package. Gitlab.config.packages.dpkg_deb_path defaults to /usr/bin/dpkg-deb, so it is the version from our own on-premise installation (currently Debian 10.13 Buster). Even the version from Debian 11.7 Bullseye is too old to support ZStandard. Only the version from Debian 12 Bookworm supports it (or the equivalent from Ubuntu). The compression algorithm for binary packages is controlled by dpkg-deb -Z….

      As I'm a Debian Developer myself I also did some more research on dpkg and the supported compression algorithms:

      compress since deprecation Year Debian Ubuntu
      none 1.10.24 2004 3.1 Sarge
      gzip
      bzip2 1.10.24 1.18.11 2004 3.1 Sarge
      lzma 1.13.25 1.18.11 2007 4 Etch
      xz 1.15.6 2010 6 Squeeze
      zstd 1.21.18 2023 12 Bookworm 18.04 Bionic

      bzip2 and lzma have been deprecated by Debian for building binary packages, but extracting existing packages and source files is still supported. But as you can still use older versions of dpkg itself to build Debian packages, Gitlab should still support these deprecated algorithms as Debian does for extraction.

      So support for ZStandard depends on the version of Debian package dpkg installed on the Gitlab host/cluster/environment: Ubuntu supports it since 2018, Debian only since 2023. I see multiple options:

      1. Document that requirement: Support for "ZStandard" compressed Debian binary packages depends on the version of dpkg-deb available to Gitlab; the path to the binary can be configured in gitlab.yml via packages.dpkg_deb_path.
      2. Ship a new enough version of dpkg with Gitlab, but that will require shipping several shared libraries like libz, liblzma, libbz2, libzstd, …
      3. Find a replacement for calling the external dpkg-deb by Popen(): I'm no ruby developer myself but maybe there is one ruby gem to work with Debian binary packages natively; for Python there is PyPI:python-debian. The Debian binary package format is quiet simple, but handling the different compression formats may be the tricky part.
      Edited by Philipp Hahn
  • Philipp Hahn added 5 commits

    added 5 commits

    • 06400ff5 - Document requirement for Debian compression zstd
    • 3ee41ddc - Document Debian codename is string
    • c866c222 - Document Debian architectures/components are string arrays
    • a513711e - Document Debian codename vs. suite
    • 99d8b211 - Document Debian apt usage

    Compare with previous version

  • Philipp Hahn added 5 commits

    added 5 commits

    • 7f7f889a - Document requirement for Debian compression zstd
    • e79251ab - Document Debian codename is string
    • a1d2dec4 - Document Debian architectures/components are string arrays
    • b88f8ec7 - Document Debian codename vs. suite
    • 809b03c9 - Document Debian apt usage

    Compare with previous version

  • Philipp Hahn resolved all threads

    resolved all threads

  • Author Contributor
    • drop initial patch because it was wrong
    • document requirement for supporting ZStandard
    • update documentation related to Debian package registry in Gitlab
  • requested review from @dmeshcharakou

  • Hi @phillipwells! Please review this documentation merge request. This message was generated automatically. You're welcome to improve it.

  • requested review from @phillipwells

  • @sathieu @phillipwells @dmeshcharakou, this Community contribution is ready for review.

    • Do you have capacity and domain expertise to review this? We are mindful of your time, so if you are not able to take this on, please re-assign to one or more other reviewers.
    • Add the workflowin dev label if the merge request needs action from the author.

    This message was generated automatically. You're welcome to improve it.

  • Philipp Hahn marked this merge request as draft

    marked this merge request as draft

  • Philipp Hahn marked this merge request as ready

    marked this merge request as ready

  • Philipp Hahn changed the description

    changed the description

  • Author Contributor

    I just verified it again that zstd it not yet supported for source packages:

    docker run --rm -ti -v $PWD:/work -w /work ubuntu:22.04
    apt update
    apt install --no-install-recommends dpkg-dev
    dpkg --version
    # Debian 'dpkg' package management program version 1.21.1 (amd64).
    dpkg-source -b hello-1.1
    # dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../hello_1.1.orig.tar.{bz2,gz,lzma,xz}
    cat hello-1.1/debian/source/format 
    # 3.0 (quilt)
    ls -1d hello*
    # hello-1.1
    # hello_1.1.orig.tar.zst
    Edited by Philipp Hahn
  • @pmhahn Thanks for the contribution! I've left a handful of suggestions from a Technical Writing perspective. Once you've given them a review, feel free to @mention me so I can take a final look :smile:

  • Phillip Wells removed review request for @phillipwells

    removed review request for @phillipwells

  • Philipp Hahn added 5 commits

    added 5 commits

    • 464fbb5a - Document requirement for Debian compression zstd
    • 7fc1d601 - Document Debian codename is string
    • fa9cc814 - Document Debian architectures/components are string arrays
    • 4e3e5f28 - Document Debian codename vs. suite
    • abe3b6f5 - Document Debian apt usage

    Compare with previous version

  • Philipp Hahn resolved all threads

    resolved all threads

  • Philipp Hahn changed title from feat(Debian): support zstd compression to Document requirement to support ZStandard compression for Debian binary packages

    changed title from feat(Debian): support zstd compression to Document requirement to support ZStandard compression for Debian binary packages

  • Philipp Hahn changed the description

    changed the description

  • Phillip Wells requested review from @phillipwells

    requested review from @phillipwells

  • Philipp Hahn added 1 commit

    added 1 commit

    • ea4e4787 - fixup! Document requirement for Debian compression zstd

    Compare with previous version

  • Philipp Hahn marked this merge request as draft from univention/gitlab@ea4e4787

    marked this merge request as draft from univention/gitlab@ea4e4787

  • Author Contributor

    Applied all suggestions from @phillipwells :clap:, squashed and --force pushed.

  • Philipp Hahn marked this merge request as ready

    marked this merge request as ready

  • Philipp Hahn added 5 commits

    added 5 commits

    • 1a70999c - Document requirement for Debian compression zstd
    • 3edfd4b1 - Document Debian codename is string
    • dd4201f7 - Document Debian architectures/components are string arrays
    • 41bc9703 - Document Debian codename vs. suite
    • 0cbc3005 - Document Debian apt usage

    Compare with previous version

  • Dzmitry (Dima) Meshcharakou approved this merge request

    approved this merge request

  • removed review request for @dmeshcharakou

  • Phillip Wells resolved all threads

    resolved all threads

  • Everything looks good from my perspective, so I'll approve and set to merge! Thanks again, @pmhahn

  • Phillip Wells approved this merge request

    approved this merge request

  • Phillip Wells enabled an automatic merge when the pipeline for 7062249c succeeds

    enabled an automatic merge when the pipeline for 7062249c succeeds

  • Contributor
    1 Message
    :book: This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge.

    Documentation review

    The following files require a review from a technical writer:

    The review does not need to block merging this merge request. See the:

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

  • Phillip Wells changed title from Document requirement to support ZStandard compression for Debian binary packages to Document requirement for ZStandard compression

    changed title from Document requirement to support ZStandard compression for Debian binary packages to Document requirement for ZStandard compression

  • merged

  • @pmhahn, how was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:

    1. React with a :thumbsup: or a :thumbsdown: on this comment to describe your experience.
    2. Create a new comment starting with @gitlab-bot feedback below, and leave any additional feedback you have for us in the comment.

    Interested in learning more tips and tricks to solve your next challenge faster? Subscribe to the GitLab Community Newsletter for contributor-focused content and opportunities to level up.

    Thanks for your help! :heart:

    This message was generated automatically. You're welcome to improve it.

  • @pmhahn, congratulations for getting your first MR merged :tada:

    If this is your first MR against a GitLab project, we'd like to invite and encourage you to self-nominate yourself for First MR Merged swag prize here.

    Thank you again for contributing, what's your next contribution going to be? :thinking:

    This message was generated automatically. You're welcome to improve it.

  • Phillip Wells mentioned in commit 555d7429

    mentioned in commit 555d7429

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading