Repository navigation
Tips for CephFS
This page summarizes the local Rook CephFS workflow used to test REANA against
a real CSI-backed ReadWriteMany filesystem on Kind. The focus is local
development and storage-behavior validation, not production deployment.
- a local
rook-cephfsstorage class backed by Rook - a REANA deployment that uses CephFS for
shared_storage - a separate infrastructure storage path so that database and RabbitMQ storage are kept separate from user runtime workspaces
- a validated variant where both
shared_storageandinfrastructure_storageare separate PVCs from the samerook-cephfsstorage class - a repeatable smoke path for
fsGroupand shared-workspace validation
- you already have a running single-node Kind cluster
-
kubectl,kind,docker, andhelmare installed -
reana-devis installed if you want to use the conveniencereana-dev cluster-deployflow below -
reana-clientis installed if you want to use the smoke helpers below - you are running the commands below from the root of the
reanarepository
Rook needs raw block devices for Ceph OSDs. The default Kind storage class is
usually rancher.io/local-path, which does not support raw block PVCs.
$ scripts/check-cephfs-dev-prereqs.sh standardIf this fails on a default local Kind setup, this is expected. The workaround is to attach loop-backed raw devices directly inside the Kind node container.
The helper below provisions loop devices inside kind-control-plane:
$ scripts/setup-kind-rook-loop-devices.sh kind-control-planeUseful overrides:
$ DEVICE_COUNT=3 DEVICE_SIZE=6G \
scripts/setup-kind-rook-loop-devices.sh kind-control-planeThe helper creates loop-backed image files under /var/lib/rook-dev inside the
Kind node and synthesizes the udev metadata Rook expects.
$ scripts/deploy-kind-rook-cephfs.shThis deploys:
- the Rook operator
- a local Ceph cluster
- the
reanafsCeph filesystem - the
rook-cephfsstorage class
Useful readiness checks:
$ kubectl -n rook-ceph get cephcluster rook-ceph -o wide
$ kubectl -n rook-ceph get cephfilesystem reanafs -o wide
$ kubectl get storageclass rook-cephfsThe checked-in smoke PVC and pod are enough to verify RWX provisioning:
$ kubectl apply -f etc/rook-cephfs-kind/test-pvc.yaml
$ kubectl apply -f etc/rook-cephfs-kind/test-pod.yaml
$ kubectl logs rook-cephfs-smokeExpected output includes the contents of probe.txt, proving the PVC is
mounted and writable.
Cleanup:
$ kubectl delete pod rook-cephfs-smoke --ignore-not-found
$ kubectl delete pvc rook-cephfs-smoke --ignore-not-foundThe local validation that was actually exercised used:
- CephFS for
shared_storage - a separate hostPath root for
infrastructure_storage
This keeps infrastructure storage separate from user runtime workspaces while keeping local iteration simple.
The checked-in development profile is helm/configurations/values-dev-cephfs.yaml.
The relevant storage part is:
shared_storage:
backend: cephfs
volume_size: 200
access_modes: ReadWriteMany
fs_group: 0
storage_class_name: rook-cephfs
infrastructure_storage:
backend: hostpath
hostpath:
root_path: /var/reana-infrastructureBecause the infrastructure storage is a hostPath, create the database and RabbitMQ directories inside the Kind node first:
$ docker exec kind-control-plane mkdir -p \
/var/reana-infrastructure/db \
/var/reana-infrastructure/rabbitmq/mnesiaThen deploy REANA:
$ reana-dev cluster-deploy \
-v helm/configurations/values-dev-cephfs.yaml \
--admin-email john.doe@example.org \
--admin-password mysecretpasswordIf you are validating unreleased storage or security-context changes, make sure
that reana-workflow-controller and reana-job-controller images actually
contain the code under test. Otherwise the CephFS run will exercise an older
runtime pod-generation path and the result will be misleading.
To emulate the storage-volume recommendations more closely, REANA can use two separate PVCs backed by the same Rook CephFS storage class:
infrastructure_storage:
backend: cephfs
volume_size: 10
access_modes: ReadWriteMany
storage_class_name: rook-cephfs
shared_storage:
backend: cephfs
volume_size: 200
access_modes: ReadWriteMany
fs_group: 0
fs_group_change_policy: OnRootMismatch
storage_class_name: rook-cephfsThis requires a REANA chart revision that already supports
infrastructure_storage.storage_class_name. The local validation here used a
chart revision newer than 0.95.0-alpha.5; older chart releases may not
support this field yet.
The concrete Helm install pattern that was validated locally was:
$ helm upgrade --install ceph2vol helm/reana \
-n ceph2vol-test \
--create-namespace \
-f my-two-pvc-values.yaml \
--set fullnameOverride=ceph2vol \
--set secrets.database.user=test \
--set secrets.database.password=test \
--set secrets.cache.user=test \
--set secrets.cache.password=test \
--set secrets.message_broker.user=test \
--set secrets.message_broker.password=test \
--set secrets.reana.REANA_SECRET_KEY=test \
--set secrets.opensearch.user=test \
--set secrets.opensearch.password=test \
--set opensearch.initialAdminPassword=testIf you are validating unreleased controller changes, add the corresponding
components.reana_workflow_controller.image and
components.reana_job_controller.image overrides as needed.
This variant was validated locally on Kind + Rook CephFS. It resulted in two distinct bound PVCs, one for infrastructure pods and one for user runtime workspaces:
ceph2vol-infrastructure-persistent-volumeceph2vol-shared-persistent-volume
The infrastructure pods mounted the infrastructure PVC, while the
reana-run-batch and reana-run-job pods mounted the shared PVC. Runtime
containers still ran as uid=1000 gid=0, and files created in workflow
workspaces were owned 1000:0 as expected.
One caveat when testing multiple REANA releases side by side on the same Kind
cluster: REANA truncates the release prefix to 13 characters. Use a short,
unique release name, or set fullnameOverride, otherwise cluster-scoped
resources such as the CVMFS storage class may collide between releases. In the
validated example above, fullnameOverride=ceph2vol is intentional. A longer
name such as reana-cephfs-2vol would truncate to the same 13-character prefix
as reana-cephfs and collide.
The following storage settings were useful for local validation:
True chart-default asymmetry:
shared_storage:
backend: cephfs
fs_group: ""
fs_group_change_policy: OnRootMismatch
storage_class_name: rook-cephfsExplicitly aligned group:
shared_storage:
backend: cephfs
fs_group: 0
fs_group_change_policy: OnRootMismatch
storage_class_name: rook-cephfsFallback policy:
shared_storage:
backend: cephfs
fs_group: 0
fs_group_change_policy: Always
storage_class_name: rook-cephfsOnce REANA is up, use the checked-in non-root smoke workflow:
Before running the smoke helpers, make sure reana-client can authenticate to
the target deployment. If you are not already logged in via the client config,
export the server URL and access token first:
$ export REANA_SERVER_URL=https://localhost:30443
$ export REANA_ACCESS_TOKEN=<your-access-token>
$ reana-client ping$ scripts/check-shared-storage-fsgroup-smoke.shThis runs the same workflow twice against the same workspace and verifies that:
- the first run can create files
- the second run can reuse the existing workspace
- the second run can read and append to files created by the first run
For the Jupyter path, use:
$ scripts/check-jupyter-session-nonroot-smoke.shRemove the Rook resources:
$ scripts/undeploy-kind-rook-cephfs.shRemove the loop-backed devices from the Kind node:
$ scripts/cleanup-kind-rook-loop-devices.sh kind-control-planeIf you also want to reset the REANA deployment, remove it separately using the
usual reana-dev or helm uninstall workflow for your local stack.
REANA reproducible analysis platform
blog.reana.io | docs.reana.io | forum.reana.io | www.reana.io |
@gitter | @mattermost | @twitter
Introduction
Getting started
- Setting up your system
- Cloning sources
- Using production-like development mode
- Using live-code-reload and debug mode
Issue lifecycle
Understanding code base
Technology tips and tricks
- Tips for Docker
- Tips for Git
- Tips for GitLab
- Tips for Keycloak
- Tips for Kind
- Tips for Kubernetes
- Tips for OpenAPI
- Tips for PostgreSQL
- Tips for Python
- Tips for RabbitMQ
- Tips for SQLAlchemy
- Tips for CephFS