diff --git a/src/cuda.py b/src/cuda.py index 9f6069a..3d40ddf 100644 --- a/src/cuda.py +++ b/src/cuda.py @@ -54,7 +54,7 @@ def install_cuda(args: argparse.Namespace, version: str) -> str: logger.info(f'Downloading CUDA {version}...') cuda = cudas[version] file = os.path.join(args.cache, cuda.filename) - cmd = ['pget', '--force', cuda.url, file] + cmd = ['/usr/local/bin/pget', '--force', cuda.url, file] subprocess.run(cmd, check=True) logger.info(f'Installing CUDA {version}...') @@ -97,7 +97,7 @@ def install_cudnn(args: argparse.Namespace, version: str, cuda_major: str) -> st logger.info(f'Downloading CuDNN {key}...') cudnn = cudnns[key] file = os.path.join(args.cache, cudnn.filename) - cmd = ['pget', '--force', cudnn.url, file] + cmd = ['/usr/local/bin/pget', '--force', cudnn.url, file] subprocess.run(cmd, check=True) logger.info(f'Installing CuDNN {key}...') diff --git a/src/pget b/src/pget index 92588d8..134a44c 100755 --- a/src/pget +++ b/src/pget @@ -5,6 +5,7 @@ set -euo pipefail PGET_BIN="/usr/local/bin/pget-bin" +PROC_FILE="/srv/r8/fuse-rpc/proc/pget" url='' dst='' @@ -20,8 +21,8 @@ for arg in "$@"; do fi done -if [ -z "$url" ] || [ -z "$dst" ]; then - # Fail to parse arguments, use vanilla PGET +if [ ! -f "$PROC_FILE" ] || [ -z "$url" ] || [ -z "$dst" ]; then + # No proc file or fail to parse arguments, use vanilla PGET exec "$PGET_BIN" "$@" else # Finger print object name with URL, size, ETag, and last modified @@ -41,7 +42,7 @@ else size="$(echo "$fingerprint" | grep -oP '(?<=^content-length: )[0-9]+')" # Request file from FUSE - echo "{\"name\":\"$name\",\"size\":$size,\"url\":\"$url\"}" > /srv/r8/fuse-rpc/proc/pget + echo "{\"name\":\"$name\",\"size\":$size,\"url\":\"$url\"}" > "$PROC_FILE" # Symlink file to destination mkdir -p "$(dirname "$dst")"