diff --git a/.vsts/pipeline.yml b/.vsts/pipeline.yml index ee54b83..2d3e231 100644 --- a/.vsts/pipeline.yml +++ b/.vsts/pipeline.yml @@ -3,7 +3,7 @@ name: $(SourceBranch)$(Rev:.r) jobs: - job: ComponentGovernance pool: - vmImage: vs2017-win2016 + vmImage: windows-2019 condition: ne(variables['Build.Reason'], 'PullRequest') variables: EnableDetectorPip: true @@ -143,9 +143,9 @@ jobs: condition: and(succeeded(), ne(variables['ARTIFACT_CLI'], '')) - powershell: | docker version - docker login -u="$(docker.username)" -p="$(docker.password)" - $cargoImage = "alfpark/batch-shipyard:" + $env:GIT_TAG + "-cargo-windows" - $cliImage = "alfpark/batch-shipyard:" + $env:GIT_TAG + "-cli-windows" + docker login "$(docker.servername)" -u="$(docker.username)" -p="$(docker.password)" + $cargoImage = "$(docker.servername)/public/azure-batch/shipyard:" + $env:GIT_TAG + "-cargo-windows" + $cliImage = "$(docker.servername)/public/azure-batch/shipyard:" + $env:GIT_TAG + "-cli-windows" pushd docker\\windows\\cargo docker build --build-arg GIT_BRANCH=$env:BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$env:BUILD_SOURCEVERSION -t $cargoImage . docker push $cargoImage @@ -241,6 +241,25 @@ jobs: condition: > and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Manual'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['python.version'], '3.7')) + - script: | + set -e + set -o pipefail + docker version + docker login "$(docker.servername)" -u="$(docker.username)" -p="$(docker.password)" + singularity_version=$(grep -m1 _SINGULARITY_VERSION convoy/misc.py | cut -d "'" -f 2) + echo "Replicating Singularity verison $singularity_version images to MCR" + dhImage="alfpark/singularity:${singularity_version}-mnt" + docker pull "$dhImage" + mcrImage="$(docker.servername)/public/azure-batch/shipyard:${singularity_version}-singularity-mnt" + docker tag "$dhImage" "$mcrImage" + docker push "$mcrImage" + dhImage="alfpark/singularity:${singularity_version}-mnt-resource" + docker pull "$dhImage" + mcrImage="$(docker.servername)/public/azure-batch/shipyard:${singularity_version}-singularity-mnt-resource" + docker tag "$dhImage" "$mcrImage" + docker push "$mcrImage" + displayName: Replicate Singularity Container Images + condition: and(succeeded(), ne(variables['ARTIFACT_CLI'], '')) - template: ./pyenv.yml - script: | set -e @@ -277,35 +296,38 @@ jobs: set -e set -o pipefail docker version - docker login -u="$(docker.username)" -p="$(docker.password)" + docker login "$(docker.servername)" -u="$(docker.username)" -p="$(docker.password)" if [ -n "$GIT_TAG" ]; then - cargoImage="alfpark/batch-shipyard:${DOCKER_TAG}-cargo" pushd cargo + cargoImage="$(docker.servername)/public/azure-batch/shipyard:${DOCKER_TAG}-cargo" docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $cargoImage . docker push $cargoImage popd - cascadeImage="alfpark/batch-shipyard:${DOCKER_TAG}-cascade" pushd cascade - docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $cascadeImage . + cascadeImage="$(docker.servername)/public/azure-batch/shipyard:${DOCKER_TAG}-cascade-docker" + docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $cascadeImage -f Dockerfile.docker . + docker push $cascadeImage + cascadeImage="$(docker.servername)/public/azure-batch/shipyard:${DOCKER_TAG}-cascade-singularity" + docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $cascadeImage -f Dockerfile.singularity . docker push $cascadeImage popd - fedImage="alfpark/batch-shipyard:${DOCKER_TAG}-federation" pushd federation + fedImage="$(docker.servername)/public/azure-batch/shipyard:${DOCKER_TAG}-federation" docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $fedImage . docker push $fedImage popd - heimdallImage="alfpark/batch-shipyard:${DOCKER_TAG}-heimdall" pushd heimdall + heimdallImage="$(docker.servername)/public/azure-batch/shipyard:${DOCKER_TAG}-heimdall" docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $heimdallImage . docker push $heimdallImage popd - slurmImage="alfpark/batch-shipyard:${DOCKER_TAG}-slurm" pushd slurm + slurmImage="$(docker.servername)/public/azure-batch/shipyard:${DOCKER_TAG}-slurm" docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $slurmImage . docker push $slurmImage popd fi - cliImage="alfpark/batch-shipyard:${DOCKER_TAG}-cli" + cliImage="$(docker.servername)/public/azure-batch/shipyard:${DOCKER_TAG}-cli" pushd docker/linux/cli docker build --build-arg GIT_BRANCH=$BUILD_SOURCEBRANCHNAME --build-arg GIT_COMMIT=$BUILD_SOURCEVERSION -t $cliImage . docker push $cliImage diff --git a/cascade/Dockerfile.singularity b/cascade/Dockerfile.singularity index fad38a6..5100a70 100644 --- a/cascade/Dockerfile.singularity +++ b/cascade/Dockerfile.singularity @@ -1,7 +1,7 @@ # Dockerfile for Azure/batch-shipyard (Cascade/Singularity) # base image containing singularity -FROM alfpark/singularity:3.3.0-default +FROM alfpark/singularity:3.3.0 FROM ubuntu:18.04 MAINTAINER Fred Park diff --git a/convoy/batch.py b/convoy/batch.py index eefde8b..c4d9af7 100644 --- a/convoy/batch.py +++ b/convoy/batch.py @@ -5204,7 +5204,8 @@ def add_jobs( addlcmds = data.process_input_data(config, bxfile, jobspec) if addlcmds is not None: if util.is_not_empty(federation_id): - tfm = 'alfpark/batch-shipyard:{}-cargo'.format(__version__) + tfm = 'mcr.microsoft.com/azure-batch/shipyard:{}-cargo'.format( + __version__) if tfm in addlcmds: raise RuntimeError( 'input_data:azure_batch is not supported at the ' @@ -5368,7 +5369,10 @@ def add_jobs( config, 'continue adding job schedule {}'.format( job_id)): continue - jmimgname = 'alfpark/batch-shipyard:{}-cargo'.format(__version__) + jmimgname = ( + 'mcr.microsoft.com/azure-batch/shipyard:{}-cargo'.format( + __version__) + ) if is_windows: jmimgname = '{}-windows'.format(jmimgname) jscmdline = ( diff --git a/convoy/data.py b/convoy/data.py index fa712a1..3ec8f32 100644 --- a/convoy/data.py +++ b/convoy/data.py @@ -226,7 +226,8 @@ def process_input_data(config, bxfile, spec, on_task=False): :rtype: str :return: additonal command """ - tfmimage = 'alfpark/batch-shipyard:{}-cargo'.format(__version__) + tfmimage = 'mcr.microsoft.com/azure-batch/shipyard:{}-cargo'.format( + __version__) is_windows = settings.is_windows_pool(config) if is_windows: bxcmd = ('powershell -ExecutionPolicy Unrestricted -command ' diff --git a/convoy/fleet.py b/convoy/fleet.py index 4aedf61..9986bb6 100644 --- a/convoy/fleet.py +++ b/convoy/fleet.py @@ -2238,10 +2238,10 @@ def _update_container_images( d='-d' if (settings.batch_shipyard_settings(config) .use_shipyard_docker_image) else '', e='-e {}'.format(envfile), - i='-i alfpark/batch-shipyard:{}-cascade-docker'.format( - __version__), - j=('-j alfpark/batch-shipyard:{}-cascade-singularity' - .format(__version__)), + i=('-i mcr.microsoft.com/azure-batch/shipyard:' + '{}-cascade-docker'.format(__version__)), + j=('-j mcr.microsoft.com/azure-batch/shipyard:' + '{}-cascade-singularity'.format(__version__)), ld='-l $log_directory', p='-p {}'.format( settings.batch_shipyard_settings(config) @@ -2391,8 +2391,9 @@ def _list_docker_images(batch_client, config): for out in spout: if util.is_not_empty(out): dec = out.split() - if (not dec[1].startswith('alfpark/batch-shipyard') and - not dec[1].startswith('alfpark/blobxfer')): + if (not dec[1].startswith( + 'mcr.microsoft.com/azure-batch/shipyard') and + not dec[1].startswith('mcr.microsoft.com/blobxfer')): node_images[key].add(dec[0]) if dec[0] not in all_images: all_images[dec[0]] = dec[1] diff --git a/docker/singularity/Dockerfile b/docker/singularity/Dockerfile index f08519c..f59e3a4 100644 --- a/docker/singularity/Dockerfile +++ b/docker/singularity/Dockerfile @@ -3,10 +3,10 @@ FROM ubuntu:18.04 MAINTAINER Fred Park +ARG SINGULARITY_VERSION ARG LOCAL_STATE_DIR -ENV SINGULARITY_VERSION=3.3.0 \ - GO_VERSION=1.12 \ +ENV GO_VERSION=1.12 \ GOOS=linux \ GOARCH=amd64 diff --git a/docker/singularity/build-images.sh b/docker/singularity/build-images.sh new file mode 100755 index 0000000..475efaa --- /dev/null +++ b/docker/singularity/build-images.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +SINGULARITY_VERSION=3.3.0 +REPO=alfpark/singularity + +LSD=(/var/lib /mnt /mnt/resource) +TAGS=(default mnt mnt-resource) + +i=0 +for lsd in "${LSD[@]}"; do + tag="-${TAGS[$i]}" + if [ "$tag" == "-default" ]; then + tag="" + fi + di="${REPO}:${SINGULARITY_VERSION}${tag}" + docker build --pull -t "$di" --build-arg SINGULARITY_VERSION="$SINGULARITY_VERSION" --build-arg LOCAL_STATE_DIR="$lsd" -f Dockerfile . + i=$((i + 1)) +done diff --git a/docs/01-batch-shipyard-installation.md b/docs/01-batch-shipyard-installation.md index be5cbdf..c8afaca 100644 --- a/docs/01-batch-shipyard-installation.md +++ b/docs/01-batch-shipyard-installation.md @@ -307,7 +307,8 @@ Please see the Upgrading section below for information on upgrading to a new release of Batch Shipyard. ## Batch Shipyard CLI Installation via Docker -If using the [alfpark/batch-shipyard:latest-cli](https://hub.docker.com/r/alfpark/batch-shipyard) +If using the +[mcr.microsoft.com/azure-batch/shipyard:latest-cli](https://hub.docker.com/_/microsoft-azure-batch-shipyard) Docker image, then all of the required software is bundled in the image itself, however, you will need an installation of the Docker engine on your machine. More information on installing Docker to your local machine @@ -315,7 +316,7 @@ can be found [here](https://www.docker.com/products/overview). To install: ```shell -docker pull alfpark/batch-shipyard:latest-cli +docker pull mcr.microsoft.com/azure-batch/shipyard:latest-cli ``` This will pull the CLI Docker image of Batch Shipyard to your local machine. You are now ready to execute it with `docker run`. Please see the @@ -323,7 +324,8 @@ You are now ready to execute it with `docker run`. Please see the on how to execute the Batch Shipyard CLI Docker image. ## Batch Shipyard CLI Installation via Singularity -If using the [alfpark/batch-shipyard-singularity:cli](https://www.singularity-hub.org/collections/204) +If using the +[library://alfpark/batch/shipyard:latest-cli](https://cloud.sylabs.io/library/alfpark/batch/shipyard), Singularity image, then all of the required software is bundled in the image itself, however, you will need an installation of Singularity on your machine. More information on installing Singularity to your local machine @@ -331,7 +333,7 @@ can be found [here](https://www.sylabs.io/singularity/). To install: ```shell -singularity pull shub://alfpark/batch-shipyard-singularity:cli +singularity pull library://alfpark/batch/shipyard:cli ``` This will pull the CLI Singularity image of Batch Shipyard to your local machine (to the current working directory). You are now ready to execute diff --git a/docs/20-batch-shipyard-usage.md b/docs/20-batch-shipyard-usage.md index 0eb3c69..8e5a79f 100644 --- a/docs/20-batch-shipyard-usage.md +++ b/docs/20-batch-shipyard-usage.md @@ -1088,18 +1088,19 @@ task `task1` from a live compute node. Because all portions of the `--filespec` option are specified, the tool will not prompt for any input. ## Batch Shipyard Container Image CLI Invocation -If using either the Docker image [alfpark/batch-shipyard:latest-cli](https://hub.docker.com/r/alfpark/batch-shipyard) +If using either the Docker image +[mcr.microsoft.com/azure-batch/shipyard:latest-cli](https://hub.docker.com/_/microsoft-azure-batch-shipyard) or the Singularity image -[shub://alfpark/batch-shipyard-singularity:cli](https://www.singularity-hub.org/collections/204), +[library://alfpark/batch/shipyard:latest-cli](https://cloud.sylabs.io/library/alfpark/batch/shipyard), then you would invoke Batch Shipyard as: ```shell # if using Docker -docker run --rm -it alfpark/batch-shipyard:latest-cli \ +docker run --rm -it mcr.microsoft.com/azure-batch/shipyard:latest-cli \ # if using Singularity -singularity run shub://alfpark/batch-shipyard-singularity:cli \ +singularity run library://alfpark/batch/shipyard:latest-cli \ ``` @@ -1119,14 +1120,14 @@ Shipyard configs are stored in the host path docker run --rm -it \ -v /home/user/batch-shipyard-configs:/configs \ -w /configs \ - alfpark/batch-shipyard:latest-cli \ + mcr.microsoft.com/azure-batch/shipyard:latest-cli \ # if using Singularity singularity run \ -B /home/user/batch-shipyard-configs:/configs \ --pwd /configs \ - shub://alfpark/batch-shipyard-singularity:cli \ + library://alfpark/batch/shipyard:latest-cli \ ``` diff --git a/docs/94-batch-shipyard-major-version-migration.md b/docs/94-batch-shipyard-major-version-migration.md index e238bf0..ccec9bf 100644 --- a/docs/94-batch-shipyard-major-version-migration.md +++ b/docs/94-batch-shipyard-major-version-migration.md @@ -78,7 +78,10 @@ The Docker image name for the CLI has changed. Batch Shipyard Docker images now follow the `version-component` naming convetion for tags. Thus, the `latest` CLI version will now be `alfpark/batch-shipyard:latest-cli`. This will also apply to versioned CLI images. For example, version `3.0.0` will -be named as `alfpark/batch-shipyard:3.0.0-cli`. +be named as `alfpark/batch-shipyard:3.0.0-cli`. As of version `3.8.0`, +Docker images are published to the +[mcr.microsoft.com/azure-batch/shipyard](https://hub.docker.com/_/microsoft-azure-batch-shipyard) +on the Microsoft Container Registry instead of Docker Hub. #### Command Renaming Some commands have been placed under sub-commands for better hierarchy diff --git a/federation/docker-compose.yml b/federation/docker-compose.yml index d106f3f..2024c9d 100644 --- a/federation/docker-compose.yml +++ b/federation/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.5" services: federation: - image: alfpark/batch-shipyard:{BATCH_SHIPYARD_VERSION}-federation + image: mcr.microsoft.com/azure-batch/shipyard:{BATCH_SHIPYARD_VERSION}-federation container_name: federation restart: unless-stopped privileged: true diff --git a/heimdall/docker-compose-nonginx.yml b/heimdall/docker-compose-nonginx.yml index 558d84c..9b5d467 100644 --- a/heimdall/docker-compose-nonginx.yml +++ b/heimdall/docker-compose-nonginx.yml @@ -10,7 +10,7 @@ networks: services: heimdall: - image: alfpark/batch-shipyard:{BATCH_SHIPYARD_VERSION}-heimdall + image: mcr.microsoft.com/azure-batch/shipyard:{BATCH_SHIPYARD_VERSION}-heimdall container_name: heimdall restart: unless-stopped networks: diff --git a/heimdall/docker-compose.yml b/heimdall/docker-compose.yml index f0c54d9..410b1d1 100644 --- a/heimdall/docker-compose.yml +++ b/heimdall/docker-compose.yml @@ -10,7 +10,7 @@ networks: services: heimdall: - image: alfpark/batch-shipyard:{BATCH_SHIPYARD_VERSION}-heimdall + image: mcr.microsoft.com/azure-batch/shipyard:{BATCH_SHIPYARD_VERSION}-heimdall container_name: heimdall restart: unless-stopped networks: diff --git a/scripts/replicate_batch_shipyard_images.sh b/scripts/replicate_batch_shipyard_images.sh index 011bf12..a9c51ff 100755 --- a/scripts/replicate_batch_shipyard_images.sh +++ b/scripts/replicate_batch_shipyard_images.sh @@ -95,11 +95,11 @@ log INFO "Logging into target Docker registry" docker login --username "$username" --password "$password" "$registry" log INFO "Mirroring Docker images" -mirror_docker_image "alfpark/blobxfer:$bxver" -mirror_docker_image "alfpark/batch-shipyard:${bsver}-cascade" -mirror_docker_image "alfpark/batch-shipyard:${bsver}-cargo" -mirror_docker_image "alfpark/singularity:${sinver}-ubuntu-16.04" -#mirror_docker_image "alfpark/singularity:${sinver}-ubuntu-18.04" -mirror_docker_image "alfpark/singularity:${sinver}-centos-7" +mirror_docker_image "mcr.microsoft.com/blobxfer:$bxver" +mirror_docker_image "mcr.microsoft.com/azure-batch/shipyard:${bsver}-cascade-docker" +mirror_docker_image "mcr.microsoft.com/azure-batch/shipyard:${bsver}-cascade-singularity" +mirror_docker_image "mcr.microsoft.com/azure-batch/shipyard:${bsver}-cargo" +mirror_docker_image "mcr.microsoft.com/azure-batch/shipyard:${sinver}-singularity-mnt" +mirror_docker_image "mcr.microsoft.com/azure-batch/shipyard:${sinver}-singularity-mnt-resource" log INFO "Docker image mirroring complete" diff --git a/scripts/shipyard_nodeprep.sh b/scripts/shipyard_nodeprep.sh index 8b9e362..cc6c8e5 100755 --- a/scripts/shipyard_nodeprep.sh +++ b/scripts/shipyard_nodeprep.sh @@ -22,6 +22,7 @@ MOUNTS_PATH=$AZ_BATCH_NODE_ROOT_DIR/mounts VOLATILE_PATH=$AZ_BATCH_NODE_ROOT_DIR/volatile IB_PKEY_FILE=$AZ_BATCH_TASK_WORKING_DIR/IB_PKEY UCX_IB_PKEY_FILE=$AZ_BATCH_TASK_WORKING_DIR/UCX_IB_PKEY +SHIPYARD_IMAGE_PREFIX=mcr.microsoft.com/azure-batch/shipyard # status file consts lisinstalled=${VOLATILE_PATH}/.batch_shipyard_lis_installed @@ -127,7 +128,7 @@ while getopts "h?abcde:fg:i:jkl:m:no:p:qrs:tuv:wx:yz:" opt; do echo "-e [thumbprint] encrypted credentials with cert" echo "-f set up glusterfs on compute" echo "-g [nv-series:driver file:nvidia docker pkg] gpu support" - echo "-i [version] singularity version" + echo "-i [version] install singularity container runtime" echo "-j delay docker image preload" echo "-k install kata containers runtime" echo "-l [lis pkg] LIS package install" @@ -895,21 +896,21 @@ install_singularity() { return fi if [ -z "$singularityversion" ]; then - log WARNING "Singularity version not specified, not installing" + log DEBUG "Singularity not flagged for install" return fi local disuffix singularity_basedir="${USER_MOUNTPOINT}/singularity" if [ "${USER_MOUNTPOINT}" == "/mnt" ]; then - disuffix=mnt + disuffix=singularity-mnt else - disuffix=mnt-resource + disuffix=singularity-mnt-resource fi log DEBUG "Setting up Singularity for $DISTRIB_ID $DISTRIB_RELEASE" # install squashfs-tools for mksquashfs install_packages squashfs-tools # fetch docker image for singularity bits - local di="alfpark/singularity:${singularityversion}-${disuffix}" + local di="${SHIPYARD_IMAGE_PREFIX}:${singularityversion}-${disuffix}" log DEBUG "Image=${di} basedir=${singularity_basedir}" docker_pull_image "$di" mkdir -p /opt/singularity @@ -1023,6 +1024,7 @@ process_fstab_entry() { mount_storage_clusters() { if [ -n "$SHIPYARD_STORAGE_CLUSTER_FSTAB" ]; then log DEBUG "Mounting storage clusters" + local fstab_mounts IFS='#' read -ra fstab_mounts <<< "$SHIPYARD_STORAGE_CLUSTER_FSTAB" for fstab in "${fstab_mounts[@]}"; do # eval and split fstab var to expand vars @@ -1035,9 +1037,10 @@ mount_storage_clusters() { } process_storage_clusters() { - if [ -n "$sc_args" ]; then + if [ -n "${sc_args[0]}" ]; then log DEBUG "Processing storage clusters" # eval and split fstab var to expand vars (this is ok since it is set by shipyard) + local fstab_mounts fstab_mounts=$(eval echo "$SHIPYARD_STORAGE_CLUSTER_FSTAB") IFS='#' read -ra fstabs <<< "$fstab_mounts" i=0 @@ -1054,6 +1057,7 @@ process_storage_clusters() { mount_custom_fstab() { if [ -n "$SHIPYARD_CUSTOM_MOUNTS_FSTAB" ]; then log DEBUG "Mounting custom mounts via fstab" + local fstab_mounts IFS='#' read -ra fstab_mounts <<< "$SHIPYARD_CUSTOM_MOUNTS_FSTAB" for fstab in "${fstab_mounts[@]}"; do # eval and split fstab var to expand vars @@ -1068,6 +1072,7 @@ mount_custom_fstab() { process_custom_fstab() { if [ -n "$SHIPYARD_CUSTOM_MOUNTS_FSTAB" ]; then log DEBUG "Processing custom mounts via fstab" + local fstab_mounts IFS='#' read -ra fstab_mounts <<< "$SHIPYARD_CUSTOM_MOUNTS_FSTAB" for fstab in "${fstab_mounts[@]}"; do # eval and split fstab var to expand vars @@ -1264,35 +1269,36 @@ install_glusterfs_on_compute() { } check_for_storage_cluster_software() { + if [ -z "${sc_args[0]}" ]; then + return + fi local rc - if [ -n "$sc_args" ]; then - for sc_arg in "${sc_args[@]}"; do - IFS=':' read -ra sc <<< "$sc_arg" - local server_type=${sc[0]} - if [ "$server_type" == "nfs" ]; then - set +e - mount.nfs4 -V - rc=$? - set -e - elif [ "$server_type" == "glusterfs" ]; then - set +e - glusterfs -V - rc=$? - set -e - else - log ERROR "Unknown file server type ${sc[0]} for ${sc[1]}" - exit 1 - fi - done - fi - if [ $rc -ne 0 ]; then - log ERROR "required storage cluster software to mount $sc_args not installed" - exit 1 - fi + for sc_arg in "${sc_args[@]}"; do + IFS=':' read -ra sc <<< "$sc_arg" + local server_type=${sc[0]} + if [ "$server_type" == "nfs" ]; then + set +e + mount.nfs4 -V + rc=$? + set -e + elif [ "$server_type" == "glusterfs" ]; then + set +e + glusterfs -V + rc=$? + set -e + else + log ERROR "Unknown file server type ${sc[0]} for ${sc[1]}" + exit 1 + fi + if [ $rc -ne 0 ]; then + log ERROR "Required storage cluster software to mount $server_type not installed" + exit 1 + fi + done } install_storage_cluster_dependencies() { - if [ -z "$sc_args" ]; then + if [ -z "${sc_args[0]}" ]; then return fi log DEBUG "Installing storage cluster dependencies" @@ -1566,7 +1572,7 @@ install_and_start_node_exporter() { else ib="--no-collector.infiniband" fi - if [ -n "$sc_args" ]; then + if [ -n "${sc_args[0]}" ]; then for sc_arg in "${sc_args[@]}"; do IFS=':' read -ra sc <<< "$sc_arg" if [ "${sc[0]}" == "nfs" ]; then @@ -1606,7 +1612,7 @@ install_and_start_cadvisor() { if [ -n "${PROM_CADVISOR_OPTIONS}" ]; then IFS=',' read -ra pcao <<< "$PROM_CADVISOR_OPTIONS" else - pcao= + pcao=() fi "${AZ_BATCH_TASK_WORKING_DIR}"/cadvisor \ -port "${PROM_CADVISOR_PORT}" \ @@ -1644,7 +1650,7 @@ echo "Encryption cert thumbprint: $encrypted" echo "Install Kata Containers: $kata" echo "Default container runtime: $default_container_runtime" echo "Install BeeGFS BeeOND: $beeond" -echo "Storage cluster mount: ${sc_args[*]}" +echo "Storage cluster mounts (${#sc_args[@]}): ${sc_args[*]}" echo "Custom mount: $SHIPYARD_CUSTOM_MOUNTS_FSTAB" echo "Install LIS: $lis" echo "GPU: $gpu" @@ -1787,7 +1793,7 @@ if [ $gluster_on_compute -eq 1 ]; then fi # check or install dependencies for storage cluster mount -if [ -n "$sc_args" ]; then +if [ -n "${sc_args[0]}" ]; then if [ $custom_image -eq 1 ]; then check_for_storage_cluster_software else @@ -1812,7 +1818,7 @@ fi # retrieve required docker images docker_pull_image "mcr.microsoft.com/blobxfer:${blobxferversion}" -docker_pull_image "alfpark/batch-shipyard:${shipyardversion}-cargo" +docker_pull_image "${SHIPYARD_IMAGE_PREFIX}:${shipyardversion}-cargo" # install container runtimes install_singularity @@ -1837,8 +1843,8 @@ fi # touch node prep finished file to preserve idempotency touch "$nodeprepfinished" -cascade_docker_image="alfpark/batch-shipyard:${shipyardversion}-cascade-docker" -cascade_singularity_image="alfpark/batch-shipyard:${shipyardversion}-cascade-singularity" +cascade_docker_image="${SHIPYARD_IMAGE_PREFIX}:${shipyardversion}-cascade-docker" +cascade_singularity_image="${SHIPYARD_IMAGE_PREFIX}:${shipyardversion}-cascade-singularity" # execute cascade if [ $native_mode -eq 0 ] || [ $delay_preload -eq 1 ]; then diff --git a/scripts/shipyard_remotefs_bootstrap.sh b/scripts/shipyard_remotefs_bootstrap.sh index fe1a3bb..b51fac9 100755 --- a/scripts/shipyard_remotefs_bootstrap.sh +++ b/scripts/shipyard_remotefs_bootstrap.sh @@ -852,7 +852,7 @@ if [ $attach_disks -eq 0 ]; then exit 1 fi # setup samba server if specified - if [ -n "$samba_options" ]; then + if [ "${#samba_options[@]}" -ne 0 ]; then # install samba apt-get install -y -q --no-install-recommends samba # parse options diff --git a/scripts/shipyard_slurm_computenode_nodeprep.sh b/scripts/shipyard_slurm_computenode_nodeprep.sh index c13dc7a..f5db3c1 100755 --- a/scripts/shipyard_slurm_computenode_nodeprep.sh +++ b/scripts/shipyard_slurm_computenode_nodeprep.sh @@ -342,7 +342,7 @@ check_provisioning_status() { local reset_host=$2 set +e docker run --rm -v "${SHIPYARD_VAR_DIR}:${SHIPYARD_VAR_DIR}:ro" \ - "alfpark/batch-shipyard:${shipyardversion}-slurm" \ + "mcr.microsoft.com/azure-batch/shipyard:${shipyardversion}-slurm" \ check-provisioning-status --conf "${SHIPYARD_CONF_FILE}" \ --host "$1" rc=$? @@ -405,7 +405,7 @@ if [ -s "$SHIPYARD_HOST_FILE" ]; then docker run --rm -v "${SHIPYARD_CONF_FILE}:${SHIPYARD_CONF_FILE}:ro" \ -v "${AZFILE_MOUNT_DIR}:${AZFILE_MOUNT_DIR}:rw" \ - "alfpark/batch-shipyard:${shipyardversion}-slurm" \ + "mcr.microsoft.com/azure-batch/shipyard:${shipyardversion}-slurm" \ complete-node-assignment --conf "${SHIPYARD_CONF_FILE}" \ --host "$host" touch "$SHIPYARD_COMPLETED_ASSIGNMENT_FILE" @@ -420,7 +420,7 @@ create_batch_shipyard_slurm_config echo "Fetching host assignment" docker run --rm -v "${SHIPYARD_VAR_DIR}:${SHIPYARD_VAR_DIR}:rw" \ -v "${AZFILE_MOUNT_DIR}:${AZFILE_MOUNT_DIR}:rw" \ - "alfpark/batch-shipyard:${shipyardversion}-slurm" \ + "mcr.microsoft.com/azure-batch/shipyard:${shipyardversion}-slurm" \ get-node-assignment --conf "${SHIPYARD_CONF_FILE}" host=$(<${SHIPYARD_HOST_FILE}) echo "Hostname assignment retrieved: $host" diff --git a/scripts/shipyard_slurm_master_bootstrap.sh b/scripts/shipyard_slurm_master_bootstrap.sh index d60d191..0250d90 100755 --- a/scripts/shipyard_slurm_master_bootstrap.sh +++ b/scripts/shipyard_slurm_master_bootstrap.sh @@ -348,7 +348,7 @@ install_docker_host_engine() { } install_storage_cluster_dependencies() { - if [ -z "$sc_args" ]; then + if [ -z "${sc_args[0]}" ]; then return fi log DEBUG "Installing storage cluster dependencies" @@ -433,7 +433,7 @@ process_fstab_entry() { } process_storage_clusters() { - if [ -n "$sc_args" ]; then + if [ -n "${sc_args[0]}" ]; then log DEBUG "Processing storage clusters" IFS='#' read -ra fstabs <<< "$SHIPYARD_STORAGE_CLUSTER_FSTAB" i=0 @@ -521,7 +521,7 @@ echo "Hostname: $HOSTNAME" echo "Batch Shipyard Version: $shipyardversion" echo "AAD cloud: $aad_cloud" echo "Storage: $storage_account:$storage_rg:$storage_prefix" -echo "Storage cluster mount: ${sc_args[*]}" +echo "Storage cluster mounts (${#sc_args[@]}): ${sc_args[*]}" echo "Cluster Id: $cluster_id" echo "Cluster Name: $cluster_name" echo "Cluster user: $cluster_user" @@ -550,7 +550,7 @@ install_packages build-essential libffi-dev libssl-dev python3-dev curl -fSsL https://bootstrap.pypa.io/get-pip.py | python3 # check or install dependencies for storage cluster mount -if [ -n "$sc_args" ]; then +if [ -n "${sc_args[0]}" ]; then install_storage_cluster_dependencies fi # process and mount storage clusters diff --git a/scripts/windows/shipyard_nodeprep_nativedocker.ps1 b/scripts/windows/shipyard_nodeprep_nativedocker.ps1 index babf5e4..a4c924c 100644 --- a/scripts/windows/shipyard_nodeprep_nativedocker.ps1 +++ b/scripts/windows/shipyard_nodeprep_nativedocker.ps1 @@ -99,7 +99,7 @@ if (!$?) } # pull required images -Exec { docker pull alfpark/batch-shipyard:${v}-cargo-windows } +Exec { docker pull mcr.microsoft.com/azure-batch/shipyard:${v}-cargo-windows } # touch node prep finished file New-Item -ItemType file $NodePrepFinished -Force