diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8350f16..43199c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,13 @@ concurrency: jobs: unittests: - name: unittests - runs-on: ubuntu-24.04 + name: unittests (${{ matrix.os }}) + # amd64 and arm64 runners + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, ubuntu-24.04-arm] steps: - name: Checkout uses: actions/checkout@v6 @@ -94,8 +99,12 @@ jobs: docker: # builds the image and checks the SSL handling of its entrypoint (contrib/docker-smoke-test.sh) - name: docker - runs-on: ubuntu-24.04 + name: docker (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, ubuntu-24.04-arm] steps: - uses: actions/checkout@v6 @@ -107,12 +116,13 @@ jobs: integration: # ElectrumX against a real Palladium node in regtest mode (tests/integration), with each DB engine - name: integration (${{ matrix.db_engine }}) - runs-on: ubuntu-24.04 + name: integration (${{ matrix.db_engine }}, ${{ matrix.os }}) + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: db_engine: [leveldb, rocksdb] + os: [ubuntu-24.04, ubuntu-24.04-arm] steps: - uses: actions/checkout@v6 diff --git a/CLAUDE.md b/CLAUDE.md index 857b3f4..3b3d0ce 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -62,5 +62,5 @@ Integration tests (`tests/integration`): `node/Dockerfile` + `node/palladium.con - History is a snapshot of upstream commit `280cb33` plus Palladium commits: no common history, `git merge upstream` does not work. Update with `git diff 280cb33 upstream/master | git apply --3way` (see the "Fork notes" in `README.md`). - Do not create, move or delete git tags. - Do not `git add -A`: generated files (`.coverage`, `.env`) get swept in. Add files by name. `.coverage` and `.env` are in `.gitignore`. -- CI (`.github/workflows/ci.yml`, on `main`): `unittests`, `pycodestyle`, `build_docs`, `docker` (builds the image, runs the smoke test). It runs on Ubuntu 24.04; `test_storage.py` fails with RocksDB 9.10 (Debian trixie) in teardown. +- CI (`.github/workflows/ci.yml`, on `main`): `unittests`, `pycodestyle`, `build_docs`, `docker` (builds the image, runs the smoke test). It runs on Ubuntu 24.04, amd64 and arm64 (`ubuntu-24.04-arm`) for `unittests`, `docker` and `integration`. - In repo documentation never cite paths or links of the palladiumcore repository; describe the concept (the Palladium node, the `palladium` Docker network). diff --git a/DEPLOY.md b/DEPLOY.md index 4e7a254..0eaf6da 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -189,6 +189,13 @@ DONATION_ADDRESS=plm1q...your address... amount) and use an address you are happy to make public, since it is sent to everyone who connects. - After changing it, apply it with `docker compose up -d` (the container is recreated with the new value). +## Architectures + +amd64 and arm64 (for example a Raspberry Pi 5) are both supported: the Docker image builds natively on either. +Without Docker, the DB engine bindings are compiled from source, so install the development headers first: +`libleveldb-dev` for LevelDB (`plyvel`), or RocksDB >= 8.0 (`librocksdb-dev`) for RocksDB (`rocksdb-ng`). +Debian 12 ships RocksDB 7.8.3, which is too old: use Debian 13 (or the Docker image) for RocksDB. + ## Data directory and first start Create the data directory as the user that runs Docker, before the first start (otherwise Docker creates it as root and diff --git a/README.md b/README.md index 1270d2e..7432a0a 100644 --- a/README.md +++ b/README.md @@ -66,21 +66,19 @@ Verified on aarch64 (Raspberry Pi, Debian 12, Docker 29): - the systemd unit in `contrib/systemd` starts, syncs a regtest chain, answers on the Electrum protocol and `electrumx_rpc`, and stops cleanly through its `ExecStop`. +Added: the `unittests`, `docker` and `integration` CI jobs run on amd64 and arm64 (`ubuntu-24.04-arm`); +`DEPLOY.md` has an "Architectures" section (headers needed to compile `plyvel` and `rocksdb-ng`). +`docker build --no-cache` of the server image on arm64 works (`rocksdb-ng` compiles from scratch), and the +RocksDB tests in `tests/server/test_storage.py` pass with RocksDB 9.10 (the fixture now closes the DB before the `chdir`). + +`rocksdb-ng` needs RocksDB >= 8.0: Debian 12 (7.8.3) is too old, use Debian 13 or the Docker image. + Still to do or verify: -- **RocksDB version**: `rocksdb-ng` needs RocksDB >= 8.0 and compiles from source; Debian 12 (7.8.3) is too old, - use Debian 13 or the Docker image. In `tests/server/test_storage.py` the 7 RocksDB tests error at teardown with - 9.10 (the fixture does `os.chdir` before `db.close()` on a relative path), the same on ARM and amd64. -- **Server image build without cache**: confirm that `rocksdb-ng` compiles on arm64 from scratch - (`docker build --no-cache -t plm-electrumx .`). - **A full sync** of the server image against a real Palladium node on ARM (speed, memory, `CACHE_MB`). -- **amd64**: nothing was run on this machine, rely on the CI. -- **CI**: add an ARM runner (`ubuntu-24.04-arm`) to the `unittests`, `integration` and `docker` jobs - of `.github/workflows/ci.yml`, so both architectures are tested on every push. -- **Published image** (if any): build it multi-arch with +- **First run of the amd64/arm64 CI matrix** on GitHub (nothing amd64 was run on the ARM machine used here). +- **Published image** (none is published today): build it multi-arch with `docker buildx build --platform linux/amd64,linux/arm64`. -- **Development on ARM**: `plyvel` needs `libleveldb-dev` to compile (`apt install libleveldb-dev`); - document it in `DEPLOY.md` if it is useful there. ## Fork notes diff --git a/tests/server/test_storage.py b/tests/server/test_storage.py index 1838a91..086f3e4 100644 --- a/tests/server/test_storage.py +++ b/tests/server/test_storage.py @@ -22,8 +22,8 @@ def db(tmpdir, request): os.chdir(str(tmpdir)) db = db_class(request.param)("db", False) yield db - os.chdir(cwd) db.close() + os.chdir(cwd) def test_put_get(db):