diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49298277c4f..4e78a51a22e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-24.04, ubuntu-24.04-arm] - container_engine: ['docker'] # TODO: add 'podman' into the list + container_engine: ['docker', 'podman'] compose_profiles: ['feature-complete', 'errors-only'] name: ${{ format('integration test{0}{1}{2}', matrix.os == 'ubuntu-24.04-arm' && ' (arm64)' || '', matrix.container_engine == 'podman' && ' (podman)' || '', matrix.compose_profiles == 'errors-only' && ' (errors-only)' || '') }} env: @@ -73,4 +73,5 @@ jobs: uses: './' with: compose_profiles: ${{ matrix.compose_profiles }} + container_engine: ${{ matrix.container_engine }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/action.yaml b/action.yaml index 7f7a98f84fc..4fecaedb336 100644 --- a/action.yaml +++ b/action.yaml @@ -9,6 +9,9 @@ inputs: compose_profiles: required: false description: "Docker Compose profile to use. Defaults to feature-complete." + container_engine: + required: false + default: docker CODECOV_TOKEN: required: false description: "The Codecov token to upload coverage." @@ -67,9 +70,11 @@ runs: fi - name: Get Compose + if: ${{ inputs.container_engine == 'docker' }} uses: getsentry/self-hosted/get-compose-action@master - name: Compute Docker Volume Cache Keys + if: ${{ inputs.container_engine == 'docker' }} id: cache_key shell: bash run: | @@ -83,6 +88,7 @@ runs: echo "ARCH=$(uname -m)" >> $GITHUB_OUTPUT - name: Restore Sentry Volume Cache + if: ${{ inputs.container_engine == 'docker' }} id: restore_cache_sentry uses: BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd with: @@ -93,6 +99,7 @@ runs: sentry-postgres - name: Restore Snuba Volume Cache + if: ${{ inputs.container_engine == 'docker' }} id: restore_cache_snuba uses: BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd with: @@ -103,6 +110,7 @@ runs: sentry-clickhouse - name: Restore Kafka Volume Cache + if: ${{ inputs.container_engine == 'docker' }} id: restore_cache_kafka uses: BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd with: @@ -121,6 +129,8 @@ runs: # changed. Heats up your head a bit but if you think about it, it makes sense. SKIP_SENTRY_MIGRATIONS: ${{ steps.restore_cache_sentry.outputs.cache-hit == 'true' && '1' || '' }} SKIP_SNUBA_MIGRATIONS: ${{ steps.restore_cache_snuba.outputs.cache-hit == 'true' && '1' || '' }} + CONTAINER_ENGINE: ${{ inputs.container_engine }} + DEBUG: ${{ env.ACTIONS_STEP_DEBUG == 'true' }} shell: bash run: | cd ${{ github.action_path }} @@ -128,32 +138,40 @@ runs: cat <> sentry/enhance-image.sh #!/bin/bash touch /created-by-enhance-image + echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections apt-get update - apt-get install -y gcc libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev + apt-get install --yes --no-install-recommends gcc libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev EOT chmod 755 sentry/enhance-image.sh echo "python-ldap" > sentry/requirements.txt ./install.sh --no-report-self-hosted-issues --skip-commit-check - - name: Save Sentry Volume Cache - if: steps.restore_cache_sentry.outputs.cache-hit != 'true' + - name: Save Sentry Docker Volume Cache + if: ${{ steps.restore_cache_sentry.outputs.cache-hit != 'true' && inputs.container_engine == 'docker' }} uses: BYK/docker-volume-cache-action/save@be89365902126f508dcae387a32ec3712df6b1cd with: key: ${{ steps.restore_cache_sentry.outputs.cache-primary-key }} volumes: | sentry-postgres - - name: Save Snuba Volume Cache - if: steps.restore_cache_snuba.outputs.cache-hit != 'true' + - name: Save Sentry Podman Volume Cache + if: ${{ steps.restore_cache_sentry.outputs.cache-hit != 'true' && inputs.container_engine == 'podman' }} + uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 + with: + key: ${{ steps.restore_cache_sentry.outputs.cache-primary-key }}-podman + path: ${{ runner.temp }}/sentry-postgres.tar + + - name: Save Snuba Docker Volume Cache + if: ${{ steps.restore_cache_snuba.outputs.cache-hit != 'true' && inputs.container_engine == 'docker' }} uses: BYK/docker-volume-cache-action/save@be89365902126f508dcae387a32ec3712df6b1cd with: key: ${{ steps.restore_cache_snuba.outputs.cache-primary-key }} volumes: | sentry-clickhouse - - name: Save Kafka Volume Cache - if: steps.restore_cache_kafka.outputs.cache-hit != 'true' + - name: Save Kafka Docker Volume Cache + if: ${{ steps.restore_cache_kafka.outputs.cache-hit != 'true' && inputs.container_engine == 'docker' }} uses: BYK/docker-volume-cache-action/save@be89365902126f508dcae387a32ec3712df6b1cd with: key: ${{ steps.restore_cache_kafka.outputs.cache-primary-key }} @@ -171,10 +189,13 @@ runs: sudo swapon --show free -h - - name: Integration Test - shell: bash + - name: Integration Test with docker + if: ${{ inputs.container_engine == 'docker' }} env: + CONTAINER_ENGINE: ${{ inputs.container_engine }} + CONTAINER_ENGINE_PODMAN: ${{ inputs.container_engine == 'podman' && '1' || '0' }} COMPOSE_PROFILES: ${{ inputs.compose_profiles }} + shell: bash run: | sudo chown root /usr/bin/rsync && sudo chmod u+s /usr/bin/rsync rsync -aW --super --numeric-ids --no-compress --mkpath \ @@ -185,6 +206,21 @@ runs: cd ${{ github.action_path }} pytest -x --cov --junitxml=junit.xml _integration-test/ + - name: Integration Test with podman + if: ${{ inputs.container_engine == 'podman' }} + env: + CONTAINER_ENGINE: ${{ inputs.container_engine }} + CONTAINER_ENGINE_PODMAN: ${{ inputs.container_engine == 'podman' && '1' || '0' }} + COMPOSE_PROFILES: ${{ inputs.compose_profiles }} + shell: bash + run: | + set -x + for volume in sentry-postgres sentry-clickhouse sentry-kafka; do + podman volume export -o "${RUNNER_TEMP}/volumes/${volume}.tar" "$volume" + done + cd ${{ github.action_path }} + pytest -s -v -x --cov --junitxml=junit.xml _integration-test/ + - name: Upload coverage to Codecov if: inputs.CODECOV_TOKEN continue-on-error: true diff --git a/install/bootstrap-s3-nodestore.sh b/install/bootstrap-s3-nodestore.sh index c2cf91669f5..a1e273a00c2 100644 --- a/install/bootstrap-s3-nodestore.sh +++ b/install/bootstrap-s3-nodestore.sh @@ -1,6 +1,6 @@ echo "${_group}Bootstrapping seaweedfs (node store)..." -$dc up --wait seaweedfs postgres +start_service_and_wait_ready seaweedfs postgres $dc exec -e "HTTP_PROXY=${HTTP_PROXY:-}" -e "HTTPS_PROXY=${HTTPS_PROXY:-}" -e "NO_PROXY=${NO_PROXY:-}" -e "http_proxy=${http_proxy:-}" -e "https_proxy=${https_proxy:-}" -e "no_proxy=${no_proxy:-}" seaweedfs apk add --no-cache s3cmd $dc exec seaweedfs mkdir -p /data/idx/ s3cmd="$dc exec seaweedfs s3cmd" diff --git a/install/detect-platform.sh b/install/detect-platform.sh index 9009f79b63d..a69eddfd9ca 100644 --- a/install/detect-platform.sh +++ b/install/detect-platform.sh @@ -22,7 +22,8 @@ fi export DOCKER_ARCH=$($CONTAINER_ENGINE info --format "$FORMAT") if [[ "$DOCKER_ARCH" = "x86_64" || "$DOCKER_ARCH" = "amd64" ]]; then export DOCKER_PLATFORM="linux/amd64" -elif [[ "$DOCKER_ARCH" = "aarch64" ]]; then +# NOTE(aldy505): Docker outputs `aarch64`, but Podman outputs `arm64`. +elif [[ "$DOCKER_ARCH" = "aarch64" || "$DOCKER_ARCH" = "arm64" ]]; then export DOCKER_PLATFORM="linux/arm64" else echo "FAIL: Unsupported docker architecture $DOCKER_ARCH."