Skip to content

Commit 6733e5a

Browse files
authored
refactor: Use boil instead of bake (#79)
* feat(setup-tools): Support installing latest version of tools * refactor!(shard): Use boil * chore(run-integration-test): Add comments * refactor!(build-product-image): Use boil * chore: Update refs to local actions * chore: Add release instructions * temp: Temporarily use PR branch for actions pointing to main * chore: Add boil config, remove old bake configs * chore(shard): Adjust version extraction command * fix(shard): Add missing double quote * fix(shard): Use --compact-output for jq instead of pretty (default) * ci: Use Ubuntu 24.04 for Ubicloud ARM runner * fix(build-product-image): Use correct boil command and args * ci(smoke): Add boil config * fix(build-product-image): Use --target-platform arg * fix(build-product-image): Remove superfluous double quote Aaaaaaaargh * fix(build-product-image): Load container image * fix: Add registry-namespace input * ci: Use correct source image URI * chore: Use main branch again, add follow-up PR comments Note: This will break CI again. It will be fixed in a follow-up PR. * ci: Temporarily pin boil version
1 parent d2f634f commit 6733e5a

File tree

14 files changed

+140
-164
lines changed

14 files changed

+140
-164
lines changed

.github/workflows/smoke-build.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: ./shard
2929
with:
3030
product-name: smoke
31-
config-file: smoke/conf.py
31+
boil-version: 0.1.0
3232
outputs:
3333
versions: ${{ steps.shard.outputs.versions }}
3434

@@ -41,8 +41,10 @@ jobs:
4141
strategy:
4242
matrix:
4343
runner:
44+
# Github's ubuntu-latest runners use 24.04. By default Ubicloud's runners use 22.04.
45+
# We therefore explicitly request 24.04 for them as well.
4446
- {name: "ubuntu-latest", arch: "amd64"}
45-
- {name: "ubicloud-standard-8-arm", arch: "arm64"}
47+
- {name: "ubicloud-standard-8-arm-ubuntu-2404", arch: "arm64"}
4648
versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }}
4749
steps:
4850
- name: Checkout Repository
@@ -57,10 +59,12 @@ jobs:
5759
id: build
5860
uses: ./build-product-image
5961
with:
60-
product-name: smoke
6162
product-version: ${{ matrix.versions }}
62-
bake-config-file: smoke/conf.py
63+
boil-config-file: smoke/boil.toml
64+
boil-version: 0.1.0
65+
registry-namespace: stackable
6366
extra-tag-data: pr-321
67+
product-name: smoke
6468

6569
- name: Publish Container Image on oci.stackable.tech
6670
uses: ./publish-image
@@ -70,7 +74,7 @@ jobs:
7074
image-registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
7175
image-repository: stackable/smoke
7276
image-manifest-tag: ${{ steps.build.outputs.image-manifest-tag }}
73-
source-image-uri: localhost/smoke:${{ steps.build.outputs.image-manifest-tag }}
77+
source-image-uri: localhost/stackable/smoke:${{ steps.build.outputs.image-manifest-tag }}
7478

7579
publish_manifests:
7680
name: Build/Publish ${{ matrix.versions }} Index Manifest

.scripts/actions/shard.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

RELEASE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Release
2+
3+
To release a new set of actions follow these steps:
4+
5+
- Choose an appropriate new semantic version based on the latest changes
6+
- Update any references in actions to other local actions to the chosen version
7+
- Raise a PR with the appropriate changes
8+
- Once merged, tag on `main` using `git tag -s v<X.Y.Z>`
9+
- Manually create a GitHub release

build-product-image/README.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,17 @@
88
> a name. If the name does not contain a registry, `hub.docker.com` (?) is implied. Therefore,
99
> `localhost` will be used as the registry so as to avoid accidental interactions with an unintended
1010
> registry.
11-
>
12-
> Ideally, bake should be refactored to use `localhost` as the registry for the previously mentioned
13-
> reason (whether or not that is behind some option).
1411
15-
This action builds a *single* container image using `bake`. It does the following work:
12+
This action builds a *single* container image using `boil`. It does the following work:
1613

1714
1. Free disk space to avoid running out of disk space during larger builds.
18-
2. Build the image using `bake` which internally uses `docker buildx`.
19-
3. Temporarily retag the image to use `localhost` instead of `oci.stackable.tech/sdp`.
20-
4. Produce output values to be used in later steps.
15+
2. Build the image using `boil` which internally uses `docker buildx`.
16+
3. Produce output values to be used in later steps.
2117

2218
This action is considered to be the **single** source of truth regarding image index tag and image
2319
manifest tag. All subsequent tasks must use these values to ensure consistency.
2420

25-
Currently, bake provides the following ouput in the `bake-target-tags` file:
26-
27-
```plain
28-
oci.stackable.tech/sdp/kafka:3.4.1-stackable0.0.0-dev-amd64
29-
```
30-
31-
Until bake supports the ability to specify the registry, this action will retag the image as:
21+
boil provides the following output in the `boil-target-tags` file:
3222

3323
```plain
3424
localhost/kafka:3.4.1-stackable0.0.0-dev-amd64
@@ -41,16 +31,21 @@ localhost/kafka:3.4.1-stackable0.0.0-dev-amd64
4131
4232
### Inputs
4333

44-
- `product-name` (eg: `kafka`)
45-
- `product-version` (eg: `3.4.1`)
46-
- `image-tools-version` (eg: `0.0.14`)
47-
- `bake-config-file` (defaults to `./conf.py`)
48-
- `sdp-version` (defaults to: `0.0.0-dev`)
49-
- `extra-tag-data` (optional, eg. `pr321`)
34+
| Input | Required (Default) | Description |
35+
| -------------------- | ------------------ | ------------------------------------------------------------ |
36+
| `product-name` | Yes | The name of the product image to build (eg: `kafka`) |
37+
| `product-version` | Yes | The version of the product image to build (eg: `3.4.1`) |
38+
| `registry-namespace` | Yes | The path of the registry namespace, eg. `sdp` or `stackable` |
39+
| `boil-version` | No (`latest`) | The version of boil used to build the image |
40+
| `boil-config-file` | No (`./boil.toml`) | The path to the boil config file |
41+
| `sdp-version` | No (`0.0.0-dev`) | The SDP version of the image |
42+
| `extra-tag-data` | No | Extra data to be included in the tag, eg. `pr321` |
5043

5144
### Outputs
5245

53-
- `image-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev-amd64`)
54-
- `suggested-image-index-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev`)
46+
| Output | Example | Description |
47+
| ------------------------------------ | -------------------------------- | ----------------------------------------------- |
48+
| `image-manifest-tag` | `3.4.1-stackable0.0.0-dev-amd64` | The image manifest tag (including architecture) |
49+
| `suggested-image-index-manifest-tag` | `3.4.1-stackable0.0.0-dev` | The suggested image index manifest tag |
5550

5651
[build-product-image]: ./action.yaml

build-product-image/action.yaml

Lines changed: 37 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
---
22
name: Build Product Image
3-
description: This action builds a product Docker image with a specific version
3+
description: This action builds a product container image with a specific version
44
inputs:
55
product-name:
6-
description: The name of the product to build via bake (directory name)
6+
description: The name of the product to build via boil (directory name)
77
required: true
88
product-version:
9-
description: The version of the product to build via bake
9+
description: The version of the product to build via boil
1010
required: true
11-
image-tools-version:
12-
description: The Stackable image-tools version
13-
default: 0.0.17
14-
bake-config-file:
15-
description: Path to the bake config file, defaults to `./conf.py`
16-
default: ./conf.py
11+
boil-version:
12+
description: The boil version
13+
default: latest
14+
boil-config-file:
15+
description: Path to the boil config file, defaults to `./boil.toml`
16+
default: ./boil.toml
1717
sdp-version:
1818
description: |
1919
Stackable Data Platform version (eg: `24.7.0`)
2020
default: 0.0.0-dev
2121
extra-tag-data:
2222
description: |
2323
Extra data to include in the final image manifest tag (eg: `pr321`)
24+
registry-namespace:
25+
description: Path of the registry namespace, eg. `sdp` or `stackable`
26+
required: true
2427
outputs:
2528
image-manifest-tag:
2629
description: |
@@ -38,22 +41,18 @@ runs:
3841
- name: Setup Docker Buildx
3942
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
4043

41-
# NOTE (@Techassi): Why do we install python via apt and not the setup-python action?
42-
- name: Setup Python
43-
shell: bash
44-
run: |
45-
set -euo pipefail
46-
sudo apt update
47-
sudo apt install -y python3
44+
- name: Setup boil (${{ inputs.boil-version }})
45+
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
46+
# more comfortable again.
47+
uses: stackabletech/actions/setup-tools@main # TODO: Replace with latest released version
48+
with:
49+
boil-version: ${{ inputs.boil-version }}
4850

49-
- name: Install image-tools-stackabletech
50-
shell: bash
51-
run: pip install image-tools-stackabletech==${{ inputs.image-tools-version }}
52-
53-
- name: Building ${{ inputs.product-name }} Container Image using bake
51+
- name: Building ${{ inputs.product-name }} Container Image using boil
5452
env:
55-
BAKE_PRODUCT_VERSION: ${{ inputs.product-version }}
56-
BAKE_CONFIG_FILE: ${{ inputs.bake-config-file }}
53+
REGISTRY_NAMESPACE: ${{ inputs.registry-namespace }}
54+
BOIL_PRODUCT_VERSION: ${{ inputs.product-version }}
55+
BOIL_CONFIG_FILE: ${{ inputs.boil-config-file }}
5756
IMAGE_REPOSITORY: ${{ inputs.product-name }}
5857
EXTRA_TAG_DATA: ${{ inputs.extra-tag-data }}
5958
SDP_VERSION: ${{ inputs.sdp-version }}
@@ -63,9 +62,9 @@ runs:
6362
IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")
6463
6564
# Will be either:
66-
# - 3.9.2-stackable0.0.0-dev-arm64 or
67-
# - 3.9.2-stackable0.0.0-dev-pr321-arm64
68-
IMAGE_INDEX_MANIFEST_TAG="${SDP_VERSION}${EXTRA_TAG_DATA:+-$EXTRA_TAG_DATA}-${IMAGE_ARCH}"
65+
# - 3.9.2-stackable0.0.0-dev or
66+
# - 3.9.2-stackable0.0.0-dev-pr321
67+
IMAGE_INDEX_MANIFEST_TAG="${SDP_VERSION}${EXTRA_TAG_DATA:+-$EXTRA_TAG_DATA}"
6968
echo "IMAGE_INDEX_MANIFEST_TAG=$IMAGE_INDEX_MANIFEST_TAG" | tee -a "$GITHUB_ENV"
7069
7170
# Validate that final tag is valid according to
@@ -75,40 +74,27 @@ runs:
7574
exit 1
7675
fi
7776
78-
echo "::group::bake"
79-
bake \
80-
--product "$IMAGE_REPOSITORY=$BAKE_PRODUCT_VERSION" \
77+
echo "::group::boil"
78+
boil build \
8179
--image-version "$IMAGE_INDEX_MANIFEST_TAG" \
82-
--release "$SDP_VERSION" \
83-
--architecture "linux/${IMAGE_ARCH}" \
84-
--export-tags-file bake-target-tags \
85-
--configuration "$BAKE_CONFIG_FILE"
80+
--registry-namespace "$REGISTRY_NAMESPACE" \
81+
--target-platform "linux/${IMAGE_ARCH}" \
82+
--configuration "$BOIL_CONFIG_FILE" \
83+
--write-image-manifest-uris \
84+
--use-localhost-registry \
85+
--load \
86+
"$IMAGE_REPOSITORY=$BOIL_PRODUCT_VERSION"
8687
echo "::endgroup::"
8788
88-
- name: Re-tag Image (Temporary)
89-
shell: bash
90-
run: |
91-
set -euo pipefail
92-
93-
# Extract the image uri and replace 'oci.stackable.tech/sdp'
94-
# with 'localhost' until bake does the right thing
95-
OLD_IMAGE_URI="$(< bake-target-tags)"
96-
97-
# Replace the image uri in the bake file
98-
sed -i -e 's/oci\.stackable\.tech\/sdp/localhost/' bake-target-tags
99-
100-
# Finally, re-tag image
101-
docker tag "$OLD_IMAGE_URI" "$(< bake-target-tags)"
102-
10389
- name: Extract Environment Variables
10490
id: image_info
10591
shell: bash
10692
run: |
10793
set -euo pipefail
108-
echo "bake-target-tags: "$(< bake-target-tags)
94+
echo "boil-target-tags: "$(< boil-target-tags)
10995
110-
# Extract the image manifest tag from the bake-target-tags file
111-
IMAGE_MANIFEST_TAG=$(cut -d : -f 2 < bake-target-tags)
96+
# Extract the image manifest tag from the boil-target-tags file
97+
IMAGE_MANIFEST_TAG=$(cut -d : -f 2 < boil-target-tags)
11298
[[ -n "$IMAGE_MANIFEST_TAG" ]]
11399
[[ -n "$IMAGE_INDEX_MANIFEST_TAG" ]]
114100

publish-helm-chart/action.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ runs:
3636
- name: Set up Helm
3737
# We cannot use a path to point to the local action
3838
# See https://github.com/orgs/community/discussions/74934
39-
uses: stackabletech/actions/setup-k8s-tools@7279ffd852a8013df52028de0d99eef68700f803 # TODO: Pin this to the latest tag
39+
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
40+
# more comfortable again.
41+
uses: stackabletech/actions/setup-k8s-tools@main # TODO: Replace with latest released version
4042
with:
4143
helm-version: ${{ inputs.helm-version }}
4244

run-integration-test/action.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ runs:
6060
using: composite
6161
steps:
6262
- name: Install interu
63-
uses: stackabletech/actions/setup-tools@7279ffd852a8013df52028de0d99eef68700f803 # TODO: Pin this to the latest tag
63+
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
64+
# more comfortable again.
65+
uses: stackabletech/actions/setup-tools@main # TODO: Replace with latest released version
6466
with:
6567
interu-version: ${{ inputs.interu-version }}
6668
- name: Extract Test and Instance Configuration
@@ -97,7 +99,9 @@ runs:
9799
# and are therefore not available, there is no need to create the cluster or run the tests,
98100
# because the tests can never run in the first place.
99101
- name: Install kubectl, kubectl-kuttl, and helm
100-
uses: stackablectl/actions/setup-k8s-tools@7279ffd852a8013df52028de0d99eef68700f803 # TODO: Pin this to the latest tag
102+
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
103+
# more comfortable again.
104+
uses: stackablectl/actions/setup-k8s-tools@main # TODO: Replace with latest released version
101105
with:
102106
kubectl-version: ${{ inputs.kubectl-version }}
103107
kuttl-version: ${{ inputs.kuttl-version }}
@@ -110,7 +114,9 @@ runs:
110114
# mikefarah/yq is already installed on the runner
111115
# See https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-yq.sh
112116
- name: Install stackablectl and beku
113-
uses: stackabletech/actions/setup-tools@7279ffd852a8013df52028de0d99eef68700f803 # TODO: Pin this to the latest tag
117+
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
118+
# more comfortable again.
119+
uses: stackabletech/actions/setup-tools@main # TODO: Replace with latest released version
114120
with:
115121
stackablectl-version: ${{ inputs.stackablectl-version }}
116122
beku-version: ${{ inputs.beku-version }}

setup-tools/action.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ runs:
2525
2626
ARCH=$(uname -m)
2727
28-
curl -fsSL -o /tmp/boil "https://github.com/stackabletech/docker-images/releases/download/boil-${BOIL_VERSION}/boil-${ARCH}-unknown-linux-gnu"
28+
if [ "$BOIL_VERSION" == "latest" ]; then
29+
curl -fsSL -o /tmp/boil "https://github.com/stackabletech/docker-images/releases/latest/download/boil-${ARCH}-unknown-linux-gnu"
30+
else
31+
curl -fsSL -o /tmp/boil "https://github.com/stackabletech/docker-images/releases/download/boil-${BOIL_VERSION}/boil-${ARCH}-unknown-linux-gnu"
32+
fi
33+
2934
sudo install -m 755 -t /usr/local/bin /tmp/boil
3035
3136
- name: Install stackablectl
@@ -40,7 +45,12 @@ runs:
4045
4146
ARCH=$(uname -m)
4247
43-
curl -fsSL -o /tmp/stackablectl "https://github.com/stackabletech/stackable-cockpit/releases/download/stackablectl-${STACKABLECTL_VERSION}/stackablectl-${ARCH}-unknown-linux-gnu"
48+
if [ "$STACKABLECTL_VERSION" == "latest" ]; then
49+
curl -fsSL -o /tmp/stackablectl "https://github.com/stackabletech/stackable-cockpit/releases/latest/download/stackablectl-${ARCH}-unknown-linux-gnu"
50+
else
51+
curl -fsSL -o /tmp/stackablectl "https://github.com/stackabletech/stackable-cockpit/releases/download/stackablectl-${STACKABLECTL_VERSION}/stackablectl-${ARCH}-unknown-linux-gnu"
52+
fi
53+
4454
sudo install -m 755 -t /usr/local/bin /tmp/stackablectl
4555
4656
- name: Install interu
@@ -55,7 +65,12 @@ runs:
5565
5666
ARCH=$(uname -m)
5767
58-
curl -fsSL -o /tmp/interu "https://github.com/stackabletech/actions/releases/download/interu-${INTERU_VERSION}/interu-${ARCH}-unknown-linux-gnu"
68+
if [ "$INTERU_VERSION" == "latest" ]; then
69+
curl -fsSL -o /tmp/interu "https://github.com/stackabletech/actions/releases/latest/download/interu-${ARCH}-unknown-linux-gnu"
70+
else
71+
curl -fsSL -o /tmp/interu "https://github.com/stackabletech/actions/releases/download/interu-${INTERU_VERSION}/interu-${ARCH}-unknown-linux-gnu"
72+
fi
73+
5974
sudo install -m 755 -t /usr/local/bin /tmp/interu
6075
6176
- name: Install beku

0 commit comments

Comments
 (0)