install final
This commit is contained in:
+14
-4
@@ -1,10 +1,20 @@
|
||||
!/bin/bash
|
||||
|
||||
echo "==== System installation for rpi 4/5"
|
||||
echo "==== System installation for rpi"
|
||||
echo
|
||||
|
||||
sudo apt update
|
||||
#sudo apt upgrade
|
||||
sudo apt upgrade
|
||||
|
||||
ETC="$(pwd)"
|
||||
|
||||
mkdir -p $HOME/exports
|
||||
mkdir -p$HOME/medias
|
||||
mkdir -p /mnt/exports
|
||||
|
||||
cp ../test_tube_scanner/.env.example ../test_tube_scanner/.env
|
||||
echo "==== Copie .env ==> MODIFIER CE FICHIER POUR POUVOIR cONTINUER"
|
||||
echo
|
||||
|
||||
# system
|
||||
echo "==== system essential"
|
||||
@@ -15,8 +25,8 @@ sudo apt -y install python3-dev python3-pip python3-venv libpq-dev default-libmy
|
||||
|
||||
echo "==== supervisor http access login:pass => root:toor"
|
||||
sudo cp supervisor-inet_http.conf /etc/supervisor/conf.d/
|
||||
sudo ln -s scanner_service.conf /etc/supervisor/conf.d/
|
||||
sudo ln -s reductstore_service.conf /etc/supervisor/conf.d/
|
||||
sudo ln -s $ETC/scanner_service.conf /etc/supervisor/conf.d/
|
||||
sudo ln -s $ETC/reductstore_service.conf /etc/supervisor/conf.d/
|
||||
|
||||
echo "==== restart supervisor "
|
||||
sudo systemctl restart supervisor
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
!/bin/bash
|
||||
echo "--- install reductstore"
|
||||
echo " machine raspberry pi4"
|
||||
echo " Compilation finished `release` profile [optimized] target(s) in 16m 31s"
|
||||
|
||||
sudo apt install libprotobuf-dev protobuf-compiler
|
||||
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
|
||||
source $HOME/.cargo/env
|
||||
@@ -10,3 +11,4 @@ cargo --version
|
||||
rustc --version
|
||||
cargo install reductstore
|
||||
|
||||
mkdir -p $HOME/medias
|
||||
|
||||
@@ -11,7 +11,11 @@ echo "[2/6] Installation de Nginx et PHP-FPM..."
|
||||
sudo apt install -y nginx
|
||||
|
||||
# Détection de la version de PHP installée (ou installation si absente)
|
||||
PHP_VERSION=$(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$' | sort -V | tail -n 1)
|
||||
VERSION=$(apt-cache policy php | awk '/Candidate:/ {print $2}')
|
||||
PHP_VERSION=$(apt-cache show php | awk -F'[: ]+' '/Depends:/ {for(i=1;i<=NF;i++) if($i ~ /^php[0-9]+\.[0-9]+$/) print substr($i,4)}' | head -n1)
|
||||
echo "Version du paquet php (meta): $version"
|
||||
echo "Version PHP utilisée: $php_version"
|
||||
|
||||
if [ -z "$PHP_VERSION" ]; then
|
||||
echo "Aucune version de PHP détectée. Installation de PHP 8.2 par défaut..."
|
||||
sudo apt install -y php8.2 php8.2-fpm php8.2-mysql
|
||||
|
||||
@@ -8,22 +8,35 @@ echo
|
||||
ETC="$(pwd)"
|
||||
APP_DIR=" ../test_tube_scanner"
|
||||
|
||||
echo "---- Lancer reductstore ..."
|
||||
sudo supervisorctl reread
|
||||
sudo supervisorctl restart reductstore
|
||||
|
||||
cd $APP_DIR
|
||||
|
||||
echo "migration de la base de données ..."
|
||||
echo "---- Création des répertoires media ..."
|
||||
mkdir -p $APP_DIR/media/images $APP_DIR/media/simulation
|
||||
mkdir -p $APP_DIR/logs
|
||||
touch $APP_DIR/logs/celery.log $APP_DIR/logs/test_tube.log
|
||||
|
||||
echo "---- Migration de la base de données ..."
|
||||
./manage.py migrate
|
||||
./manage.py makemigrations
|
||||
./manage.py migrate
|
||||
|
||||
echo "User / django_celery_beat ..."
|
||||
echo "---- User / django_celery_beat ..."
|
||||
./manage.py init_data
|
||||
|
||||
echo "Tables ..."
|
||||
echo "---- Tables ..."
|
||||
./manage.py loaddata $ETC/db/configuration.json
|
||||
./manage.py loaddata $ETC/db/well.json
|
||||
./manage.py loaddata $ETC/db/multiwell.json
|
||||
./manage.py loaddata $ETC/db/welposition.json
|
||||
|
||||
echo "---- start test_tube:*"
|
||||
echo
|
||||
sudo supervisorctl reread
|
||||
sudo supervisorctl update
|
||||
sudo supervisorctl restart test_tube:*
|
||||
|
||||
echo
|
||||
echo "=== Installation terminée ==="
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
Django BASE_DIR: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
Django application data: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
|
||||
[{"model": "scanner.configuration", "pk": 1, "fields": {"name": "Configuration par défaut", "author": 1, "sidebar_width": "25%", "default_grid_columns": 3, "opencv_fourcc_format": "mp4v", "opencv_video_type": "mp4", "grbl_xmax": 350.0, "grbl_ymax": 250.0, "use_rpicam": true, "webcam_device_index": 2, "image_quality": 90, "video_jpeg_quality": 90, "video_frame_rate": 5.0, "video_width_capture": 2028, "video_height_capture": 1520, "calibration_crop_radius": 500, "calibration_default_multiwell": "HG", "calibration_default_feed": 1000, "calibration_default_step": 1.0, "calibration_default_duration": 3.0, "active": true}}]
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
Django BASE_DIR: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
Django application data: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
[{"model": "scanner.multiwell", "pk": 2, "fields": {"label": "Haut gauche", "author": 1, "position": "HG", "default": false, "cols": 6, "rows": 4, "diameter": 16.0, "row_def": "A,B,C,D", "row_order": "D,C,B,A", "order": 2, "duration": 12, "xbase": 156.45, "ybase": 12.75, "dx": 19.3, "dy": 19.3, "feed": 1000, "well_position": true, "active": true}}, {"model": "scanner.multiwell", "pk": 3, "fields": {"label": "Haut droit", "author": 1, "position": "HD", "default": true, "cols": 6, "rows": 4, "diameter": 16.0, "row_def": "A,B,C,D", "row_order": "D,C,B,A", "order": 0, "duration": 3, "xbase": 10.963, "ybase": 15.825, "dx": 19.4, "dy": 19.4, "feed": 1000, "well_position": true, "active": true}}, {"model": "scanner.multiwell", "pk": 4, "fields": {"label": "Bas gauche", "author": 1, "position": "BG", "default": false, "cols": 6, "rows": 4, "diameter": 16.0, "row_def": "A,B,C,D", "row_order": "D,C,B,A", "order": 3, "duration": 12, "xbase": 150.15, "ybase": 112.55, "dx": 19.5, "dy": 19.5, "feed": 1000, "well_position": true, "active": true}}, {"model": "scanner.multiwell", "pk": 5, "fields": {"label": "Bas droit", "author": 1, "position": "BD", "default": false, "cols": 6, "rows": 4, "diameter": 16.0, "row_def": "A,B,C,D", "row_order": "D,C,B,A", "order": 1, "duration": 12, "xbase": 10.15, "ybase": 111.05, "dx": 19.55, "dy": 19.55, "feed": 1000, "well_position": true, "active": true}}]
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
Django BASE_DIR: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
Django application data: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
[{"model": "scanner.well", "pk": 1, "fields": {"author": 1, "name": "A1"}}, {"model": "scanner.well", "pk": 2, "fields": {"author": 1, "name": "A2"}}, {"model": "scanner.well", "pk": 3, "fields": {"author": 1, "name": "A3"}}, {"model": "scanner.well", "pk": 4, "fields": {"author": 1, "name": "A4"}}, {"model": "scanner.well", "pk": 5, "fields": {"author": 1, "name": "A5"}}, {"model": "scanner.well", "pk": 6, "fields": {"author": 1, "name": "A6"}}, {"model": "scanner.well", "pk": 7, "fields": {"author": 1, "name": "B1"}}, {"model": "scanner.well", "pk": 8, "fields": {"author": 1, "name": "B2"}}, {"model": "scanner.well", "pk": 9, "fields": {"author": 1, "name": "B3"}}, {"model": "scanner.well", "pk": 10, "fields": {"author": 1, "name": "B4"}}, {"model": "scanner.well", "pk": 11, "fields": {"author": 1, "name": "B5"}}, {"model": "scanner.well", "pk": 12, "fields": {"author": 1, "name": "B6"}}, {"model": "scanner.well", "pk": 13, "fields": {"author": 1, "name": "C1"}}, {"model": "scanner.well", "pk": 14, "fields": {"author": 1, "name": "C2"}}, {"model": "scanner.well", "pk": 15, "fields": {"author": 1, "name": "C3"}}, {"model": "scanner.well", "pk": 16, "fields": {"author": 1, "name": "C4"}}, {"model": "scanner.well", "pk": 17, "fields": {"author": 1, "name": "C5"}}, {"model": "scanner.well", "pk": 18, "fields": {"author": 1, "name": "C6"}}, {"model": "scanner.well", "pk": 19, "fields": {"author": 1, "name": "D1"}}, {"model": "scanner.well", "pk": 20, "fields": {"author": 1, "name": "D2"}}, {"model": "scanner.well", "pk": 21, "fields": {"author": 1, "name": "D3"}}, {"model": "scanner.well", "pk": 22, "fields": {"author": 1, "name": "D4"}}, {"model": "scanner.well", "pk": 23, "fields": {"author": 1, "name": "D5"}}, {"model": "scanner.well", "pk": 24, "fields": {"author": 1, "name": "D6"}}]
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Django BASE_DIR: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
Django application data: /home/rpi4/django-test-tube-scanner/test_tube_scanner
|
||||
@@ -0,0 +1,46 @@
|
||||
[group:test_tube]
|
||||
programs=webUI,planification,services
|
||||
|
||||
[program:webUI]
|
||||
process_name=%(program_name)s
|
||||
priority=500
|
||||
directory=/home/rpi4/PlanarianScanner/test_tube_scanner
|
||||
command=
|
||||
/home/rpi4/PlanarianScanner/.venv/bin/daphne
|
||||
-b 0.0.0.0
|
||||
-p 8000
|
||||
home.asgi:application
|
||||
user=rpi4
|
||||
group=rpi4
|
||||
stopasgroup=true
|
||||
stopsignal=SIGINT
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
|
||||
[program:planification]
|
||||
process_name=%(program_name)s
|
||||
priority=800
|
||||
directory=/home/rpi4/PlanarianScanner/test_tube_scanner
|
||||
command=/home/rpi4/PlanarianScanner/.venv/bin/celery -A home beat -l info
|
||||
user=rpi4
|
||||
group=rpi4
|
||||
stopasgroup=true
|
||||
stopsignal=SIGINT
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
|
||||
[program:services]
|
||||
process_name=%(program_name)s
|
||||
priority=900
|
||||
directory=/home/rpi4/PlanarianScanner/test_tube_scanner
|
||||
command=/home/rpi4/PlanarianScanner/run-workers.sh
|
||||
user=rpi4
|
||||
group=rpi4
|
||||
stopasgroup=true
|
||||
stopsignal=SIGINT
|
||||
autostart=true
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
|
||||
Reference in New Issue
Block a user