Skip to content

Commit

Permalink
try to fix setup script to allow specifying existing repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ianohara committed Feb 4, 2025
1 parent 32b8319 commit 975fd3e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ jobs:
- name: Checkout the Squid repo
uses: actions/checkout@v4
- name: Run the setup script for Ubuntu 22.04
run: ./setup_22.04.sh
run: ./setup_22.04.sh -r=.
working-directory: ./software
env:
SRC_ROOT: "${{ runner.temp }}"
- name: Run the cuda setup script
run: ./setup_cuda_22.04.sh
working-directory: ./software
Expand Down
42 changes: 30 additions & 12 deletions software/setup_22.04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,28 @@ if [[ -n "$TRACE" ]]; then
set -x
fi

if [[ -z "$SRC_ROOT" ]]; then
readonly SRC_ROOT="$HOME/Desktop"
fi
echo "Using SRC_ROOT=$SRC_ROOT"
echo "Disk space summary (before setup):"
df -h
SQUID_REPO_PATH="$HOME/Desktop/Squid"

for i in "$@"; do
case $i in
-r=*|--repo_path=*)
SQUID_REPO_PATH="${i#*=}"
shift
;;
-*|--*)
echo "Unknown option $i"
exit 1
;;
*)
;;
esac
done

echo "Using SQUID_REPO_PATH='${SQUID_REPO_PATH}'"

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 SQUID_SOFTWARE_ROOT="${SQUID_REPO_PATH}/software"
readonly SQUID_REPO_PATH_PARENT="$(dirname "${SQUID_REPO_PATH}")"
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"
Expand All @@ -28,10 +39,17 @@ sudo apt install python3-pip -y
sudo apt install python3-pyqtgraph python3-pyqt5 -y
sudo apt install python3-pyqt5.qtsvg

# clone the repo
sudo apt-get install git -y
cd "$SRC_ROOT"
git clone "$SQUID_REPO_HTTP" "$SQUID_REPO_NAME"
## clone the repo if we don't already have it.
# No matter, make sure the repo's parent dir is there
mkdir -p "${SQUID_REPO_PATH_PARENT}"
if [[ ! -d "${SQUID_REPO_PATH}" ]]; then
git clone "$SQUID_REPO_HTTP" "${SQUID_REPO_PATH}"
else
echo "Using existing repo at '${SQUID_REPO_PATH}' at HEAD=$(cd "${SQUID_REPO_PATH}" && git rev-parse HEAD)"
fi


cd "$SQUID_SOFTWARE_ROOT"
mkdir -p "$SQUID_SOFTWARE_ROOT/cache"

Expand Down

0 comments on commit 975fd3e

Please sign in to comment.