Skip to content

Commit

Permalink
chore: run extension build as downstream
Browse files Browse the repository at this point in the history
Run extensions build as downstream

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Feb 27, 2023
1 parent 426fe96 commit 5a01d5f
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 141 deletions.
327 changes: 195 additions & 132 deletions .drone.jsonnet

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,14 @@ RUN mkdir -p pkg/machinery/gendata/data && \
echo -n ${PKGS} > pkg/machinery/gendata/data/pkgs && \
echo -n ${TAG} > pkg/machinery/gendata/data/tag && \
echo -n ${ARTIFACTS} > pkg/machinery/gendata/data/artifacts
RUN mkdir -p _out && \
echo PKGS=${PKGS} >> _out/talos-metadata && \
echo TAG=${TAG} >> _out/talos-metadata && \
echo EXTRAS=${EXTRAS} >> _out/talos-metadata

FROM scratch AS embed
COPY --from=embed-generate /src/pkg/machinery/gendata/data /pkg/machinery/gendata/data
COPY --from=embed-generate /src/_out/talos-metadata /_out/talos-metadata

FROM embed-generate AS embed-abbrev-generate
ARG ABBREV_TAG
Expand All @@ -263,6 +268,7 @@ RUN echo -n "undefined" > pkg/machinery/gendata/data/sha && \

FROM scratch AS embed-abbrev
COPY --from=embed-abbrev-generate /src/pkg/machinery/gendata/data /pkg/machinery/gendata/data
COPY --from=embed-abbrev-generate /src/_out/talos-metadata /_out/talos-metadata

FROM --platform=${BUILDPLATFORM} scratch AS generate
COPY --from=proto-format-build /src/api /api/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NAME = Talos

ARTIFACTS := _out
TOOLS ?= ghcr.io/siderolabs/tools:v1.4.0-alpha.0-17-gcd9687b
PKGS ?= v1.4.0-alpha.0-26-g185f482
PKGS ?= v1.4.0-alpha.0-29-g5dbce6b
EXTRAS ?= v1.4.0-alpha.0-5-g8b28b6b
# renovate: datasource=github-tags depName=golang/go
GO_VERSION ?= 1.20
Expand Down
20 changes: 20 additions & 0 deletions hack/test/e2e-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@ case "${WITH_CONFIG_PATCH:-false}" in
;;
esac

case "${WITH_CONFIG_PATCH_FILE:-false}" in
# using arrays here to preserve spaces properly in WITH_CONFIG_PATCH_FILE
false)
CONFIG_PATCH_FLAG=()
;;
*)
CONFIG_PATCH_FLAG=(--config-patch "@${WITH_CONFIG_PATCH_FILE}")
;;
esac

case "${WITH_CONFIG_PATCH_FILE_WORKER:-false}" in
# using arrays here to preserve spaces properly in WITH_CONFIG_PATCH_FILE
false)
CONFIG_PATCH_FLAG=()
;;
*)
CONFIG_PATCH_FLAG=(--config-patch-worker "@${WITH_CONFIG_PATCH_FILE_WORKER}")
;;
esac

function create_cluster {
build_registry_mirrors

Expand Down
42 changes: 35 additions & 7 deletions hack/test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,44 @@ function build_registry_mirrors {
}

function run_extensions_test {
# e2e-qemu creates 3 controlplanes
# use a worker node to test extensions
"${TALOSCTL}" config node 172.20.1.5

echo "Testing firmware extensions..."
${TALOSCTL} ls /lib/firmware | grep amd-ucode
${TALOSCTL} ls /lib/firmware | grep bnx2x
${TALOSCTL} ls /lib/firmware | grep i915
${TALOSCTL} ls /lib/firmware | grep intel-ucode

echo "Testing kernel modules tree extension..."
${TALOSCTL} get extensions modules.dep
KERNEL_VERSION=$(${TALOSCTL} get extensions modules.dep -o json | jq -r '.spec.metadata.version')
${TALOSCTL} ls /lib/modules/${KERNEL_VERSION}/extras/ | grep gasket
${TALOSCTL} read /lib/modules/${KERNEL_VERSION}/modules.dep | grep -E gasket
${TALOSCTL} ls /lib/modules/${KERNEL_VERSION}/extras/ | grep drbd
${TALOSCTL} read /lib/modules/${KERNEL_VERSION}/modules.dep | grep -E drbd

echo "Testing iscsi-tools extensions service..."
${TALOSCTL} services ext-iscsid | grep -E "STATE\s+Running"
${TALOSCTL} services ext-tgtd | grep -E "STATE\s+Running"

echo "Testing gVsisor..."
${KUBECTL} apply -f ${PWD}/hack/test/gvisor/manifest.yaml
sleep 10
${KUBECTL} wait --for=condition=ready pod nginx-gvisor --timeout=1m

echo "Testing firmware extension..."
${TALOSCTL} ls -lr /lib/firmware | grep intel-ucode

echo "Testing extension service..."
curl http://172.20.1.2/ | grep Hello
${TALOSCTL} read /proc/sys/user/max_user_namespaces
${TALOSCTL} get extensions
${TALOSCTL} get mc -o yaml
${KUBECTL} get pods
${KUBECTL} describe pod nginx-gvisor
${KUBECTL} wait --for=condition=ready pod nginx-gvisor --timeout=2m

echo "Testing hello-world extension service..."
${TALOSCTL} services ext-hello-world | grep -E "STATE\s+Running"
curl http://172.20.1.5/ | grep Hello

# set talosctl config back to the first controlplane
"${TALOSCTL}" config node 172.20.1.2
}

function run_csi_tests {
Expand Down
2 changes: 1 addition & 1 deletion pkg/machinery/gendata/data/pkgs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4.0-alpha.0-26-g185f482
v1.4.0-alpha.0-29-g5dbce6b

0 comments on commit 5a01d5f

Please sign in to comment.