Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
  • Loading branch information
aznashwan committed Sep 9, 2024
1 parent 8c47f15 commit ba9c78d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
4 changes: 4 additions & 0 deletions tests/sanity/test_longhorn_instance_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ def test_check_rock_image_contents(image_version):
rock_image,
binary_paths_to_check,
)

process = docker_util.run_in_docker(rock_image, ["nvme", "version"])
assert "nvme version 2.9.1" in process.stdout
assert "libnvme version 1.9" in process.stdout
43 changes: 32 additions & 11 deletions v1.7.0/longhorn-instance-manager/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ base: ubuntu@24.04
build-base: ubuntu@24.04
platforms:
amd64:
arm64:

environment:
LD_LIBRARY_PATH: /usr/local/lib

services:
longhorn-instance-manager:
Expand All @@ -30,7 +32,8 @@ services:
override: replace

# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L175-L177
command: /tini -- [ longhorn ]
# https://github.com/longhorn/longhorn-instance-manager/pull/664
command: /tini -- [ longhorn-instance-manager ]

on-success: shutdown
on-failure: shutdown
Expand Down Expand Up @@ -89,7 +92,7 @@ parts:
make -j$(nproc)
make install
ldconfig
ldconfig -p
# The Makefile targets are just the scripts found in the scripts/ directory which
# are executed within the Dapper build container:
Expand All @@ -114,11 +117,9 @@ parts:
bash ./scripts/build
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L165
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L165-L166
mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
cp $CRAFT_PART_SRC/bin/longhorn-instance-manager $CRAFT_PART_INSTALL/usr/local/bin
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L166
cp package/instance-manager $CRAFT_PART_INSTALL/usr/local/bin
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L18-L26
Expand Down Expand Up @@ -199,8 +200,8 @@ parts:
make install
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L151-L157
mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
cp /usr/sbin/{tgt-admin,tgt-setup-lun,tgtadm,tgtd,tgtimg} $CRAFT_PART_INSTALL/usr/local/bin
mkdir -p $CRAFT_PART_INSTALL/usr/sbin
cp /usr/sbin/{tgt-admin,tgt-setup-lun,tgtadm,tgtd,tgtimg} $CRAFT_PART_INSTALL/usr/sbin
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L72-L93
build-spdk:
Expand Down Expand Up @@ -264,7 +265,11 @@ parts:
make
make install
# TODO(aznashwan): copy lib to final image
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L159-L161
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib
cp /usr/local/lib/libjson-c* $CRAFT_PART_INSTALL/usr/local/lib/
ldconfig -p
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L106-L113
build-nvme-cli:
Expand All @@ -289,8 +294,14 @@ parts:
meson install -C .build
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L147-L149
mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
cp /usr/local/sbin/nvme $CRAFT_PART_INSTALL/usr/local/bin
mkdir -p $CRAFT_PART_INSTALL/usr/local/sbin
cp /usr/local/sbin/nvme $CRAFT_PART_INSTALL/usr/local/sbin
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L159-L161
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib
cp /usr/local/lib/*/libnvme*.so $CRAFT_PART_INSTALL/usr/local/lib/
ldconfig -p
# Pulls a pre-built binary release of the `tini` init system.
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.7.0/package/Dockerfile#L173
Expand Down Expand Up @@ -336,4 +347,14 @@ parts:
- procps
- libfuse3-3 # fuse3-devel
- awk
# NOTE(aznashwan): although not explicitly installed in any of the
# upstream build procedures, some of the secondary CLI tools
# (e.g. nvmecli) require libncurses:
- libncurses-dev

override-build: |
set -eux -o pipefail
mkdir -p $CRAFT_PART_INSTALL/etc/ld.so.conf.d
echo /usr/local/lib > $CRAFT_PART_INSTALL/etc/ld.so.conf.d/99_local_libs.conf

0 comments on commit ba9c78d

Please sign in to comment.