Skip to content

Commit 5fbd266

Browse files
committed
Update for NnfPodSpec
Signed-off-by: Blake Devcich <blake.devcich@hpe.com>
1 parent 0779deb commit 5fbd266

2 files changed

Lines changed: 54 additions & 67 deletions

File tree

docs/guides/data-movement/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ for understanding how to use profiles, set a default, etc.
2424
For an in-depth understanding of the capabilities offered by Data Movement profiles, we recommend
2525
referring to the following resources:
2626

27-
- [Type definition](https://github.com/NearNodeFlash/nnf-sos/blob/master/api/v1alpha6/nnfdatamovementprofile_types.go#L27) for `NnfDataMovementProfile`
28-
- [Sample](https://github.com/NearNodeFlash/nnf-sos/blob/master/config/samples/nnf_v1alpha6_nnfdatamovementprofile.yaml) for `NnfDataMovementProfile`
27+
- [Type definition](https://github.com/NearNodeFlash/nnf-sos/blob/master/api/v1alpha7/nnfdatamovementprofile_types.go#L27) for `NnfDataMovementProfile`
28+
- [Sample](https://github.com/NearNodeFlash/nnf-sos/blob/master/config/samples/nnf_v1alpha7_nnfdatamovementprofile.yaml) for `NnfDataMovementProfile`
2929
- [Online Examples](https://github.com/NearNodeFlash/nnf-sos/blob/master/config/examples/nnf_nnfdatamovementprofile.yaml) for `NnfDataMovementProfile`
3030

3131
## Copy Offload API Server

docs/guides/user-containers/readme.md

Lines changed: 52 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,12 @@ The next few subsections provide an overview of the primary components comprisin
5252
aspects, they don't encompass every single detail. For an in-depth understanding of the capabilities
5353
offered by container profiles, we recommend referring to the following resources:
5454

55-
- [Type definition](https://github.com/NearNodeFlash/nnf-sos/blob/master/api/v1alpha6/nnfcontainerprofile_types.go#L35) for `NnfContainerProfile`
56-
- [Sample](https://github.com/NearNodeFlash/nnf-sos/blob/master/config/samples/nnf_v1alpha6_nnfcontainerprofile.yaml) for `NnfContainerProfile`
57-
- [Online Examples](https://github.com/NearNodeFlash/nnf-sos/blob/master/config/examples/nnf_nnfcontainerprofiles.yaml) for `NnfContainerProfile` (same as `kubectl get` above)
55+
- [Type definition](https://github.com/NearNodeFlash/nnf-sos/blob/master/api/v1alpha7/nnfcontainerprofile_types.go#L36) for `NnfContainerProfile`
56+
- [Examples](https://github.com/NearNodeFlash/nnf-sos/blob/master/config/examples/nnf_nnfcontainerprofiles.yaml) for `NnfContainerProfile` (same as `kubectl get` above)
5857

5958
#### Container Storages
6059

61-
The `Storages` defined in the profile allow NNF filesystems to be made available inside of the
60+
The `Storages` defined in the profile allow NNF filesystems to be made available inside the
6261
container. These storages need to be referenced in the container workflow unless they are marked as
6362
optional.
6463

@@ -108,47 +107,38 @@ Example:
108107
109108
#### Container Spec
110109
111-
As mentioned earlier, container workflows can be categorized into two types: MPI and Non-MPI. It's
110+
As mentioned earlier, container workflows can be categorized into two types: MPI and Non-MPI. It is
112111
essential to choose and define only one of these types within the container profile. Regardless of
113-
the type chosen, the data structure that implements the specification is equipped with two
114-
"standard" resources that are distinct from NNF custom resources.
112+
the chosen type, the same data structure is used to implement the specification.
115113
116-
For Non-MPI containers, the specification utilizes the `spec` resource. This is the standard
117-
Kubernetes
118-
[`PodSpec`](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec)
119-
that outlines the desired configuration for the pod.
114+
An
115+
[`NnfPodSpec`](https://github.com/NearNodeFlash/nnf-sos/blob/master/api/v1alpha7/nnfcontainerprofile_types.go#L93)
116+
is used to define the specification for the pod and its containers. Inside the `NnfPodSpec` is an
117+
[`NnfContainer`](https://github.com/NearNodeFlash/nnf-sos/blob/master/api/v1alpha7/nnfcontainerprofile_types.go#L145).
120118

121-
For MPI containers, `mpiSpec` is used. This custom resource, available through `MPIJobSpec` from
122-
`mpi-operator`, serves as a facilitator for executing MPI applications across worker containers.
123-
This resource can be likened to a wrapper around a `PodSpec`, but users need to define a `PodSpec`
124-
for both Launcher and Worker containers. For assistance in finding the rabbit that is running the Launcher, see `NNF_CONTAINER_LAUNCHER` below.
119+
Both `NnfPodSpec` and `NnfContainer` are simplified versions of Kubernetes
120+
[`PodSpec`](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec).
125121

126-
See the [`MPIJobSpec`
127-
definition](https://github.com/kubeflow/mpi-operator/blob/v0.4.0/pkg/apis/kubeflow/v2beta1/types.go#L137)
128-
for more details on what can be configured for an MPI application.
129-
130-
It's important to bear in mind that the NNF Software is designed to override specific values within
131-
the `MPIJobSpec` for ensuring the desired behavior in line with NNF software requirements. To
132-
prevent complications, it's advisable not to delve too deeply into the specification. A few
133-
illustrative examples of fields that are overridden by the NNF Software include:
122+
- **Non-MPI Containers**: The specification utilizes the `spec` resource.
123+
- **MPI Containers**: The `mpiSpec` resource is used. Unlike Non-MPI containers, `mpiSpec` includes
124+
two `NnfPodSpec` definitions: one for the MPI Launcher and another for the Workers. The MPI Launcher
125+
facilitates the execution of MPI applications across worker containers.
134126

135-
- Replicas
136-
- RunPolicy.BackoffLimit
137-
- Worker/Launcher.RestartPolicy
138-
- SSHAuthMountPath
127+
For assistance in identifying the Rabbit node running the Launcher, refer to the
128+
`NNF_CONTAINER_LAUNCHER` environment variable below.
139129

140-
By keeping these considerations in mind and refraining from extensive alterations to the
141-
specification, you can ensure a smoother integration with the NNF Software and mitigate any
142-
potential issues that may arise.
130+
See the [`mpiSpec`
131+
definition](https://github.com/NearNodeFlash/nnf-sos/blob/master/api/v1alpha7/nnfcontainerprofile_types.go#L119)
132+
for more details on what can be configured for an MPI application.
143133

144-
Please see the Sample and Examples listed above for more detail on container Specs.
134+
Please refer to the examples listed above for more details on container specifications.
145135

146136
#### Container Ports
147137

148138
Container Profiles allow for ports to be reserved for a container workflow. `numPorts` can be used
149139
to specify the number of ports needed for a container workflow. The ports are opened on each
150-
targeted NNF node and are accessible outside of the cluster. Users must know how to contact the
151-
specific NNF node. It is recommend that DNS entries are made for this purpose.
140+
targeted NNF node and are accessible outside the cluster. Users must know how to contact the
141+
specific NNF node. It is recommended that DNS entries are made for this purpose.
152142

153143
In the workflow, the allocated port numbers are made available via the
154144
[`NNF_CONTAINER_PORTS`](#nnf_container_ports) environment variable.
@@ -243,9 +233,8 @@ data:
243233
storages:
244234
- name: DW_JOB_local_storage
245235
optional: false
246-
template:
247-
mpiSpec:
248-
...
236+
mpiSpec:
237+
...
249238
```
250239

251240
The resulting container directive looks like this:
@@ -504,6 +493,14 @@ RABBIT=$(cat /etc/local-rabbit.conf)
504493
$RABBIT:$(NNF_CONTAINER_PORTS)
505494
```
506495

496+
Additionally, environment variables are also provided for each container defined in the container
497+
profile. These variables include the name of the container.
498+
499+
```console
500+
$NNF_CONTAINER_PORTS_my_container_name
501+
$NNF_CONTAINER_PORTS_my_other_container_name
502+
```
503+
507504
#### `NNF_CONTAINER_LAUNCHER`
508505

509506
If the NNF Container Profile is using `mpiSpec`, then this environment variable provides the name of the rabbit that is running the MPI Launcher pod.
@@ -609,7 +606,7 @@ The following profile shows the placement of the `readonly-red-rock-slushy` secr
609606
in the previous step, and points to the user's `dean/red-rock-slushy:v1.0` container.
610607

611608
```yaml
612-
apiVersion: nnf.cray.hpe.com/v1alpha6
609+
apiVersion: nnf.cray.hpe.com/v1alpha7
613610
kind: NnfContainerProfile
614611
metadata:
615612
name: red-rock-slushy
@@ -647,41 +644,31 @@ insert two `imagePullSecrets` lists into the `mpiSpec` of the NnfContainerProfil
647644
launcher and the MPI worker.
648645

649646
```yaml
650-
apiVersion: nnf.cray.hpe.com/v1alpha6
647+
apiVersion: nnf.cray.hpe.com/v1alpha7
651648
kind: NnfContainerProfile
652649
metadata:
653650
name: mpi-red-rock-slushy
654651
namespace: nnf-system
655652
data:
656653
mpiSpec:
657-
mpiImplementation: OpenMPI
658-
mpiReplicaSpecs:
659-
Launcher:
660-
template:
661-
spec:
662-
imagePullSecrets:
663-
- name: readonly-red-rock-slushy
664-
containers:
665-
- command:
666-
- mpirun
667-
- dcmp
668-
- $(DW_JOB_foo_local_storage)/0
669-
- $(DW_JOB_foo_local_storage)/1
670-
image: dean/red-rock-slushy:v2.0
671-
name: red-rock-launcher
672-
Worker:
673-
template:
674-
spec:
675-
imagePullSecrets:
676-
- name: readonly-red-rock-slushy
677-
containers:
678-
- image: dean/red-rock-slushy:v2.0
679-
name: red-rock-worker
680-
runPolicy:
681-
cleanPodPolicy: Running
682-
suspend: false
654+
launcher:
655+
imagePullSecrets:
656+
- name: readonly-red-rock-slushy
657+
containers:
658+
- command:
659+
- mpirun
660+
- dcmp
661+
- $(DW_JOB_foo_local_storage)/0
662+
- $(DW_JOB_foo_local_storage)/1
663+
image: dean/red-rock-slushy:v2.0
664+
name: red-rock-launcher
665+
worker:
666+
imagePullSecrets:
667+
- name: readonly-red-rock-slushy
668+
containers:
669+
- image: dean/red-rock-slushy:v2.0
670+
name: red-rock-worker
683671
slotsPerWorker: 1
684-
sshAuthMountPath: /root/.ssh
685672
pinned: false
686673
retryLimit: 6
687674
storages:

0 commit comments

Comments
 (0)