Compare commits

..

No commits in common. "master" and "feat/mqtt_service" have entirely different histories.

50 changed files with 582 additions and 1478 deletions

View File

@ -0,0 +1,2 @@
rabbitmq_user: satanas
rabbitmq_password: satanas

View File

@ -1,5 +1,9 @@
[car] [car]
satanas.local ansible_user=pi become=yes become_user=root
diabolo.local ansible_user=pi become=yes become_user=root diabolo.local ansible_user=pi become=yes become_user=root
[microservice] [microservice]
diabolo.local diabolo.local
[donkey]
satanas.local

View File

@ -93,4 +93,3 @@ dtoverlay=pi3-disable-bt
gpu_mem=256 gpu_mem=256
dtoverlay=w1-gpio dtoverlay=w1-gpio
enable_uart=1

View File

@ -481,28 +481,3 @@ fr_FR.UTF-8 UTF-8
# zh_TW.UTF-8 UTF-8 # zh_TW.UTF-8 UTF-8
# zu_ZA ISO-8859-1 # zu_ZA ISO-8859-1
# zu_ZA.UTF-8 UTF-8 # zu_ZA.UTF-8 UTF-8
# agr_PE UTF-8
# az_IR UTF-8
# bho_NP UTF-8
# bi_VU UTF-8
# ca_ES@valencia UTF-8
# dsb_DE UTF-8
# el_GR@euro ISO-8859-7
# en_SC.UTF-8 UTF-8
# hif_FJ UTF-8
# kab_DZ UTF-8
# mai_NP UTF-8
# mfe_MU UTF-8
# miq_NI UTF-8
# mjw_IN UTF-8
# mnw_MM UTF-8
# sah_RU UTF-8
# shn_MM UTF-8
# sm_WS UTF-8
# to_TO UTF-8
# tpi_PG UTF-8
# yuw_PG UTF-8
# C.UTF-8 UTF-8
# ckb_IQ UTF-8
# rif_MA UTF-8
# syr UTF-8

View File

@ -0,0 +1,35 @@
- name: Add apt key
apt_key:
url: https://download.docker.com/linux/debian/gpg
- name: Add docker-ce repository
apt_repository:
repo: deb [arch={{ arch | default('armhf') }}] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
state: present
filename: 'docker'
- meta: flush_handlers
- name: Install docker-ce
apt:
name:
- python3-pip
- docker-ce
- xfsprogs
state: present
- name: Set groups to pi user
user:
name: pi
groups: docker
- meta: flush_handlers
- name: Install ansible tool docker and docker-compose
pip:
name:
- docker-compose
executable: pip3

View File

@ -0,0 +1,4 @@
---
- include_tasks: docker.yml

View File

@ -0,0 +1,13 @@
---
donkey_username: pi
donkey_groupname: pi
donkey_home_dir: /home/{{ donkey_username }}
donkey_git_repo: https://github.com/cyrilix/donkey.git
donkey_git_branch: master
donkey_sources: "{{ donkey_home_dir }}/donkeycar"
donkey_virtualenv_dir: "{{ donkey_home_dir }}/venv"
donkey_data_dir: "{{ donkey_home_dir }}/data"

View File

@ -0,0 +1,16 @@
---
- name: Make data directory
file:
path: "{{ donkey_data_dir }}"
owner: "{{ donkey_username }}"
group: "{{ donkey_groupname }}"
state: directory
- name: Make tmpfs
mount:
path: "{{ donkey_data_dir }}"
src: tmpfs
fstype: tmpfs
opts: defaults
state: mounted

View File

@ -0,0 +1,62 @@
---
- include_tasks: data.yml
- name: Install dependencies
apt:
name:
- python3-setuptools-git
- virtualenv
- libopenjp2-7
- libtiff5
- libblas3
- liblapack3
- libatlas3-base
- libjpeg-dev
- libilmbase12
- libopenexr22
- libgstreamer1.0-0
- libavcodec57
- libavformat57
- libswscale4
- libgtk-3-0
- i2c-tools
- read-edid
- libsdl1.2debian
- libjasper1
- libqtgui4
- libqt4-test
- python-h5py
state: present
- name: Fetch git repository
become_user: "{{ donkey_username }}"
git:
repo: "{{ donkey_git_repo }}"
dest: "{{ donkey_sources }}"
version: "{{ donkey_git_branch }}"
ssh_opts: "-o StrictHostKeyChecking=no"
- name: Install donkey
become_user: "{{ donkey_username }}"
pip:
name: "{{ donkey_sources }}"
virtualenv_python: python3
virtualenv: "{{ donkey_virtualenv_dir }}"
editable: yes
#- name: Install dependencies
# become_user: "{{ donkey_username }}"
# pip:
# requirements: "{{ donkey_sources }}/requirements-pi.txt"
# virtualenv: "{{ donkey_virtualenv_dir }}"
# virtualenv_python: python3
- name: Load virtualenv at connection
template:
src: bash_custom
dest: "{{ donkey_home_dir }}/.bash_custom"
owner: "{{ donkey_username }}"
group: "{{ donkey_groupname }}"
mode: 0644

View File

@ -0,0 +1,2 @@
# Activate virtualenv
source {{ donkey_virtualenv_dir }}/bin/activate

View File

@ -1,3 +1,3 @@
--- ---
k3s_version: v1.28.3%2Bk3s2 k3s_version: v1.22.5%2Bk3s1
k3s_url: https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s-{{ arch | default('armhf') }} k3s_url: https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s-{{ arch | default('armhf') }}

View File

@ -1,12 +1,10 @@
---
- name: Add apt key - name: Add apt key
ansible.builtin.apt_key: apt_key:
url: https://download.docker.com/linux/debian/gpg url: https://download.docker.com/linux/debian/gpg
keyring: /etc/apt/trusted.gpg.d/docker.gpg
- name: Add docker-ce repository - name: Add docker-ce repository
apt_repository: apt_repository:
repo: deb [arch={{ arch | default('armhf') }}] https://download.docker.com/linux/debian bookworm stable repo: deb [arch={{ arch | default('armhf') }}] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
state: present state: present
filename: 'docker' filename: 'docker'

View File

@ -26,4 +26,4 @@ RestartSec=5s
ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service' ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'
ExecStartPre=-/sbin/modprobe br_netfilter ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server --disable traefik --disable-helm-controller ExecStart=/usr/local/bin/k3s server

View File

@ -1,21 +0,0 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: robocar-pca9685-pwm
data:
############################
# STEERING PWM - PCA9685 #
############################
#STEERING_PCA9685_LEFT_PWM: "995"
STEERING_PCA9685_LEFT_PWM: "1265"
STEERING_PCA9685_RIGHT_PWM: "1650"
STEERING_PCA9685_CENTER_PWM: "1440"
###########################
# THROTTLE PWM - PCA9685 #
############################
THROTTLE_PCA9685_MIN_PWM: "994"
THROTTLE_PCA9685_MAX_PWM: "1975"
THROTTLE_PCA9685_ZERO_PWM: "1420"

View File

@ -103,49 +103,12 @@ spec:
spec: spec:
containers: containers:
- name: camera - name: camera
image: git.cyrilix.bzh/robocars/robocar-oak-camera image: docker.io/cyrilix/robocar-oak-camera
args: args:
- "--image-width=$(CAMERA_WIDTH)" - "--image-width=$(CAMERA_WIDTH)"
- "--image-height=$(CAMERA_HEIGHT)" - "--image-height=$(CAMERA_HEIGHT)"
- "--objects-threshold=$(THRESHOLD_OBJECTS)"
- "--camera-fps=$(CAMERA_FPS)"
- "--log=info"
- "--camera-tuning-exposition=8300us"
#- "--camera-tuning-exposition=500us"
- "--disable-disparity"
- "--stereo-mode-lr-check" # remove incorrectly calculated disparity pixels due to occlusions at object borders
- "--stereo-mode-extended-disparity" # allows detecting closer distance objects for the given baseline. This increases the maximum disparity search from 96 to 191, meaning the range is now: [ 0..190 ]
- "--stereo-mode-subpixel" # improves the precision and is especially useful for long range measurements
#- "--stereo-post-processing-median-filter"
#- "--stereo-post-processing-median-value=KERNEL_7x7" #{MEDIAN_OFF,KERNEL_3x3,KERNEL_5x5,KERNEL_7x7}
- "--stereo-post-processing-speckle-filter"
- "--stereo-post-processing-speckle-enable=true"
- "--stereo-post-processing-speckle-range=200"
#- "--stereo-post-processing-temporal-filter"
#- "--stereo-post-processing-temporal-persistency-mode=VALID_2_IN_LAST_4" # {PERSISTENCY_OFF,VALID_8_OUT_OF_8,VALID_2_IN_LAST_3,VALID_2_IN_LAST_4,VALID_2_OUT_OF_8,VALID_1_IN_LAST_2,VALID_1_IN_LAST_5,VALID_1_IN_LAST_8,PERSISTENCY_INDEFINITELY}
#- "--stereo-post-processing-temporal-alpha=0.4"
#- "--stereo-post-processing-temporal-delta=0"
- "--stereo-post-processing-spatial-filter"
- "--stereo-post-processing-spatial-enable=true"
- "--stereo-post-processing-spatial-hole-filling-radius=4"
#- "--stereo-post-processing-spatial-alpha=0.5"
#- "--stereo-post-processing-spatial-delta=0"
- "--stereo-post-processing-spatial-num-iterations=1"
- "--stereo-post-processing-threshold-filter"
- "--stereo-post-processing-threshold-min-range=1450"
- "--stereo-post-processing-threshold-max-range=15000"
#- "--stereo-post-processing-decimation-filter"
#- "--stereo-post-processing-decimation-decimal-factor=2" # {1,2,3,4}
#- "--stereo-post-processing-decimation-mode=PIXEL_SKIPPING" # {PIXEL_SKIPPING,NON_ZERO_MEDIAN,NON_ZERO_MEAN}
securityContext: securityContext:
runAsUser: 0 runAsUser: 1234
privileged: true privileged: true
volumeMounts: volumeMounts:
- name: sys - name: sys
@ -153,10 +116,8 @@ spec:
- name: dev - name: dev
mountPath: /dev mountPath: /dev
env: env:
- name: MQTT_BROKER_HOST - name: MQTT_BROKER
value: localhost # because use host network value: localhost # because use host network
- name: MQTT_BROKER_PORT
value: "30183"
- name: MQTT_USERNAME - name: MQTT_USERNAME
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
@ -174,26 +135,6 @@ spec:
configMapKeyRef: configMapKeyRef:
key: MQTT_TOPIC_CAMERA_OAK_COLOR key: MQTT_TOPIC_CAMERA_OAK_COLOR
name: robocar name: robocar
- name: MQTT_TOPIC_OBJECTS
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_OBJECTS
name: robocar
- name: MQTT_TOPIC_DISPARITY
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_CAMERA_DISPARITY
name: robocar
- name: THRESHOLD_OBJECTS
valueFrom:
configMapKeyRef:
key: OBJECTS_THRESHOLD
name: robocar-objects
- name: CAMERA_FPS
valueFrom:
configMapKeyRef:
key: CAMERA_FPS
name: robocar-camera
- name: CAMERA_WIDTH - name: CAMERA_WIDTH
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
@ -206,8 +147,6 @@ spec:
name: robocar-camera name: robocar-camera
- name: MQTT_QOS - name: MQTT_QOS
value: "0" value: "0"
#- name: DEPTHAI_LEVEL
# value: debug
- name: TZ - name: TZ
value: "Europe/Paris" value: "Europe/Paris"
hostNetwork: true hostNetwork: true
@ -246,14 +185,13 @@ spec:
args: args:
- "--mqtt-retain=false" - "--mqtt-retain=false"
- "--throttle-channel=15" - "--throttle-channel=15"
- "--steering-channel=13" - "--steering-channel=14"
- "--throttle-zero-pwm=$(THROTTLE_PCA9685_ZERO_PWM)" - "--throttle-zero-pwm=$(THROTTLE_ZERO_PWM)"
- "--throttle-min-pwm=$(THROTTLE_PCA9685_MIN_PWM)" - "--throttle-min-pwm=$(THROTTLE_MIN_PWM)"
- "--throttle-max-pwm=$(THROTTLE_PCA9685_MAX_PWM)" - "--throttle-max-pwm=$(THROTTLE_MAX_PWM)"
- "--steering-left-pwm=$(STEERING_PCA9685_LEFT_PWM)" - "--steering-left-pwm=$(STEERING_LEFT_PWM)"
- "--steering-right-pwm=$(STEERING_PCA9685_RIGHT_PWM)" - "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
- "--steering-center-pwm=$(STEERING_PCA9685_CENTER_PWM)" - "--steering-center-pwm=$(STEERING_CENTER_PWM)"
- "--pwm-freq=50"
- "--update-pwm-frequency=25" - "--update-pwm-frequency=25"
- "--log=info" - "--log=info"
securityContext: securityContext:
@ -263,9 +201,6 @@ spec:
volumeMounts: volumeMounts:
- mountPath: /dev/i2c-1 - mountPath: /dev/i2c-1
name: i2c name: i2c
envFrom:
- configMapRef:
name: robocar-pca9685-pwm
env: env:
- name: MQTT_BROKER - name: MQTT_BROKER
valueFrom: valueFrom:
@ -296,6 +231,36 @@ spec:
name: robocar name: robocar
- name: MQTT_QOS - name: MQTT_QOS
value: "0" value: "0"
- name: STEERING_LEFT_PWM
valueFrom:
configMapKeyRef:
name: robocar-steering-pwm
key: STEERING_LEFT_PWM
- name: STEERING_RIGHT_PWM
valueFrom:
configMapKeyRef:
name: robocar-steering-pwm
key: STEERING_RIGHT_PWM
- name: STEERING_CENTER_PWM
valueFrom:
configMapKeyRef:
name: robocar-steering-pwm
key: STEERING_CENTER_PWM
- name: THROTTLE_MIN_PWM
valueFrom:
configMapKeyRef:
name: robocar-throttle-pwm
key: THROTTLE_MIN_PWM
- name: THROTTLE_MAX_PWM
valueFrom:
configMapKeyRef:
name: robocar-throttle-pwm
key: THROTTLE_MAX_PWM
- name: THROTTLE_ZERO_PWM
valueFrom:
configMapKeyRef:
name: robocar-throttle-pwm
key: THROTTLE_ZERO_PWM
- name: TZ - name: TZ
value: "Europe/Paris" value: "Europe/Paris"
volumes: volumes:

View File

@ -5,16 +5,15 @@ kind: Kustomization
namespace: robocar namespace: robocar
resources: resources:
- ../common-car - ../common
- deployments.yaml - deployments.yaml
- configmap.yaml
images: images:
- name: docker.io/cyrilix/robocar-camera - name: docker.io/cyrilix/robocar-camera
newTag: v0.3.1 newTag: v0.3.0
- name: docker.io/cyrilix/robocar-pca9685 - name: docker.io/cyrilix/robocar-pca9685
newTag: v0.6.4 newTag: v0.6.0
- name: git.cyrilix.bzh/robocars/robocar-oak-camera - name: docker.io/cyrilix/robocar-oak-camera
newTag: v0.6.1 newTag: v0.1.0

View File

@ -1,335 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: arduino
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: arduino
template:
metadata:
labels:
component: arduino
spec:
containers:
- name: arduino
image: docker.io/cyrilix/robocar-arduino
args:
- "-device=/dev/ttyAMA1"
- "-baud=115200"
- "-mqtt-retain=false"
- "--steering-left-pwm=$(STEERING_LEFT_PWM)"
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
- "--throttle-min-pwm=$(THROTTLE_MIN_PWM)"
- "--throttle-max-pwm=$(THROTTLE_MAX_PWM)"
- "--throttle-center-pwm=$(THROTTLE_ZERO_PWM)"
- '--throttle-feedback-config=/etc/robocar/thresholds.json'
- '--ctrl-throttle-min-pwm=$(CTRL_THROTTLE_MIN_PWM)'
- '--ctrl-throttle-max-pwm=$(CTRL_THROTTLE_MAX_PWM)'
- "-log=info"
volumeMounts:
- mountPath: "/dev/ttyAMA0"
name: serial
- mountPath: "/etc/robocar"
name: robocar
securityContext:
privileged: true
runAsUser: 1234
runAsGroup: 20 # Set 20/dialout group to access to serial device
envFrom:
- configMapRef:
name: robocar-throttle-pwm
- configMapRef:
name: robocar-steering-pwm
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
key: MQTT_USERNAME
name: mqtt-credentials
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-arduino
- name: MQTT_TOPIC_THROTTLE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_THROTTLE
name: robocar
- name: MQTT_TOPIC_STEERING
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_STEERING
name: robocar
- name: MQTT_TOPIC_DRIVE_MODE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_DRIVE_MODE
name: robocar
- name: MQTT_TOPIC_SWITCH_RECORD
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_SWITCH_RECORD
name: robocar
- name: MQTT_TOPIC_THROTTLE_FEEDBACK
valueFrom:
configMapKeyRef:
name: robocar
key: MQTT_TOPIC_THROTTLE_FEEDBACK
- name: MQTT_TOPIC_MAX_THROTTLE_CTRL
valueFrom:
configMapKeyRef:
name: robocar
key: MQTT_TOPIC_MAX_THROTTLE_CTRL
- name: CTRL_THROTTLE_MIN_PWM
valueFrom:
configMapKeyRef:
name: robocar-throttle-pwm
key: CTRL_THROTTLE_MIN_PWM
- name: CTRL_THROTTLE_MAX_PWM
valueFrom:
configMapKeyRef:
name: robocar-throttle-pwm
key: CTRL_THROTTLE_MAX_PWM
- name: MQTT_QOS
value: "0"
- name: TZ
value: "Europe/Paris"
volumes:
- name: serial
hostPath:
path: /dev/ttyAMA0
type: CharDevice
- name: robocar
configMap:
name: robocar-objects
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: led
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: led
template:
metadata:
labels:
component: led
spec:
containers:
- name: led
image: docker.io/cyrilix/robocar-led
args:
- "-mqtt-retain=false"
- "-log=info"
volumeMounts:
- name: gpiomem
mountPath: "/dev/gpiomem"
- name: gpiochip0
mountPath: "/dev/gpiochip0"
- name: gpiochip1
mountPath: "/dev/gpiochip1"
securityContext:
privileged: true
runAsUser: 1234
runAsGroup: 997 # Set 997/gpio group to access to serial device
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
key: MQTT_USERNAME
name: mqtt-credentials
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-led
- name: MQTT_TOPIC_DRIVE_MODE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_DRIVE_MODE
name: robocar
- name: MQTT_TOPIC_RECORD
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_SWITCH_RECORD
name: robocar
- name: MQTT_TOPIC_SPEED_ZONE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_SPEED_ZONE
name: robocar
- name: MQTT_TOPIC_THROTTLE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_THROTTLE
name: robocar
- name: MQTT_QOS
value: "0"
- name: TZ
value: "Europe/Paris"
volumes:
- name: gpiomem
hostPath:
path: /dev/gpiomem
type: CharDevice
- name: gpiochip0
hostPath:
path: /dev/gpiochip0
type: CharDevice
- name: gpiochip1
hostPath:
path: /dev/gpiochip1
type: CharDevice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tflite-steering
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: tflite-steering
template:
metadata:
labels:
component: tflite-steering
spec:
containers:
- name: tflite-steering
image: docker.io/cyrilix/robocar-steering-tflite-edgetpu
args:
#- "--model=/model/$(MODEL_STEERING)"
- "--oci-model-registry=$(OCI_IMAGE_MODEL_REGISTRY)"
- "--oci-model-repository=$(OCI_IMAGE_MODEL_REPOSITORY)"
- "--oci-model-tag=$(OCI_IMAGE_MODEL_TAG)"
- "--edge-verbosity=0"
- "--log=info"
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: true
volumeMounts:
- name: models
mountPath: /model
- name: bus-usb
mountPath: /dev/bus/usb
- name: sys
mountPath: /sys
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
key: MQTT_USERNAME
name: mqtt-credentials
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-tflite-steering
- name: MQTT_TOPIC_CAMERA
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_CAMERA_OAK_COLOR
name: robocar
- name: MQTT_TOPIC_STEERING
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_TF_STEERING
name: robocar
- name: OCI_IMAGE_MODEL_REGISTRY
valueFrom:
configMapKeyRef:
key: OCI_IMAGE_MODEL_REGISTRY
name: robocar-models
- name: OCI_IMAGE_MODEL_REPOSITORY
valueFrom:
configMapKeyRef:
key: OCI_IMAGE_MODEL_REPOSITORY
name: robocar-models
- name: OCI_IMAGE_MODEL_TAG
valueFrom:
configMapKeyRef:
key: OCI_IMAGE_MODEL_TAG
name: robocar-models
#- name: MODEL_STEERING
# valueFrom:
# configMapKeyRef:
# key: MODEL_STEERING
# name: robocar-models
#- name: MODEL_IMAGE_WIDTH
# valueFrom:
# configMapKeyRef:
# key: MODEL_IMAGE_WIDTH
# name: robocar-models
#- name: MODEL_IMAGE_HEIGHT
# valueFrom:
# configMapKeyRef:
# key: MODEL_IMAGE_HEIGHT
# name: robocar-models
#- name: HORIZON
# valueFrom:
# configMapKeyRef:
# key: HORIZON
# name: robocar-models
- name: MQTT_QOS
value: "0"
- name: LD_LIBRARY_PATH
value: "/usr/local/lib/:/usr/lib"
- name: TZ
value: "Europe/Paris"
volumes:
- name: models
hostPath:
path: /home/pi/models/steering
type: DirectoryOrCreate
- name: bus-usb
hostPath:
path: /dev/bus/usb
- name: sys
hostPath:
path: /sys

View File

@ -1,20 +0,0 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../common
#- namespace.yaml
- deployments.yaml
#- services.yaml
#- configmap.yaml
images:
- name: docker.io/cyrilix/robocar-arduino
newTag: v0.11.0
- name: docker.io/cyrilix/robocar-led
newTag: v0.7.0
- name: docker.io/cyrilix/robocar-steering-tflite-edgetpu
newTag: v0.6.1

View File

@ -1,9 +0,0 @@
---
apiVersion: v1
kind: Secret
metadata:
name: mqtt-credentials
namespace: robocar
stringData:
MQTT_USERNAME: satanas
MQTT_PASSWORD: satanas

View File

@ -4,25 +4,20 @@ metadata:
name: robocar name: robocar
data: data:
# Broker configuration # Broker configuration
MQTT_BROKER_HOST: "nats-server.nats.svc.cluster.local" MQTT_BROKER_HOST: mqtt.robocar.svc.cluster.local
#MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883" MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
MQTT_BROKER: "tcp://nats-server.nats.svc.cluster.local:1883"
# Camera # Camera
MQTT_TOPIC_CAMERA: "car/satanas/part/camera/color" MQTT_TOPIC_CAMERA: car/satanas/part/camera/camera/color
MQTT_TOPIC_CAMERA_OAK_COLOR: "car/satanas/part/camera/color" MQTT_TOPIC_CAMERA_OAK_COLOR: car/satanas/part/camera/color
MQTT_TOPIC_CAMERA_DISPARITY: "car/satanas/part/camera/disparity"
# Objects detection
MQTT_TOPIC_OBJECTS: "car/satanas/part/objects/raw"
MQTT_TOPIC_OBJECTS_CLEAN: "car/satanas/part/objects/clean"
# Radio command # Radio command
MQTT_TOPIC_RC_THROTTLE: car/satanas/part/rc/throttle MQTT_TOPIC_RC_THROTTLE: car/satanas/part/rc/throttle
MQTT_TOPIC_RC_STEERING: car/satanas/part/rc/steering MQTT_TOPIC_RC_STEERING: car/satanas/part/rc/steering
MQTT_TOPIC_RC_SWITCH_RECORD: car/satanas/part/rc/switch_record MQTT_TOPIC_RC_SWITCH_RECORD: car/satanas/part/rc/switch_record
MQTT_TOPIC_RC_DRIVE_MODE: car/satanas/part/rc/drive_mode MQTT_TOPIC_RC_DRIVE_MODE: car/satanas/part/rc/drive_mode
MQTT_TOPIC_MAX_THROTTLE_CTRL: car/satanas/part/rc/max_throttle
MQTT_TOPIC_TF_STEERING: car/satanas/part/tflite/steering MQTT_TOPIC_TF_STEERING: car/satanas/part/tflite/steering
@ -30,17 +25,12 @@ data:
MQTT_TOPIC_THROTTLE: car/satanas/part/throttle MQTT_TOPIC_THROTTLE: car/satanas/part/throttle
MQTT_TOPIC_STEERING: car/satanas/part/steering MQTT_TOPIC_STEERING: car/satanas/part/steering
MQTT_TOPIC_SPEED_ZONE: car/satanas/part/speed_zone
# Road detection # Road detection
MQTT_TOPIC_ROAD: car/satanas/part/road MQTT_TOPIC_ROAD: car/satanas/part/road
# Records topic # Records topic
MQTT_TOPIC_RECORDS: car/satanas/part/records MQTT_TOPIC_RECORDS: car/satanas/part/records
# Feedbacks
MQTT_TOPIC_THROTTLE_FEEDBACK: car/satanas/part/feedback/throttle
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -50,107 +40,32 @@ data:
############ ############
# Throttle # # Throttle #
############ ############
THROTTLE_MIN: "0.3"
## For manual driving THROTTLE_MAX: "0.4"
#####################
# THROTTLE_MIN: "0.10"
# THROTTLE_MAX: "0.12"
## Slow auto-pilot
####################
#THROTTLE_MIN: "0.10"
#THROTTLE_MAX: "0.10"
## Secure auto-pilot
####################
#THROTTLE_MIN: "0.11"
#THROTTLE_MAX: "0.12"
## bump auto-pilot
####################
THROTTLE_MIN: "0.11"
THROTTLE_MAX: "0.11"
## bump speed auto-pilot
####################
#THROTTLE_MIN: "0.12"
#THROTTLE_MAX: "0.18"
## Speed auto-pilot
###################
#THROTTLE_MIN: "0.11"
#THROTTLE_MAX: "0.13"
## Speed race auto-pilot
###################
#THROTTLE_MIN: "0.11"
#THROTTLE_MAX: "0.15"
# Throttle acceleration boost
#############################
THROTTLE_ACCELERATOR_FACTOR: "1.2"
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: robocar-steering-pwm name: robocar-steering-pwm
data: data:
################ ################
# STEERING PWM # # STEERING PWM #
################ ################
STEERING_LEFT_PWM: "1004" STEERING_LEFT_PWM: "1002"
STEERING_RIGHT_PWM: "2048" STEERING_RIGHT_PWM: "1985"
STEERING_CENTER_PWM: "1514" STEERING_CENTER_PWM: "1491"
############################
# STEERING PWM - SECOND RC #
############################
STEERING_SECONDARY_LEFT_PWM: "1119"
STEERING_SECONDARY_RIGHT_PWM: "2141"
STEERING_SECONDARY_CENTER_PWM: "1641"
#################################
# OLD RADIO-COMAND STEERING PWM #
#################################
#STEERING_LEFT_PWM: "1000"
#STEERING_RIGHT_PWM: "1985"
#STEERING_CENTER_PWM: "1492"
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: robocar-throttle-pwm name: robocar-throttle-pwm
data: data:
################ ################
# THROTTLE PWM # # THROTTLE PWM #
################ ################
THROTTLE_MIN_PWM: "980" THROTTLE_MIN_PWM: "1092"
THROTTLE_MAX_PWM: "2046" THROTTLE_MAX_PWM: "1986"
THROTTLE_ZERO_PWM: "1509" THROTTLE_ZERO_PWM: "1583"
###########################
# THROTTLE PWM - SECOND RC #
############################
THROTTLE_SECONDARY_MIN_PWM: "994"
THROTTLE_SECONDARY_MAX_PWM: "1975"
THROTTLE_SECONDARY_ZERO_PWM: "1506"
####################
# OLD THROTTLE PWM #
####################
# THROTTLE_MIN_PWM: "994"
# THROTTLE_MAX_PWM: "1979"
# THROTTLE_ZERO_PWM: "1484"
############################
# MAX THROTTLE CONTROL PWM #
############################
CTRL_THROTTLE_MIN_PWM: "1000"
CTRL_THROTTLE_MAX_PWM: "2000"
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -166,9 +81,7 @@ data:
CAMERA_WIDTH: "160" CAMERA_WIDTH: "160"
CAMERA_HEIGHT: "120" CAMERA_HEIGHT: "120"
CAMERA_FPS: "35" MQTT_CAMERA_PUB_FREQUENCY: "30"
MQTT_CAMERA_PUB_FREQUENCY: "35"
--- ---
apiVersion: v1 apiVersion: v1
@ -177,49 +90,15 @@ metadata:
name: robocar-models name: robocar-models
data: data:
# model to use for steering # model to use for steering
#MODEL_STEERING: model_categorical_160x120h0_edgetpu.tflite MODEL_STEERING: model_160x120h0_edgetpu.tflite
MODEL_STEERING: "model_linear_160x120h0_edgetpu.tflite" MODEL_STEERING3: model_edgetpu.tflite
#OCI_IMAGE_MODEL: "git.cyrilix.bzh/robocars/model-steering:v20230429.0945-edgetpu" MODEL_STEERING4: model_160x120h20_edgetpu.tflite
#OCI_IMAGE_MODEL: "docker.io/cyrilix/model-steering:v20230429.0945-edgetpu" MODEL_STEERING2: model-sim-bigimg_edgetpu.tflite
#OCI_IMAGE_MODEL: "docker.io/cyrilix/model-steering:v0.1.0-edgetpu"
OCI_IMAGE_MODEL_REGISTRY: "registry.registry:5000"
OCI_IMAGE_MODEL_REPOSITORY: "robocars/model-steering"
# OCI_IMAGE_MODEL_TAG: "v20230602.2041-edgetpu" # vibreurs seuls ou v20230601.2338-edgetpu
#OCI_IMAGE_MODEL_TAG: "v20230602.2058-edgetpu" # vibreurs + toutes les sessions bump
#OCI_IMAGE_MODEL_TAG: "v20230603.1130-edgetpu" # clean1
#OCI_IMAGE_MODEL_TAG: "v20230603.1144-edgetpu" # clean1
#OCI_IMAGE_MODEL_TAG: "v20230617.0938-edgetpu"
#OCI_IMAGE_MODEL_TAG: "v20230617.0946-edgetpu" # bad
#OCI_IMAGE_MODEL_TAG: "v20230617.1010-edgetpu" # rd + vt not exist
#OCI_IMAGE_MODEL_TAG: "v20230429.0945-edgetpu" # All + bump
#OCI_IMAGE_MODEL_TAG: "v20230617.1058-edgetpu" # clean3
#OCI_IMAGE_MODEL_TAG: "v20230617.1312-edgetpu" # clean10
OCI_IMAGE_MODEL_TAG: "v20230603.1157-edgetpu" # clean1 # Model RD good
#OCI_IMAGE_MODEL_TAG: "v20231215.1955-tflite" # Model RD good + plots
#OCI_IMAGE_MODEL_TAG: "v20231215.2002-tflite" # Model RD good + plots + brightness 0.5 + contrast 0.5
#OCI_IMAGE_MODEL_TAG: "v20231013.2034-edgetpu" # clean3, light + contrast
#OCI_IMAGE_MODEL_TAG: "v20230617.1327-edgetpu" # clean10
#MODEL_STEERING: model_linear_160x120h40_edgetpu.tflite
#MODEL_STEERING: model_linear_160x120h20_edgetpu.tflite
#MODEL_STEERING: model_categorical_160x120h20_edgetpu.tflite
#MODEL_STEERING: model_linear_160x120h50_edgetpu.tflite
MODEL_IMAGE_WIDTH: "160" MODEL_IMAGE_WIDTH: "160"
MODEL_IMAGE_HEIGHT: "120" MODEL_IMAGE_HEIGHT: "120"
HORIZON: "20" HORIZON: "20"
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
@ -227,164 +106,3 @@ metadata:
name: robocar-road name: robocar-road
data: data:
HORIZON: "20" HORIZON: "20"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: steering
data:
grid.json: |
{
"steering_steps": [ -1, -0.66, -0.33, 0, 0.33, 0.66, 1],
"distance_steps": [ 0, 0.3, 0.4, 0.5, 0.8, 1],
"data": [
[ 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0],
[ 0, 0.5, 0.75, -0.75, 0.5, 0],
[ 0.5, 0.75, 1, -1, -0.75, 0.5],
[ 0.75, 1, 1, -1, -1, -0.75]
]
}
grid2.json: |
{
"steering_steps": [ -1, -0.66, -0.33, 0, 0.33, 0.66, 1],
"distance_steps": [ 0, 0.3, 0.4, 0.5, 0.8, 1],
"data": [
[ 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0],
[ 0, 0, 0.75, -0.75, 0, 0],
[ 0, 0.75, 1, -1, -0.75, 0],
[ 0.75, 1, 1, -1, -1, -0.75]
]
}
"omf.json": |
{
"steering_steps":[-1, -0.66, -0.33, 0, 0.33, 0.66, 1],
"distance_steps": [0, 0.2, 0.4, 0.6, 0.8, 1],
"data": [
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0.25, 0, 0, -0.25, 0],
[0.5, 0.25, 0, 0, -0.5, -0.25]
]
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: robocar-objects
data:
OBJECTS_THRESHOLD: "0.2"
# To delete?
thresholds.json: |
{
"threshold_steps": [ 0.07, 0.08, 0.09, 0.1, 0.125, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 ],
"min_valid": 500,
"data": [ 8700, 4800, 3500, 2550, 1850, 1387, 992, 840, 750, 700, 655, 620, 590, 570, 553, 549, 548 ]
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: throttle
data:
brake2.json: |
{
"delta_steps": [ 0.05, 0.1, 0.2, 0.3, 0.5 ],
"data": [ -0.1, -0.2, -0.3, -0.6, -1.0 ]
}
brake.json3: |
{
"delta_steps": [ 0.005, 0.1, 0.2, 0.3, 0.5 ],
"data": [ -0.26, -0.4, -0.7, -0.8, -1.0 ]
}
brake.json: |
{
"delta_steps": [ 0.005, 0.05, 0.1, 0.2, 0.5 ],
"data": [ -0.26, -0.4, -0.7, -0.8, -1.0 ]
}
# speed_custom
speed_steering.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.17, 0.16, 0.15, 0.13]
}
# speed_custom
speed_steering_2.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.18, 0.16, 0.15, 0.13]
}
# speed_custom
speed_steering_3.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.18, 0.17, 0.16, 0.14]
}
speed_steering_4.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.19, 0.18, 0.16, 0.14]
}
# good_custom_steering
safe_steering.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.14, 0.13, 0.12, 0.11]
}
# little_speeed_custom_steering
ls_custom_steering.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.16, 0.15, 0.14, 0.12]
}
very_speed_custom_steering.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.21, 0.17, 0.15, 0.12]
}
bcustom_steering.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.18, 0.15, 0.14, 0.13]
}
slow_custom_steering.json: |
{
"steering_values": [0.0, 0.20, 0.50, 0.70],
"throttle_steps": [0.12, 0.115, 0.112, 0.11]
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: robocar-profiles
data:
#throttle_from_steering: "slow_custom_steering.json"
#throttle_from_steering: "safe_steering.json"
#throttle_from_steering: "ls_custom_steering.json" # little_speeed_custom_steering
#throttle_from_steering: "speed_steering.json"
throttle_from_steering: "speed_steering_2.json"
#throttle_from_steering: "speed_steering_3.json"
#throttle_from_steering: "speed_steering_4.json"
#throttle_from_steering: "very_speed_custom_steering.json"
detection_objects: "false"
#detection_objects: "true"

View File

@ -2,7 +2,7 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: objects-detection name: arduino
annotations: annotations:
reloader.stakater.com/auto: "true" reloader.stakater.com/auto: "true"
spec: spec:
@ -12,33 +12,30 @@ spec:
type: Recreate type: Recreate
selector: selector:
matchLabels: matchLabels:
component: objects-detection component: arduino
template: template:
metadata: metadata:
labels: labels:
component: objects-detection component: arduino
spec: spec:
containers: containers:
- name: objects-detection - name: arduino
image: docker.io/cyrilix/robocar-objects-detection image: docker.io/cyrilix/robocar-arduino
args: args:
- "-device=/dev/ttyAMA1"
- "-baud=115200"
- "-mqtt-retain=false" - "-mqtt-retain=false"
- "--image-width=$(IMAGE_WIDTH)" - "--steering-left-pwm=$(STEERING_LEFT_PWM)"
- "--image-height=$(IMAGE_HEIGHT)" - "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
- "--object-size-threshold=0.50" - "--steering-center-pwm=$(STEERING_CENTER_PWM)"
- "--enable-big-objects-remove=true" - "-log=info"
- "--enable-group-objects=false" # to debug/test volumeMounts:
- "--enable-bottom-filter=false" # don't work - mountPath: "/dev/ttyAMA0"
- "--enable-nearest-filter=true" name: serial
- "--object-bottom-limit=0.90"
- "--log=info"
securityContext: securityContext:
privileged: true
runAsUser: 1234 runAsUser: 1234
runAsGroup: 1234 runAsGroup: 20 # Set 20/dialout group to access to serial device
resources:
limits:
memory: 100Mi
env: env:
- name: MQTT_BROKER - name: MQTT_BROKER
valueFrom: valueFrom:
@ -56,36 +53,240 @@ spec:
key: MQTT_PASSWORD key: MQTT_PASSWORD
name: mqtt-credentials name: mqtt-credentials
- name: MQTT_CLIENT_ID - name: MQTT_CLIENT_ID
value: rc-objects-detection value: rc-arduino
- name: MQTT_TOPIC_OBJECTS - name: MQTT_TOPIC_THROTTLE
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
key: MQTT_TOPIC_OBJECTS key: MQTT_TOPIC_RC_THROTTLE
name: robocar name: robocar
- name: MQTT_TOPIC_OBJECTS_CLEAN - name: MQTT_TOPIC_STEERING
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
key: MQTT_TOPIC_OBJECTS_CLEAN key: MQTT_TOPIC_RC_STEERING
name: robocar name: robocar
- name: MQTT_TOPIC_DISPARITY - name: MQTT_TOPIC_DRIVE_MODE
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
key: MQTT_TOPIC_CAMERA_DISPARITY key: MQTT_TOPIC_RC_DRIVE_MODE
name: robocar
- name: MQTT_TOPIC_SWITCH_RECORD
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_SWITCH_RECORD
name: robocar name: robocar
- name: MQTT_QOS - name: MQTT_QOS
value: "0" value: "0"
- name: IMAGE_WIDTH - name: STEERING_LEFT_PWM
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
key: CAMERA_WIDTH name: robocar-steering-pwm
name: robocar-camera key: STEERING_LEFT_PWM
- name: IMAGE_HEIGHT - name: STEERING_RIGHT_PWM
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
key: CAMERA_HEIGHT name: robocar-steering-pwm
name: robocar-camera key: STEERING_RIGHT_PWM
- name: STEERING_CENTER_PWM
valueFrom:
configMapKeyRef:
name: robocar-steering-pwm
key: STEERING_CENTER_PWM
- name: TZ - name: TZ
value: "Europe/Paris" value: "Europe/Paris"
volumes:
- name: serial
hostPath:
path: /dev/ttyAMA0
type: CharDevice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: led
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: led
template:
metadata:
labels:
component: led
spec:
containers:
- name: led
image: docker.io/cyrilix/robocar-led
args:
- "-mqtt-retain=false"
- "-log=info"
volumeMounts:
- name: gpiomem
mountPath: "/dev/gpiomem"
- name: gpiochip0
mountPath: "/dev/gpiochip0"
- name: gpiochip1
mountPath: "/dev/gpiochip1"
securityContext:
privileged: true
runAsUser: 1234
runAsGroup: 997 # Set 997/gpio group to access to serial device
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
key: MQTT_USERNAME
name: mqtt-credentials
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-led
- name: MQTT_TOPIC_DRIVE_MODE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_DRIVE_MODE
name: robocar
- name: MQTT_TOPIC_RECORD
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_SWITCH_RECORD
name: robocar
- name: MQTT_QOS
value: "0"
- name: TZ
value: "Europe/Paris"
volumes:
- name: gpiomem
hostPath:
path: /dev/gpiomem
type: CharDevice
- name: gpiochip0
hostPath:
path: /dev/gpiochip0
type: CharDevice
- name: gpiochip1
hostPath:
path: /dev/gpiochip1
type: CharDevice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tflite-steering
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: tflite-steering
template:
metadata:
labels:
component: tflite-steering
spec:
containers:
- name: tflite-steering
image: docker.io/cyrilix/robocar-steering-tflite-edgetpu
args:
- "--model=/model/$(MODEL_STEERING)"
- "--edge-verbosity=0"
- "--img-width=$(MODEL_IMAGE_WIDTH)"
- "--img-height=$(MODEL_IMAGE_HEIGHT)"
- "--horizon=$(HORIZON)"
- "--log=info"
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: true
volumeMounts:
- name: models
mountPath: /model
- name: bus-usb
mountPath: /dev/bus/usb
- name: sys
mountPath: /sys
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
key: MQTT_USERNAME
name: mqtt-credentials
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-tflite-steering
- name: MQTT_TOPIC_CAMERA
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_CAMERA
name: robocar
- name: MQTT_TOPIC_STEERING
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_TF_STEERING
name: robocar
- name: MODEL_STEERING
valueFrom:
configMapKeyRef:
key: MODEL_STEERING
name: robocar-models
- name: MODEL_IMAGE_WIDTH
valueFrom:
configMapKeyRef:
key: MODEL_IMAGE_WIDTH
name: robocar-models
- name: MODEL_IMAGE_HEIGHT
valueFrom:
configMapKeyRef:
key: MODEL_IMAGE_HEIGHT
name: robocar-models
- name: HORIZON
valueFrom:
configMapKeyRef:
key: HORIZON
name: robocar-models
- name: MQTT_QOS
value: "0"
- name: LD_LIBRARY_PATH
value: "/usr/local/lib/:/usr/lib"
- name: TZ
value: "Europe/Paris"
volumes:
- name: models
hostPath:
path: /home/pi/models/steering
type: DirectoryOrCreate
- name: bus-usb
hostPath:
path: /dev/bus/usb
- name: sys
hostPath:
path: /sys
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -111,11 +312,6 @@ spec:
image: docker.io/cyrilix/robocar-steering image: docker.io/cyrilix/robocar-steering
args: args:
- "-mqtt-retain=false" - "-mqtt-retain=false"
- "--enable-objects-correction=$(DETECTION_OBJECTS)"
- "--enable-objects-correction-user=$(DETECTION_OBJECTS)"
- "--grid-map-config=/etc/robocar/grid.json"
- "--objects-move-factors-config=/etc/robocar/omf.json"
- "--delta-middle=0.1"
- "-log=info" - "-log=info"
securityContext: securityContext:
runAsUser: 1234 runAsUser: 1234
@ -158,37 +354,10 @@ spec:
configMapKeyRef: configMapKeyRef:
key: MQTT_TOPIC_RC_DRIVE_MODE key: MQTT_TOPIC_RC_DRIVE_MODE
name: robocar name: robocar
- name: MQTT_TOPIC_OBJECTS
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_OBJECTS_CLEAN
name: robocar
- name: MQTT_QOS - name: MQTT_QOS
value: "0" value: "0"
- name: IMAGE_WIDTH
valueFrom:
configMapKeyRef:
key: CAMERA_WIDTH
name: robocar-camera
- name: IMAGE_HEIGHT
valueFrom:
configMapKeyRef:
key: CAMERA_HEIGHT
name: robocar-camera
- name: TZ - name: TZ
value: "Europe/Paris" value: "Europe/Paris"
- name: DETECTION_OBJECTS
valueFrom:
configMapKeyRef:
key: detection_objects
name: robocar-profiles
volumeMounts:
- mountPath: /etc/robocar
name: robocar-configs
volumes:
- name: robocar-configs
configMap:
name: steering
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -213,13 +382,8 @@ spec:
- name: throttle - name: throttle
image: docker.io/cyrilix/robocar-throttle image: docker.io/cyrilix/robocar-throttle
args: args:
- "--mqtt-retain=false" - "-mqtt-retain=false"
- "--enable-brake-feature=true" - "-debug=false"
- "--brake-configuration=/etc/robocar/brake.json"
- "--enable-custom-steering-processor=true"
- "--custom-steering-processor-config=/etc/robocar/$(THROTTLE_STEERING_CONFIG)"
- "--accelerator-factor=$(THROTTLE_ACCELERATOR_FACTOR)"
- "--log=info"
securityContext: securityContext:
runAsUser: 1234 runAsUser: 1234
runAsGroup: 1234 runAsGroup: 1234
@ -256,26 +420,6 @@ spec:
configMapKeyRef: configMapKeyRef:
key: MQTT_TOPIC_RC_DRIVE_MODE key: MQTT_TOPIC_RC_DRIVE_MODE
name: robocar name: robocar
- name: MQTT_TOPIC_THROTTLE_FEEDBACK
valueFrom:
configMapKeyRef:
name: robocar
key: MQTT_TOPIC_THROTTLE_FEEDBACK
- name: MQTT_TOPIC_STEERING
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_STEERING
name: robocar
- name: MQTT_TOPIC_SPEED_ZONE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_SPEED_ZONE
name: robocar
- name: MQTT_TOPIC_MAX_THROTTLE_CTRL
valueFrom:
configMapKeyRef:
name: robocar
key: MQTT_TOPIC_MAX_THROTTLE_CTRL
- name: THROTTLE_MIN - name: THROTTLE_MIN
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
@ -286,27 +430,10 @@ spec:
configMapKeyRef: configMapKeyRef:
key: THROTTLE_MAX key: THROTTLE_MAX
name: robocar-throttle name: robocar-throttle
- name: THROTTLE_ACCELERATOR_FACTOR
valueFrom:
configMapKeyRef:
name: robocar-throttle
key: THROTTLE_ACCELERATOR_FACTOR
- name: THROTTLE_STEERING_CONFIG
valueFrom:
configMapKeyRef:
key: throttle_from_steering
name: robocar-profiles
- name: MQTT_QOS - name: MQTT_QOS
value: "0" value: "0"
- name: TZ - name: TZ
value: "Europe/Paris" value: "Europe/Paris"
volumeMounts:
- mountPath: /etc/robocar
name: throttle-config
volumes:
- name: throttle-config
configMap:
name: throttle
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -398,7 +525,7 @@ spec:
image: docker.io/cyrilix/robocar-record image: docker.io/cyrilix/robocar-record
args: args:
- "-mqtt-retain=true" - "-mqtt-retain=true"
- "-debug=false" - "-debug=true"
securityContext: securityContext:
runAsUser: 1234 runAsUser: 1234
runAsGroup: 1234 runAsGroup: 1234
@ -435,16 +562,6 @@ spec:
configMapKeyRef: configMapKeyRef:
key: MQTT_TOPIC_RC_SWITCH_RECORD key: MQTT_TOPIC_RC_SWITCH_RECORD
name: robocar name: robocar
- name: MQTT_TOPIC_AUTOPILOT_STEERING
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_TF_STEERING
name: robocar
- name: MQTT_TOPIC_DRIVE_MODE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_RC_DRIVE_MODE
name: robocar
- name: MQTT_TOPIC_RECORDS - name: MQTT_TOPIC_RECORDS
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
@ -463,7 +580,7 @@ metadata:
reloader.stakater.com/auto: "true" reloader.stakater.com/auto: "true"
spec: spec:
revisionHistoryLimit: 0 revisionHistoryLimit: 0
replicas: 0 replicas: 1
strategy: strategy:
type: Recreate type: Recreate
selector: selector:
@ -479,25 +596,10 @@ spec:
image: docker.io/cyrilix/robocar-road image: docker.io/cyrilix/robocar-road
args: args:
- "-mqtt-retain=false" - "-mqtt-retain=false"
- "-image-width=$(IMAGE_WIDTH)"
- "-image-height=$(IMAGE_HEIGHT)"
- "-white-threshold-low=20"
- "-white-threshold-high=255"
- "-canny-threshold-low=100"
- "-canny-threshold-high=250"
- "-hough-lines-rho=2" # distance resolution in pixels of the Hough grid")
#- "-hough-lines-theta", 1*math.Pi/180, "angular resolution in radians of the Hough grid, default Pi/180")
- "-hough-lines-threshold=15" # minimum number of votes (intersections in Hough grid cell)
- "-hough-lines-min-line-length=10" # minimum number of pixels making up a line
- "-hough-lines-max-lines-gap=20" # maximum gap in pixels between connectable line segments
- "--log=info" - "--log=info"
securityContext: securityContext:
runAsUser: 1234 runAsUser: 1234
runAsGroup: 1234 runAsGroup: 1234
resources:
limits:
memory: 100Mi
cpu: 500m
env: env:
- name: MQTT_BROKER - name: MQTT_BROKER
valueFrom: valueFrom:
@ -528,15 +630,5 @@ spec:
name: robocar name: robocar
- name: MQTT_QOS - name: MQTT_QOS
value: "0" value: "0"
- name: IMAGE_WIDTH
valueFrom:
configMapKeyRef:
key: CAMERA_WIDTH
name: robocar-camera
- name: IMAGE_HEIGHT
valueFrom:
configMapKeyRef:
key: CAMERA_HEIGHT
name: robocar-camera
- name: TZ - name: TZ
value: "Europe/Paris" value: "Europe/Paris"

View File

@ -0,0 +1,13 @@
---
apiVersion: v1
kind: Endpoints
metadata:
name: mqtt
labels:
app: mqtt
subsets:
- addresses:
- ip: 192.168.2.221
# - ip: 192.168.217.19
ports:
- port: 1883

View File

@ -3,27 +3,32 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- namespace.yaml
- deployments.yaml - deployments.yaml
- endpoints.yaml
- services.yaml - services.yaml
- configmap.yaml - configmap.yaml
images: images:
- name: docker.io/cyrilix/robocar-arduino
newTag: v0.7.0
- name: docker.io/cyrilix/robocar-led
newTag: v0.5.0
- name: docker.io/cyrilix/robocar-steering-tflite-edgetpu
newTag: v0.4.0
- name: docker.io/cyrilix/robocar-throttle - name: docker.io/cyrilix/robocar-throttle
newTag: v0.9.0 newTag: v0.4.1
- name: docker.io/cyrilix/robocar-record - name: docker.io/cyrilix/robocar-record
newTag: v0.6.0 newTag: v0.5.0
- name: docker.io/cyrilix/robocar-recorder-store - name: docker.io/cyrilix/robocar-recorder-store
newTag: v0.3.0 newTag: v0.2.0
- name: docker.io/cyrilix/robocar-steering - name: docker.io/cyrilix/robocar-steering
newTag: v0.8.0 newTag: v0.5.0
- name: docker.io/cyrilix/robocar-road - name: docker.io/cyrilix/robocar-road
newTag: v0.3.0 newTag: v0.1.0-5-gdc6e465
- name: docker.io/cyrilix/robocar-objects-detection
newTag: v0.2.0

View File

@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: robocar

View File

@ -3,7 +3,6 @@ apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: mqtt-credentials name: mqtt-credentials
namespace: robocar
stringData: stringData:
MQTT_USERNAME: satanas MQTT_USERNAME: satanas
MQTT_PASSWORD: satanas MQTT_PASSWORD: satanas

View File

@ -1,10 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- registry
- registry/secrets.yaml
- reloader
- nats
- car
- common/secrets.yaml

View File

@ -1,8 +0,0 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: robocar-camera-replay
data:
REPLAY_FRAME_DIR: "/records/clean3/records/2023-05-13T10-14_33/cam"

View File

@ -1,173 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: camera-replay
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: camera-replay
template:
metadata:
labels:
component: camera-replay
spec:
containers:
- name: camera-replay
image: docker.io/cyrilix/robocar-camera-replay
args:
- "-mqtt-pub-frequency=$(MQTT_CAMERA_PUB_FREQUENCY)"
- "-frame-dir=$(REPLAY_FRAME_DIR)"
- "-log=info"
securityContext:
runAsUser: 1000
runAsGroup: 1000
privileged: false
volumeMounts:
- name: camera-records
mountPath: /records
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
key: MQTT_USERNAME
name: mqtt-credentials
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-camera-replay
- name: MQTT_TOPIC
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_CAMERA
name: robocar
- name: REPLAY_FRAME_DIR
valueFrom:
configMapKeyRef:
key: REPLAY_FRAME_DIR
name: robocar-camera-replay
- name: MQTT_CAMERA_PUB_FREQUENCY
valueFrom:
configMapKeyRef:
key: MQTT_CAMERA_PUB_FREQUENCY
name: robocar-camera
- name: MQTT_QOS
value: "0"
- name: TZ
value: "Europe/Paris"
volumes:
- name: camera-records
hostPath:
path: "/home/cyrille/robocar-clean/"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tflite-steering
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: tflite-steering
template:
metadata:
labels:
component: tflite-steering
spec:
containers:
- name: tflite-steering
image: docker.io/cyrilix/robocar-steering-tflite-edgetpu
args:
#- "--model=/model/$(MODEL_STEERING)"
- "--oci-model-registry=$(OCI_IMAGE_MODEL_REGISTRY)"
- "--oci-model-repository=$(OCI_IMAGE_MODEL_REPOSITORY)"
- "--oci-model-tag=$(OCI_IMAGE_MODEL_TAG)"
- "--edge-verbosity=0"
- "--log=info"
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: true
volumeMounts:
- name: models
mountPath: /model
- name: bus-usb
mountPath: /dev/bus/usb
- name: sys
mountPath: /sys
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
key: MQTT_USERNAME
name: mqtt-credentials
- name: MQTT_PASSWORD
valueFrom:
secretKeyRef:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-tflite-steering
- name: MQTT_TOPIC_CAMERA
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_CAMERA_OAK_COLOR
name: robocar
- name: MQTT_TOPIC_STEERING
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_TF_STEERING
name: robocar
- name: OCI_IMAGE_MODEL_REGISTRY
valueFrom:
configMapKeyRef:
key: OCI_IMAGE_MODEL_REGISTRY
name: robocar-models
- name: OCI_IMAGE_MODEL_REPOSITORY
valueFrom:
configMapKeyRef:
key: OCI_IMAGE_MODEL_REPOSITORY
name: robocar-models
- name: OCI_IMAGE_MODEL_TAG
value: "v20230603.1157-tflite"
- name: MQTT_QOS
value: "0"
- name: LD_LIBRARY_PATH
value: "/usr/local/lib/:/usr/lib"
- name: TZ
value: "Europe/Paris"
volumes:
- name: models
hostPath:
path: /home/pi/models/steering
type: DirectoryOrCreate
- name: bus-usb
hostPath:
path: /dev/bus/usb
- name: sys
hostPath:
path: /sys

View File

@ -1,18 +0,0 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: robocar
resources:
- ../common
- deployments.yaml
- configmap.yaml
images:
- name: docker.io/cyrilix/robocar-camera-replay
newTag: v0.0.1-2-ga422aed
- name: docker.io/cyrilix/robocar-steering-tflite-edgetpu
#newTag: v0.6.1
newTag: v0.6.1-1-g5d5858a

View File

@ -1,18 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nats
data:
standalone.conf: |
server_name: nats
http: 0.0.0.0:8222
jetstream {
store_dir: /data/datastore
}
mqtt {
listen: 0.0.0.0:1883
}
authorization: {
user: satanas,
password: satanas
}

View File

@ -1,11 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: nats
resources:
- namespace.yaml
- serviceaccount.yaml
- configmaps.yaml
- statefulset.yaml
- services.yaml

View File

@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: nats

View File

@ -1,5 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: nats-server
automountServiceAccountToken: false

View File

@ -1,41 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: nats-server-ext
spec:
type: NodePort
ports:
- port: 4222
name: tcp-nats-client
targetPort: tcp-nats-client
nodePort: 30422
- name: http-monitoring
port: 8222
targetPort: http-monitoring
nodePort: 30822
- name: tcp-mqtt
port: 1883
targetPort: tcp-mqtt
nodePort: 30183
selector:
appli: nats-server
---
apiVersion: v1
kind: Service
metadata:
name: nats-server
spec:
type: ClusterIP
ports:
- port: 4222
name: tcp-nats-client
targetPort: tcp-nats-client
- name: http-monitoring
port: 8222
targetPort: http-monitoring
- name: tcp-mqtt
port: 1883
targetPort: tcp-mqtt
selector:
appli: nats-server

View File

@ -1,58 +0,0 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nats-server
annotations:
reloader.stakater.com/auto: "true"
spec:
selector:
matchLabels:
appli: nats-server
serviceName: nats
replicas: 1
revisionHistoryLimit: 0
template:
metadata:
name: nats-server
labels:
appli: nats-server
spec:
serviceAccountName: nats-server
containers:
- name: nats-server
image: docker.io/library/nats:latest
args:
- --http_port=8222
- --config=/etc/nats/standalone.conf
ports:
- containerPort: 4222
name: tcp-nats-client
- name: http-monitoring
containerPort: 8222
- name: tcp-mqtt
containerPort: 1883
volumeMounts:
- mountPath: /etc/nats
name: nats-config
- name: nats-data
mountPath: /data
securityContext:
runAsUser: 1234
runAsGroup: 1234
fsGroup: 1234
fsGroupChangePolicy: Always
volumes:
- name: nats-config
configMap:
name: nats
volumeClaimTemplates:
- metadata:
name: nats-data
spec:
resources:
requests:
storage: 1Gi
storageClassName: local-path
accessModes:
- ReadWriteOnce

View File

@ -1,42 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: zot-config
data:
config.json: |
{
"storage": {
"rootDirectory": "/var/lib/registry"
},
"http": {
"address": "0.0.0.0",
"port": "5000"
},
"log": {
"level": "debug"
},
"extensions": {
"sync": {
"credentialsFile": "/etc/zot/credentials.json",
"registries": [
{
"urls": [
"https://ghcr.io"
],
"onDemand": true,
"pollInterval": "6h",
"tlsVerify": false,
"maxRetries": 3,
"retryDelay": "5m",
"onlySigned": false,
"content": [
{
"prefix": "/cyrilix/model-steering",
"destination": "/robocars/model-steering"
}
]
}
]
}
}
}

View File

@ -1,61 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: registry
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: registry
template:
metadata:
labels:
app: registry
spec:
containers:
- name: registry
image: ghcr.io/project-zot/zot-linux-arm64
env:
- name: TZ
value: 'Europe/Paris'
- name: REGISTRY_HTTP_ADDR
value: 0.0.0.0:5000
ports:
- containerPort: 5000
name: http-registry
volumeMounts:
- mountPath: /var/lib/registry
name: registry
- name: config
mountPath: /etc/zot/config.json
subPath: config.json
- name: credentials
mountPath: /etc/zot/credentials.json
subPath: credentials.json
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
fsGroupChangePolicy: OnRootMismatch
volumes:
- name: registry
hostPath:
path: /home/pi/registry
- name: config
configMap:
name: zot-config
items:
- key: config.json
path: config.json
- name: credentials
secret:
secretName: registries-credentials
items:
- key: credentials.json
path: credentials.json

View File

@ -1,15 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: registry
images:
- name: ghcr.io/project-zot/zot-linux-arm64
newTag: v1.4.3
resources:
- namespace.yaml
- configmaps.yaml
- serviceaccount.yaml
- services.yaml
- deployements.yaml

View File

@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: registry

View File

@ -1,13 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: registries-credentials
namespace: registry
stringData:
credentials.json: |
{
"ghcr.io": {
"username": "cyrilix",
"password": "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"
}

View File

@ -1,5 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: registry
automountServiceAccountToken: false

View File

@ -1,27 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: registry-ext
spec:
type: NodePort
ports:
- port: 5000
name: http-registry
targetPort: http-registry
nodePort: 32000
selector:
app: registry
---
apiVersion: v1
kind: Service
metadata:
name: registry
spec:
type: ClusterIP
ports:
- port: 5000
name: http-registry
targetPort: http-registry
selector:
app: registry

View File

@ -3,7 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- namespace.yaml
- https://github.com/stakater/Reloader/deployments/kubernetes - https://github.com/stakater/Reloader/deployments/kubernetes
namespace: reloader namespace: reloader

View File

@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: reloader

View File

@ -5,10 +5,10 @@ kind: Kustomization
namespace: robocar namespace: robocar
resources: resources:
- ../common-car - ../common
- deployments.yaml - deployments.yaml
- configmap.yaml - configmap.yaml
images: images:
- name: docker.io/cyrilix/robocar-simulator - name: docker.io/cyrilix/robocar-simulator
newTag: v0.4.1 newTag: v0.4.0

View File

@ -0,0 +1,4 @@
---
version: 3.6.6
threads: 4

View File

@ -0,0 +1,52 @@
---
- name: "Install python {{version}} runtime & build dependencies"
become: yes
apt: name={{item}}
with_items:
- build-essential
- tk-dev
- libncurses5-dev
- libncursesw5-dev
- libreadline6-dev
- libdb5.3-dev
- libgdbm-dev
- libsqlite3-dev
- libssl-dev
- libbz2-dev
- libexpat1-dev
- liblzma-dev
- libffi-dev
- uuid-dev
- zlib1g-dev
- name: "Download python{{version}}"
get_url:
url: "https://www.python.org/ftp/python/{{version}}/Python-{{version}}.tar.xz"
dest: "/tmp/Python-{{version}}.tar.xz"
- name: "Unarchive python{{version}}"
unarchive:
src: "/tmp/Python-{{version}}.tar.xz"
dest: "/tmp/"
copy: no
creates: "/tmp/Python-{{version}}"
- name: "configure python{{version}} build"
command: ./configure --prefix=/opt/python-{{version}} --enable-optimizations
args:
chdir: "/tmp/Python-{{version}}"
creates: "/tmp/Python-{{version}}/Makefile"
- name: "build python{{version}}"
# not using make module to be able to use -j and creates option to fully skip step
command: make -j{{threads}}
args:
chdir: "/tmp/Python-{{version}}"
creates: "/tmp/Python-{{version}}/python"
- name: "install python{{version}}"
become: yes
make:
chdir: "/tmp/Python-{{version}}"
target: altinstall

View File

@ -0,0 +1,11 @@
---
- name: expand filesystem
shell: resize2fs /dev/mmcblk0p2
notify:
- reboot
- name: restart rabbitmq
service:
name: rabbitmq-server
start: restarted

View File

@ -0,0 +1,35 @@
---
- name: Install ansible dependencies
apt:
name: "python3-requests"
state: present
- name: Install rabbitmq package
apt:
name: rabbitmq-server
state: present
with_items:
- rabbitmq-server
- python3-requests
- name: Enables rabbitmq plugins
rabbitmq_plugin:
names: rabbitmq_management,rabbitmq_mqtt
state: enabled
- name: Add rabbitmq user
rabbitmq_user:
user: "{{ rabbitmq_user }}"
password: "{{ rabbitmq_password }}"
vhost: /
configure_priv: .*
read_priv: .*
write_priv: .*
tags: administrator
state: present
- name: Create exchange
rabbitmq_exchange:
name: car
type: topic
vhost: "/"

View File

@ -8,5 +8,13 @@
- hosts: microservice - hosts: microservice
become: yes become: yes
roles: roles:
- { role: rabbitmq, tags: [rabbitmq] }
- { role: k3s, tags: [k3s] } - { role: k3s, tags: [k3s] }
- { role: microservices, tags: [microservices, ms] } - { role: microservices, tags: [microservices, ms] }
- hosts: donkey
become: yes
roles:
- { role: python, tags: [python]}
- { role: donkey, tags: [donkey] }