Compare commits
37 Commits
feat/mqtt_
...
master
Author | SHA1 | Date | |
---|---|---|---|
09df2bb0a7 | |||
affd0568cb | |||
3c6aab0145 | |||
c3ed6e6a9d | |||
9335b69c74 | |||
1d60c61c30 | |||
3e2035cb11 | |||
eeccf8122a | |||
330345e202 | |||
6e543d36e4 | |||
b6879da90e | |||
70b26e1337 | |||
daa6861b07 | |||
43efdb9156 | |||
ae0c9081b8 | |||
395b672574 | |||
c6f5f8a185 | |||
220162f6f4 | |||
e446025e76 | |||
6759304b25 | |||
3f6ff95dc0 | |||
6562036b05 | |||
8b6ee0cc06 | |||
140e3509be | |||
c915e2b957 | |||
1123071750 | |||
1bfb3d1930 | |||
4663a545df | |||
94773908e6 | |||
48b2abd99b | |||
4eb2084ce6 | |||
c25fa4b13b | |||
1fdd3932d6 | |||
aa9443c7ff | |||
300ed78b2a | |||
2eb1fe3b10 | |||
8d259c3311 |
@ -1,2 +0,0 @@
|
||||
rabbitmq_user: satanas
|
||||
rabbitmq_password: satanas
|
@ -1,9 +1,5 @@
|
||||
[car]
|
||||
satanas.local ansible_user=pi become=yes become_user=root
|
||||
diabolo.local ansible_user=pi become=yes become_user=root
|
||||
|
||||
[microservice]
|
||||
diabolo.local
|
||||
|
||||
[donkey]
|
||||
satanas.local
|
||||
|
@ -93,3 +93,4 @@ dtoverlay=pi3-disable-bt
|
||||
gpu_mem=256
|
||||
|
||||
dtoverlay=w1-gpio
|
||||
enable_uart=1
|
||||
|
@ -481,3 +481,28 @@ fr_FR.UTF-8 UTF-8
|
||||
# zh_TW.UTF-8 UTF-8
|
||||
# zu_ZA ISO-8859-1
|
||||
# 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
|
||||
|
@ -1,35 +0,0 @@
|
||||
- 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
|
||||
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
---
|
||||
|
||||
- include_tasks: docker.yml
|
||||
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
|
||||
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"
|
@ -1,16 +0,0 @@
|
||||
---
|
||||
|
||||
- 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
|
@ -1,62 +0,0 @@
|
||||
---
|
||||
|
||||
- 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
|
@ -1,2 +0,0 @@
|
||||
# Activate virtualenv
|
||||
source {{ donkey_virtualenv_dir }}/bin/activate
|
@ -1,3 +1,3 @@
|
||||
---
|
||||
k3s_version: v1.22.5%2Bk3s1
|
||||
k3s_version: v1.28.3%2Bk3s2
|
||||
k3s_url: https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s-{{ arch | default('armhf') }}
|
||||
|
@ -1,10 +1,12 @@
|
||||
---
|
||||
- name: Add apt key
|
||||
apt_key:
|
||||
ansible.builtin.apt_key:
|
||||
url: https://download.docker.com/linux/debian/gpg
|
||||
keyring: /etc/apt/trusted.gpg.d/docker.gpg
|
||||
|
||||
- name: Add docker-ce repository
|
||||
apt_repository:
|
||||
repo: deb [arch={{ arch | default('armhf') }}] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
|
||||
repo: deb [arch={{ arch | default('armhf') }}] https://download.docker.com/linux/debian bookworm stable
|
||||
state: present
|
||||
filename: 'docker'
|
||||
|
||||
|
@ -26,4 +26,4 @@ RestartSec=5s
|
||||
ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'
|
||||
ExecStartPre=-/sbin/modprobe br_netfilter
|
||||
ExecStartPre=-/sbin/modprobe overlay
|
||||
ExecStart=/usr/local/bin/k3s server
|
||||
ExecStart=/usr/local/bin/k3s server --disable traefik --disable-helm-controller
|
||||
|
21
ansible/roles/microservices/files/robocar/car/configmap.yaml
Normal file
21
ansible/roles/microservices/files/robocar/car/configmap.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
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"
|
||||
|
@ -103,12 +103,49 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: camera
|
||||
image: docker.io/cyrilix/robocar-oak-camera
|
||||
image: git.cyrilix.bzh/robocars/robocar-oak-camera
|
||||
args:
|
||||
- "--image-width=$(CAMERA_WIDTH)"
|
||||
- "--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:
|
||||
runAsUser: 1234
|
||||
runAsUser: 0
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: sys
|
||||
@ -116,8 +153,10 @@ spec:
|
||||
- name: dev
|
||||
mountPath: /dev
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
- name: MQTT_BROKER_HOST
|
||||
value: localhost # because use host network
|
||||
- name: MQTT_BROKER_PORT
|
||||
value: "30183"
|
||||
- name: MQTT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
@ -135,6 +174,26 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_CAMERA_OAK_COLOR
|
||||
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
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
@ -147,6 +206,8 @@ spec:
|
||||
name: robocar-camera
|
||||
- name: MQTT_QOS
|
||||
value: "0"
|
||||
#- name: DEPTHAI_LEVEL
|
||||
# value: debug
|
||||
- name: TZ
|
||||
value: "Europe/Paris"
|
||||
hostNetwork: true
|
||||
@ -185,13 +246,14 @@ spec:
|
||||
args:
|
||||
- "--mqtt-retain=false"
|
||||
- "--throttle-channel=15"
|
||||
- "--steering-channel=14"
|
||||
- "--throttle-zero-pwm=$(THROTTLE_ZERO_PWM)"
|
||||
- "--throttle-min-pwm=$(THROTTLE_MIN_PWM)"
|
||||
- "--throttle-max-pwm=$(THROTTLE_MAX_PWM)"
|
||||
- "--steering-left-pwm=$(STEERING_LEFT_PWM)"
|
||||
- "--steering-right-pwm=$(STEERING_RIGHT_PWM)"
|
||||
- "--steering-center-pwm=$(STEERING_CENTER_PWM)"
|
||||
- "--steering-channel=13"
|
||||
- "--throttle-zero-pwm=$(THROTTLE_PCA9685_ZERO_PWM)"
|
||||
- "--throttle-min-pwm=$(THROTTLE_PCA9685_MIN_PWM)"
|
||||
- "--throttle-max-pwm=$(THROTTLE_PCA9685_MAX_PWM)"
|
||||
- "--steering-left-pwm=$(STEERING_PCA9685_LEFT_PWM)"
|
||||
- "--steering-right-pwm=$(STEERING_PCA9685_RIGHT_PWM)"
|
||||
- "--steering-center-pwm=$(STEERING_PCA9685_CENTER_PWM)"
|
||||
- "--pwm-freq=50"
|
||||
- "--update-pwm-frequency=25"
|
||||
- "--log=info"
|
||||
securityContext:
|
||||
@ -201,6 +263,9 @@ spec:
|
||||
volumeMounts:
|
||||
- mountPath: /dev/i2c-1
|
||||
name: i2c
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: robocar-pca9685-pwm
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
valueFrom:
|
||||
@ -231,36 +296,6 @@ spec:
|
||||
name: robocar
|
||||
- name: MQTT_QOS
|
||||
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
|
||||
value: "Europe/Paris"
|
||||
volumes:
|
||||
|
@ -5,15 +5,16 @@ kind: Kustomization
|
||||
namespace: robocar
|
||||
|
||||
resources:
|
||||
- ../common
|
||||
- ../common-car
|
||||
- deployments.yaml
|
||||
- configmap.yaml
|
||||
|
||||
images:
|
||||
- name: docker.io/cyrilix/robocar-camera
|
||||
newTag: v0.3.0
|
||||
newTag: v0.3.1
|
||||
|
||||
- name: docker.io/cyrilix/robocar-pca9685
|
||||
newTag: v0.6.0
|
||||
newTag: v0.6.4
|
||||
|
||||
- name: docker.io/cyrilix/robocar-oak-camera
|
||||
newTag: v0.1.0
|
||||
- name: git.cyrilix.bzh/robocars/robocar-oak-camera
|
||||
newTag: v0.6.1
|
@ -0,0 +1,335 @@
|
||||
---
|
||||
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
|
@ -0,0 +1,20 @@
|
||||
---
|
||||
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
|
@ -0,0 +1,9 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mqtt-credentials
|
||||
namespace: robocar
|
||||
stringData:
|
||||
MQTT_USERNAME: satanas
|
||||
MQTT_PASSWORD: satanas
|
@ -4,20 +4,25 @@ metadata:
|
||||
name: robocar
|
||||
data:
|
||||
# Broker configuration
|
||||
MQTT_BROKER_HOST: mqtt.robocar.svc.cluster.local
|
||||
MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
|
||||
MQTT_BROKER_HOST: "nats-server.nats.svc.cluster.local"
|
||||
#MQTT_BROKER: "tcp://mqtt.robocar.svc.cluster.local:1883"
|
||||
MQTT_BROKER: "tcp://nats-server.nats.svc.cluster.local:1883"
|
||||
|
||||
# Camera
|
||||
MQTT_TOPIC_CAMERA: car/satanas/part/camera/camera/color
|
||||
MQTT_TOPIC_CAMERA_OAK_COLOR: car/satanas/part/camera/color
|
||||
MQTT_TOPIC_CAMERA: "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
|
||||
MQTT_TOPIC_RC_THROTTLE: car/satanas/part/rc/throttle
|
||||
MQTT_TOPIC_RC_STEERING: car/satanas/part/rc/steering
|
||||
MQTT_TOPIC_RC_SWITCH_RECORD: car/satanas/part/rc/switch_record
|
||||
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
|
||||
|
||||
@ -25,12 +30,17 @@ data:
|
||||
MQTT_TOPIC_THROTTLE: car/satanas/part/throttle
|
||||
MQTT_TOPIC_STEERING: car/satanas/part/steering
|
||||
|
||||
MQTT_TOPIC_SPEED_ZONE: car/satanas/part/speed_zone
|
||||
|
||||
# Road detection
|
||||
MQTT_TOPIC_ROAD: car/satanas/part/road
|
||||
|
||||
# Records topic
|
||||
MQTT_TOPIC_RECORDS: car/satanas/part/records
|
||||
|
||||
# Feedbacks
|
||||
MQTT_TOPIC_THROTTLE_FEEDBACK: car/satanas/part/feedback/throttle
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@ -40,32 +50,107 @@ data:
|
||||
############
|
||||
# Throttle #
|
||||
############
|
||||
THROTTLE_MIN: "0.3"
|
||||
THROTTLE_MAX: "0.4"
|
||||
|
||||
## For manual driving
|
||||
#####################
|
||||
# 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
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: robocar-steering-pwm
|
||||
data:
|
||||
|
||||
################
|
||||
# STEERING PWM #
|
||||
################
|
||||
STEERING_LEFT_PWM: "1002"
|
||||
STEERING_RIGHT_PWM: "1985"
|
||||
STEERING_CENTER_PWM: "1491"
|
||||
STEERING_LEFT_PWM: "1004"
|
||||
STEERING_RIGHT_PWM: "2048"
|
||||
STEERING_CENTER_PWM: "1514"
|
||||
|
||||
############################
|
||||
# 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
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: robocar-throttle-pwm
|
||||
data:
|
||||
|
||||
################
|
||||
# THROTTLE PWM #
|
||||
################
|
||||
THROTTLE_MIN_PWM: "1092"
|
||||
THROTTLE_MAX_PWM: "1986"
|
||||
THROTTLE_ZERO_PWM: "1583"
|
||||
THROTTLE_MIN_PWM: "980"
|
||||
THROTTLE_MAX_PWM: "2046"
|
||||
THROTTLE_ZERO_PWM: "1509"
|
||||
|
||||
###########################
|
||||
# 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
|
||||
kind: ConfigMap
|
||||
@ -81,7 +166,9 @@ data:
|
||||
CAMERA_WIDTH: "160"
|
||||
CAMERA_HEIGHT: "120"
|
||||
|
||||
MQTT_CAMERA_PUB_FREQUENCY: "30"
|
||||
CAMERA_FPS: "35"
|
||||
|
||||
MQTT_CAMERA_PUB_FREQUENCY: "35"
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@ -90,15 +177,49 @@ metadata:
|
||||
name: robocar-models
|
||||
data:
|
||||
# model to use for steering
|
||||
MODEL_STEERING: model_160x120h0_edgetpu.tflite
|
||||
MODEL_STEERING3: model_edgetpu.tflite
|
||||
MODEL_STEERING4: model_160x120h20_edgetpu.tflite
|
||||
MODEL_STEERING2: model-sim-bigimg_edgetpu.tflite
|
||||
#MODEL_STEERING: model_categorical_160x120h0_edgetpu.tflite
|
||||
MODEL_STEERING: "model_linear_160x120h0_edgetpu.tflite"
|
||||
#OCI_IMAGE_MODEL: "git.cyrilix.bzh/robocars/model-steering:v20230429.0945-edgetpu"
|
||||
#OCI_IMAGE_MODEL: "docker.io/cyrilix/model-steering:v20230429.0945-edgetpu"
|
||||
#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_HEIGHT: "120"
|
||||
HORIZON: "20"
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@ -106,3 +227,164 @@ metadata:
|
||||
name: robocar-road
|
||||
data:
|
||||
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"
|
||||
|
@ -2,7 +2,7 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: arduino
|
||||
name: objects-detection
|
||||
annotations:
|
||||
reloader.stakater.com/auto: "true"
|
||||
spec:
|
||||
@ -12,30 +12,33 @@ spec:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
component: arduino
|
||||
component: objects-detection
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
component: arduino
|
||||
component: objects-detection
|
||||
spec:
|
||||
containers:
|
||||
- name: arduino
|
||||
image: docker.io/cyrilix/robocar-arduino
|
||||
- name: objects-detection
|
||||
image: docker.io/cyrilix/robocar-objects-detection
|
||||
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)"
|
||||
- "-log=info"
|
||||
volumeMounts:
|
||||
- mountPath: "/dev/ttyAMA0"
|
||||
name: serial
|
||||
- "--image-width=$(IMAGE_WIDTH)"
|
||||
- "--image-height=$(IMAGE_HEIGHT)"
|
||||
- "--object-size-threshold=0.50"
|
||||
- "--enable-big-objects-remove=true"
|
||||
- "--enable-group-objects=false" # to debug/test
|
||||
- "--enable-bottom-filter=false" # don't work
|
||||
- "--enable-nearest-filter=true"
|
||||
- "--object-bottom-limit=0.90"
|
||||
- "--log=info"
|
||||
securityContext:
|
||||
privileged: true
|
||||
runAsUser: 1234
|
||||
runAsGroup: 20 # Set 20/dialout group to access to serial device
|
||||
runAsGroup: 1234
|
||||
resources:
|
||||
limits:
|
||||
memory: 100Mi
|
||||
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
valueFrom:
|
||||
@ -53,240 +56,36 @@ spec:
|
||||
key: MQTT_PASSWORD
|
||||
name: mqtt-credentials
|
||||
- name: MQTT_CLIENT_ID
|
||||
value: rc-arduino
|
||||
- name: MQTT_TOPIC_THROTTLE
|
||||
value: rc-objects-detection
|
||||
- name: MQTT_TOPIC_OBJECTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_THROTTLE
|
||||
key: MQTT_TOPIC_OBJECTS
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_STEERING
|
||||
- name: MQTT_TOPIC_OBJECTS_CLEAN
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_STEERING
|
||||
key: MQTT_TOPIC_OBJECTS_CLEAN
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_DRIVE_MODE
|
||||
- name: MQTT_TOPIC_DISPARITY
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_DRIVE_MODE
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_SWITCH_RECORD
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_SWITCH_RECORD
|
||||
key: MQTT_TOPIC_CAMERA_DISPARITY
|
||||
name: robocar
|
||||
- name: MQTT_QOS
|
||||
value: "0"
|
||||
- name: STEERING_LEFT_PWM
|
||||
- name: IMAGE_WIDTH
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_LEFT_PWM
|
||||
- name: STEERING_RIGHT_PWM
|
||||
key: CAMERA_WIDTH
|
||||
name: robocar-camera
|
||||
- name: IMAGE_HEIGHT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_RIGHT_PWM
|
||||
- name: STEERING_CENTER_PWM
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: robocar-steering-pwm
|
||||
key: STEERING_CENTER_PWM
|
||||
key: CAMERA_HEIGHT
|
||||
name: robocar-camera
|
||||
- name: TZ
|
||||
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
|
||||
kind: Deployment
|
||||
@ -312,6 +111,11 @@ spec:
|
||||
image: docker.io/cyrilix/robocar-steering
|
||||
args:
|
||||
- "-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"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
@ -354,10 +158,37 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_DRIVE_MODE
|
||||
name: robocar
|
||||
- name: MQTT_TOPIC_OBJECTS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_OBJECTS_CLEAN
|
||||
name: robocar
|
||||
- name: MQTT_QOS
|
||||
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
|
||||
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
|
||||
kind: Deployment
|
||||
@ -382,8 +213,13 @@ spec:
|
||||
- name: throttle
|
||||
image: docker.io/cyrilix/robocar-throttle
|
||||
args:
|
||||
- "-mqtt-retain=false"
|
||||
- "-debug=false"
|
||||
- "--mqtt-retain=false"
|
||||
- "--enable-brake-feature=true"
|
||||
- "--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:
|
||||
runAsUser: 1234
|
||||
runAsGroup: 1234
|
||||
@ -420,6 +256,26 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_DRIVE_MODE
|
||||
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
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
@ -430,10 +286,27 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: THROTTLE_MAX
|
||||
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
|
||||
value: "0"
|
||||
- name: TZ
|
||||
value: "Europe/Paris"
|
||||
volumeMounts:
|
||||
- mountPath: /etc/robocar
|
||||
name: throttle-config
|
||||
volumes:
|
||||
- name: throttle-config
|
||||
configMap:
|
||||
name: throttle
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@ -525,7 +398,7 @@ spec:
|
||||
image: docker.io/cyrilix/robocar-record
|
||||
args:
|
||||
- "-mqtt-retain=true"
|
||||
- "-debug=true"
|
||||
- "-debug=false"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
runAsGroup: 1234
|
||||
@ -562,6 +435,16 @@ spec:
|
||||
configMapKeyRef:
|
||||
key: MQTT_TOPIC_RC_SWITCH_RECORD
|
||||
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
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
@ -580,7 +463,7 @@ metadata:
|
||||
reloader.stakater.com/auto: "true"
|
||||
spec:
|
||||
revisionHistoryLimit: 0
|
||||
replicas: 1
|
||||
replicas: 0
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
@ -596,10 +479,25 @@ spec:
|
||||
image: docker.io/cyrilix/robocar-road
|
||||
args:
|
||||
- "-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"
|
||||
securityContext:
|
||||
runAsUser: 1234
|
||||
runAsGroup: 1234
|
||||
resources:
|
||||
limits:
|
||||
memory: 100Mi
|
||||
cpu: 500m
|
||||
env:
|
||||
- name: MQTT_BROKER
|
||||
valueFrom:
|
||||
@ -630,5 +528,15 @@ spec:
|
||||
name: robocar
|
||||
- name: MQTT_QOS
|
||||
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
|
||||
value: "Europe/Paris"
|
||||
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
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
|
@ -3,32 +3,27 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- deployments.yaml
|
||||
- endpoints.yaml
|
||||
- services.yaml
|
||||
- configmap.yaml
|
||||
|
||||
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
|
||||
newTag: v0.4.1
|
||||
newTag: v0.9.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-record
|
||||
newTag: v0.5.0
|
||||
newTag: v0.6.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-recorder-store
|
||||
newTag: v0.2.0
|
||||
newTag: v0.3.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-steering
|
||||
newTag: v0.5.0
|
||||
newTag: v0.8.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-road
|
||||
newTag: v0.1.0-5-gdc6e465
|
||||
newTag: v0.3.0
|
||||
|
||||
- name: docker.io/cyrilix/robocar-objects-detection
|
||||
newTag: v0.2.0
|
||||
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: robocar
|
@ -3,6 +3,7 @@ apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mqtt-credentials
|
||||
namespace: robocar
|
||||
stringData:
|
||||
MQTT_USERNAME: satanas
|
||||
MQTT_PASSWORD: satanas
|
||||
|
10
ansible/roles/microservices/files/robocar/kustomization.yaml
Normal file
10
ansible/roles/microservices/files/robocar/kustomization.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- registry
|
||||
- registry/secrets.yaml
|
||||
- reloader
|
||||
- nats
|
||||
- car
|
||||
- common/secrets.yaml
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: robocar-camera-replay
|
||||
data:
|
||||
|
||||
REPLAY_FRAME_DIR: "/records/clean3/records/2023-05-13T10-14_33/cam"
|
173
ansible/roles/microservices/files/robocar/local/deployments.yaml
Normal file
173
ansible/roles/microservices/files/robocar/local/deployments.yaml
Normal file
@ -0,0 +1,173 @@
|
||||
---
|
||||
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
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
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
|
@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: nats
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- serviceaccount.yaml
|
||||
- configmaps.yaml
|
||||
- statefulset.yaml
|
||||
- services.yaml
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: nats
|
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: nats-server
|
||||
automountServiceAccountToken: false
|
41
ansible/roles/microservices/files/robocar/nats/services.yaml
Normal file
41
ansible/roles/microservices/files/robocar/nats/services.yaml
Normal file
@ -0,0 +1,41 @@
|
||||
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
|
@ -0,0 +1,58 @@
|
||||
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
|
@ -0,0 +1,42 @@
|
||||
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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
---
|
||||
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
|
@ -0,0 +1,15 @@
|
||||
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
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: registry
|
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: registries-credentials
|
||||
namespace: registry
|
||||
|
||||
stringData:
|
||||
credentials.json: |
|
||||
{
|
||||
"ghcr.io": {
|
||||
"username": "cyrilix",
|
||||
"password": "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"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: registry
|
||||
automountServiceAccountToken: false
|
@ -0,0 +1,27 @@
|
||||
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
|
@ -3,6 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- https://github.com/stakater/Reloader/deployments/kubernetes
|
||||
|
||||
namespace: reloader
|
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: reloader
|
@ -5,10 +5,10 @@ kind: Kustomization
|
||||
namespace: robocar
|
||||
|
||||
resources:
|
||||
- ../common
|
||||
- ../common-car
|
||||
- deployments.yaml
|
||||
- configmap.yaml
|
||||
|
||||
images:
|
||||
- name: docker.io/cyrilix/robocar-simulator
|
||||
newTag: v0.4.0
|
||||
newTag: v0.4.1
|
||||
|
@ -1,4 +0,0 @@
|
||||
---
|
||||
|
||||
version: 3.6.6
|
||||
threads: 4
|
@ -1,52 +0,0 @@
|
||||
---
|
||||
|
||||
- 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
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
- name: expand filesystem
|
||||
shell: resize2fs /dev/mmcblk0p2
|
||||
notify:
|
||||
- reboot
|
||||
|
||||
- name: restart rabbitmq
|
||||
service:
|
||||
name: rabbitmq-server
|
||||
start: restarted
|
||||
|
@ -1,35 +0,0 @@
|
||||
---
|
||||
- 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: "/"
|
@ -8,13 +8,5 @@
|
||||
- hosts: microservice
|
||||
become: yes
|
||||
roles:
|
||||
- { role: rabbitmq, tags: [rabbitmq] }
|
||||
- { role: k3s, tags: [k3s] }
|
||||
- { role: microservices, tags: [microservices, ms] }
|
||||
|
||||
|
||||
- hosts: donkey
|
||||
become: yes
|
||||
roles:
|
||||
- { role: python, tags: [python]}
|
||||
- { role: donkey, tags: [donkey] }
|
||||
|
Loading…
Reference in New Issue
Block a user