-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RPM/DEB] Changes to binary distribution #6638
base: main
Are you sure you want to change the base?
Conversation
…agent into feat/binary-distr
…agent into feat/binary-rpm
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Quality Gate failedFailed conditions |
We have integration tests for these packages that should be updated to verify this works properly:
Is an environment variable the canonical way to provide options to these package types? If we do something that doesn't follow the system convention we'll be explaining it forever. |
An env var is NOT what you would expect. For both RPM & DEB you would expect multiple RPM & DEB files that are built from the same source. I would expect 2 RPM & DEB files, one that installs the minimal, and one that installs the extra components. The extra components one would depend on the minimal. Any upgrade scenario would upgrade both. vim is a good example. RPMYou can install $ rpm -ql vim-minimal
/etc/virc
/usr/bin/ex
/usr/bin/rvi
/usr/bin/rview
/usr/bin/vi
/usr/bin/view
/usr/lib/.build-id
/usr/lib/.build-id/5c
/usr/lib/.build-id/5c/ca9c420c7d69ce13f7cfe7ea0e7fdc7c18bc3f
/usr/libexec/vi
/usr/share/man/man1/ex.1.gz
/usr/share/man/man1/rvi.1.gz
/usr/share/man/man1/rview.1.gz
/usr/share/man/man1/vi.1.gz
/usr/share/man/man1/view.1.gz
/usr/share/man/man5/virc.5.gz If you then want a more "full" vim experience you install $ rpm -ql vim-enhanced
/usr/bin/rvim
/usr/bin/vim
/usr/bin/vimdiff
/usr/bin/vimtutor
/usr/lib/.build-id
/usr/lib/.build-id/cc
/usr/lib/.build-id/cc/b0b26d3af0feb447e3f786a6b7be4f79f854bd But both of these are built from the same RPM source: vim-minimal $ dnf info vim-minimal
Last metadata expiration check: 0:00:40 ago on Fri 31 Jan 2025 03:49:34 PM CST.
Installed Packages
Name : vim-minimal
Epoch : 2
Version : 8.2.2637
Release : 21.el9
Architecture : aarch64
Size : 1.4 M
Source : vim-8.2.2637-21.el9.src.rpm
Repository : @System
From repo : baseos
Summary : A minimal version of the VIM editor
URL : http://www.vim.org/
License : Vim and MIT
Description : VIM (VIsual editor iMproved) is an updated and improved version of the
: vi editor. Vi was the first real screen-based editor for UNIX, and is
: still very popular. VIM improves on vi by adding new features:
: multiple windows, multi-level undo, block highlighting and more. The
: vim-minimal package includes a minimal version of VIM, providing
: the commands vi, view, ex, rvi, and rview. NOTE: The online help is
: only available when the vim-common package is installed. vim-enhanced $ dnf info vim-enhanced
Last metadata expiration check: 0:00:29 ago on Fri 31 Jan 2025 03:49:34 PM CST.
Available Packages
Name : vim-enhanced
Epoch : 2
Version : 8.2.2637
Release : 21.el9
Architecture : aarch64
Size : 1.7 M
Source : vim-8.2.2637-21.el9.src.rpm
Repository : appstream
Summary : A version of the VIM editor which includes recent enhancements
URL : http://www.vim.org/
License : Vim and MIT
Description : VIM (VIsual editor iMproved) is an updated and improved version of the
: vi editor. Vi was the first real screen-based editor for UNIX, and is
: still very popular. VIM improves on vi by adding new features:
: multiple windows, multi-level undo, block highlighting and more. The
: vim-enhanced package contains a version of VIM with extra, recently
: introduced features like Python and Perl interpreters.
:
: Install the vim-enhanced package if you'd like to use a version of the
: VIM editor which includes recently added enhancements like
: interpreters for the Python and Perl scripting languages. You'll also
: need to install the vim-common package. DebYou can install dpkg -L vim-tiny
/.
/etc
/etc/vim
/etc/vim/vimrc.tiny
/usr
/usr/bin
/usr/bin/vim.tiny
/usr/share
/usr/share/bug
/usr/share/bug/vim-tiny
/usr/share/bug/vim-tiny/presubj
/usr/share/bug/vim-tiny/script
/usr/share/doc
/usr/share/doc/vim-tiny
/usr/share/doc/vim-tiny/changelog.Debian.gz
/usr/share/doc/vim-tiny/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/vim-tiny
/usr/share/vim
/usr/share/vim/vim91
/usr/share/vim/vim91/doc
/usr/share/vim/vim91/doc/README.Debian
/usr/share/vim/vim91/doc/help.txt
diverted by vim-runtime to: /usr/share/vim/vim91/doc/help.txt.vim-tiny
/usr/share/vim/vim91/doc/tags
diverted by vim-runtime to: /usr/share/vim/vim91/doc/tags.vim-tiny If you want the full vim experience you would install $ dpkg -L vim-nox
/.
/usr
/usr/bin
/usr/bin/vim.nox
/usr/share
/usr/share/bug
/usr/share/bug/vim-nox
/usr/share/bug/vim-nox/presubj
/usr/share/bug/vim-nox/script
/usr/share/doc
/usr/share/doc/vim-nox
/usr/share/doc/vim-nox/changelog.Debian.gz
/usr/share/doc/vim-nox/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/vim-nox Deb packages use the alternates system to set symlink so But as you can see from the vim-tiny $ apt info vim-tiny
Package: vim-tiny
Version: 2:9.1.0016-1ubuntu7.6
Priority: important
Section: editors
Source: vim
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Vim Maintainers <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1,850 kB
Provides: editor
Depends: vim-common (= 2:9.1.0016-1ubuntu7.6), libacl1 (>= 2.2.23), libc6 (>= 2.34), libselinux1 (>= 3.1~), libtinfo6 (>= 6)
Suggests: indent
Homepage: https://www.vim.org/
Task: minimal
Download-Size: 770 kB
APT-Manual-Installed: no
APT-Sources: http://ports.ubuntu.com/ubuntu-ports noble-updates/main arm64 Packages
Description: Vi IMproved - enhanced vi editor - compact version
Vim is an almost compatible version of the UNIX editor Vi.
.
This package contains a minimal version of Vim compiled with no GUI and
a small subset of features. This package's sole purpose is to provide
the vi binary for base installations.
.
If a vim binary is wanted, try one of the following more featureful
packages: vim, vim-nox, vim-motif, or vim-gtk3. vim-nox $ apt info vim-nox
Package: vim-nox
Version: 2:9.1.0016-1ubuntu7.6
Priority: extra
Section: universe/editors
Source: vim
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Vim Maintainers <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 4,950 kB
Provides: editor, vim (= 2:9.1.0016-1ubuntu7.6), vim-lua (= 2:9.1.0016-1ubuntu7.6), vim-perl (= 2:9.1.0016-1ubuntu7.6), vim-python3 (= 2:9.1.0016-1ubuntu7.6), vim-ruby (= 2:9.1.0016-1ubuntu7.6), vim-tcl (= 2:9.1.0016-1ubuntu7.6)
Depends: vim-common (= 2:9.1.0016-1ubuntu7.6), vim-runtime (= 2:9.1.0016-1ubuntu7.6), libacl1 (>= 2.2.23), libc6 (>= 2.38), libgpm2 (>= 1.20.7), liblua5.1-0, libperl5.38t64 (>= 5.38.2), libpython3.12t64 (>= 3.12.1), libruby3.2 (>= 3.2.2), libselinux1 (>= 3.1~), libsodium23 (>= 1.0.14), libtcl8.6 (>= 8.6.0), libtinfo6 (>= 6)
Suggests: cscope, vim-doc
Homepage: https://www.vim.org/
Download-Size: 2,040 kB
APT-Manual-Installed: yes
APT-Sources: http://ports.ubuntu.com/ubuntu-ports noble-updates/universe arm64 Packages
Description: Vi IMproved - enhanced vi editor - with scripting languages support
Vim is an almost compatible version of the UNIX editor Vi.
.
Many new features have been added: multi level undo, syntax
highlighting, command line history, on-line help, filename
completion, block operations, folding, Unicode support, etc.
.
This package contains a version of vim compiled with support for
scripting with Lua, Perl, Python 3, Ruby, and Tcl but no GUI. |
What does this PR do?
Fixes behavior for RPM
This takes a bit different approach as we cannot control what's being copied over during installations.
Before install we mark desired flavor into flavor file.
After install we execute new undocumented command
apply-flavor
that removes all unnecessary component from current version home.Why is it important?
Reducing space on disk by omitting not needed components.
Checklist
./changelog/fragments
using the changelog toolHow to test
DEB
install scenario
dpkg -i elastic-agent-{rest of filename}.deb
cat /var/lib/elastic-agent/.flavor
(expected basic)ls -la /var/lib/elastic-agent/data/elastic-agent-*/componentes
expected limited setELASTIC_AGENT_FLAVOR=servers dpkg -i elastic-agent-{rest of filename}.deb
cat /var/lib/elastic-agent/.flavor
(expected servers)ls -la /var/lib/elastic-agent/data/elastic-agent-*/componentes
expected apm fleet-server presentupgrade scenario
compile deb
install 8.17.2 snapshot
dpkg -i elastic-agent-{rest of filename}.deb
cat /var/lib/elastic-agent/.flavor
(expected file not found)ls -la /var/lib/elastic-agent/data/elastic-agent-*/componentes
expected whole setinstall 9.0.0 snapshot
dpkg -i elastic-agent-{rest of filename}.deb
cat /var/lib/elastic-agent/.flavor
expected not foundls -la /var/lib/elastic-agent/data/elastic-agent-*/componentes
expected whole setuninstall and purge
compile additional deb with different hash
install additional deb
ELASTIC_AGENT_FLAVOR=servers dpkg -i elastic-agent-{rest of filename}.deb
cat /var/lib/elastic-agent/.flavor
(expected servers)ls -la /var/lib/elastic-agent/data/elastic-agent-*/componentes
expected servers setinstall original build
dpkg -i elastic-agent-{rest of filename}.deb
cat /var/lib/elastic-agent/.flavor
expected serversls -la /var/lib/elastic-agent/data/elastic-agent-*/componentes
expected servers setsame steps for rpm but use yum
Fixes: #6637