Skip to content
Snippets Groups Projects
Commit fda0da91 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Added Arm64 support (docker-based), tested on M1-based Mac

parent f5dab66b
No related branches found
No related tags found
1 merge request!320Added Arm64 support (docker-based), tested on M1-based Mac
...@@ -81,7 +81,7 @@ echo "Setting up development environment for eicweb/$CONTAINER:$VERSION" ...@@ -81,7 +81,7 @@ echo "Setting up development environment for eicweb/$CONTAINER:$VERSION"
mkdir -p $PREFIX/local/lib || exit 1 mkdir -p $PREFIX/local/lib || exit 1
function install_linux() { function install_singularity() {
SINGULARITY= SINGULARITY=
## check for a singularity install ## check for a singularity install
## default singularity if new enough ## default singularity if new enough
...@@ -213,7 +213,7 @@ function print_the_help { ...@@ -213,7 +213,7 @@ function print_the_help {
echo " -n,--no-cvmfs Disable check for local CVMFS when updating. (D: enabled)" echo " -n,--no-cvmfs Disable check for local CVMFS when updating. (D: enabled)"
echo " -h,--help Print this message" echo " -h,--help Print this message"
echo "" echo ""
echo " Start the eic-shell containerized software environment." echo " Start the eic-shell containerized software environment (Singularity version)."
echo "" echo ""
echo "EXAMPLES: " echo "EXAMPLES: "
echo " - Start an interactive shell: ./eic-shell" echo " - Start an interactive shell: ./eic-shell"
...@@ -288,11 +288,11 @@ EOF ...@@ -288,11 +288,11 @@ EOF
echo " - Created custom eic-shell excecutable" echo " - Created custom eic-shell excecutable"
} }
function install_macos() { function install_docker() {
## check for docker install ## check for docker install
DOCKER=$(which docker) DOCKER=$(which docker)
if [ -z ${DOCKER} ]; then if [ -z ${DOCKER} ]; then
echo "ERROR: no docker install found, docker is required for running on MacOS" echo "ERROR: no docker install found, docker is required for the docker-based install"
fi fi
echo " - Found docker at ${DOCKER}" echo " - Found docker at ${DOCKER}"
...@@ -318,9 +318,14 @@ function install_macos() { ...@@ -318,9 +318,14 @@ function install_macos() {
fi fi
done done
echo " - Docker mount directive: '$MOUNT'" echo " - Docker mount directive: '$MOUNT'"
PLATFORM_FLAG=''
if [ `uname -m` = 'arm64' ]; then
PLATFORM_FLAG='--platform linux/amd64'
echo " - Additional platform flag to run on arm64"
fi
## create a new top-level eic-shell launcher script ## create a new top-level eic-shell launcher script
## that sets the ATHENA_PREFIX and then starts singularity ## that sets the magix PREFIX and then starts singularity
cat << EOF > eic-shell cat << EOF > eic-shell
#!/bin/bash #!/bin/bash
...@@ -337,7 +342,7 @@ function print_the_help { ...@@ -337,7 +342,7 @@ function print_the_help {
echo " -u,--upgrade Upgrade the container to the latest version" echo " -u,--upgrade Upgrade the container to the latest version"
echo " -h,--help Print this message" echo " -h,--help Print this message"
echo "" echo ""
echo " Start the eic-shell containerized software environment." echo " Start the eic-shell containerized software environment (Docker version)."
echo "" echo ""
echo "EXAMPLES: " echo "EXAMPLES: "
echo " - Start an interactive shell: ./eic-shell" echo " - Start an interactive shell: ./eic-shell"
...@@ -379,7 +384,7 @@ if [ ! -z \${UPGRADE} ]; then ...@@ -379,7 +384,7 @@ if [ ! -z \${UPGRADE} ]; then
exit 0 exit 0
fi fi
docker run $MOUNT -w=$PWD -it --rm -e ATHENA_PREFIX=$PREFIX/local $IMG eic-shell \$@ docker run $PLATFORM_FLAG $MOUNT -w=$PWD -it --rm -e ATHENA_PREFIX=$PREFIX/local $IMG eic-shell \$@
EOF EOF
chmod +x eic-shell chmod +x eic-shell
...@@ -389,14 +394,21 @@ EOF ...@@ -389,14 +394,21 @@ EOF
## detect OS ## detect OS
OS=`uname -s` OS=`uname -s`
CPU=`uname -m`
case ${OS} in case ${OS} in
Linux) Linux)
echo " - Detected OS: Linux" echo " - Detected OS: Linux"
install_linux echo " - Detected CPU: $CPU"
if [ "$CPU" = "arm64" ]; then
install_docker
else
install_singularity
fi
;; ;;
Darwin) Darwin)
echo " - Detected OS: MacOS" echo " - Detected OS: MacOS"
install_macos echo " - Detected CPU: $CPU"
install_docker
;; ;;
*) *)
echo "ERROR: OS '${OS}' not currently supported" echo "ERROR: OS '${OS}' not currently supported"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment