Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup v1.6.2 rocks #34

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions v1.6.2/backing-image-manager/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,11 @@ parts:
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
cp 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
Expand Down
20 changes: 2 additions & 18 deletions v1.6.2/longhorn-engine/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,6 @@ parts:

ldconfig

# NOTE(aznashwan): pull and install liblonghorn
# https://github.com/longhorn/longhorn-engine/blob/v1.6.2/package/Dockerfile#L12-L19
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

Comment on lines -99 to -108
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not used at all or included through another build step/part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a build-liblonghorn step below, which clones this repo at this commit hash and runs make and 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.6.2/Makefile#L1
Expand All @@ -126,13 +116,11 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC

bash ./scripts/build

# https://github.com/longhorn/longhorn-engine/blob/v1.6.2/package/Dockerfile#L56
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.6.2/package/Dockerfile#L58
cp package/launch-simple-longhorn $CRAFT_PART_INSTALL/usr/local/bin
Expand All @@ -148,16 +136,14 @@ parts:
after: ["setup-build-env"]

source-type: git
source: https://github.com/longhorn/longhorn-engine
source: https://github.com/longhorn/longhorn-instance-manager
# https://github.com/longhorn/longhorn-engine/blob/v1.6.2/Dockerfile.dapper#L139
source-tag: v1.6.x
source-depth: 1

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 @@ -178,7 +164,6 @@ parts:
set -eux -o pipefail

# https://github.com/longhorn/longhorn-engine/blob/v1.6.2/package/Dockerfile#L12-L19
cd $CRAFT_PART_SRC
make
make install

Expand All @@ -195,7 +180,6 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC
make
make install

Expand Down
15 changes: 2 additions & 13 deletions v1.6.2/longhorn-instance-manager/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,11 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC

bash ./scripts/build

# https://github.com/longhorn/longhorn-instance-manager/blob/v1.6.2/package/Dockerfile#L136
mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
cp $CRAFT_PART_SRC/bin/longhorn-instance-manager $CRAFT_PART_INSTALL/usr/local/bin
cp bin/longhorn-instance-manager $CRAFT_PART_INSTALL/usr/local/bin

# NOTE(aznashwan): the original script is lacking any error
# handling/debugging so we add it ourselves:
Expand All @@ -139,13 +137,12 @@ parts:
source-depth: 1

build-snaps:
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.6.2/Dockerfile.dapper#L1
# https://github.com/longhorn/longhorn-instance-manager/blob/v1.6.2/Dockerfile.dapper#L40
- go/1.22/stable

override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC
go build

mkdir -p $CRAFT_PART_INSTALL/usr/local/bin
Expand Down Expand Up @@ -184,7 +181,6 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC
make
make install

Expand All @@ -201,7 +197,6 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC
make
make install

Expand All @@ -221,8 +216,6 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC

git submodule update --init

bash ./scripts/pkgdep.sh
Expand Down Expand Up @@ -261,8 +254,6 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC

mkdir -p .build
cd .build

Expand Down Expand Up @@ -292,8 +283,6 @@ parts:
override-build: |
set -eux -o pipefail

cd $CRAFT_PART_SRC

meson setup --force-fallback-for=libnvme .build
meson compile -C .build
meson install -C .build
Expand Down
Loading