Repository navigation
feat(cluster): step a server down and back up under memory pressure without losing its etcd vote #44
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Headscale Litestream | |
| # Runs tests/litestream/run.sh: the headscale_hosted provider with Litestream and a warm standby against an S3-compatible store, a real Tailscale client, promotion of the standby, and the headscale_in_cluster guard, once as is and once with the Headscale hosts pinning github_runner_cluster_docker_context while the current Docker context points at nothing. Only on changes that can affect them. | |
| # | |
| # Runs on GitHub-hosted ubuntu-latest, which has the Docker daemon the test needs. The work directory sits under runner.temp, which the job always has write access to. | |
| on: | |
| pull_request: | |
| paths: | |
| - roles/github_runner_cluster/tasks/mesh/headscale_*.yml | |
| - roles/github_runner_cluster/tasks/headscale_promote.yml | |
| - roles/github_runner_cluster/tasks/docker_context.yml | |
| - plugins/filter/docker.py | |
| - tests/lib/** | |
| - roles/github_runner_cluster/templates/headscale/** | |
| - roles/github_runner_cluster/files/headscale/** | |
| - roles/github_runner_cluster/defaults/main.yml | |
| - playbooks/promote_headscale_standby.yml | |
| - tests/litestream/** | |
| - .github/workflows/litestream.yml | |
| workflow_dispatch: | |
| concurrency: | |
| group: litestream-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| litestream: | |
| name: Litestream and standby promotion${{ matrix.pin && ' (context pinned)' || '' }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Pinned: the Headscale hosts pin github_runner_cluster_docker_context while the current Docker context points at nothing (see tests/litestream/run.sh). | |
| pin: [false, true] | |
| env: | |
| COMPOSE_VERSION: v5.5.1 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install the pinned Docker Compose | |
| # Always the pinned version, not whatever the runner has: ubuntu-latest has shipped Compose releases the cluster role refuses (see its tasks/main.yml). The user plugin directory takes precedence over the system one. | |
| run: | | |
| set -euo pipefail | |
| docker version --format 'Docker Engine {{.Server.Version}}' | |
| case "$(uname -m)" in | |
| x86_64) arch=x86_64 ;; | |
| aarch64 | arm64) arch=aarch64 ;; | |
| *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;; | |
| esac | |
| mkdir -p "${HOME}/.docker/cli-plugins" | |
| base="https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-linux-${arch}" | |
| curl -fsSL -o "${RUNNER_TEMP}/docker-compose" "$base" | |
| echo "$(curl -fsSL "${base}.sha256" | cut -d' ' -f1) ${RUNNER_TEMP}/docker-compose" | sha256sum -c - | |
| install -m 0755 "${RUNNER_TEMP}/docker-compose" "${HOME}/.docker/cli-plugins/docker-compose" | |
| docker compose version | |
| - name: Install Ansible | |
| run: | | |
| set -euo pipefail | |
| if ! python3 -m venv "${RUNNER_TEMP}/venv" 2>/dev/null; then | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq python3-venv | |
| python3 -m venv "${RUNNER_TEMP}/venv" | |
| fi | |
| "${RUNNER_TEMP}/venv/bin/pip" install --quiet --prefer-binary ansible-core | |
| "${RUNNER_TEMP}/venv/bin/ansible-galaxy" collection install -r ansible/requirements.yml -p "${RUNNER_TEMP}/collections" | |
| echo "${RUNNER_TEMP}/venv/bin" >> "$GITHUB_PATH" | |
| - name: Run the test | |
| env: | |
| GRTEST_WORK: ${{ runner.temp }}/grtest-ls | |
| GRTEST_EXTRA_COLLECTIONS: ${{ runner.temp }}/collections | |
| GRTEST_PIN_CONTEXT: ${{ matrix.pin && '1' || '0' }} | |
| run: tests/litestream/run.sh | |
| required-checks: | |
| name: Headscale Litestream result | |
| needs: [litestream] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Fail if the test failed or was cancelled | |
| run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then | |
| echo "The test did not succeed:" | |
| echo '${{ toJSON(needs) }}' | |
| exit 1 | |
| fi |