Skip to content

Commit 944b3c0

Browse files
committed
Merge branch 'main' into release-v0.1.27
Signed-off-by: Anthony Floeder <anthony.floeder@hpe.com>
2 parents 77c965f + ba28770 commit 944b3c0

1 file changed

Lines changed: 86 additions & 7 deletions

File tree

docs/guides/user-containers/readme.md

Lines changed: 86 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,83 @@ New NnfContainerProfile resources may be restricted to a specific user ID or gro
205205
matching user ID or group ID will be allowed to use that profile . If the profile specifies both of
206206
these IDs, then the Workflow resource must match both of them.
207207

208+
#### External Container Creation
209+
210+
By default a container profile creates Kubernetes `Job` or `MPIJob` resources to run user containers
211+
on the Rabbit nodes. Setting `createContainer: false` in the profile disables this behaviour, allowing
212+
an external orchestrator to manage the container lifecycle. All the normal PreRun storage setup still
213+
takes place — `NnfAccess` resources are created, NNF filesystems are mounted on the Rabbit nodes —
214+
but **no pods are launched by NNF**. Instead, the NNF software creates an `NnfContainerData` resource
215+
that records the mount-path information for each storage volume.
216+
217+
This is useful when an external orchestrator is responsible for driving the actual container lifecycle,
218+
but still relies on NNF to provision and mount the storage.
219+
220+
```yaml
221+
apiVersion: nnf.cray.hpe.com/v1alpha7
222+
kind: NnfContainerProfile
223+
metadata:
224+
name: example-profile
225+
namespace: nnf-system
226+
data:
227+
createContainer: false # do not launch pods; create NnfContainerData instead
228+
storages:
229+
- name: DW_JOB_local_storage
230+
optional: false
231+
spec:
232+
containers:
233+
- name: placeholder # spec is still required for validation
234+
image: "none"
235+
```
236+
237+
The workflow advances through PreRun, PostRun, and Teardown without blocking on pod lifecycle events.
238+
The resulting `NnfContainerData` resource is deleted during Teardown alongside any other container
239+
resources.
240+
241+
##### NnfContainerData
242+
243+
The `NnfContainerData` resource is created in the workflow's namespace during PreRun. It describes
244+
each NNF storage volume that has been mounted on the Rabbit node, giving the external orchestrator
245+
the information it needs to attach its own containers to the prepared mounts.
246+
247+
Given a workflow with the following directives:
248+
249+
```bash
250+
#DW jobdw name=my-gfs2 type=gfs2 capacity=100GB
251+
#DW persistentdw name=my-persistent
252+
#DW container name=my-container profile=red-rock-slushy-data-only DW_JOB_local_storage=my-gfs2 DW_PERSISTENT_shared_storage=my-persistent
253+
```
254+
255+
The `NnfContainerData` resource created during PreRun would look like this:
256+
257+
```yaml
258+
apiVersion: nnf.cray.hpe.com/v1alpha11
259+
kind: NnfContainerData
260+
metadata:
261+
name: my-workflow-2
262+
namespace: default
263+
data:
264+
volumes:
265+
- name: local_storage
266+
command: jobdw
267+
directiveIndex: 0
268+
mountPath: /mnt/nnf/3e92c060-ca0e-4ddb-905b-3d24137cbff4-0
269+
- name: shared_storage
270+
command: persistentdw
271+
directiveIndex: 1
272+
mountPath: /mnt/nnf/3e92c060-ca0e-4ddb-905b-3d24137cbff4-1
273+
```
274+
275+
| Field | Type | Description |
276+
|---|---|---|
277+
| `data.volumes[].name` | string | Storage name as defined in the `NnfContainerProfile` (e.g. `local_storage`) |
278+
| `data.volumes[].command` | string | Directive command that created the storage: `jobdw` or `persistentdw` |
279+
| `data.volumes[].directiveIndex` | int | Zero-based index of the `#DW` directive in the workflow that created this storage |
280+
| `data.volumes[].mountPath` | string | Absolute path on the Rabbit node where the storage is mounted |
281+
282+
The external orchestrator can query the resource by workflow name and namespace to discover where
283+
each storage volume is mounted.
284+
208285
## Creating a Container Workflow
209286

210287
The user's workflow will specify the name of the `NnfContainerProfile` in a DW directive. If the
@@ -215,8 +292,7 @@ with the `profile` parameter.
215292
#DW container profile=red-rock-slushy [...]
216293
```
217294

218-
Furthermore, to set the container storages for the workflow, storage parameters must also be
219-
supplied in the workflow. This is done using the `<storage_name>` (see [Container
295+
Furthermore, to set the container storages for the workflow, storage parameters must also be supplied in the workflow. This is done using the `<storage_name>` (see [Container
220296
Storages](#container-storages)) and setting it to the name of a storage directive that defines an
221297
NNF filesystem. That storage directive must already exist as part of another workflow (e.g.
222298
persistent storage) or it can be supplied in the same workflow as the container. For global lustre,
@@ -275,13 +351,16 @@ overview of the container-related behavior that occurs:
275351
- Proposal: Verify [storages](#container-storages) are provided according to the container profile.
276352
- Setup: If applicable, [request ports](#container-ports) from NnfPortManager.
277353
- DataIn: No container related activity.
278-
- PreRun: Appropriate `MPIJob` or `Job(s)` are created for the workflow. In turn, user containers
279-
are created and launched by Kubernetes. Containers are expected to start in this state.
280-
- PostRun: Once in PostRun, user containers are expected to complete (non-zero exit)
281-
successfully.
354+
- PreRun: If `createContainer: true` (default), appropriate `MPIJob` or `Job(s)` are created for
355+
the workflow. In turn, user containers are created and launched by Kubernetes. Containers are
356+
expected to start in this state. If `createContainer: false`, no pods are launched; instead an
357+
[`NnfContainerData`](#nnfcontainerdata) resource is created that records the storage mount paths.
358+
- PostRun: If `createContainer: true`, user containers are expected to complete (zero exit)
359+
successfully. If `createContainer: false`, the NNF code does not coordinate with the external
360+
container launcher.
282361
- DataOut: No container related activity.
283362
- Teardown: Ports are released; `MPIJob` or `Job(s)` are deleted, which in turn deletes the user
284-
containers.
363+
containers. Any `NnfContainerData` resource is also deleted.
285364

286365
The two main states of a container workflow (i.e. PreRun, PostRun) are discussed further in the
287366
following sections.

0 commit comments

Comments
 (0)