Skip to content

Commit

Permalink
setup and cleanup: fix setup scripts for new repo, delete outdate and…
Browse files Browse the repository at this point in the history
… move tools. Add action for install + tests. (Cephla-Lab#31)

This fixes the setup scripts to use the new main repository at
https://github.com/Cephla-Lab/Squid . It also deletes the outdated
`setup_octopi.sh` script (Hongquan mentioned it was outdated and no
longer used), moves some tooling scripts into the `tools` subdirectory,
and generally does a bit of cleanup.

This also introduces a github workflow that will run our setup scripts
and run the python tests whenever pull requests are made, or master is
updated.

You can add new tests in `software/tests` by following the example
already there.

Tested by: The workflow runs and succeeds.
  • Loading branch information
ianohara authored and soham1202 committed Dec 6, 2024
1 parent d50b125 commit 6c362a4
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 194 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Install Environment and Run Tests

on:
push:
branches: master
pull_request:

jobs:
install-and-test:
permissions:
contents: read
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./software
steps:
- name: Checkout the Squid repo
uses: actions/checkout@v4
- name: Run the setup script for Ubuntu 22.04
run: ./setup_22.04.sh
- name: Run the cuda setup script
run: ./setup_cuda_22.04.sh
- name: Run the tests
run: python3 -m pytest
10 changes: 9 additions & 1 deletion software/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
## Setting up the environments
Run the following script in terminal to clone the repo and set up the environment
```
wget https://raw.githubusercontent.com/hongquanli/octopi-research/master/software/setup_22.04.sh
wget https://raw.githubusercontent.com/Cephla-Lab/Squid/master/software/setup_22.04.sh
chmod +x setup_22.04.sh
./setup_22.04.sh
```

Then run this script to set up cuda
```
wget https://raw.githubusercontent.com/Cephla-Lab/Squid/master/software/setup_cuda_22.04.sh
chmod +x setup_cuda_22.04.sh
./setup_cuda_22.04.sh
```

Reboot the computer to finish the installation.

## Optional or Hardware-specific dependencies
Expand Down
3 changes: 0 additions & 3 deletions software/add_desktop_launcher_malaria.sh

This file was deleted.

30 changes: 22 additions & 8 deletions software/setup_22.04.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash
set -eo pipefail

if [[ -n "$TRACE" ]]; then
echo "TRACE variable non-empty, turning on script tracing."
set -x
fi

readonly SRC_ROOT="$HOME/Desktop"
mkdir -p "$SRC_ROOT"
readonly SQUID_REPO_HTTP="https://github.com/Cephla-Lab/Squid.git"
readonly SQUID_REPO_NAME="Squid"
readonly SQUID_SOFTWARE_ROOT="$SRC_ROOT/$SQUID_REPO_NAME/software"
readonly DAHENG_CAMERA_DRIVER_ROOT="$SQUID_SOFTWARE_ROOT/drivers and libraries/daheng camera/Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122"
readonly DAHENG_CAMERA_DRIVER_API_ROOT="$SQUID_SOFTWARE_ROOT/drivers and libraries/daheng camera/Galaxy_Linux_Python_1.0.1905.9081/api"
readonly TOUPCAM_UDEV_RULE_PATH="$SQUID_SOFTWARE_ROOT/drivers and libraries/toupcam/linux/udev/99-toupcam.rules"
# update
sudo apt update

Expand All @@ -10,24 +24,24 @@ sudo apt install python3-pyqt5.qtsvg

# clone the repo
sudo apt-get install git -y
cd ~/Desktop
git clone https://github.com/hongquanli/octopi-research.git
cd octopi-research/software
cd "$SRC_ROOT"
git clone "$SQUID_REPO_HTTP" "$SQUID_REPO_NAME"
cd "$SQUID_SOFTWARE_ROOT"
mkdir cache

# install libraries
pip3 install qtpy pyserial pandas imageio crc==1.3.0 lxml numpy tifffile scipy napari
pip3 install opencv-python-headless opencv-contrib-python-headless
pip3 install napari[all] scikit-image dask_image ome_zarr aicsimageio basicpy
pip3 install napari[all] scikit-image dask_image ome_zarr aicsimageio basicpy pytest

# install camera drivers
cd ~/Desktop/octopi-research/software/drivers\ and\ libraries/daheng\ camera/Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122
cd "$DAHENG_CAMERA_DRIVER_ROOT"
./Galaxy_camera.run
cd ~/Desktop/octopi-research/software/drivers\ and\ libraries/daheng\ camera/Galaxy_Linux_Python_1.0.1905.9081/api
cd "$DAHENG_CAMERA_DRIVER_API_ROOT"
python3 setup.py build
sudo python3 setup.py install
cd ~/Desktop/octopi-research/software
sudo cp drivers\ and\ libraries/toupcam/linux/udev/99-toupcam.rules /etc/udev/rules.d
cd "$SQUID_SOFTWARE_ROOT"
sudo cp "$TOUPCAM_UDEV_RULE_PATH" /etc/udev/rules.d

# enable access to serial ports without sudo
sudo usermod -aG dialout $USER
Empty file modified software/setup_cuda_22.04.sh
100644 → 100755
Empty file.
182 changes: 0 additions & 182 deletions software/setup_octopi.sh

This file was deleted.

File renamed without changes.

0 comments on commit 6c362a4

Please sign in to comment.