canonical / chisel-releases

36 stars 51 forks source link

feat(24.04): add rabbitmq slices #258

Open linostar opened 5 months ago

linostar commented 5 months ago

Proposed changes

Add rabbitmq-server and librabbitmq4 slices to 24.04.

Note that erlang* and logrotate packages are not available for i386 arch, so they have been commented out.

Related issues/PRs

N/A

Forward porting

N/A

Testing

chisel cut --release ./ --root rootfs rabbitmq-server_bins                                                                                                                                        

2024/06/13 11:27:35 Processing ./ release...
2024/06/13 11:27:36 Selecting slices...
2024/06/13 11:27:36 Fetching ubuntu 24.04 noble suite details...
2024/06/13 11:27:38 Release date: Thu, 25 Apr 2024 15:10:33 UTC
2024/06/13 11:27:38 Fetching index for ubuntu 24.04 noble main component...
2024/06/13 11:27:38 Fetching index for ubuntu 24.04 noble universe component...
2024/06/13 11:27:38 Fetching ubuntu 24.04 noble-security suite details...
2024/06/13 11:27:39 Release date: Wed, 12 Jun 2024 13:31:47 UTC
2024/06/13 11:27:39 Fetching index for ubuntu 24.04 noble-security main component...
2024/06/13 11:27:39 Fetching index for ubuntu 24.04 noble-security universe component...
2024/06/13 11:27:39 Fetching ubuntu 24.04 noble-updates suite details...
2024/06/13 11:27:39 Release date: Thu, 13 Jun 2024  7:51:49 UTC
2024/06/13 11:27:39 Fetching index for ubuntu 24.04 noble-updates main component...
2024/06/13 11:27:39 Fetching index for ubuntu 24.04 noble-updates universe component...
2024/06/13 11:27:39 Fetching pool/main/a/adduser/adduser_3.137ubuntu1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/a/audit/libaudit-common_3.1.2-2.1build1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/g/glibc/libc6_2.39-0ubuntu8.2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libc/libcap-ng/libcap-ng0_0.8.4-2build2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/a/audit/libaudit1_3.1.2-2.1build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libx/libxcrypt/libcrypt1_4.4.36-4build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/d/debconf/debconf_1.5.86ubuntu1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/p/pam/libpam-modules-bin_1.5.3-5ubuntu5.1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/pam/libpam0g_1.5.3-5ubuntu5.1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/pcre2/libpcre2-8-0_10.42-4ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libs/libselinux/libselinux1_3.5-2ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libc/libcap2/libcap2_2.66-5ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libg/libgpg-error/libgpg-error0_1.47-3build2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libg/libgcrypt20/libgcrypt20_1.10.3-2build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/l/lz4/liblz4-1_1.9.4-1build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/x/xz-utils/liblzma5_5.6.1+really5.4.5-1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libz/libzstd/libzstd1_1.5.5+dfsg2-2build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/s/systemd/libsystemd0_255.4-1ubuntu8.1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/pam/libpam-modules_1.5.3-5ubuntu5.1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/b/bzip2/libbz2-1.0_1.0.8-5.1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libs/libsemanage/libsemanage-common_3.5-1build5_all.deb...
2024/06/13 11:27:39 Fetching pool/main/libs/libsepol/libsepol2_3.5-2build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libs/libsemanage/libsemanage2_3.5-1build5_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/s/shadow/passwd_4.13+dfsg1-4ubuntu3_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/c/cron/cron-daemon-common_3.0pl1-184ubuntu2_all.deb...
2024/06/13 11:27:39 Fetching pool/main/c/cron/cron_3.0pl1-184ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/i/init-system-helpers/init-system-helpers_1.66ubuntu1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/p/pam/libpam-runtime_1.5.3-5ubuntu5.1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/s/sensible-utils/sensible-utils_0.0.22_all.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-base_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/g/gcc-14/libgcc-s1_14-20240412-0ubuntu1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/g/gcc-14/libstdc++6_14-20240412-0ubuntu1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/n/ncurses/libtinfo6_6.4+20240113-1ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/n/ncurses/libncursesw6_6.4+20240113-1ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/procps/libproc2-0_4.0.4-4ubuntu3_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/procps/procps_4.0.4-4ubuntu3_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-asn1_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/o/openssl/libssl3t64_3.0.13-0ubuntu3.1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-crypto_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-public-key_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-mnesia_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-runtime-tools_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-ssl_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-eldap_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-ftp_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-inets_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-tftp_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-snmp_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-os-mon_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-parsetools_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-syntax-tools_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-tools_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/erlang/erlang-xmerl_25.3.2.8+dfsg-1ubuntu4_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/a/acl/libacl1_2.3.2-1build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/d/db5.3/libdb5.3t64_5.3.28+dfsg2-7_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/e/expat/libexpat1_2.6.1-2build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/libf/libffi/libffi8_3.4.6-1build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/popt/libpopt0_1.19+dfsg-1build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/python3.12/libpython3.12-minimal_3.12.3-1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/m/media-types/media-types_10.1.0_all.deb...
2024/06/13 11:27:39 Fetching pool/main/n/netbase/netbase_6.4_all.deb...
2024/06/13 11:27:39 Fetching pool/main/p/python3.12/libpython3.12-stdlib_3.12.3-1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/r/readline/readline-common_8.2-4build1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/r/readline/libreadline8t64_8.2-4build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/s/sqlite3/libsqlite3-0_3.45.1-1ubuntu2_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/t/tzdata/tzdata_2024a-3ubuntu1.1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/t/tcp-wrappers/libwrap0_7.6.q-33_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/l/logrotate/logrotate_3.21.0-2build1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/o/openssl/openssl_3.0.13-0ubuntu3.1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/python3.12/python3.12-minimal_3.12.3-1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/p/python3.12/python3.12_3.12.3-1_amd64.deb...
2024/06/13 11:27:39 Fetching pool/main/r/rabbitmq-server/rabbitmq-server_3.12.1-1ubuntu1_all.deb...
2024/06/13 11:27:39 Fetching pool/main/s/socat/socat_1.8.0.0-4build3_amd64.deb...
2024/06/13 11:27:39 Extracting files from package "adduser"...
2024/06/13 11:27:39 Extracting files from package "libaudit-common"...
2024/06/13 11:27:39 Extracting files from package "libc6"...
2024/06/13 11:27:39 Extracting files from package "libcap-ng0"...
2024/06/13 11:27:39 Extracting files from package "libaudit1"...
2024/06/13 11:27:39 Extracting files from package "libcrypt1"...
2024/06/13 11:27:39 Extracting files from package "debconf"...
2024/06/13 11:27:39 Extracting files from package "libpam-modules-bin"...
2024/06/13 11:27:39 Extracting files from package "libpam0g"...
2024/06/13 11:27:39 Extracting files from package "libpcre2-8-0"...
2024/06/13 11:27:39 Extracting files from package "libselinux1"...
2024/06/13 11:27:39 Extracting files from package "libcap2"...
2024/06/13 11:27:39 Extracting files from package "libgpg-error0"...
2024/06/13 11:27:39 Extracting files from package "libgcrypt20"...
2024/06/13 11:27:39 Extracting files from package "liblz4-1"...
2024/06/13 11:27:39 Extracting files from package "liblzma5"...
2024/06/13 11:27:39 Extracting files from package "libzstd1"...
2024/06/13 11:27:39 Extracting files from package "libsystemd0"...
2024/06/13 11:27:39 Extracting files from package "libpam-modules"...
2024/06/13 11:27:39 Extracting files from package "libbz2-1.0"...
2024/06/13 11:27:39 Extracting files from package "libsemanage-common"...
2024/06/13 11:27:39 Extracting files from package "libsepol2"...
2024/06/13 11:27:39 Extracting files from package "libsemanage2"...
2024/06/13 11:27:39 Extracting files from package "passwd"...
2024/06/13 11:27:39 Extracting files from package "cron-daemon-common"...
2024/06/13 11:27:39 Extracting files from package "cron"...
2024/06/13 11:27:39 Extracting files from package "init-system-helpers"...
2024/06/13 11:27:39 Extracting files from package "libpam-runtime"...
2024/06/13 11:27:39 Extracting files from package "sensible-utils"...
2024/06/13 11:27:39 Extracting files from package "erlang-base"...
2024/06/13 11:27:39 Extracting files from package "libgcc-s1"...
2024/06/13 11:27:39 Extracting files from package "libstdc++6"...
2024/06/13 11:27:39 Extracting files from package "libtinfo6"...
2024/06/13 11:27:39 Extracting files from package "libncursesw6"...
2024/06/13 11:27:39 Extracting files from package "libproc2-0"...
2024/06/13 11:27:39 Extracting files from package "procps"...
2024/06/13 11:27:39 Extracting files from package "zlib1g"...
2024/06/13 11:27:39 Extracting files from package "erlang-asn1"...
2024/06/13 11:27:39 Extracting files from package "libssl3t64"...
2024/06/13 11:27:39 Extracting files from package "erlang-crypto"...
2024/06/13 11:27:39 Extracting files from package "erlang-public-key"...
2024/06/13 11:27:39 Extracting files from package "erlang-mnesia"...
2024/06/13 11:27:40 Extracting files from package "erlang-runtime-tools"...
2024/06/13 11:27:40 Extracting files from package "erlang-ssl"...
2024/06/13 11:27:40 Extracting files from package "erlang-eldap"...
2024/06/13 11:27:40 Extracting files from package "erlang-ftp"...
2024/06/13 11:27:40 Extracting files from package "erlang-inets"...
2024/06/13 11:27:40 Extracting files from package "erlang-tftp"...
2024/06/13 11:27:40 Extracting files from package "erlang-snmp"...
2024/06/13 11:27:40 Extracting files from package "erlang-os-mon"...
2024/06/13 11:27:40 Extracting files from package "erlang-parsetools"...
2024/06/13 11:27:40 Extracting files from package "erlang-syntax-tools"...
2024/06/13 11:27:40 Extracting files from package "erlang-tools"...
2024/06/13 11:27:40 Extracting files from package "erlang-xmerl"...
2024/06/13 11:27:40 Extracting files from package "libacl1"...
2024/06/13 11:27:40 Extracting files from package "libdb5.3t64"...
2024/06/13 11:27:40 Extracting files from package "libexpat1"...
2024/06/13 11:27:40 Extracting files from package "libffi8"...
2024/06/13 11:27:40 Extracting files from package "libpopt0"...
2024/06/13 11:27:40 Extracting files from package "libpython3.12-minimal"...
2024/06/13 11:27:40 Extracting files from package "media-types"...
2024/06/13 11:27:40 Extracting files from package "netbase"...
2024/06/13 11:27:40 Extracting files from package "libpython3.12-stdlib"...
2024/06/13 11:27:40 Extracting files from package "readline-common"...
2024/06/13 11:27:40 Extracting files from package "libreadline8t64"...
2024/06/13 11:27:40 Extracting files from package "libsqlite3-0"...
2024/06/13 11:27:40 Extracting files from package "tzdata"...
2024/06/13 11:27:40 Extracting files from package "libwrap0"...
2024/06/13 11:27:40 Extracting files from package "logrotate"...
2024/06/13 11:27:40 Extracting files from package "openssl"...
2024/06/13 11:27:40 Extracting files from package "python3.12-minimal"...
2024/06/13 11:27:40 Extracting files from package "python3.12"...
2024/06/13 11:27:40 Extracting files from package "rabbitmq-server"...
2024/06/13 11:27:40 Extracting files from package "socat"...

Checklist

Additional Context

github-actions[bot] commented 5 months ago

Diff of dependencies:

slices/erlang-base.yaml ```diff @@ -1,8 +1,6 @@ -adduser libc6 libgcc-s1 libstdc++6 libsystemd0 libtinfo6 -procps zlib1g ```
slices/libpam-runtime.yaml ```diff @@ -1,4 +0,0 @@ -cdebconf -debconf -debconf-2.0 -libpam-modules ```
slices/librabbitmq4.yaml ```diff @@ -1,2 +1,2 @@ libc6 -libssl3 +libssl3t64 ```
slices/rabbitmq-server.yaml ```diff @@ -1,19 +1,13 @@ -adduser -erlang-base -erlang-base-hipe -erlang-crypto -erlang-eldap -erlang-inets -erlang-mnesia -erlang-os-mon -erlang-parsetools -erlang-public-key -erlang-runtime-tools -erlang-ssl -erlang-syntax-tools -erlang-tools -erlang-xmerl -logrotate -openssl -python3 -socat +base-files +base-passwd +bash +coreutils +grep +libc-bin +libtinfo6 +login +netbase +passwd +python3.12 +sed +util-linux ```

linostar commented 5 months ago

Manual testing of the slice in a rock:

rockcraft.yaml

name: rabbitmq
base: ubuntu@24.04
version: '0.1'
summary: RabbitMQ rock
description: |
    This is a RabbitMQ Server rock.
platforms:
    amd64:

services:
    rabbitmq-service:
        override: replace
        startup: enabled
        command: /usr/sbin/rabbitmq-server

parts:
    build-context:
        plugin: nil
        source: chisel-releases/
        source-type: local
        override-build: |
            set -x
            ERL_COOKIE=${CRAFT_PART_INSTALL}/var/lib/rabbitmq/.erlang.cookie
            chisel cut --release ./ --root ${CRAFT_PART_INSTALL} rabbitmq-server_bins
            groupadd -r -g 90 -R ${CRAFT_PART_INSTALL} rabbitmq
            useradd -d /var/lib/rabbitmq -M -u 90 -g 90 -r -s /usr/sbin/nologin -R ${CRAFT_PART_INSTALL} rabbitmq
            chown 90:90 ${CRAFT_PART_INSTALL}/etc/rabbitmq
            chown -R 90:90 ${CRAFT_PART_INSTALL}/var/lib/rabbitmq
            chown -R 90:90 ${CRAFT_PART_INSTALL}/var/log/rabbitmq
            openssl rand -base64 -out ${ERL_COOKIE} 42
            chown 90:90 ${ERL_COOKIE}
            chmod 400 ${ERL_COOKIE}

Running the rock:

$ docker run --rm rabbitmq --verbose
2024-07-01T12:27:18.585Z [pebble] Started daemon.
2024-07-01T12:27:18.595Z [pebble] POST /v1/services 5.384266ms 202
2024-07-01T12:27:18.599Z [pebble] Service "rabbitmq-service" starting: /usr/sbin/rabbitmq-server
2024-07-01T12:27:19.611Z [pebble] GET /v1/changes/1/wait 1.01580796s 200
2024-07-01T12:27:19.612Z [pebble] Started default services with change 1.
2024-07-01T12:27:20.687Z [rabbitmq-service] 2024-07-01 12:27:20.683100+00:00 [notice] <0.44.0> Application syslog exited with reason: stopped
2024-07-01T12:27:20.687Z [rabbitmq-service] 2024-07-01 12:27:20.687486+00:00 [notice] <0.230.0> Logging: switching to configured handler(s); following messages may not be visible in this log output
2024-07-01T12:27:20.998Z [rabbitmq-service] 
2024-07-01T12:27:20.998Z [rabbitmq-service]   ##  ##      RabbitMQ 3.12.1
2024-07-01T12:27:20.998Z [rabbitmq-service]   ##  ##
2024-07-01T12:27:20.998Z [rabbitmq-service]   ##########  Copyright (c) 2007-2023 VMware, Inc. or its affiliates.
2024-07-01T12:27:20.998Z [rabbitmq-service]   ######  ##
2024-07-01T12:27:20.998Z [rabbitmq-service]   ##########  Licensed under the MPL 2.0. Website: https://rabbitmq.com
2024-07-01T12:27:20.998Z [rabbitmq-service] 
2024-07-01T12:27:20.998Z [rabbitmq-service]   Erlang:      25.3.2.8 [jit]
2024-07-01T12:27:20.998Z [rabbitmq-service]   TLS Library: OpenSSL - OpenSSL 3.0.13 30 Jan 2024
2024-07-01T12:27:20.998Z [rabbitmq-service]   Release series support status: supported
2024-07-01T12:27:20.998Z [rabbitmq-service] 
2024-07-01T12:27:20.998Z [rabbitmq-service]   Doc guides:  https://rabbitmq.com/documentation.html
2024-07-01T12:27:20.998Z [rabbitmq-service]   Support:     https://rabbitmq.com/contact.html
2024-07-01T12:27:20.998Z [rabbitmq-service]   Tutorials:   https://rabbitmq.com/getstarted.html
2024-07-01T12:27:20.998Z [rabbitmq-service]   Monitoring:  https://rabbitmq.com/monitoring.html
2024-07-01T12:27:20.998Z [rabbitmq-service] 
2024-07-01T12:27:20.998Z [rabbitmq-service]   Logs: /var/log/rabbitmq/rabbit@e98fcf741cde.log
2024-07-01T12:27:20.998Z [rabbitmq-service]         <stdout>
2024-07-01T12:27:20.998Z [rabbitmq-service] 
2024-07-01T12:27:20.998Z [rabbitmq-service]   Config file(s): (none)
2024-07-01T12:27:20.998Z [rabbitmq-service] 
2024-07-01T12:27:20.998Z [rabbitmq-service]   Starting broker... completed with 0 plugins.
linostar commented 4 months ago

thanks for this.

can you please explain the rationale for this diff:

@@ -1,19 +1,5 @@
 adduser
-erlang-base
-erlang-base-hipe
-erlang-crypto
-erlang-eldap
-erlang-inets
-erlang-mnesia
-erlang-os-mon
-erlang-parsetools
-erlang-public-key
-erlang-runtime-tools
-erlang-ssl
-erlang-syntax-tools
-erlang-tools
-erlang-xmerl
-logrotate
+base-files
 openssl
-python3
+python3.12
 socat

Also, thanks for the test rock. Can you demonstrate a simple message exchange?

erlang* and logrotate packages are not available for i386 arch, so they have been commented out.

linostar commented 4 months ago

Rafid's review:

cjdcordeiro commented 4 months ago

erlang* and logrotate packages are not available for i386 arch, so they have been commented out.

and the additions?

miyoyo commented 3 months ago

According to this, socat is no longer required as of RabbitMQ 3.9.0

linostar commented 2 months ago

@rebornplusplus This is ready for a final review, as all tests now are passing.

linostar commented 1 month ago

@cjdcordeiro @rebornplusplus This has been rebased with the lastest upstream changes so it's ready for review.

linostar commented 3 weeks ago

Erlang slices were moved to another separate PR #384.