From 268eddefab06a564b1aeb922240cd28cc5f3af53 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Keck <jean-baptiste.keck@univ-grenoble-alpes.fr> Date: Sat, 24 Sep 2022 11:16:36 +0200 Subject: [PATCH] Update docker/ci scripts [ci skip] --- ci/utils/build_docker_image.sh | 6 +++--- ci/utils/pull_docker_image.sh | 13 +++++++------ ci/utils/push_docker_image.sh | 12 ++++++------ ci/utils/run_ci.sh | 8 ++++---- ci/utils/run_debug.sh | 8 ++++---- ci/utils/run_docker_image.sh | 8 ++++---- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/ci/utils/build_docker_image.sh b/ci/utils/build_docker_image.sh index da9408dfa..2ea5e089e 100755 --- a/ci/utils/build_docker_image.sh +++ b/ci/utils/build_docker_image.sh @@ -17,7 +17,7 @@ set -feu -o pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" NTHREADS="$(nproc)" -UBUNTU_RELEASE=${1:-jammy} -GRICAD_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' +DOCKER_IMAGE_TAG=${1:-jammy} +HYSOP_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' -docker build --rm=true --build-arg "NTHREADS=$NTHREADS" -t "${GRICAD_REGISTRY_URL}/particle_methods/hysop:${UBUNTU_RELEASE}" -f "${SCRIPT_DIR}/../docker_images/ubuntu/${UBUNTU_RELEASE}/Dockerfile" "${SCRIPT_DIR}/../.." +docker build --rm=true --build-arg "NTHREADS=$NTHREADS" -t "${HYSOP_REGISTRY_URL}/particle_methods/hysop:${DOCKER_IMAGE_TAG}" -f "${SCRIPT_DIR}/../docker_images/ubuntu/${DOCKER_IMAGE_TAG}/Dockerfile" "${SCRIPT_DIR}/../.." diff --git a/ci/utils/pull_docker_image.sh b/ci/utils/pull_docker_image.sh index c77068138..46d12f5a6 100755 --- a/ci/utils/pull_docker_image.sh +++ b/ci/utils/pull_docker_image.sh @@ -15,12 +15,13 @@ ## limitations under the License. ## set -euf -o pipefail -UBUNTU_RELEASE=${1:-jammy} -GRICAD_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' +DOCKER_IMAGE_TAG=${1:-jammy} +HYSOP_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' docker logout -if [[ -z "${GRICAD_USERNAME}" ]] || [[ -z "${GRICAD_REGISTRY_TOKEN}" ]]; then - docker login "${GRICAD_REGISTRY_URL}" +if [[ -z "${HYSOP_REGISTRY_USERNAME}" ]] || [[ -z "${HYSOP_REGISTRY_TOKEN}" ]]; then + docker login "${HYSOP_REGISTRY_URL}" else - echo "${GRICAD_REGISTRY_TOKEN}" | docker login "${GRICAD_REGISTRY_URL}" --username "${GRICAD_USERNAME}" --password-stdin + echo "${HYSOP_REGISTRY_TOKEN}" | docker login "${HYSOP_REGISTRY_URL}" --username "${HYSOP_REGISTRY_USERNAME}" --password-stdin fi -docker pull "${GRICAD_REGISTRY_URL}/particle_methods/hysop:${UBUNTU_RELEASE}" +docker pull "${HYSOP_REGISTRY_URL}/particle_methods/hysop:${DOCKER_IMAGE_TAG}" +docker logout diff --git a/ci/utils/push_docker_image.sh b/ci/utils/push_docker_image.sh index 06d50ffae..c4e9a855e 100755 --- a/ci/utils/push_docker_image.sh +++ b/ci/utils/push_docker_image.sh @@ -15,13 +15,13 @@ ## limitations under the License. ## set -euf -o pipefail -UBUNTU_RELEASE=${1:-jammy} -GRICAD_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' +DOCKER_IMAGE_TAG=${1:-jammy} +HYSOP_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' docker logout -if [[ -z "${GRICAD_USERNAME}" ]] || [[ -z "${GRICAD_REGISTRY_TOKEN}" ]]; then - docker login "${GRICAD_REGISTRY_URL}" +if [[ -z "${HYSOP_REGISTRY_USERNAME}" ]] || [[ -z "${HYSOP_REGISTRY_TOKEN}" ]]; then + docker login "${HYSOP_REGISTRY_URL}" else - echo "${GRICAD_REGISTRY_TOKEN}" | docker login "${GRICAD_REGISTRY_URL}" --username "${GRICAD_USERNAME}" --password-stdin + echo "${HYSOP_REGISTRY_TOKEN}" | docker login "${HYSOP_REGISTRY_URL}" --username "${HYSOP_REGISTRY_USERNAME}" --password-stdin fi -docker push "${GRICAD_REGISTRY_URL}/particle_methods/hysop:${UBUNTU_RELEASE}" +docker push "${HYSOP_REGISTRY_URL}/particle_methods/hysop:${DOCKER_IMAGE_TAG}" docker logout diff --git a/ci/utils/run_ci.sh b/ci/utils/run_ci.sh index bc9f75140..a279f4e36 100755 --- a/ci/utils/run_ci.sh +++ b/ci/utils/run_ci.sh @@ -16,12 +16,12 @@ ## set -feu -o pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -UBUNTU_RELEASE=${1:-jammy} -GRICAD_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' -DOCKER_IMG="${GRICAD_REGISTRY_URL}/particle_methods/hysop:${UBUNTU_RELEASE}" +DOCKER_IMAGE_TAG=${1:-jammy} +HYSOP_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' +DOCKER_IMG="${HYSOP_REGISTRY_URL}/particle_methods/hysop:${DOCKER_IMAGE_TAG}" CONTAINER_ID='hysop_build_and_test' -if [[ $UBUNTU_RELEASE == *_cuda ]]; then +if [[ ${DOCKER_IMAGE_TAG} == *_cuda ]]; then EXTRA_ARGS="--gpus all" else EXTRA_ARGS="" diff --git a/ci/utils/run_debug.sh b/ci/utils/run_debug.sh index 7bf8c6692..bd6f91190 100755 --- a/ci/utils/run_debug.sh +++ b/ci/utils/run_debug.sh @@ -16,12 +16,12 @@ ## set -feu -o pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -UBUNTU_RELEASE=${1:-jammy} -GRICAD_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' -DOCKER_IMG="${GRICAD_REGISTRY_URL}/particle_methods/hysop:${UBUNTU_RELEASE}" +DOCKER_IMAGE_TAG=${1:-jammy} +HYSOP_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' +DOCKER_IMG="${HYSOP_REGISTRY_URL}/particle_methods/hysop:${DOCKER_IMAGE_TAG}" CONTAINER_ID='hysop_build_and_debug' -if [[ $UBUNTU_RELEASE == *_cuda ]]; then +if [[ ${DOCKER_IMAGE_TAG} == *_cuda ]]; then EXTRA_ARGS="--gpus all" else EXTRA_ARGS="" diff --git a/ci/utils/run_docker_image.sh b/ci/utils/run_docker_image.sh index 2372adf32..47472d361 100755 --- a/ci/utils/run_docker_image.sh +++ b/ci/utils/run_docker_image.sh @@ -16,13 +16,13 @@ ## set -feu -o pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -UBUNTU_RELEASE=${1:-jammy} -GRICAD_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' +DOCKER_IMAGE_TAG=${1:-jammy} +HYSOP_REGISTRY_URL='gricad-registry.univ-grenoble-alpes.fr' -if [[ $UBUNTU_RELEASE == *_cuda ]]; then +if [[ ${DOCKER_IMAGE_TAG} == *_cuda ]]; then EXTRA_ARGS="--gpus all" else EXTRA_ARGS="" fi -docker run --cap-add=SYS_PTRACE ${EXTRA_ARGS} -it -v "${SCRIPT_DIR}/../..:/hysop:ro" "${GRICAD_REGISTRY_URL}/particle_methods/hysop:${UBUNTU_RELEASE}" +docker run --cap-add=SYS_PTRACE ${EXTRA_ARGS} -it -v "${SCRIPT_DIR}/../..:/hysop:ro" "${HYSOP_REGISTRY_URL}/particle_methods/hysop:${DOCKER_IMAGE_TAG}" -- GitLab