Skip to content
Draft
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
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -73,4 +73,5 @@ jobs:
uses: './'
with:
compose_profiles: ${{ matrix.compose_profiles }}
container_engine: ${{ matrix.container_engine }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
54 changes: 45 additions & 9 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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: |
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -121,39 +129,49 @@ 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 }}
# Add some customizations to test that path
cat <<EOT >> 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 }}
Expand All @@ -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 \
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion install/bootstrap-s3-nodestore.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion install/detect-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Loading