Skip to content

Replace localstack with MicroCeph #1162

Open
srbouffard wants to merge 5 commits intotrack/1from
validate-track-1-ci
Open

Replace localstack with MicroCeph #1162
srbouffard wants to merge 5 commits intotrack/1from
validate-track-1-ci

Conversation

@srbouffard
Copy link
Copy Markdown
Contributor

@srbouffard srbouffard commented Apr 24, 2026

Changes

1. Replace localstack with MicroCeph radosgw for S3 tests

S3 integration tests now use MicroCeph radosgw as the S3-compatible backend, matching the fix applied to discourse operator.

  • Added s3-installation.sh (sets up MicroCeph radosgw with fixed credentials)
  • Removed localstack-installation.sh
  • Updated tests/integration/conftest.py: replaced localstack_address fixture with s3_address (auto-detects host IP, port 7480, fixed credentials)
  • Updated tests/conftest.py, tox.ini, and .github/workflows/integration_test.yaml to use the new script and env var names

2. Fix psycopg2-binary install hook crash

charmcraft 4.x runs two pip passes: first installs charm-binary-python-packages as binary wheels, then installs requirements.txt with --no-binary=:all:. Without version pins in charm-binary-python-packages, the second pass detects a version mismatch and recompiles from source — producing a .so that links against system libpq.so.5, which is absent in Juju's charm container.

Fix: pin versions in charmcraft.yaml to match requirements.txt so the binary wheel is already satisfied and pip skips recompilation.

  • charmcraft.yaml: psycopg2-binary==2.9.10 and cryptography==46.0.4 in charm-binary-python-packages
  • requirements.txt: downgraded psycopg2-binary from 2.9.112.9.10 (2.9.11 also lacked a compatible binary wheel in this build context)

srbouffard and others added 4 commits April 24, 2026 16:08
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Localstack is no longer functional in CI. Switch to MicroCeph radosgw
as an S3-compatible backend, matching the fix applied in
canonical/discourse-k8s-operator#435.

- Add s3-installation.sh that bootstraps MicroCeph and enables radosgw
- Remove localstack-installation.sh
- Update integration_test.yaml to use s3-installation.sh (no more
  --localstack-address extra-argument)
- Rename --localstack-address → --s3-address throughout tests
- Switch S3 endpoint port from 4566 to 7480 (radosgw)
- Use fixed credentials matching s3-installation.sh (radosgw requires
  a pre-created user, unlike localstack which accepts any credentials)
- Auto-detect host IP in s3_address fixture via _host_ip()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
psycopg2-binary 2.9.11 does not provide a working binary wheel in the
charmcraft build context, causing the charm's install hook to fail at
runtime with 'libpq.so.5: cannot open shared object file'. 2.9.10 is
the version used on main and is known to work correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
charmcraft installs charm-binary-python-packages first as binary
wheels, then installs requirements.txt with --no-binary=:all:.
Without version pins, it installs the latest binary version, then
the pinned version from requirements.txt is compiled from source
(overwriting the binary install).

Pinning to the same versions as requirements.txt ensures the binary
wheel satisfies the version constraint, so pip skips reinstallation.

This fixes the install hook crash:
  ImportError: libpq.so.5: cannot open shared object file

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Unused entries in .trivyignore

Image: ghcr.io/canonical/synapse:dbc4131412718464902fffd70259f4954f296293-_4.0_amd64

The following CVEs are in .trivyignore but not ignored by Trivy anymore:

@srbouffard srbouffard changed the title Add test change Replace localstack with MicroCeph Apr 24, 2026
@srbouffard srbouffard marked this pull request as ready for review April 24, 2026 23:37
@srbouffard srbouffard requested a review from a team as a code owner April 24, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants