From 5a94a4048e3daafeb1cf214f5c0089d8514c5e9b Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Mon, 18 Jan 2021 11:40:11 +0200 Subject: [PATCH] Update agent and services docker files --- docker/agent/Dockerfile | 4 ++-- docker/agent/entrypoint.sh | 14 +++++++------- docker/services/Dockerfile | 2 +- docker/services/entrypoint.sh | 18 ++++++++++-------- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/docker/agent/Dockerfile b/docker/agent/Dockerfile index faf81d9..8ff8dce 100644 --- a/docker/agent/Dockerfile +++ b/docker/agent/Dockerfile @@ -10,9 +10,9 @@ RUN apt-get dist-upgrade -y RUN apt-get install -y curl python3-pip git RUN curl -sSL https://get.docker.com/ | sh RUN python3 -m pip install -U pip -RUN python3 -m pip install trains-agent +RUN python3 -m pip install clearml-agent RUN python3 -m pip install -U "cryptography>=2.9" -ENV TRAINS_DOCKER_SKIP_GPUS_FLAG=1 +ENV CLEARML_DOCKER_SKIP_GPUS_FLAG=1 ENTRYPOINT ["/usr/agent/entrypoint.sh"] diff --git a/docker/agent/entrypoint.sh b/docker/agent/entrypoint.sh index fc2cb8d..fed5560 100755 --- a/docker/agent/entrypoint.sh +++ b/docker/agent/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh LOWER_PIP_UPDATE_VERSION="$(echo "$PIP_UPDATE_VERSION" | tr '[:upper:]' '[:lower:]')" -LOWER_TRAINS_AGENT_UPDATE_VERSION="$(echo "$TRAINS_AGENT_UPDATE_VERSION" | tr '[:upper:]' '[:lower:]')" +LOWER_CLEARML_AGENT_UPDATE_VERSION="$(echo "${CLEARML_AGENT_UPDATE_VERSION:-$TRAINS_AGENT_UPDATE_VERSION}" | tr '[:upper:]' '[:lower:]')" if [ "$LOWER_PIP_UPDATE_VERSION" = "yes" ] || [ "$LOWER_PIP_UPDATE_VERSION" = "true" ] ; then python3 -m pip install -U pip @@ -9,11 +9,11 @@ elif [ ! -z "$LOWER_PIP_UPDATE_VERSION" ] ; then python3 -m pip install pip$LOWER_PIP_UPDATE_VERSION ; fi -echo "TRAINS_AGENT_UPDATE_VERSION = $LOWER_TRAINS_AGENT_UPDATE_VERSION" -if [ "$LOWER_TRAINS_AGENT_UPDATE_VERSION" = "yes" ] || [ "$LOWER_TRAINS_AGENT_UPDATE_VERSION" = "true" ] ; then - python3 -m pip install trains-agent -U -elif [ ! -z "$LOWER_TRAINS_AGENT_UPDATE_VERSION" ] ; then - python3 -m pip install trains-agent$LOWER_TRAINS_AGENT_UPDATE_VERSION ; +echo "CLEARML_AGENT_UPDATE_VERSION = $LOWER_CLEARML_AGENT_UPDATE_VERSION" +if [ "$LOWER_CLEARML_AGENT_UPDATE_VERSION" = "yes" ] || [ "$LOWER_CLEARML_AGENT_UPDATE_VERSION" = "true" ] ; then + python3 -m pip install clearml-agent -U +elif [ ! -z "$LOWER_CLEARML_AGENT_UPDATE_VERSION" ] ; then + python3 -m pip install clearml-agent$LOWER_CLEARML_AGENT_UPDATE_VERSION ; fi -python3 -m trains_agent daemon --docker "$TRAINS_AGENT_DEFAULT_BASE_DOCKER" --force-current-version $TRAINS_AGENT_EXTRA_ARGS \ No newline at end of file +python3 -m clearml_agent daemon --docker "${CLEARML_AGENT_DEFAULT_BASE_DOCKER:-$TRAINS_AGENT_DEFAULT_BASE_DOCKER}" --force-current-version ${CLEARML_AGENT_EXTRA_ARGS:-$TRAINS_AGENT_EXTRA_ARGS} \ No newline at end of file diff --git a/docker/services/Dockerfile b/docker/services/Dockerfile index f758538..3439a21 100644 --- a/docker/services/Dockerfile +++ b/docker/services/Dockerfile @@ -19,7 +19,7 @@ RUN locale-gen en_US.UTF-8 RUN apt-get install -y curl python3-pip git RUN curl -sSL https://get.docker.com/ | sh RUN python3 -m pip install -U pip -RUN python3 -m pip install trains-agent +RUN python3 -m pip install clearml-agent RUN python3 -m pip install -U "cryptography>=2.9" ENTRYPOINT ["/usr/agent/entrypoint.sh"] diff --git a/docker/services/entrypoint.sh b/docker/services/entrypoint.sh index 615b205..8c14542 100755 --- a/docker/services/entrypoint.sh +++ b/docker/services/entrypoint.sh @@ -1,14 +1,16 @@ #!/bin/sh -if [ -z "$TRAINS_FILES_HOST" ]; then - TRAINS_HOST_IP=${TRAINS_HOST_IP:-$(curl -s https://ifconfig.me/ip)} +CLEARML_FILES_HOST=${CLEARML_FILES_HOST:-$TRAINS_FILES_HOST} + +if [ -z "$CLEARML_FILES_HOST" ]; then + CLEARML_HOST_IP=${CLEARML_HOST_IP:-${TRAINS_HOST_IP:-$(curl -s https://ifconfig.me/ip)}} fi -TRAINS_FILES_HOST=${TRAINS_FILES_HOST:-"http://$TRAINS_HOST_IP:8081"} -TRAINS_WEB_HOST=${TRAINS_WEB_HOST:-"http://$TRAINS_HOST_IP:8080"} -TRAINS_API_HOST=${TRAINS_API_HOST:-"http://$TRAINS_HOST_IP:8008"} +CLEARML_FILES_HOST=${CLEARML_FILES_HOST:-${TRAINS_FILES_HOST:-"http://$CLEARML_HOST_IP:8081"}} +CLEARML_WEB_HOST=${CLEARML_WEB_HOST:-${TRAINS_WEB_HOST:-"http://$CLEARML_HOST_IP:8080"}} +CLEARML_API_HOST=${CLEARML_API_HOST:-${TRAINS_API_HOST:-"http://$CLEARML_HOST_IP:8008"}} -echo $TRAINS_FILES_HOST $TRAINS_WEB_HOST $TRAINS_API_HOST 1>&2 +echo $CLEARML_FILES_HOST $CLEARML_WEB_HOST $CLEARML_API_HOST 1>&2 -python3 -m pip install -q -U "trains-agent${TRAINS_AGENT_UPDATE_VERSION}" -trains-agent daemon --services-mode --queue services --create-queue --docker "$TRAINS_AGENT_DEFAULT_BASE_DOCKER" --cpu-only $TRAINS_AGENT_EXTRA_ARGS +python3 -m pip install -q -U "clearml-agent${CLEARML_AGENT_UPDATE_VERSION:-$TRAINS_AGENT_UPDATE_VERSION}" +clearml-agent daemon --services-mode --queue services --create-queue --docker "${CLEARML_AGENT_DEFAULT_BASE_DOCKER:-$TRAINS_AGENT_DEFAULT_BASE_DOCKER}" --cpu-only ${CLEARML_AGENT_EXTRA_ARGS:-$TRAINS_AGENT_EXTRA_ARGS} \ No newline at end of file