The Concourse CI Machine charm now supports automatic discovery and mounting of any folders under /srv in worker containers. This provides a flexible system for mounting datasets, models, outputs, and other resources without requiring charm reconfiguration.
/srv on the LXC container is automatically discovered and mounted_writable or _rw suffix are mounted with write permissions/srv/datasets mountingAny folder without a special suffix is mounted as read-only:
/srv/datasets # Read-only
/srv/models # Read-only
/srv/reference-data # Read-only
Folders ending with _writable or _rw are mounted with write permissions:
/srv/outputs_writable # Read-write
/srv/cache_rw # Read-write
/srv/models_writable # Read-write
On the Juju machine hosting your Concourse worker:
# Find your worker container
juju status concourse-worker
# SSH to the machine
juju ssh concourse-worker/0
# Create read-only folder
sudo mkdir -p /srv/datasets
echo "Sample data" | sudo tee /srv/datasets/sample.txt
# Create writable folder
sudo mkdir -p /srv/outputs_writable
sudo chmod 777 /srv/outputs_writable
For persistent folders that survive container restarts:
# On the Juju host machine
# Identify container name (e.g., juju-abc123-0)
lxc list
# Add disk device for read-only folder
lxc config device add juju-abc123-0 datasets disk \
source=/path/on/host/datasets \
path=/srv/datasets \
readonly=true
# Add disk device for writable folder
lxc config device add juju-abc123-0 outputs disk \
source=/path/on/host/outputs \
path=/srv/outputs_writable
Folders are discovered automatically when tasks are started:
# For new deployment
juju deploy ./concourse-ci-machine.charm concourse-worker
# For existing deployment (refresh charm)
juju refresh concourse-worker --path=./concourse-ci-machine.charm
Create a test pipeline:
jobs:
- name: test-mounts
plan:
- task: verify-folders
config:
platform: linux
image_resource:
type: registry-image
source: {repository: busybox}
run:
path: sh
args:
- -c
- |
echo "=== Checking /srv folders ==="
ls -la /srv/
echo "=== Reading from read-only folder ==="
cat /srv/datasets/sample.txt
echo "=== Writing to writable folder ==="
echo "Task output" > /srv/outputs_writable/result.txt
cat /srv/outputs_writable/result.txt
# Read-only datasets
/srv/training-data # Training datasets (read-only)
/srv/validation-data # Validation datasets (read-only)
/srv/pretrained-models # Pre-trained models (read-only)
# Writable outputs
/srv/model-outputs_writable # Save trained models
/srv/logs_writable # Training logs
/srv/checkpoints_writable # Model checkpoints
# Read-only resources
/srv/build-tools # Build dependencies (read-only)
/srv/reference-libs # Reference libraries (read-only)
# Writable outputs
/srv/build-cache_rw # Build cache for faster rebuilds
/srv/artifacts_writable # Build artifacts
# Read-only inputs
/srv/raw-data # Input data (read-only)
/srv/schemas # Data schemas (read-only)
# Writable outputs
/srv/processed_writable # Processed output data
/srv/reports_writable # Generated reports
The charm automatically reports folder status:
# Check worker status
juju status concourse-worker
# Example output:
# Worker ready (GPU: 1x NVIDIA) (3 folders: 2 RO, 1 RW)
# └─ 2 read-only, 1 writable folder
Problem: Folders in /srv on the LXC container don’t appear in Concourse tasks.
Solutions:
juju ssh worker/0 'ls -la /srv/'
juju debug-log --include=concourse-worker
juju ssh worker/0 'sudo systemctl restart concourse-worker'
Problem: Cannot read from or write to mounted folders.
Solutions:
sudo chmod -R a+r /srv/datasets
sudo chmod -R 777 /srv/outputs_writable
Problem: Folder ends with _writable but writes fail.
Solutions:
ls -la /srv/ | grep writable
ls -ld /srv/outputs_writable
lxc config device show juju-abc123-0
The existing /srv/datasets GPU mounting mechanism continues to work unchanged:
/srv/datasets is discovered like any other folderThe folder mounting system uses OCI runtime wrappers:
/usr/local/bin/runc-gpu-wrapper
/srv folders/usr/local/bin/runc-wrapper
/srv foldersThese wrappers intercept container creation and dynamically inject bind mounts before the container starts.
runc create command/srv for directories_writable, _rw)Folders are read-only by default to prevent accidental data corruption:
The wrapper validates folder paths to prevent security issues:
/srv are scanned.something) are skippedWhile /srv is the default scan location, you can add folders anywhere in the LXC container by using LXC disk devices with custom paths. The automatic discovery only scans /srv.
Each worker independently discovers folders from its own /srv directory:
/srv/datasets-gpu (GPU worker)/srv/datasets-cpu (CPU worker)To add folders after worker deployment: