Introduce Kubernetes Device Plugin to Kuberntes Executor
Description
The Existing docker executors can support Nvidia GPU as additional devices#4585 (closed) which makes the GPU accessible to CI scripts. But unfortunately, the GPU is the only device that can be accessed in the gitlab runner executor. To address this problem, Kuberntes introduced the concept of device plugin, which enables the container to mount custom devices.
Proposal
Once the device plugin is installed in the Kubernetes cluster, the containers of this cluster can request custom devices (containers.resources.limits
) as follows:
(ref: https://github.com/Xilinx/FPGA_as_a_Service/blob/master/k8s-fpga-device-plugin/aws-accelator-pod.yaml)
apiVersion: apps/v1
kind: Deployment
metadata:
name: accelator-pod
spec:
selector:
matchLabels:
app: accelator-pod
replicas: 1
template:
metadata:
labels:
app: accelator-pod
spec:
containers:
- name: accelator-pod
image: memo40k/k8s:accelator_pod
imagePullPolicy: IfNotPresent
resources:
limits:
xilinx.com/fpga-xilinx_aws-vu9p-f1_dynamic_5_0-43981: 1
It would be better if the Kuberntes Executor of Gitlab Runner could support the device plugin feature. As the following config.toml
[runners.kubernetes.device_plugin]
<custom_device> = "1" <the number of requested devices>