Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: actions-smoke-test
name: smoke-build

on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/pr_actions-smoke-test.yml
- .github/workflows/smoke-build.yaml
- build-container-image/action.yaml
- build-product-image/action.yaml
- free-disk-space/action.yaml
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ particular step in a workflow.
- [run-integration-test](./run-integration-test/README.md)
- [run-pre-commit](./run-pre-commit/README.md)
- [send-slack-notification](./send-slack-notification/README.md)
- [setup-k8s-tools](./setup-k8s-tools/README.md)
- [setup-tools](./setup-tools/README.md)
- [shard](./shard/README.md)
<!-- end:links -->
102 changes: 16 additions & 86 deletions run-integration-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,16 @@ outputs:
runs:
using: composite
steps:
- name: Install interu
uses: stackabletech/actions/setup-tools
with:
interu-version: ${{ inputs.interu-version }}
- name: Extract Test and Instance Configuration
env:
TEST_MODE_INPUT: ${{ inputs.test-mode-input }}
TEST_SUITE: ${{ inputs.test-suite }}
TEST_MODE: ${{ inputs.test-mode }}
TEST: ${{ inputs.test }}
INTERU_VERSION: ${{ inputs.interu-version }}
GITHUB_DEBUG: ${{ runner.debug }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}"
Expand All @@ -74,10 +77,6 @@ runs:
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

# Download interu
curl -fsSL -o /tmp/interu "https://github.com/stackabletech/actions/releases/download/interu-$INTERU_VERSION/interu-x86_64-unknown-linux-gnu"
sudo install -m 755 -t /usr/local/bin /tmp/interu

# Generate the cluster name
echo "KUBERNETES_CLUSTER_NAME=integration-test-${GITHUB_REPOSITORY}-${GITHUB_RUN_ID}" | tee -a "$GITHUB_ENV"

Expand All @@ -97,93 +96,24 @@ runs:
# Install all tools BEFORE creating the cluster, because if some of the tools fail to download
# and are therefore not available, there is no need to create the cluster or run the tests,
# because the tests can never run in the first place.

# We technically don't need to install kubectl, kind or helm because it is already part of the installed
# tools of the runner image, but we at least install kubectl and helm explicitly, to be able to pin the versions.
# See https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-kubernetes-tools.sh
- name: Install kubectl
env:
KUBECTL_VERSION: ${{ inputs.kubectl-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")

echo "::group::Install kubectl"
curl -fsSL -o /tmp/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl"
# Overwrite the existing binary
sudo install -m 755 -t /usr/local/bin /tmp/kubectl

kubectl version --client
echo "::endgroup::"

- name: Install Helm
env:
HELM_VERSION: ${{ inputs.helm-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

PLATFORM=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_platform.sh")
ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")

FILENAME="helm-${HELM_VERSION}-${PLATFORM}-${ARCH}.tar.gz"

echo "::group::Install helm"
mkdir /tmp/helm
curl -fsSL -o /tmp/helm/helm.tar.gz "https://get.helm.sh/${FILENAME}"
curl -fsSL -o /tmp/helm/helm.tar.gz.asc "https://github.com/helm/helm/releases/download/${HELM_VERSION}/${FILENAME}.asc"

curl https://keybase.io/mattfarina/pgp_keys.asc | gpg --import
gpg --verify /tmp/helm/helm.tar.gz.asc /tmp/helm/helm.tar.gz

tar --directory="/tmp/helm" --strip-components=1 -zxvf /tmp/helm/helm.tar.gz "${PLATFORM}-${ARCH}"
# Overwrite the existing binary
sudo install -m 755 -t /usr/local/bin /tmp/helm/helm

helm version --short
echo "::endgroup::"

- name: Install kubectl-kuttl
env:
KUTTL_VERSION: ${{ inputs.kuttl-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

curl -fsSL -o /tmp/kubectl-kuttl "https://github.com/kudobuilder/kuttl/releases/download/v$KUTTL_VERSION/kubectl-kuttl_${KUTTL_VERSION}_linux_x86_64"
sudo install -m 755 -t /usr/local/bin /tmp/kubectl-kuttl
- name: Install kubectl, kubectl-kuttl, and helm
uses: stackablectl/actions/setup-k8s-tools
with:
kubectl-version: ${{ inputs.kubectl-version }}
kuttl-version: ${{ inputs.kuttl-version }}
helm-version: ${{ inputs.helm-version }}

# Python3 is already installed, if we ever need to specify the version, we can use the
# setup-python action.
# See https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-python.sh
- name: Install beku
env:
BEKU_VERSION: ${{ inputs.beku-version }}
shell: bash
run: |
set -euo pipefail
pip install "beku-stackabletech==$BEKU_VERSION"

#
# mikefarah/yq is already installed on the runner
# See https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-yq.sh

- name: Install stackablectl
env:
STACKABLECTL_VERSION: ${{ inputs.stackablectl-version }}
shell: bash
run: |
set -euo pipefail

curl -fsSL -o /tmp/stackablectl "https://github.com/stackabletech/stackable-cockpit/releases/download/stackablectl-$STACKABLECTL_VERSION/stackablectl-x86_64-unknown-linux-gnu"
sudo install -m 755 -t /usr/local/bin /tmp/stackablectl
- name: Install stackablectl and beku
uses: stackabletech/actions/setup-tools
with:
stackablectl-version: ${{ inputs.stackablectl-version }}
beku-version: ${{ inputs.beku-version }}

- name: Install apt packages
shell: bash
Expand Down
26 changes: 26 additions & 0 deletions setup-k8s-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# `setup-k8s-tools`

> Manifest: [setup-k8s-tools/action.yml][setup-k8s-tools]

This action downloads and installs Kubernetes tools.

## Inputs and Outputs

> [!TIP]
> For descriptions of the inputs and outputs, see the complete [setup-k8s-tools] action.

### Inputs

| Input | Required | Description |
| ----------------- | -------- | ----------------------------- |
| `kubectl-version` | No | The version of kubectl* |
| `kuttl-version` | No | The version of kubectl-kuttl* |
| `helm-version` | No | The version of helm* |

\* If no input is set, the tool won't be installed.

### Outputs

None.

[setup-k8s-tools]: ./action.yaml
80 changes: 80 additions & 0 deletions setup-k8s-tools/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: Setup Kubernetes Tools
description: This action sets up Kubernetes tools
inputs:
kubectl-version:
description: The version of kubectl
kuttl-version:
description: The version of kubectl-kuttl
helm-version:
description: The version of helm
runs:
using: composite
steps:
# We technically don't need to install kubectl, kind or helm because it is already part of the installed
# tools of the runner image, but we at least install kubectl and helm explicitly, to be able to pin the versions.
# See https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-kubernetes-tools.sh
- name: Install kubectl
if: inputs.kubectl-version
env:
KUBECTL_VERSION: ${{ inputs.kubectl-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")

echo "::group::Install kubectl"
curl -fsSL -o /tmp/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl"
# Overwrite the existing binary
sudo install -m 755 -t /usr/local/bin /tmp/kubectl

kubectl version --client
echo "::endgroup::"

- name: Install kubectl-kuttl
if: inputs.kuttl-version
env:
KUTTL_VERSION: ${{ inputs.kuttl-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

echo "::group::Install kubectl-kuttl"
curl -fsSL -o /tmp/kubectl-kuttl "https://github.com/kudobuilder/kuttl/releases/download/v$KUTTL_VERSION/kubectl-kuttl_${KUTTL_VERSION}_linux_x86_64"
sudo install -m 755 -t /usr/local/bin /tmp/kubectl-kuttl
echo "::endgroup::"

- name: Install Helm
if: inputs.helm-version
env:
HELM_VERSION: ${{ inputs.helm-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

PLATFORM=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_platform.sh")
ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")

FILENAME="helm-${HELM_VERSION}-${PLATFORM}-${ARCH}.tar.gz"

echo "::group::Install helm"
mkdir /tmp/helm
curl -fsSL -o /tmp/helm/helm.tar.gz "https://get.helm.sh/${FILENAME}"
curl -fsSL -o /tmp/helm/helm.tar.gz.asc "https://github.com/helm/helm/releases/download/${HELM_VERSION}/${FILENAME}.asc"

curl https://keybase.io/mattfarina/pgp_keys.asc | gpg --import
gpg --verify /tmp/helm/helm.tar.gz.asc /tmp/helm/helm.tar.gz

tar --directory="/tmp/helm" --strip-components=1 -zxvf /tmp/helm/helm.tar.gz "${PLATFORM}-${ARCH}"
# Overwrite the existing binary
sudo install -m 755 -t /usr/local/bin /tmp/helm/helm

helm version --short
echo "::endgroup::"
27 changes: 27 additions & 0 deletions setup-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# `setup-tools`

> Manifest: [setup-tools/action.yml][setup-tools]

This action downloads and installs Stackable tools.

## Inputs and Outputs

> [!TIP]
> For descriptions of the inputs and outputs, see the complete [setup-tools] action.

### Inputs

| Input | Required | Description |
| ---------------------- | -------- | ---------------------------- |
| `boil-version` | No | The version of boil* |
| `stackablectl-version` | No | The version of stackablectl* |
| `interu-version` | No | The version of interu* |
| `beku-version` | No | The version of beku* |

\* If no input is set, the tool won't be installed.

### Outputs

None.

[setup-tools]: ./action.yaml
71 changes: 71 additions & 0 deletions setup-tools/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: Setup Stackable Tools
description: This action sets up Stackable tools
inputs:
boil-version:
description: The version of boil
stackablectl-version:
description: The version of stackablectl
interu-version:
description: The version of interu
beku-version:
description: The version of beku
runs:
using: composite
steps:
- name: Install boil
if: inputs.boil-version
env:
BOIL_VERSION: ${{ inputs.boil-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

ARCH=$(uname -m)

curl -fsSL -o /tmp/boil "https://github.com/stackabletech/docker-images/releases/download/boil-${BOIL_VERSION}/boil-${ARCH}-unknown-linux-gnu"
sudo install -m 755 -t /usr/local/bin /tmp/boil

- name: Install stackablectl
if: inputs.stackablectl-version
env:
STACKABLECTL_VERSION: ${{ inputs.stackablectl-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

ARCH=$(uname -m)

curl -fsSL -o /tmp/stackablectl "https://github.com/stackabletech/stackable-cockpit/releases/download/stackablectl-${STACKABLECTL_VERSION}/stackablectl-${ARCH}-unknown-linux-gnu"
sudo install -m 755 -t /usr/local/bin /tmp/stackablectl

- name: Install interu
if: inputs.interu-version
env:
INTERU_VERSION: ${{ inputs.interu-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

ARCH=$(uname -m)

curl -fsSL -o /tmp/interu "https://github.com/stackabletech/actions/releases/download/interu-${INTERU_VERSION}/interu-${ARCH}-unknown-linux-gnu"
sudo install -m 755 -t /usr/local/bin /tmp/interu

- name: Install beku
if: inputs.beku-version
env:
BEKU_VERSION: ${{ inputs.beku-version }}
GITHUB_DEBUG: ${{ runner.debug }}
shell: bash
run: |
set -euo pipefail
[ -n "$GITHUB_DEBUG" ] && set -x

pip install "beku-stackabletech==$BEKU_VERSION"