Skip to content

Commit

Permalink
Fixes and cleans up longhorn engine rock
Browse files Browse the repository at this point in the history
The rock should contain the longhorn-instance-manager, but
longhorn-engine is built and included instead.

Removes redundant liblonghorn clone and installation.
  • Loading branch information
claudiubelu committed Sep 16, 2024
1 parent 3c7d372 commit dd7ec85
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions v1.7.0/longhorn-engine/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,6 @@ parts:
ldconfig
# NOTE(aznashwan): pull and install liblonghorn
# https://github.com/longhorn/longhorn-engine/blob/v1.7.0/package/Dockerfile#L15-L22
LIBLONGHORN_COMMIT_ID="53d1c063b95efc8d949b095bd4bf04637230265f"
cd /usr/src
git clone https://github.com/rancher/liblonghorn.git
cd liblonghorn
git checkout ${LIBLONGHORN_COMMIT_ID}
make
make install
# 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/longhorn-engine/blob/v1.7.0/Makefile#L1
# https://github.com/longhorn/longhorn-engine/blob/v1.7.0/Makefile#L10-L11
Expand All @@ -128,13 +117,11 @@ parts:
override-build: |
set -eux -o pipefail
cd $CRAFT_PART_SRC
bash ./scripts/build
# https://github.com/longhorn/longhorn-engine/blob/v1.7.0/package/Dockerfile#L59
mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
cp $CRAFT_PART_SRC/bin/longhorn $CRAFT_PART_INSTALL/usr/local/bin
cp bin/longhorn $CRAFT_PART_INSTALL/usr/local/bin
# https://github.com/longhorn/longhorn-engine/blob/v1.7.0/package/Dockerfile#L62
cp package/launch-simple-longhorn $CRAFT_PART_INSTALL/usr/local/bin
Expand All @@ -150,7 +137,7 @@ parts:
after: ["setup-build-env"]

source-type: git
source: https://github.com/longhorn/longhorn-engine
source: https://github.com/longhorn/longhorn-instance-manager
# NOTE(aznashwan): the build steps in the Dapper file clone the
# longhorn-instance-manager's tip, which could potentially lead
# to compatibility issues so we pin its version too:
Expand All @@ -161,8 +148,6 @@ parts:
override-build: |
set -eux -o pipefail
cd $CRAFT_PART_SRC
go build \
-tags netgo -ldflags "-linkmode external -extldflags -static" \
-o ./longhorn-instance-manager
Expand All @@ -183,7 +168,6 @@ parts:
set -eux -o pipefail
# https://github.com/longhorn/longhorn-engine/blob/v1.7.0/package/Dockerfile#L15-L22
cd $CRAFT_PART_SRC
make
make install
Expand All @@ -200,7 +184,6 @@ parts:
override-build: |
set -eux -o pipefail
cd $CRAFT_PART_SRC
make
make install
Expand Down

0 comments on commit dd7ec85

Please sign in to comment.