Skip to content
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

Distribution packaging changes #228

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Conversation

ddiss
Copy link
Collaborator

@ddiss ddiss commented Sep 21, 2023

An attempt to address #204 . Packages based on this RFC can be found at:
https://build.opensuse.org/package/show/home:dmdiss:rapido/rapido

The following changes since commit 7a71765ebcf2302962c7ec89432999f6400e73b0:

  autorun/ceph: load rbd module prior to sysfs IO (2023-09-11 12:31:33 +0200)

are available in the Git repository at:

  https://github.com/ddiss/rapido.git distro_pkg

for you to fetch changes up to 9eba94f75bca048a28b2d355060afd73f2e8edc0:

  tools/bash_completion: support rapido binary in PATH (2023-09-21 16:40:37 +0200)

----------------------------------------------------------------
David Disseldorp (4):
      build: add Makefile for install target
      build: generate and install /etc/rapido/rapido.conf
      runtime: use /etc/rapido/rapido.conf RAPIDO_CONF if present
      tools/bash_completion: support rapido binary in PATH

 Makefile              | 42 ++++++++++++++++++++++++++++++++++++++++++
 runtime.vars          |  8 ++++++--
 tools/bash_completion |  4 ++--
 3 files changed, 50 insertions(+), 4 deletions(-)
 create mode 100644 Makefile

Useful for distribution packages. May also come in handy in future if we
add some things that require compilation.

Signed-off-by: David Disseldorp <[email protected]>
Use sed to explicitly set VM_NET_CONF="/etc/rapido/net-conf",
QEMU_PID_DIR="$PWD" and DRACUT_OUT="${PWD}/rapido.cpio" to avoid
default behaviour of dumping everything under RAPIDO_DIR.

This approach has a few downsides, which probably should be further
discussed:
- /etc/rapido/rapido.conf implies a system wide configuration, with
  root access required for config changes
  + we normally try to avoid any root requirements
  + the RAPIDO_CONF env override can still be used, but it might make
    more sense to default to $HOME/.config/rapido/*conf , but that would
    require explicit configuration from the user.
  + split system and user config files might work, but would complicate
    logic further, especially WRT propagating the configuration into the
    VM images.
- $PWD usage for dracut output and VM pid state might be confusing and
  scatter garbage all over the place. /tmp/rapido-$user might be a
  better spot for this.

Signed-off-by: David Disseldorp <[email protected]>
If $RAPIDO_CONF is unset on invocation then use /etc/rapido/rapido.conf
as the default if it exists, otherwise use the until-now-default
${RAPIDO_DIR}/rapido.conf .

Signed-off-by: David Disseldorp <[email protected]>
Distribution packages will have a rapido binary symlink in $PATH:
  /usr/bin/rapido -> /usr/lib/rapido/rapido

cut scripts will be installed under /usr/lib/rapido/cut , so we
need to use "realpath -e" to work back from the $PATH binary.

Signed-off-by: David Disseldorp <[email protected]>
Fix OBS sourced-script-with-shebang error.

Signed-off-by: David Disseldorp <[email protected]>
@ddiss ddiss marked this pull request as draft September 21, 2023 22:50
ddiss added 3 commits October 6, 2023 20:13
When rapido is run from $PATH then $0 doesn't correspond to a file path.
$BASH_SOURCE provides the source file path when run via $PATH (for
distro packages) as well as explicit file path (for git clones).

Signed-off-by: David Disseldorp <[email protected]>
Rapido doesn't use working-directory relative paths, but is moving
towards supporting such paths for distribution packages, e.g.:
  DRACUT_OUT="${PWD}/rapido.cpio"

With such a configuration, cut scripts prior to this change will
attempt to write out the initramfs image under /usr/lib/rapido/.

Signed-off-by: David Disseldorp <[email protected]>
The previous attempt assumed the $1 completion parameter corresponded to
a path, which is completely incorrect. Instead, just check whether local
./rapido and ./cut/ presence indicates a git clone, or fallback to
distro paths.

Signed-off-by: David Disseldorp <[email protected]>
@ddiss
Copy link
Collaborator Author

ddiss commented Jan 18, 2024

I'm going to close this one for now, as the branch is getting a little stale, and I'm still not sure how useful it'd be to have distro packages: I expect I'll always be running from a git checkout, but maybe I'd use this for CI jobs (shrug).

@ddiss ddiss closed this Jan 18, 2024
@Werkov
Copy link
Collaborator

Werkov commented Jan 18, 2024

FTR, Dockerfiles in OBS can do both.
I use RPM currently (but can revert if you discontinue RPM).

@ddiss
Copy link
Collaborator Author

ddiss commented Jan 18, 2024

FTR, Dockerfiles in OBS can do both. I use RPM currently (but can revert if you discontinue RPM).

Ah okay, are your rpms based on these changes? If so I'll rebase this branch and start cleaning it up a bit.

@Werkov
Copy link
Collaborator

Werkov commented Jan 18, 2024 via email

@ddiss
Copy link
Collaborator Author

ddiss commented Jan 18, 2024

They're based on [1] ¯_(ツ)_/¯ At the same time, you don't have to keep RPMs because of me. I will likely notice when I rebuild the container and your OBS project is gone ;-) [1] https://build.opensuse.org/package/show/home:dmdiss:rapido/rapido

All good, will reopen as draft and put this on my queue... I was somehow under the impression that nobody was using / interested in it. I'll try to let you know if I make any breaking changes against what's already in the obs.

@ddiss ddiss reopened this Jan 18, 2024
@ddiss
Copy link
Collaborator Author

ddiss commented Nov 26, 2024

Looking back through the changes here, I should be able to start merging some of the simple standalone changes as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants