Skip to content

Commit

Permalink
Remove production client wrappers
Browse files Browse the repository at this point in the history
Having these on the PATH prevents setting up a well defined test
environment.
  • Loading branch information
kjsanger committed Sep 25, 2023
1 parent 47d035a commit 59949ed
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions singularity/scripts/singularity-wrapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Copyright (C) 2023 Genome Research Ltd. All rights reserved.
#
Expand All @@ -17,7 +17,7 @@
#
# Author: Keith James <kdj@sanger.ac.uk>

set -euo pipefail
# set -euo pipefail ## FIXME: bashism

usage() {
cat 1>&2 << EOF
Expand All @@ -36,7 +36,7 @@ Usage: $0
[-e]
[-h]
[-i <Docker image name>]
[-m <JSON manifest path>]
[-m <manifest path>]
[-p <wrapper install prefix>]
[-r <Docker registry name>]
[-s]
Expand Down Expand Up @@ -73,7 +73,7 @@ EOF

# Print an application manifest
print_manifest() {
jq . "$MANIFEST_PATH"
cat "$MANIFEST_PATH"
}

# Write a bash script wrapping an application in a Docker container
Expand Down Expand Up @@ -113,9 +113,9 @@ install_wrappers() {
install -d "$dir"
cp "/usr/local/bin/$singularity_wrap_impl" "$PREFIX/bin"

for exe in "${wrappers[@]}" ; do
while IFS= read -r exe; do
write_wrapper "$dir" "$exe"
done
done < "$MANIFEST_PATH"
}

DOCKER_REGISTRY=${DOCKER_REGISTRY:-ghcr.io}
Expand All @@ -124,7 +124,7 @@ DOCKER_IMAGE=${DOCKER_IMAGE:-""}
DOCKER_TAG=${DOCKER_TAG:-latest}

PREFIX=${PREFIX:-/opt/wtsi-npg}
MANIFEST_PATH=${MANIFEST_PATH:-"$PREFIX/etc/manifest.json"}
MANIFEST_PATH=${MANIFEST_PATH:-"$PREFIX/etc/manifest.txt"}

singularity_wrap_impl="singularity-run-docker"

Expand Down Expand Up @@ -171,14 +171,11 @@ done

shift $((OPTIND -1))

declare -a wrappers
if [ ! -e "$MANIFEST_PATH" ] ; then
echo -e "\nERROR:\n The manifest of executables at '$MANIFEST_PATH' does not exist"
exit 4
fi

wrappers=($(jq -j '.executable[] + " "' "$MANIFEST_PATH"))

operation="$@"
if [ -z "$operation" ] ; then
usage
Expand Down

0 comments on commit 59949ed

Please sign in to comment.