Skip to content

Commit

Permalink
rename some config fields
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Aug 1, 2024
1 parent e0b33f1 commit 9c18a0f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
9 changes: 5 additions & 4 deletions workspace/scripts/files/bash/firstboot_leader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ sqlite3 $DB_LOC "INSERT OR IGNORE INTO experiments (created_at, experiment, desc


# create leader's config file (still can use one even if not a worker.)
sudo -u $USERNAME touch $PIO_DIR/config_"$HOSTNAME".ini # set with the correct read/write permissions
printf '# Any settings here are specific to %s, and override the settings in config.ini\n\n' "$HOSTNAME" >> $PIO_DIR/config_"$HOSTNAME".ini
sudo -u $USERNAME touch "$PIO_DIR/config_$HOSTNAME.ini" # set with the correct read/write permissions
printf '# Any settings here are specific to %s, the leader, and override the settings in config.ini\n\n' "$HOSTNAME" >> "$PIO_DIR/config_$HOSTNAME.ini"

crudini --ini-options=nospace --set $PIO_DIR/config_"$HOSTNAME".ini cluster.topology leader_address 127.0.0.1 \
--set $PIO_DIR/config_"$HOSTNAME".ini mqtt broker_address 127.0.0.1
crudini --ini-options=nospace --set "$PIO_DIR/config_$HOSTNAME.ini" cluster.topology leader_address 127.0.0.1 \
--set "$PIO_DIR/config_$HOSTNAME.ini" mqtt broker_address 127.0.0.1

cp "$PIO_DIR/config_$HOSTNAME.ini" "$PIO_DIR/unit_config.ini"
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sqlite3 "$DB_LOC" "INSERT OR IGNORE INTO experiment_worker_assignments (pioreact

# create our config file.
sudo -u $USERNAME touch $PIO_DIR/config_"$HOSTNAME".ini # set with the correct read/write permissions
printf '# Any settings here are specific to %s, and override the settings in config.ini\n\n' "$HOSTNAME" >> $PIO_DIR/config_"$HOSTNAME".ini
printf '# Any settings here are specific to %s, the leader, and override the settings in config.ini\n\n' "$HOSTNAME" >> $PIO_DIR/config_"$HOSTNAME".ini

crudini --ini-options=nospace --set $PIO_DIR/config_"$HOSTNAME".ini cluster.topology leader_address 127.0.0.1 \
--set $PIO_DIR/config_"$HOSTNAME".ini mqtt broker_address 127.0.0.1 \
Expand Down
8 changes: 7 additions & 1 deletion workspace/scripts/files/bash/update_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ fi
# copy data over
# use rsync because we want to merge custom yamls the user has, we any updates to our own yamls.
rsync -ap --ignore-existing $UI_FOLDER/contrib/ $WORK_DIR/contrib/ 2>/dev/null || :
cp -p $UI_FOLDER/.env $WORK_DIR 2>/dev/null || :

if [ -f "$UI_FOLDER/.env" ]; then
echo "Copying .env file"
cp -p $UI_FOLDER/.env $WORK_DIR
else
echo ".env file does not exist in $UI_FOLDER"
fi

# swap folders
rm -rf $UI_FOLDER
Expand Down
4 changes: 2 additions & 2 deletions workspace/scripts/files/config.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ B=
C=
D=

[stirring]
[stirring.config]
target_rpm=500
initial_duty_cycle=30
pwm_hz=200
use_rpm=1
duration_between_updates_seconds=23

[od_config]
[od_reading.config]
# how many optical density measurements should be published per second? Recommended maximum is 1.
samples_per_second=0.2

Expand Down

0 comments on commit 9c18a0f

Please sign in to comment.