Skip to content

Commit

Permalink
Merge pull request #155 from ykulazhenkov/host-ofed
Browse files Browse the repository at this point in the history
Add support for host OFED to peer-mem POD
  • Loading branch information
moshe010 authored Mar 30, 2021
2 parents 50c2717 + 4a55f2b commit 2935f8f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
18 changes: 14 additions & 4 deletions manifests/stage-nv-peer-mem-driver/0010_nv-peer-mem-driver-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ spec:
- name: NO_PROXY
value: {{ .RuntimeSpec.NoProxy }}
volumeMounts:
- name: run-mlnx-ofed
mountPath: /run/mellanox/drivers
- name: mlnx-ofed-usr-src
mountPath: /run/mellanox/drivers/usr/src
mountPropagation: HostToContainer
- name: mlnx-ofed-lib-modules
mountPath: /run/mellanox/drivers/lib/modules
mountPropagation: HostToContainer
- name: run-nvidia
mountPath: /run/nvidia/drivers
Expand Down Expand Up @@ -108,9 +111,16 @@ spec:
initialDelaySeconds: 10
failureThreshold: 1
volumes:
- name: run-mlnx-ofed
{{ $ofedPath := "/run/mellanox/drivers" }}
{{ if .RuntimeSpec.UseHostOFED }}
{{ $ofedPath = "" }}
{{end}}
- name: mlnx-ofed-usr-src
hostPath:
path: {{ $ofedPath }}/usr/src
- name: mlnx-ofed-lib-modules
hostPath:
path: /run/mellanox/drivers
path: {{ $ofedPath }}/lib/modules
- name: run-nvidia
hostPath:
path: {{ .CrSpec.GPUDriverSourcePath }}
Expand Down
14 changes: 8 additions & 6 deletions pkg/state/state_nv_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ type stateNVPeer struct {

type nvPeerRuntimeSpec struct {
runtimeSpec
CPUArch string
OSName string
OSVer string
HTTPProxy string
HTTPSProxy string
NoProxy string
CPUArch string
OSName string
OSVer string
HTTPProxy string
HTTPSProxy string
NoProxy string
UseHostOFED bool
}

type nvPeerManifestRenderData struct {
Expand Down Expand Up @@ -146,6 +147,7 @@ func (s *stateNVPeer) getManifestObjects(
HTTPProxy: os.Getenv(consts.HTTPProxy),
HTTPSProxy: os.Getenv(consts.HTTPSProxy),
NoProxy: os.Getenv(consts.NoProxy),
UseHostOFED: cr.Spec.OFEDDriver == nil,
},
}
// render objects
Expand Down

0 comments on commit 2935f8f

Please sign in to comment.