Compare commits

..

47 Commits

Author SHA1 Message Date
09df2bb0a7 config google.IO 2024-05-13 19:50:35 +02:00
affd0568cb k8s: deploy objects-detection pod 2024-03-09 16:01:32 +01:00
3c6aab0145 k8s(camera): configure disparity 2024-03-09 16:00:54 +01:00
c3ed6e6a9d race 2024-01 2024-01-26 12:25:36 +01:00
9335b69c74 good config! 2024-01-13 18:26:23 +01:00
1d60c61c30 chore(k3s): bump 1.27.6 2023-11-01 18:57:29 +01:00
3e2035cb11 fix(ansible): mv docker apt key in dedicated file 2023-11-01 18:57:04 +01:00
eeccf8122a microservice(robocar-oak-camera): new image 2022-11-11 18:03:22 +01:00
330345e202 fix arduino deployment 2022-11-11 18:02:12 +01:00
6e543d36e4 deployment: create namespace 2022-11-11 18:01:24 +01:00
b6879da90e tune: disable objects-correction feature (not used in race) 2022-11-02 13:53:33 +01:00
70b26e1337 config(throttle): add pre-defined throttle values 2022-11-02 13:52:27 +01:00
daa6861b07 tune(k3s): disable traefic and helm-controller 2022-11-02 12:22:34 +01:00
43efdb9156 chore(k3s): bump to 1.25.3 2022-11-02 12:22:02 +01:00
ae0c9081b8 resynchronize ansible resources with car 2022-11-02 12:21:30 +01:00
395b672574 clean(ansible): remove unused roles and hosts 2022-11-02 12:20:23 +01:00
c6f5f8a185 feat: detect objects 2022-10-07 14:43:05 +02:00
220162f6f4 feat: replace rabbitmq with nats 2022-10-07 14:42:25 +02:00
e446025e76 new car config 2022-09-04 18:05:32 +02:00
6759304b25 config: config used for vivatech 2022 2022-08-16 08:46:20 +02:00
3f6ff95dc0 fix(steering): reverse direction 2022-06-16 16:02:57 +02:00
6562036b05 fix: configure slow drive 2022-06-16 12:30:03 +02:00
8b6ee0cc06 disable debug logs 2022-06-10 16:09:47 +02:00
140e3509be disable road microservice 2022-06-10 16:09:30 +02:00
c915e2b957 feat: add linear models and autodetect models configuration 2022-06-10 16:09:03 +02:00
1123071750 tune: fix PWM and min/max throttke 2022-06-10 16:07:51 +02:00
1bfb3d1930 fix: bad camera topic 2022-06-10 16:07:17 +02:00
4663a545df chore: bump robocar-simulator to v0.4.1
refs robocars/robocar-setup#3
2022-06-09 18:16:02 +02:00
94773908e6 chore: bump robocar-road to v0.2.0
refs robocars/robocar-setup#3
2022-06-09 17:54:41 +02:00
48b2abd99b chore: bump robocar-pca9685 to v0.6.1
refs robocars/robocar-setup#3
2022-06-09 16:34:37 +02:00
4eb2084ce6 chore: bump robocar-steering to v0.5.1
refs robocars/robocar-setup#3
2022-06-09 16:12:45 +02:00
c25fa4b13b chore: bump robocar-recorder-store to v0.2.1
refs robocars/robocar-setup#3
2022-06-08 21:10:13 +02:00
1fdd3932d6 chore: bump robocar-record to v0.5.1
refs robocars/robocar-setup#3
2022-06-08 20:53:14 +02:00
aa9443c7ff chore: bump robocar-throttle to v0.4.2
refs robocars/robocar-setup#3
2022-06-08 20:42:26 +02:00
300ed78b2a chore: bump robocar-steering-tflite-edgetpu to v0.5.1
refs robocars/robocar-setup#3
2022-06-08 20:27:48 +02:00
2eb1fe3b10 chore: bump robocar-led to v0.5.1
refs robocars/robocar-setup#3
2022-06-07 23:56:17 +02:00
8d259c3311 chore: bump robocar-arduino to v0.7.1
refs robocars/robocar-setup#3
2022-06-07 19:54:10 +02:00
3c80b4a970 feat(k8s): use mqtt service endpoint url
closes #1
2022-06-07 19:13:38 +02:00
d558415684 chore(k8s): bump robocar-throttle image 2022-06-07 18:54:36 +02:00
74d54c14b5 debug(arduino): disable debug logs 2022-06-07 18:53:46 +02:00
6d6cd5b26e refactor: move steering/throttle pin after car rebuilding 2022-06-07 18:53:13 +02:00
b21171cecb freeze arduino image 2022-06-07 18:52:36 +02:00
bbf4328e6c refactor: unify pwm config for arduino and pca9685 2022-06-07 18:51:53 +02:00
e1602339ee freeze: robocar-pca9685 OK 2022-05-30 16:16:33 +02:00
1dde1786f6 fix: bad throttle pwm parameters 2022-05-30 15:01:00 +02:00
d3071a5abf clean: pca9685 deployment 2022-05-30 14:28:33 +02:00
e0955aac8f It's working! 2022-05-30 14:24:48 +02:00
50 changed files with 1493 additions and 650 deletions

View File

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

View File

@ -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

View File

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

View File

@ -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

View File

@ -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

View File

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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

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

View File

@ -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') }}

View File

@ -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'

View File

@ -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

View File

@ -2,12 +2,20 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: robocar-pca9685
name: robocar-pca9685-pwm
data:
################
# STEERING PWM #
################
STEERING_LEFT_PWM: "1092"
STEERING_RIGHT_PWM: "1986"
STEERING_CENTER_PWM: "1583"
############################
# 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,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,11 +153,10 @@ spec:
- name: dev
mountPath: /dev
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER_HOST
name: robocar
- name: MQTT_BROKER_HOST
value: localhost # because use host network
- name: MQTT_BROKER_PORT
value: "30183"
- name: MQTT_USERNAME
valueFrom:
secretKeyRef:
@ -138,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:
@ -150,6 +206,8 @@ spec:
name: robocar-camera
- name: MQTT_QOS
value: "0"
#- name: DEPTHAI_LEVEL
# value: debug
- name: TZ
value: "Europe/Paris"
hostNetwork: true
@ -166,7 +224,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: pca9685-steering
name: pca9685
annotations:
reloader.stakater.com/auto: "true"
spec:
@ -184,15 +242,20 @@ spec:
spec:
containers:
- name: pca9685
image: docker.io/cyrilix/robocar-pca9685-python
image: docker.io/cyrilix/robocar-pca9685
args:
- "steering"
- "--i2c-bus=1"
- "--i2c-address=40"
- "--pca9685-channel=0"
- "--left-pulse=$(STEERING_LEFT_PWM)"
- "--right-pulse=$(STEERING_RIGHT_PWM)"
- "--debug"
- "--mqtt-retain=false"
- "--throttle-channel=15"
- "--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:
runAsUser: 1234
runAsGroup: 998 # Set 998/i2c group to access to i2c device
@ -200,11 +263,14 @@ spec:
volumeMounts:
- mountPath: /dev/i2c-1
name: i2c
envFrom:
- configMapRef:
name: robocar-pca9685-pwm
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER_HOST
key: MQTT_BROKER
name: robocar
- name: MQTT_USERNAME
valueFrom:
@ -217,100 +283,19 @@ spec:
key: MQTT_PASSWORD
name: mqtt-credentials
- name: MQTT_CLIENT_ID
value: rc-pca9685-steering
- name: MQTT_TOPIC
value: rc-pca9685
- name: MQTT_TOPIC_THROTTLE
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_THROTTLE
name: robocar
- name: MQTT_TOPIC_STEERING
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_STEERING
name: robocar
- name: MQTT_QOS
value: "0"
- name: STEERING_LEFT_PWM
valueFrom:
configMapKeyRef:
name: robocar-pca9685
key: STEERING_LEFT_PWM
- name: STEERING_RIGHT_PWM
valueFrom:
configMapKeyRef:
name: robocar-pca9685
key: STEERING_RIGHT_PWM
- name: STEERING_CENTER_PWM
valueFrom:
configMapKeyRef:
name: robocar-pca9685
key: STEERING_CENTER_PWM
- name: TZ
value: "Europe/Paris"
volumes:
- name: i2c
hostPath:
path: /dev/i2c-1
type: CharDevice
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pca9685-throttle
annotations:
reloader.stakater.com/auto: "true"
spec:
revisionHistoryLimit: 0
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: pca9685
template:
metadata:
labels:
component: pca9685
spec:
containers:
- name: pca9685-throttle
image: docker.io/cyrilix/robocar-pca9685-python
args:
- "throttle"
- "--zero-pulse=378"
- "--min-pulse=250"
- "--max-pulse=500"
- "--i2c-bus=1"
- "--i2c-address=40"
- "--pca9685-channel=1"
- "--debug"
securityContext:
runAsUser: 1234
runAsGroup: 998 # Set 998/i2c group to access to i2c device
privileged: true
volumeMounts:
- mountPath: /dev/i2c-1
name: i2c
env:
- name: MQTT_BROKER
valueFrom:
configMapKeyRef:
key: MQTT_BROKER_HOST
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-pca9685-throttle
- name: MQTT_TOPIC
valueFrom:
configMapKeyRef:
key: MQTT_TOPIC_THROTTLE
name: robocar
- name: MQTT_QOS
value: "0"
- name: TZ
value: "Europe/Paris"
volumes:

View File

@ -5,16 +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-python
newTag: v0.1.0-12-g2966f92
- name: docker.io/cyrilix/robocar-pca9685
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

View File

@ -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

View File

@ -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

View File

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

View File

@ -4,21 +4,25 @@ metadata:
name: robocar
data:
# Broker configuration
MQTT_BROKER_HOST: 192.168.2.221
MQTT_BROKER: "tcp://192.168.2.221: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
@ -26,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
@ -41,21 +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: "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
@ -71,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
@ -80,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
@ -96,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"

View File

@ -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/ttyAMA1"
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/ttyAMA1
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
@ -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"

View File

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

View File

@ -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.6.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.0
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

View File

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

View File

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

View File

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

View File

@ -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"

View 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

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

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

View File

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

View 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

View File

@ -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

View File

@ -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"
}
]
}
]
}
}
}

View File

@ -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

View File

@ -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

View File

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

View File

@ -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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"
}

View File

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

View File

@ -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

View File

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

View File

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

View File

@ -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

View File

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

View File

@ -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

View File

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

View File

@ -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: "/"

View File

@ -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] }