mirror of
https://gitlab.com/arm-research/smarter/smarter-device-manager.git
synced 2025-09-13 20:10:29 +00:00
Compare commits
6 Commits
v1.0.0
...
5-device-m
Author | SHA1 | Date | |
---|---|---|---|
|
f1b720f53e | ||
|
acb56cef95 | ||
|
94e5449a72 | ||
|
8a81ecce8b | ||
|
7e976ae90c | ||
|
377f5fb26e |
@@ -1,57 +1,6 @@
|
|||||||
|
include:
|
||||||
|
- project: 'ericvh/gitlab-ci-arm-template'
|
||||||
|
file: '/.gitlab-ci.yml'
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
CI_BUILD_IMAGE: "registry.gitlab.com/ericvh/docker-buildx-qemu"
|
|
||||||
CI_BUILDX_ARCHS: "linux/amd64,linux/arm64,linux/arm"
|
CI_BUILDX_ARCHS: "linux/amd64,linux/arm64,linux/arm"
|
||||||
|
|
||||||
.build:
|
|
||||||
image: $CI_BUILD_IMAGE
|
|
||||||
stage: build
|
|
||||||
services:
|
|
||||||
- name: docker:dind
|
|
||||||
entrypoint: ["env", "-u", "DOCKER_HOST"]
|
|
||||||
command: ["dockerd-entrypoint.sh"]
|
|
||||||
variables:
|
|
||||||
DOCKER_HOST: tcp://docker:2375/
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
# See https://github.com/docker-library/docker/pull/166
|
|
||||||
DOCKER_TLS_CERTDIR: ""
|
|
||||||
retry: 2
|
|
||||||
before_script:
|
|
||||||
- |
|
|
||||||
if [[ -z "$CI_COMMIT_TAG" ]]; then
|
|
||||||
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
|
|
||||||
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
|
|
||||||
else
|
|
||||||
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
|
|
||||||
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
|
|
||||||
fi
|
|
||||||
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
|
|
||||||
|
|
||||||
build:buildx-master:
|
|
||||||
extends: .build
|
|
||||||
only:
|
|
||||||
refs:
|
|
||||||
- master
|
|
||||||
variables:
|
|
||||||
- $CI_BUILDX_ARCHS
|
|
||||||
script:
|
|
||||||
# Use docker-container driver to allow useful features (push/multi-platform)
|
|
||||||
- update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
|
|
||||||
- docker buildx create --driver docker-container --use
|
|
||||||
- docker buildx inspect --bootstrap
|
|
||||||
- docker buildx ls
|
|
||||||
- docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push .
|
|
||||||
|
|
||||||
build:buildx:
|
|
||||||
extends: .build
|
|
||||||
only:
|
|
||||||
variables:
|
|
||||||
- $CI_BUILDX_ARCHS
|
|
||||||
except:
|
|
||||||
refs:
|
|
||||||
- master
|
|
||||||
script:
|
|
||||||
- update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
|
|
||||||
- docker buildx create --driver docker-container --use
|
|
||||||
- docker buildx inspect --bootstrap
|
|
||||||
- docker buildx ls
|
|
||||||
- docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" --push .
|
|
10
conf.yaml
10
conf.yaml
@@ -15,4 +15,12 @@
|
|||||||
- devicematch: ^vchiq$
|
- devicematch: ^vchiq$
|
||||||
nummaxdevices: 20
|
nummaxdevices: 20
|
||||||
- devicematch: ^vcsm.*$
|
- devicematch: ^vcsm.*$
|
||||||
nummaxdevices: 20
|
nummaxdevices: 20
|
||||||
|
- devicematch: ^ttyUSB[0-9]*$
|
||||||
|
nummaxdevices: 1
|
||||||
|
- devicematch: ^ttyACM[0-9]*$
|
||||||
|
nummaxdevices: 1
|
||||||
|
- devicematch: ^ttyTHS[0-9]*$
|
||||||
|
nummaxdevices: 1
|
||||||
|
- devicematch: ^ttyS[0-9]*$
|
||||||
|
nummaxdevices: 1
|
24
smarter-device-manager-configmap-rpi.yaml
Normal file
24
smarter-device-manager-configmap-rpi.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: smarter-device-manager-rpi
|
||||||
|
data:
|
||||||
|
conf.yaml: |
|
||||||
|
- devicematch: ^snd$
|
||||||
|
nummaxdevices: 20
|
||||||
|
- devicematch: ^gpiomem$
|
||||||
|
nummaxdevices: 40
|
||||||
|
- devicematch: ^gpiochip[0-9]*$
|
||||||
|
nummaxdevices: 20
|
||||||
|
- devicematch: ^hci[0-9]*$
|
||||||
|
nummaxdevices: 1
|
||||||
|
- devicematch: ^i2c-[0-9]*$
|
||||||
|
nummaxdevices: 1
|
||||||
|
- devicematch: ^rtc0$
|
||||||
|
nummaxdevices: 20
|
||||||
|
- devicematch: ^video[0-9]*$
|
||||||
|
nummaxdevices: 20
|
||||||
|
- devicematch: ^vchiq$
|
||||||
|
nummaxdevices: 20
|
||||||
|
- devicematch: ^vcsm.*$
|
||||||
|
nummaxdevices: 20
|
72
smarter-device-manager-k3s-cs.yaml
Normal file
72
smarter-device-manager-k3s-cs.yaml
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: < Replace with the namespace to use >
|
||||||
|
labels:
|
||||||
|
name: < Replace with the namespace to use >
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
name: smarter-device-manager
|
||||||
|
namespace: < Replace with the namespace to use >
|
||||||
|
labels:
|
||||||
|
name: smarter-device-manager
|
||||||
|
role: agent
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
name: smarter-device-manager
|
||||||
|
updateStrategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
name: smarter-device-manager
|
||||||
|
annotations:
|
||||||
|
node.kubernetes.io/bootstrap-checkpoint: "true"
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
smarter-device-manager : enabled
|
||||||
|
priorityClassName: "system-node-critical"
|
||||||
|
hostname: smarter-device-management
|
||||||
|
hostNetwork: true
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: k8sedgeregcred
|
||||||
|
containers:
|
||||||
|
- name: smarter-device-manager
|
||||||
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager/smarter-device-manager:20191204204613
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop: ["ALL"]
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 15Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 15Mi
|
||||||
|
volumeMounts:
|
||||||
|
- name: device-plugin
|
||||||
|
mountPath: /var/lib/kubelet/device-plugins
|
||||||
|
- name: dev-dir
|
||||||
|
mountPath: /dev
|
||||||
|
- name: config
|
||||||
|
mountPath: /root/config
|
||||||
|
volumes:
|
||||||
|
- name: device-plugin
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/rancher/k3s/agent/kubelet/device-plugins
|
||||||
|
- name: dev-dir
|
||||||
|
hostPath:
|
||||||
|
path: /dev
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: smarter-device-manager-rpi
|
||||||
|
- name: config
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/rancher/k3s/agent/kubelet/device-plugins
|
||||||
|
terminationGracePeriodSeconds: 30
|
69
smarter-device-manager-k8s-cs.yaml
Normal file
69
smarter-device-manager-k8s-cs.yaml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: < Replace with the namespace to use >
|
||||||
|
labels:
|
||||||
|
name: < Replace with the namespace to use >
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
name: smarter-device-manager
|
||||||
|
namespace: < Replace with the namespace to use >
|
||||||
|
labels:
|
||||||
|
name: smarter-device-manager
|
||||||
|
role: agent
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
name: smarter-device-manager
|
||||||
|
updateStrategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
name: smarter-device-manager
|
||||||
|
annotations:
|
||||||
|
node.kubernetes.io/bootstrap-checkpoint: "true"
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
smarter-device-manager : enabled
|
||||||
|
priorityClassName: "system-node-critical"
|
||||||
|
hostname: smarter-device-management
|
||||||
|
hostNetwork: true
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: k8sedgeregcred
|
||||||
|
containers:
|
||||||
|
- name: smarter-device-manager
|
||||||
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager/smarter-device-manager:20191204204613
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop: ["ALL"]
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 15Mi
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
memory: 15Mi
|
||||||
|
volumeMounts:
|
||||||
|
- name: device-plugin
|
||||||
|
mountPath: /var/lib/kubelet/device-plugins
|
||||||
|
- name: dev-dir
|
||||||
|
mountPath: /dev
|
||||||
|
- name: config
|
||||||
|
mountPath: /root/config
|
||||||
|
volumes:
|
||||||
|
- name: device-plugin
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/kubelet/device-plugins
|
||||||
|
- name: dev-dir
|
||||||
|
hostPath:
|
||||||
|
path: /dev
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: smarter-device-manager-rpi
|
||||||
|
terminationGracePeriodSeconds: 30
|
Reference in New Issue
Block a user