the cagou
05/11/2025, 2:13 PM#!/usr/bin/bash
# vim ts=2 sw=2 expandtab
set -euo pipefail
info () {
printf -- "[*] %s\n" "$@"
}
warning () {
printf -- "[!] %s\n" "$@"
}
error () {
printf -- "[-] %s\n" "$@"
}
action () {
printf -- "[+] %s\n" "$@"
}
prefix="$(readlink -f "$(dirname "$0")")"
BUILDDIR="${BUILDDIR:-"$prefix"/build}"
RUBY="$(readlink -f "${RUBY:-$(which ruby)}")"
RUBY_VERSION="$("$RUBY" --version | awk '{print $2}')"
GEM_HOME="${GEM_HOME:-"$prefix"/cache/"${RUBY_VERSION}"}"
BUNDLE="$(readlink -f "${BUNDLE:-$(which bundle)}")"
VANAGON_ENGINE="${VANAGON_ENGINE:-docker}"
VANAGON_PLATFORM="${VANAGON_PLATFORM:-el-9-x86_64}"
info "Building openvox"
info " RUBY: $RUBY"
info "RUBY_VERSION: ${RUBY_VERSION}"
info " GEM_HOME: ${GEM_HOME}"
info " BUILDDIR: ${BUILDDIR}"
info " BUNDLE: $BUNDLE ($("$BUNDLE" version))"
info " GEMS SYS: $("$RUBY" -e 'puts Gem.default_dir')"
info " GEMS USER: $("$RUBY" -e 'puts Gem.user_dir')"
[ -d "${GEM_HOME}" ] || mkdir -p "${GEM_HOME}"
[ -d "${BUILDDIR}" ] || mkdir -p "${BUILDDIR}"
export GEM_HOME
# clone puppet-runtime
[ -d "$BUILDDIR"/puppet-runtime ] \
|| git clone <https://github.com/openvoxproject/puppet-runtime> "$BUILDDIR"/puppet-runtime
cd "$BUILDDIR"/puppet-runtime
"$BUNDLE" config set --path "$GEM_HOME"
"$BUNDLE" install
"$BUNDLE" exec vanagon build --engine "${VANAGON_ENGINE}" agent-runtime-main "${VANAGON_PLATFORM}"
I see that vanagon creates almalinux_9-linux_amd64-builder container installing default tools.
$ ./build.sh
[*] Building openvox
[*] RUBY: /usr/bin/ruby
[*] RUBY_VERSION: 3.4.3
[*] GEM_HOME: /srv/data/fccagou/src/OpenVox/openvox-build/cache/3.4.3
[*] BUILDDIR: /srv/data/fccagou/src/OpenVox/openvox-build/build
[*] BUNDLE: /usr/bin/bundle (Bundler version 2.6.7 (2025-05-11 commit unknown))
[*] GEMS SYS: /usr/lib/ruby/gems/3.4.0
[*] GEMS USER: /home/fccagou/.local/share/gem/ruby/3.4.0
Bundle complete! 8 Gemfile dependencies, 48 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
/srv/data/fccagou/src/OpenVox/openvox-build/cache/3.4.3/bundler/gems/vanagon-720f8a80fb8f/lib/vanagon/extensions/ostruct/json.rb:1: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
Executing '/usr/bin/docker exec almalinux_9-linux_amd64-builder /bin/sh -c 'dnf install -y --allowerasing autoconf automake cmake createrepo curl dnf-utils gcc gcc-c++ libarchive libtool make rpm-build rpm-libs rsync systemd which && dnf config-manager --set-enabled crb && dnf install -y --allowerasing perl perl-FindBin perl-Getopt-Long perl-lib libsepol libsepol-devel pkgconfig readline-devel rpmdevtools swig systemtap-sdt-devel yum-utils zlib-devel'' locally
...
Then it downloads source code and copy them to workdir but it fails because of timeout errors...
Looking in the code of vanagon, I see the Driver making projects using engine for platform.
• With docker engine, I don't yet understand if the downloads are done by vanagon on host or in the container using docker exec.
• I also don't find if there is a ruby version compatibility
Am I on the good way ?:P