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
23 changes: 23 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dockerfile for cardano-node-tests (Antithesis/Moog driver image)
#
# Minimal image: nix is configured and the repo is copied in.
# All heavy setup (cardano binaries, Python venv) happens at runtime
# via regression.sh, which manages its own nix environment through its shebang.
#
# Build and push to GHCR before submitting to Moog:
# docker build -f docker/Dockerfile -t ghcr.io/intersectmbo/cardano-node-tests-antithesis:latest .
# docker push ghcr.io/intersectmbo/cardano-node-tests-antithesis:latest

FROM nixos/nix:2.25.5

ARG GIT_REVISION
ENV GIT_REVISION=${GIT_REVISION}

RUN mkdir -p /etc/nix && \
echo "extra-substituters = https://cache.iog.io" >> /etc/nix/nix.conf && \
echo "extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" >> /etc/nix/nix.conf && \
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf && \
echo "accept-flake-config = true" >> /etc/nix/nix.conf

WORKDIR /work
COPY . /work/
66 changes: 66 additions & 0 deletions docker/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Ignore unnecessary files during Docker build

# Git
.git/
.gitignore

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/
*.egg

# Virtual environments
.venv/
venv/
ENV/
env/

# Testing artifacts
run_workdir/
.artifacts/
.cli_coverage/
.reports/
allure-results/
allure-results.tar.xz
testrun-report.*
*.log
*.json.log

# IDE
.idea/
.vscode/
*.swp
*.swo
*~

# Nix
result
result-*

# Documentation
docs/_build/
*.md

# Temporary files
*.tmp
*.bak
.DS_Store

# Scripts output
scripts/destination/
scripts/destination_working/

# Coverage
.coverage
htmlcov/
cli_coverage.json
requirements_coverage.json

# CI specific
.bin/
59 changes: 59 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Docker setup for cardano-node-tests (Antithesis/Moog)

This directory contains the driver image and compose file for submitting
`cardano-node-tests` to Antithesis via the Moog platform.

## How it works

- `Dockerfile` — minimal image: configures Nix and copies the repo into
`/work/`. No binaries are pre-built; `regression.sh` handles all setup at
runtime via its own Nix shebang. Requires `GIT_REVISION` build arg (the
current commit hash) so pytest can identify the revision without a `.git`
directory inside the image.
- `docker-compose.yaml` — single `driver` service for Moog submission.

## Workflow

### 1. Build and push the image

```bash
docker build -f docker/Dockerfile \
--build-arg GIT_REVISION=$(git rev-parse HEAD) \
-t ghcr.io/intersectmbo/cardano-node-tests-antithesis:latest .

docker push ghcr.io/intersectmbo/cardano-node-tests-antithesis:latest
```

### 2. Validate the compose locally

```bash
docker compose -f docker/docker-compose.yaml config
docker compose -f docker/docker-compose.yaml up --build
```

### 3. Submit to Moog

```bash
moog requester create-test \
--platform github \
--username saratomaz \
--repository IntersectMBO/cardano-node-tests \
--directory ./docker \
--commit $(git rev-parse HEAD) \
--try 1 \
--duration 2
```

## Environment variables

| Variable | Default | Description |
|-------------------|------------|------------------------------------------|
| `NODE_REV` | `master` | cardano-node git revision |
| `CARDANO_CLI_REV` | (built-in) | cardano-cli revision, empty = use node's |
| `DBSYNC_REV` | (disabled) | db-sync revision, empty = disabled |
| `RUN_TARGET` | `tests` | `tests`, `testpr`, or `testnets` |
| `MARKEXPR` | | pytest marker expression |
| `CLUSTERS_COUNT` | | number of local cluster instances |
| `CLUSTER_ERA` | | e.g. `conway` |
| `PROTOCOL_VERSION`| | e.g. `11` |
| `UTXO_BACKEND` | | e.g. `disk`, `mem` |
30 changes: 30 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docker Compose for Antithesis/Moog test submission.
#
# Submit to Moog:
# moog requester create-test \
# --platform github --username <you> \
# --repository IntersectMBO/cardano-node-tests \
# --directory ./docker \
# --commit <hash> --try 1 --duration 2
#
# Validate locally before submitting:
# docker compose -f docker/docker-compose.yaml config
# docker compose -f docker/docker-compose.yaml up --build

services:
driver:
image: ghcr.io/intersectmbo/cardano-node-tests-antithesis:latest
build:
context: ..
dockerfile: docker/Dockerfile
command: ["/work/.github/regression.sh"]
environment:
- NODE_REV=${NODE_REV:-master}
- CARDANO_CLI_REV=${CARDANO_CLI_REV:-}
- DBSYNC_REV=${DBSYNC_REV:-}
- RUN_TARGET=${RUN_TARGET:-tests}
- MARKEXPR=${MARKEXPR:-}
- CLUSTERS_COUNT=${CLUSTERS_COUNT:-}
- CLUSTER_ERA=${CLUSTER_ERA:-}
- PROTOCOL_VERSION=${PROTOCOL_VERSION:-}
- UTXO_BACKEND=${UTXO_BACKEND:-}