FLARE-forecast / FLARE-containers

Docker containers to run FLARE forecast
0 stars 2 forks source link

Choose Container Version to Run #35

Open vahid-dan opened 3 years ago

vahid-dan commented 3 years ago

docker-host.sh should run the version of container specified by FLARE_VERSION environment variable (latest tag if nothing set) instead of reading the version from container.version in the flare-config.yml file.

The main part to be changed is the last line in the flare-host.sh:

([[ "${arg_o:?}" = "1" ]] && chmod -R 777 ${DIRECTORY_CONTAINER} && cp -r ${DIRECTORY_HOST_SHARED} ${DIRECTORY_CONTAINER} && ${DIRECTORY_CONTAINER}/${CONTAINER_SCRIPT} -d ${CONTAINER_NAME}) \
  || docker run --rm -v ${DIRECTORY_HOST_SHARED}:${DIRECTORY_CONTAINER_SHARED} ${DOCKERHUB_ID}/${CONTAINER_NAME}:${CONTAINER_VERSION} ${DIRECTORY_CONTAINER}/${CONTAINER_SCRIPT} ${CONTAINER_NAME}

The behavior should be similar to choosing the container image version while running flare-install.sh:

$ source <(wget -O - https://raw.githubusercontent.com/FLARE-forecast/FLARE-containers/$([[ -z "$FLARE_VERSION" ]] && echo 'latest' || echo "$FLARE_VERSION")/commons/flare-install.sh | /usr/bin/env bash -s $FLARE_CONTAINER_NAME $([[ -z "$FLARE_VERSION" ]] && echo 'latest' || echo "$FLARE_VERSION"))
Yun-Jung commented 3 years ago

@vahid-dan Done!