Skip to content

feat(chart): add health probes to api-rest #329

feat(chart): add health probes to api-rest

feat(chart): add health probes to api-rest #329

Workflow file for this run

name: K8s CI
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
jobs:
k8s-ci:
runs-on: ubuntu-latest
steps:
- name: Bind mount /dev/sda1 to /nix
run: |
sudo mkdir -p /nix
sudo mount --bind /mnt /nix
lsblk
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: DeterminateSystems/nix-installer-action@v11
with:
kvm: true
- uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Pre-populate nix-shell
run: |
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
nix-shell ./scripts/k8s/shell.nix --run "echo"
- name: Build binaries and images
id: build
run: |
TAG=$(nix-shell ./shell.nix --run './scripts/python/generate-test-tag.sh')
TEST_DIR=$(realpath $(mktemp -d ./test-dir-XXXXXX))
nix-shell ./shell.nix --run "./scripts/python/tag-chart.sh $TAG"
RUSTFLAGS="-C debuginfo=0 -C strip=debuginfo" ./scripts/release.sh --tag $TAG --build-binary-out $TEST_DIR --no-static-linking --skip-publish --debug
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "bin=$TEST_DIR" >> $GITHUB_OUTPUT
- name: BootStrap k8s cluster
run: |
nix-shell ./scripts/k8s/shell.nix --run "./scripts/k8s/deployer.sh start --label"
- name: Load images to Kind cluster
run: nix-shell ./scripts/k8s/shell.nix --run "./scripts/k8s/load-images-to-kind.sh --tag ${{ steps.build.outputs.tag }} --trim-debug-suffix"
- name: Run Pytests
run: |
export UPGRADE_TARGET_VERSION=${{ steps.build.outputs.tag }}
export TEST_DIR=${{ steps.build.outputs.bin }}
nix-shell ./shell.nix --run "./scripts/python/test.sh"
- name: The job has failed
if: ${{ failure() }}
run: |
nix-shell ./scripts/k8s/shell.nix --run "kubectl get pods -A -o wide"
nix-shell ./scripts/k8s/shell.nix --run "kubectl -n mayastor logs -lopenebs.io/release=mayastor --all-containers=true"
k8s-ci-vm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v11
with:
kvm: true
- uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Pre-populate nix-shell
run: |
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
nix-shell ./scripts/k8s/shell.nix --run "echo"
- name: Test on VM
run: |
nix-shell ./scripts/k8s/shell.nix --run "cd chart; helm dependency update"
nix-build ./tests/helm/test.nix --option sandbox false