Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/workflows/build-os-bookworm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ concurrency:
jobs:
build:
name: build
strategy:
fail-fast: false
matrix:
variant:
- adafruithat
- planktoscopehat
- fairscope-latest
base_variant_name:
- lite
permissions:
contents: read
packages: write
Expand All @@ -49,8 +40,7 @@ jobs:
with:
name: planktoscope
base_release_name: bookworm
base_image_variant: ${{ matrix.base_variant_name }}
base_image_variant: lite
base_release_date: 2025-05-13
base_file_release_date: 2025-05-13
arch: arm64
variant: ${{ matrix.variant }}
10 changes: 3 additions & 7 deletions .github/workflows/build-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ on:
description: 'The CPU architecture of the OS (armhf, arm64)'
required: true
type: string
variant:
description: 'The name of the RPi OS base image variant (none, segmenter-only, adafruithat, planktoscopehat)'
required: true
type: string

jobs:
build-os-image:
Expand Down Expand Up @@ -153,7 +149,7 @@ jobs:
ACTUAL_SHA="$(printf "%.7s" "${{ env.ACTUAL_SHA }}")"
/run/os-setup/os/ci-record-version.sh \
"github.com/${{ env.REPO }}" "$ACTUAL_SHA" "hash" \
"${{ inputs.variant }}" "/run/os-setup"
"/run/os-setup"
echo "installer-config.yml:"
cat /usr/share/planktoscope/installer-config.yml
echo "installer-versioning.yml:"
Expand Down Expand Up @@ -276,7 +272,7 @@ jobs:
run: |
echo "Running setup scripts..."
export DEBIAN_FRONTEND=noninteractive
/run/os-setup/os/setup.sh ${{ inputs.variant }}
/run/os-setup/os/setup.sh
echo "Done!"

- name: Prepare for a headless first boot on bare metal
Expand Down Expand Up @@ -330,7 +326,7 @@ jobs:
else
version="$(printf "%.7s" "${{ github.sha }}")"
fi
variant="${{ inputs.variant }}"
variant=""
if [[ "${{ inputs.base_release_name }}" != "bookworm" ]]; then
variant="$variant.${{ inputs.base_release_name }}"
fi
Expand Down
11 changes: 1 addition & 10 deletions os/ci-record-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# REPO (the repo used for setup, e.g. github.com/PlanktoScope/PlanktoScope)
# VERSION_QUERY (the version query, e.g. a commit hash)
# QUERY_TYPE (eitiher branch, tag, or hash)
# HARDWARE (either none, adafruithat, or planktoscopehat)
# VERSION_QUERY_DIR (the filesystem path of the git repo used for getting version info)

# Utilities for user interaction
Expand Down Expand Up @@ -99,7 +98,6 @@ main() {
info "${BOLD}Repo${NO_COLOR}: ${GREEN}${pretty_repo}${NO_COLOR}"
info "${BOLD}Version query${NO_COLOR}: ${GREEN}${VERSION_QUERY}${NO_COLOR}"
info "${BOLD}Query type${NO_COLOR}: ${GREEN}${QUERY_TYPE}${NO_COLOR}"
info "${BOLD}Hardware${NO_COLOR}: ${GREEN}${HARDWARE}${NO_COLOR}"
if [ -n "${VERBOSE-}" ]; then
VERBOSE=v
info "${BOLD}Tag prefix${NO_COLOR}: $(with_empty_placeholder "${TAG_PREFIX}")"
Expand Down Expand Up @@ -160,7 +158,6 @@ main() {
"repo" "${pretty_repo}" \
"version-query" "${VERSION_QUERY}" \
"query-type" "${QUERY_TYPE}" \
"hardware" "${HARDWARE}" \
"tag-prefix" "${TAG_PREFIX}" \
"setup-entrypoint" "${SETUP_ENTRYPOINT}" \
| sudo tee --append "${installer_config_file}" > /dev/null
Expand All @@ -183,8 +180,7 @@ main() {
REPO="$1"
VERSION_QUERY="$2"
QUERY_TYPE="$3"
HARDWARE="$4"
VERSION_QUERY_DIR="$5"
VERSION_QUERY_DIR="$4"

# Set default values for the command-line arguments
if [ -z "${REPO-}" ]; then
Expand All @@ -200,11 +196,6 @@ if [ -z "${QUERY_TYPE-}" ]; then
error "QUERY_TYPE environment variable was not set!"
exit 1
fi
DEFAULT_HARDWARE="planktoscopehat"
if [ -z "${HARDWARE-}" ]; then
error "HARDWARE environment variable was not set!"
exit 1
fi
DEFAULT_TAG_PREFIX="software/"
if [ -z "${TAG_PREFIX-}" ]; then
TAG_PREFIX="${DEFAULT_TAG_PREFIX}"
Expand Down
18 changes: 5 additions & 13 deletions os/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

setup_scripts_root=$(dirname $(realpath $BASH_SOURCE))

# Get command-line args

hardware_type="$1" # should be either none, adafruithat, or planktoscopehat

# Set up pretty error printing

red_fg=31
Expand All @@ -35,16 +31,12 @@ function panic {

# Run sub-scripts

if [ $hardware_type = "none" ]; then
echo "Warning: skipping PlanktoScope-specific setup because hardware type was specified as: $hardware_type"
description="remove unnecessary artifacts from the PlanktoScope application environment"
report_starting "$description"
if $setup_scripts_root/planktoscope-app-env/cleanup.sh ; then
report_finished "$description"
else
description="remove unnecessary artifacts from the PlanktoScope application environment"
report_starting "$description"
if $setup_scripts_root/planktoscope-app-env/cleanup.sh ; then
report_finished "$description"
else
panic "$description"
fi
panic "$description"
fi

description="remove unnecessary artifacts from the base operating system"
Expand Down
11 changes: 0 additions & 11 deletions os/planktoscope-app-env/node-red-frontend/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
# Determine the base path for copied files
config_files_root=$(dirname "$(realpath "$BASH_SOURCE")")

# Get command-line args
hardware_type="$1" # should be either adafruithat, planktoscopehat, or fairscope-latest
default_config="$hardware_type-latest"
if [ "$hardware_type" = "fairscope-latest" ]; then
hardware_type="planktoscopehat"
default_config="fairscope-latest"
fi

# Install dependencies
# smbus is needed by some python3 nodes in the Node-RED dashboard for the Adafruit HAT.
# Since the Node-RED systemd service runs as the pi user by default (and we don't override that
Expand All @@ -38,9 +30,6 @@ sudo cp $config_files_root/30-override.conf /etc/systemd/system/nodered.service.
sudo systemctl enable nodered.service
rm -rf /home/pi/.node-red

cp "$HOME/PlanktoScope/default-configs/$default_config.config.json" \
"$HOME"/PlanktoScope/config.json

# Configure node-red
npm --prefix "$HOME/PlanktoScope/node-red/nodes" install --omit=dev
npm --prefix "$HOME/PlanktoScope/node-red" install --omit=dev
10 changes: 0 additions & 10 deletions os/planktoscope-app-env/python-hardware-controller/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
config_files_root="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
distro_setup_files_root="$(dirname "$(dirname "$config_files_root")")"

# Get command-line args
hardware_type="$1" # should be either adafruithat, planktoscopehat, or fairscope-latest
default_config="$hardware_type-latest"
case "$hardware_type" in
"fairscope-latest")
hardware_type="planktoscopehat"
default_config="fairscope-latest"
;;
esac

## Install basic tooling
sudo -E apt-get install -y -o Dpkg::Progress-Fancy=0 \
git python3-pip python3-venv pipx
Expand Down
6 changes: 2 additions & 4 deletions os/planktoscope-app-env/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ build_scripts_root=$(dirname "$(realpath "$BASH_SOURCE")")

# Get command-line args

hardware_type="$1" # should be either adafruithat, planktoscopehat, fairscope-latest

# Set up pretty error printing

red_fg=31
Expand Down Expand Up @@ -47,15 +45,15 @@ fi

description="set up Node-RED frontend"
report_starting "$description"
if "$build_scripts_root/node-red-frontend/install.sh" "$hardware_type"; then
if "$build_scripts_root/node-red-frontend/install.sh"; then
report_finished "$description"
else
panic "$description"
fi

description="set up Python hardware controller"
report_starting "$description"
if "$build_scripts_root/python-hardware-controller/install.sh" "$hardware_type"; then
if "$build_scripts_root/python-hardware-controller/install.sh"; then
report_finished "$description"
else
panic "$description"
Expand Down
22 changes: 7 additions & 15 deletions os/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

setup_scripts_root=$(dirname "$(realpath "$BASH_SOURCE")")

# Get command-line args

hardware_type="$1" # should be either none, adafruithat, planktoscopehat, or fairscope-latest

# Set up pretty error printing

red_fg=31
Expand Down Expand Up @@ -50,17 +46,13 @@ else
panic "$description"
fi

if [ "$hardware_type" = "none" ]; then
echo "Warning: skipping PlanktoScope-specific setup because hardware type was specified as: $hardware_type"
description="set up PlanktoScope application environment"
report_starting "$description"
if "$setup_scripts_root"/planktoscope-app-env/setup.sh; then
report_finished "$description"
source "$setup_scripts_root"/planktoscope-app-env/export-env.sh
else
description="set up PlanktoScope application environment"
report_starting "$description"
if "$setup_scripts_root"/planktoscope-app-env/setup.sh "$hardware_type"; then
report_finished "$description"
source "$setup_scripts_root"/planktoscope-app-env/export-env.sh
else
panic "$description"
fi
panic "$description"
fi

"$setup_scripts_root"/cleanup.sh "$hardware_type"
"$setup_scripts_root"/cleanup.sh
Loading