Files
PSProxmoxVE/tests/infrastructure/docker-compose.storage.yml
T
Clint Branham 9817d30a11 feat(ci): multi-node PVE provisioning and Docker-based shared storage
Provision two PVE nodes per version (a/b) for future cluster testing,
plus Docker-based iSCSI target and NFS server for shared storage tests.

Multi-node changes:
- Each PVE version gets two nodes: 9a/9b and 8a/8b (4 VMs total)
- Parameterized answer.toml FQDN for unique hostnames per node
- Per-node auto-install ISOs with unique answer files
- Node name discovered from FQDN and included in test config
- API token creation handles pre-existing tokens (delete + recreate)
- New test env vars: PVETEST_HOST_B, PVETEST_APITOKEN_B
- Removed preflight cleanup from provision (use explicit cleanup instead)

Docker storage services:
- New docker-compose.storage.yml with iSCSI (tgt) and NFS containers
- Host networking so PVE nodes can reach storage services
- Docker socket mounted into dev-infra container for host Docker access
- Docker CLI added to dev-infra Dockerfile stage
- New test env vars: PVETEST_STORAGE_VM_IP, PVETEST_ISCSI_IQN, PVETEST_NFS_EXPORT

Other fixes:
- first-boot.sh installs open-iscsi on PVE nodes
- preflight-cleanup.sh handles empty ISO filename gracefully
- TMPDIR set to work dir to avoid /tmp overflow during ISO uploads

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:34:15 -05:00

54 lines
1.7 KiB
YAML

## Shared storage services for integration testing.
## Provides iSCSI target and NFS server accessible from nested PVE nodes.
##
## These run on the GitHub runner (or any Docker host on the same network
## as the PVE nodes) using host networking so the PVE nodes can reach them.
##
## Usage:
## docker compose -f tests/infrastructure/docker-compose.storage.yml up -d
## docker compose -f tests/infrastructure/docker-compose.storage.yml down -v
services:
iscsi-target:
image: ubuntu:24.04
container_name: pvetest-iscsi
network_mode: host
privileged: true
volumes:
- iscsi-data:/srv/iscsi
environment:
ISCSI_IQN: ${ISCSI_IQN:-iqn.2024-01.local.test:storage}
ISCSI_LUN_SIZE: ${ISCSI_LUN_SIZE:-10G}
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -e
apt-get update -qq && apt-get install -y -qq tgt >/dev/null 2>&1
mkdir -p /srv/iscsi
if [ ! -f /srv/iscsi/lun0.img ]; then
truncate -s $$ISCSI_LUN_SIZE /srv/iscsi/lun0.img
fi
tgtd --foreground &
sleep 2
tgtadm --lld iscsi --op new --mode target --tid 1 -T $$ISCSI_IQN
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store /srv/iscsi/lun0.img
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
echo "iSCSI target ready: $$ISCSI_IQN (port 3260)"
wait
restart: unless-stopped
nfs-server:
image: erichough/nfs-server:latest
container_name: pvetest-nfs
network_mode: host
privileged: true
volumes:
- nfs-data:/srv/nfs/shared
environment:
NFS_EXPORT_0: /srv/nfs/shared *(rw,sync,no_subtree_check,no_root_squash)
restart: unless-stopped
volumes:
iscsi-data:
nfs-data: