Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ repos:
rev: v2.3.0
hooks:
- id: codespell
args:
# ignore for "school of medicine" abbreviation
["-L","SOM"]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
Expand All @@ -24,3 +27,7 @@ repos:
rev: v1.7.1
hooks:
- id: actionlint
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
22 changes: 22 additions & 0 deletions data_strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,25 @@ flowchart LR
```

**Figure 2.** Raw data is received by the lab from Google Cloud Storage (GCS) project-specific buckets or a collaborator storage solution which is provided upfront. A lab member then transfers the data from the GCS bucket or collaborator storage solution to bandicoot (Isilon) so it may be used or shared within the lab. If the data need to be processed on HPC Alpine a lab member may decide to transfer the data to koala (PetaLibrary). Once HPC Alpine processing is complete the data are transferred back to bandicoot.

## Using Isilon

Leveraging Isilon involves the use of a computer system with access to the campus or virtual private network (VPN).
Isilon can be used through a filesystem mount or through the S3-like API.
The S3-like API requires you to email IT support at: ucd-oit-helpdesk@cuanschutz.edu
Mounting an Isilon directory entails using operating system tools to help handle authentication and persistence.
__Special note: the username provided when authenticating is your CU Anschutz enterprise username.__

- __MacOS:__ [`mount_smbfs`](https://man.freebsd.org/cgi/man.cgi?mount_smbfs) is shipped with MacOS automatically and can be used to setup a connection to Isilon directories.
For example: `mount_smbfs "$SHARE" "$MOUNT_POINT"`
- __Linux:__ [`cifs-utils`](https://wiki.samba.org/index.php/LinuxCIFS_utils) can be used in conjunction with `mount` to help setup a connection to Isilon directories.
For example: `mount -t cifs "$SHARE" "$MOUNT_POINT" -o username="$CIFS_USERNAME",domainauto`
Note: `domainauto` is important for ensuring the connection to CU Anschutz shares.

### Connection script

Please feel free to use the following script to automatically help setup your mount point to the Way Lab specific mount point on CU Anschutz Isilon: `bandicoot`.

```shell
curl https://raw.githubusercontent.com/WayScience/playbooks/refs/heads/main/internal/mount_bandicoot.sh | sh
```
104 changes: 104 additions & 0 deletions internal/mount_bandicoot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/env sh
# shellcheck shell=sh
# ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
# mount_bandicoot.sh
#
# This script creates a local mount point and mounts a CIFS/Samba share
# at //data.ucdenver.pvt/dept/SOM/DBMI/Bandicoot into ~/mnt/bandicoot.
# It auto-detects macOS vs. Linux, installs cifs-utils on Linux if needed,
# verifies VPN/network access, and works under any POSIX shell
# (sh, bash, zsh, dash, etc.).
# ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

set -eu
# -e: exit immediately on any error
# -u: treat unset variables as an error

# Remote share location (UNC path)
SHARE="//data.ucdenver.pvt/dept/SOM/DBMI/Bandicoot"
# Local directory where the share will be mounted
MOUNT_POINT="$HOME/mnt/bandicoot"

# ────────────────────────────────────────────────────────────────────────────
# 1) Ensure the mount directory exists
# ────────────────────────────────────────────────────────────────────────────
if [ ! -d "$MOUNT_POINT" ]; then
echo "→ Creating mount point directory: $MOUNT_POINT"
mkdir -p "$MOUNT_POINT"
# mkdir -p will also create any missing parent directories
fi

# ────────────────────────────────────────────────────────────────────────────
# 2) Extract host from the UNC path and verify network/VPN access
# ────────────────────────────────────────────────────────────────────────────
# Strip leading '//' and everything after the first '/'
HOST="${SHARE#//}"
HOST="${HOST%%/*}"
echo "→ Checking network reachability to $HOST..."
# Try a single ping with 1s timeout; adjust flags if your ping differs
if ! ping -c 1 -W 1 "$HOST" >/dev/null 2>&1; then
echo "✗ Unable to reach $HOST. Please ensure you're connected to VPN or network." >&2
exit 1
fi

# ────────────────────────────────────────────────────────────────────────────
# 3) Detect operating system and perform mount
# ────────────────────────────────────────────────────────────────────────────
OS="$(uname)"
case "$OS" in
Darwin)
# macOS branch
echo "→ Detected macOS (Darwin). Using mount_smbfs."
#
# mount_smbfs is the built-in macOS SMB client.
# It will prompt you for credentials if required,
# or use your current login keychain.
#
mount_smbfs "$SHARE" "$MOUNT_POINT"
;;

Linux)
# Linux branch
echo "→ Detected Linux. Verifying cifs-utils (mount.cifs) is installed..."
#
# mount.cifs is provided by the cifs-utils package.
# If it's missing, we detect your package manager and install it.
#
if ! command -v mount.cifs >/dev/null 2>&1; then
echo "→ cifs-utils not found. Attempting installation..."
if command -v apt-get >/dev/null 2>&1; then
echo " • Using apt-get to install cifs-utils"
sudo apt-get update
sudo apt-get install -y cifs-utils
elif command -v yum >/dev/null 2>&1; then
echo " • Using yum to install cifs-utils"
sudo yum install -y cifs-utils
else
echo "✗ Unsupported package manager. Please install cifs-utils manually." >&2
exit 1
fi
fi

# Prompt the user for their CIFS username
printf "Isilon/CIFS username (CU Anschutz username): " >/dev/tty
read -r CIFS_USERNAME </dev/tty # read from the terminal, not the script pipe
if [ -z "$CIFS_USERNAME" ]; then
echo "✗ Username cannot be empty." >&2
exit 1
fi
# Mount the share with domainauto for automatic domain selection
sudo mount -t cifs "$SHARE" "$MOUNT_POINT" \
-o username="$CIFS_USERNAME",domainauto
;;

*)
# Unsupported OS
echo "✗ Unsupported operating system: $OS" >&2
exit 1
;;
esac

# ────────────────────────────────────────────────────────────────────────────
# 4) Success message
# ────────────────────────────────────────────────────────────────────────────
echo "✔ Successfully mounted $SHARE at $MOUNT_POINT"