diff --git a/README.md b/README.md index 0703838e7f34f6024b247a034bead3cd014fd3ff..af5e1d3d1c8c4598cd149755019865484aab9771 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ To natively run `LarvaTagger.jl`, you will need [`julia>=1.6`](https://julialang If you are not familiar with installing Julia, you may appreciate installation helpers such as [JILL.py](https://github.com/johnnychen94/jill.py). -Alternatively, if you have Docker installed, take a look at the [dedicated instructions page](https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/tree/docker/recipes). +Alternatively, if you have Docker installed, take a look at the [dedicated instructions page](https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/tree/main/recipes). ## Install diff --git a/recipes/Dockerfile b/recipes/Dockerfile index 04b44f00361cba35779325a036d474c059411742..da7c24fb12c6f6bcb5a64cbd54ea63c01c4a70d8 100644 --- a/recipes/Dockerfile +++ b/recipes/Dockerfile @@ -9,8 +9,8 @@ RUN apt-get update && apt-get install -y \ && julia --project=$DIRNAME -e 'using Pkg; Pkg.instantiate()' \ && ln -s /$DIRNAME/scripts/larvatagger.jl /bin -# COPY requires at least one file defined, hence `test/precompile.jl` -COPY test/precompile.jl test/data_sample* $DIRNAME/test/ +# COPY requires at least one file defined, hence `test/precompile.sh` +COPY test/precompile.sh test/data_sample* $DIRNAME/test/ ARG TIMEZONE=UTC RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \ diff --git a/recipes/README.md b/recipes/README.md index eab2798d5e99490e51a91ae07aa8bcef696b1d8c..d1c7514217dc6cbe7d52fbaf98dfd3b8a2a9a2d7 100644 --- a/recipes/README.md +++ b/recipes/README.md @@ -2,7 +2,7 @@ ## Getting available images -Images are published on [Docker Hub](https://hub.docker.com/repository/docker/flaur/larvatagger). +Images are published on [Docker Hub](https://hub.docker.com/r/flaur/larvatagger/tags). They ship with `LarvaTagger.jl` and, optionally, with a MaggotUBA-based toy backend for automatic tagging. @@ -11,17 +11,19 @@ Try: docker pull flaur/larvatagger:0.5-20220418 ``` -Beware that images that ship with backends are relatively large files (>6GB). +Beware that images that ship with backends are relatively large files (>6GB on disk). ## Running an image A number of options must be passed to the `docker` command for the container to open a data file: ``` -docker -iv $(pwd):/data -p 9284:9284 larvatagger open /data/path/to/your/file +docker -iv $(pwd):/data -p 9284:9284 larvatagger open /data/path/to/your/file --browser ``` with `path/to/your/file` a relative path to your file. +In PowerShell on Windows, use `${PWD}` instead of `$(pwd)`. + In the command above, `/data` represents the local directory, made available within the container. This is required, since no files outside the container can be accessed. diff --git a/scripts/larvatagger.sh b/scripts/larvatagger.sh index e90e3671118345cfc9cbc600fda87e3f0d7aac73..c574c7d7ce3b535bcfcb59a304ae41bc1dc9e90b 100755 --- a/scripts/larvatagger.sh +++ b/scripts/larvatagger.sh @@ -33,12 +33,15 @@ fi done DOCKER_ARGS="--build-arg TIMEZONE=$(cat /etc/timezone) $DOCKER_ARGS" if [ "$BUILD" == "--dev" ]; then -docker build -t "${LARVATAGGER_IMAGE}:dev" -f recipes/Dockerfile.local ${DOCKER_ARGS}. +if ! [[ "$LARVATAGGER_IMAGE" == *:* ]]; then LARVATAGGER_IMAGE="${LARVATAGGER_IMAGE}:dev"; fi +docker build -t "$LARVATAGGER_IMAGE" -f recipes/Dockerfile.local ${DOCKER_ARGS}. elif [ "$BUILD" == "--stable" ]; then -docker build -t "${LARVATAGGER_IMAGE}:stable" -f recipes/Dockerfile ${DOCKER_ARGS}. +if ! [[ "$LARVATAGGER_IMAGE" == *:* ]]; then LARVATAGGER_IMAGE="${LARVATAGGER_IMAGE}:stable"; fi +docker build -t "$LARVATAGGER_IMAGE" -f recipes/Dockerfile ${DOCKER_ARGS}. else +if ! [[ "$LARVATAGGER_IMAGE" == *:* ]]; then LARVATAGGER_IMAGE="${LARVATAGGER_IMAGE}:latest"; fi if [ -z "$LARVATAGGER_DEFAULT_BRANCH" ]; then LARVATAGGER_DEFAULT_BRANCH=dev; fi -docker build -t "${LARVATAGGER_IMAGE}:latest" -f recipes/Dockerfile ${DOCKER_ARGS}--build-arg BRANCH=$LARVATAGGER_DEFAULT_BRANCH . +docker build -t "$LARVATAGGER_IMAGE" -f recipes/Dockerfile ${DOCKER_ARGS}--build-arg BRANCH=$LARVATAGGER_DEFAULT_BRANCH . fi #rm -rf ./external ;; diff --git a/test/precompile.sh b/test/precompile.sh index 970dfa413aab5a0eda86f6151c9202fb7a618d53..6c25d917caa9c309f8d02aeb47bb732958e83e3e 100755 --- a/test/precompile.sh +++ b/test/precompile.sh @@ -25,7 +25,8 @@ using Pkg Pkg.add([\"$client\",\"PackageCompiler\"]) using PackageCompiler println(\"🢃 🢃 🢃 Includes logs from coverage script. Please ignore 🢃 🢃 🢃\") -create_sysimage(String[], sysimage_path=\"larvatagger.so\", precompile_execution_file=\"$script\") +create_sysimage(String[], sysimage_path=\"larvatagger.so\", precompile_execution_file=\"$script\", + cpu_target=PackageCompiler.default_app_cpu_target()) println(\"🢠🢠🢠Includes logs from coverage script. Please ignore 🢠🢠ðŸ¢\") #Pkg.rm([\"PackageCompiler\",\"$client\"])"