mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
dsa: Rename dsa initcontainer to idxd
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
parent
cdaf6b3807
commit
a7c612f7fc
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -74,7 +74,7 @@ jobs:
|
|||||||
- intel-sgx-plugin
|
- intel-sgx-plugin
|
||||||
- intel-sgx-initcontainer
|
- intel-sgx-initcontainer
|
||||||
- intel-dsa-plugin
|
- intel-dsa-plugin
|
||||||
- intel-dsa-initcontainer
|
- intel-idxd-initcontainer
|
||||||
|
|
||||||
# Demo images
|
# Demo images
|
||||||
- crypto-perf
|
- crypto-perf
|
||||||
|
@ -44,8 +44,8 @@ RUN ldconfig
|
|||||||
|
|
||||||
COPY --from=builder /usr/bin/accel-config /usr/bin/
|
COPY --from=builder /usr/bin/accel-config /usr/bin/
|
||||||
|
|
||||||
ADD demo/dsa-init.sh /dsa-init/
|
ADD demo/idxd-init.sh /idxd-init/
|
||||||
ADD demo/dsa.conf /dsa-init/
|
ADD demo/dsa.conf /idxd-init/
|
||||||
|
|
||||||
WORKDIR /dsa-init
|
WORKDIR /idxd-init
|
||||||
ENTRYPOINT bash dsa-init.sh
|
ENTRYPOINT bash idxd-init.sh
|
@ -50,7 +50,7 @@ Nothing else is needed. But if you want to deploy a customized version of the pl
|
|||||||
|
|
||||||
### Deploy with initcontainer
|
### Deploy with initcontainer
|
||||||
|
|
||||||
There's a sample [DSA initcontainer](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/main/build/docker/intel-dsa-initcontainer.Dockerfile) included that provisions DSA devices and workqueues (1 engine / 1 group / 1 wq (user/dedicated)), to deploy:
|
There's a sample [DSA initcontainer](https://github.com/intel/intel-device-plugins-for-kubernetes/blob/main/build/docker/intel-idxd-initcontainer.Dockerfile) included that provisions DSA devices and workqueues (1 engine / 1 group / 1 wq (user/dedicated)), to deploy:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ kubectl apply -k deployments/dsa_plugin/overlays/dsa_initcontainer/
|
$ kubectl apply -k deployments/dsa_plugin/overlays/dsa_initcontainer/
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
DEV="${VARIABLE:-dsa}"
|
||||||
|
NODE_NAME="${NODE_NAME:-}"
|
||||||
|
|
||||||
function cmd() {
|
function cmd() {
|
||||||
|
|
||||||
echo "$@"
|
echo "$@"
|
||||||
@ -9,24 +12,24 @@ function cmd() {
|
|||||||
"${@}"
|
"${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in $(accel-config list | jq '.[].dev' | grep dsa | sed 's/\"//g'); do
|
for i in $(accel-config list | jq '.[].dev' | grep "$DEV" | sed 's/\"//g'); do
|
||||||
|
|
||||||
cmd accel-config disable-device "$i"
|
cmd accel-config disable-device "$i"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
ndev=$(accel-config list --idle | jq '.[].dev' | grep -c dsa)
|
ndev=$(accel-config list --idle | jq '.[].dev' | grep -c "$DEV")
|
||||||
nwq=4
|
nwq=4
|
||||||
|
|
||||||
for (( i = 0; i < ndev; i++ )); do
|
for (( i = 0; i < ndev; i++ )); do
|
||||||
|
|
||||||
dev="dsa${i}"
|
dev="$DEV${i}"
|
||||||
|
|
||||||
config="dsa.conf"
|
config="$DEV.conf"
|
||||||
|
|
||||||
[ -f "conf/dsa.conf" ] && config="conf/dsa.conf"
|
[ -f "conf/$DEV.conf" ] && config="conf/$DEV.conf"
|
||||||
|
|
||||||
[ -f "conf/dsa-$NODE_NAME.conf" ] && config="conf/dsa-$NODE_NAME.conf"
|
[ -f "conf/$DEV-$NODE_NAME.conf" ] && config="conf/$DEV-$NODE_NAME.conf"
|
||||||
|
|
||||||
sed "s/X/${i}/g" < "$config" > $dev.conf
|
sed "s/X/${i}/g" < "$config" > $dev.conf
|
||||||
|
|
@ -12,13 +12,13 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: spec.nodeName
|
fieldPath: spec.nodeName
|
||||||
image: intel/intel-dsa-initcontainer:devel
|
image: intel/intel-idxd-initcontainer:devel
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /sys/devices
|
- mountPath: /sys/devices
|
||||||
name: sys-devices
|
name: sys-devices
|
||||||
- mountPath: /dsa-init/conf
|
- mountPath: /idxd-init/conf
|
||||||
name: intel-dsa-config-volume
|
name: intel-dsa-config-volume
|
||||||
volumes:
|
volumes:
|
||||||
- name: sys-devices
|
- name: sys-devices
|
||||||
|
@ -95,7 +95,7 @@ func (r *DsaDevicePlugin) validatePlugin() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(r.Spec.InitImage) > 0 {
|
if len(r.Spec.InitImage) > 0 {
|
||||||
return validatePluginImage(r.Spec.InitImage, "intel-dsa-initcontainer", dsaMinVersion)
|
return validatePluginImage(r.Spec.InitImage, "intel-idxd-initcontainer", dsaMinVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -81,7 +81,7 @@ func setInitContainer(spec *v1.PodSpec, imageName string) {
|
|||||||
{
|
{
|
||||||
Image: imageName,
|
Image: imageName,
|
||||||
ImagePullPolicy: "IfNotPresent",
|
ImagePullPolicy: "IfNotPresent",
|
||||||
Name: "intel-dsa-initcontainer",
|
Name: "intel-idxd-initcontainer",
|
||||||
Env: []v1.EnvVar{
|
Env: []v1.EnvVar{
|
||||||
{
|
{
|
||||||
Name: "NODE_NAME",
|
Name: "NODE_NAME",
|
||||||
@ -246,10 +246,10 @@ func (c *controller) NewDaemonSet(rawObj client.Object) *apps.DaemonSet {
|
|||||||
})
|
})
|
||||||
|
|
||||||
for i, initcontainer := range daemonSet.Spec.Template.Spec.InitContainers {
|
for i, initcontainer := range daemonSet.Spec.Template.Spec.InitContainers {
|
||||||
if initcontainer.Name == "intel-dsa-initcontainer" {
|
if initcontainer.Name == "intel-idxd-initcontainer" {
|
||||||
daemonSet.Spec.Template.Spec.InitContainers[i].VolumeMounts = append(daemonSet.Spec.Template.Spec.InitContainers[i].VolumeMounts, v1.VolumeMount{
|
daemonSet.Spec.Template.Spec.InitContainers[i].VolumeMounts = append(daemonSet.Spec.Template.Spec.InitContainers[i].VolumeMounts, v1.VolumeMount{
|
||||||
Name: "intel-dsa-config-volume",
|
Name: "intel-dsa-config-volume",
|
||||||
MountPath: "/dsa-init/conf",
|
MountPath: "/idxd-init/conf",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user