Skip to content

Commit

Permalink
v1.6.2: README updates.
Browse files Browse the repository at this point in the history
Signed-off-by: Nashwan Azhari <[email protected]>

Copy v1.7.0 engine/instance-man/backing-image-man as 1.6.2.

Signed-off-by: Nashwan Azhari <[email protected]>

backing-image-manager: adapt copied 1.7 rockfile to v1.6.2.

Signed-off-by: Nashwan Azhari <[email protected]>

engine: adapt copied 1.7.0 rockfile to v1.6.2.

Signed-off-by: Nashwan Azhari <[email protected]>

engine:v1.7.0: ensure `jq` present in final image.

Signed-off-by: Nashwan Azhari <[email protected]>

instance-manager: adapt copied 1.7.0 rockfile to v1.6.2.

Signed-off-by: Nashwan Azhari <[email protected]>
  • Loading branch information
Nashwan Azhari authored and claudiubelu committed Sep 16, 2024
1 parent 6ab8d3f commit f794a7b
Show file tree
Hide file tree
Showing 9 changed files with 841 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/sanity/test_longhorn_backing_image_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


IMAGE_NAME = "backing-image-manager"
IMAGE_VERSIONS = ["v1.7.0"]
IMAGE_VERSIONS = ["v1.6.2", "v1.7.0"]


@pytest.mark.abort_on_fail
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/test_longhorn_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


IMAGE_NAME = "longhorn-engine"
IMAGE_VERSIONS = ["v1.7.0"]
IMAGE_VERSIONS = ["v1.6.2", "v1.7.0"]


@pytest.mark.abort_on_fail
Expand Down
12 changes: 9 additions & 3 deletions tests/sanity/test_longhorn_instance_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


IMAGE_NAME = "longhorn-instance-manager"
IMAGE_VERSIONS = ["v1.7.0"]
IMAGE_VERSIONS = ["v1.6.2", "v1.7.0"]


@pytest.mark.abort_on_fail
Expand Down Expand Up @@ -80,5 +80,11 @@ def test_check_rock_image_contents(image_version):
# to re-index some libs `nvme` dynamically links to:
cmd = "ldconfig && nvme version"
process = docker_util.run_in_docker(rock_image, ["bash", "-c", cmd])
assert "nvme version 2.9.1" in process.stdout
assert "libnvme version 1.9" in process.stdout
nvme_cli_and_lib_ver_map = {
"v1.7.0": ("2.9.1", "1.9"),
"v1.6.2": ("2.7.1", "1.7"),
}
LOG.info(f"`nvme version` output: {process.stdout}")
cliv, libv = nvme_cli_and_lib_ver_map[image_version]
assert f"nvme version {cliv}" in process.stdout
assert f"libnvme version {libv}" in process.stdout
23 changes: 23 additions & 0 deletions v1.6.2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Canonical ROCKs for Longhorn v1.6.2

Aim to be compatible with following upstream images
[listed in the v1.6.2 release of Longhorn](https://github.com/longhorn/longhorn/releases/download/v1.6.2/longhorn-images.txt).

* longhornio/longhorn-engine:v1.6.2
* longhornio/longhorn-manager:v1.6.2
* longhornio/longhorn-ui:v1.6.2
* longhornio/longhorn-instance-manager:v1.6.2
* longhornio/longhorn-share-manager:v1.6.2
* longhornio/backing-image-manager:v1.6.2
* longhornio/support-bundle-kit:v0.0.37

The CSI components required by Longhorn can be found here: https://github.com/canonical/csi-rocks.

The CSI rocks required for a Longhorn v1.6.2 deplyoment are:

* ghcr.io/canonical/csi-attacher:v4.5.1
* ghcr.io/canonical/csi-provisioner:v3.6.4
* ghcr.io/canonical/csi-node-driver-registrar:v2.9.2
* ghcr.io/canonical/csi-resizer:v1.10.1
* ghcr.io/canonical/csi-snapshotter:v6.3.4
* ghcr.io/canonical/livenessprobe:v2.12.0
144 changes: 144 additions & 0 deletions v1.6.2/backing-image-manager/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

# Rockcraft definition for the Longhorn Backing Image Manager image:
# longhornio/backing-image-manager:v1.6.2

name: backing-image-manager
summary: Rock containing the Longhorn Backing Image Manager component.
description: |
Rock containing Longhorn Backing Image manager component: https://github.com/longhorn/backing-image-manager
Aims to replicate the upstream official image: longhornio/backing-image-manager:v1.6.2
license: Apache-2.0

version: "v1.6.2"

# NOTE(aznashwan): the base for the image is the Suse Linux Enterprise
# Base Container Image (SLE BCE) Service Pack 5 which ships with Linux 5.14,
# and is thus most comparable to 22.04:
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/package/Dockerfile#L1
base: [email protected]

build-base: [email protected]
platforms:
amd64:


services:
backing-image-manager:
startup: enabled
override: replace

# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/package/Dockerfile#L21-L23
command: /tini -- [ backing-image-manager ]

on-success: shutdown
on-failure: shutdown

entrypoint-service: backing-image-manager

parts:

# NOTE(aznashwan): the binary is built within a Docker container
# which is set up by Rancher's Dapper tool: https://github.com/rancher/dapper
# The setup steps for the build container are contained within this Dockerfile:
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/Dockerfile.dapper
setup-build-env:
plugin: nil

build-packages:
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/Dockerfile.dapper#L20-L24
- cmake
- wget
- curl
- git
- less
- file
- libkmod-dev # libkmod-devel
- libnl-3-dev # libnl3-devel
- linux-headers-5.15.0-25 # linux-glibc-devel
- pkg-config
- psmisc
- fuse
- librdmacm-dev # librdmacm1
- rdmacm-utils # librdmacm-utils
- libibverbs-dev # libibverbs
- libaio-dev # libaio-devel
- libc6-dev # glibc-devel, glibc-devel-static
- iptables
- libltdl7
- libdevmapper1.02.1 # libdevmapper1_03
- iproute2
- jq
- gcc

# NOTE(aznashwan): the Makefile targets are just the scripts found in the
# scripts/ directory which are executed within the Dapper build container:
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/Makefile#L1
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/Makefile#L10-L11
build-lonhorn-backing-image-manager:
plugin: nil
after: ["setup-build-env"]

source-type: git
source: https://github.com/longhorn/backing-image-manager
source-tag: v1.6.2
source-depth: 1

build-snaps:
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/Dockerfile.dapper#L36
- go/1.21/stable

override-build: |
set -eux -o pipefail
cd $CRAFT_PART_SRC
bash ./scripts/build
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/package/Dockerfile#L13
mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
cp $CRAFT_PART_SRC/bin/backing-image-manager $CRAFT_PART_INSTALL/usr/local/bin/backing-image-manager
# Pulls a pre-built binary release of the `tini` init system.
# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/package/Dockerfile#L18-L20
fetch-tini-init:
plugin: nil
after: ["setup-build-env"]

override-build: |
set -eux -o pipefail
TINI_VERSION="v0.19.0"
ARCH="$CRAFT_TARGET_ARCH"
URL="https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${ARCH}"
curl -sSfL $URL -o $CRAFT_PART_INSTALL/tini
chmod +x $CRAFT_PART_INSTALL/tini
prep-final-image:
plugin: nil

# https://github.com/longhorn/backing-image-manager/blob/v1.6.2/package/Dockerfile#L9-L11
stage-packages:
- kmod
- curl
- wget
- nfs-common # nfs-client
- nfs4-acl-tools
- fuse
- librdmacm-dev # librdmacm1
- rdmacm-utils # librdmacm-utils
- libibverbs-dev # libibverbs
- libconfig-general-perl # perl-Config-General
- libaio-dev # libaio-devel
- sg3-utils # sg3_utils
- net-tools # iputils
- telnet
- iperf3 # iperf
- qemu-utils # qemu-tools
- iproute2
- e2fsprogs
- xfsprogs
- xfslibs-dev # xfsprogs-devel
Loading

0 comments on commit f794a7b

Please sign in to comment.