Skip to content
Snippets Groups Projects
Commit 6a2a3307 authored by François  LAURENT's avatar François LAURENT
Browse files

docker testing on Windows

parent a27719e0
No related branches found
No related tags found
No related merge requests found
Pipeline #83182 passed
...@@ -8,7 +8,7 @@ To natively run `LarvaTagger.jl`, you will need [`julia>=1.6`](https://julialang ...@@ -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). 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 ## Install
......
...@@ -9,8 +9,8 @@ RUN apt-get update && apt-get install -y \ ...@@ -9,8 +9,8 @@ RUN apt-get update && apt-get install -y \
&& julia --project=$DIRNAME -e 'using Pkg; Pkg.instantiate()' \ && julia --project=$DIRNAME -e 'using Pkg; Pkg.instantiate()' \
&& ln -s /$DIRNAME/scripts/larvatagger.jl /bin && ln -s /$DIRNAME/scripts/larvatagger.jl /bin
# COPY requires at least one file defined, hence `test/precompile.jl` # COPY requires at least one file defined, hence `test/precompile.sh`
COPY test/precompile.jl test/data_sample* $DIRNAME/test/ COPY test/precompile.sh test/data_sample* $DIRNAME/test/
ARG TIMEZONE=UTC ARG TIMEZONE=UTC
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \ RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## Getting available images ## 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. They ship with `LarvaTagger.jl` and, optionally, with a MaggotUBA-based toy backend for automatic tagging.
...@@ -11,17 +11,19 @@ Try: ...@@ -11,17 +11,19 @@ Try:
docker pull flaur/larvatagger:0.5-20220418 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 ## Running an image
A number of options must be passed to the `docker` command for the container to open a data file: 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. 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. 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. This is required, since no files outside the container can be accessed.
......
...@@ -33,12 +33,15 @@ fi ...@@ -33,12 +33,15 @@ fi
done done
DOCKER_ARGS="--build-arg TIMEZONE=$(cat /etc/timezone) $DOCKER_ARGS" DOCKER_ARGS="--build-arg TIMEZONE=$(cat /etc/timezone) $DOCKER_ARGS"
if [ "$BUILD" == "--dev" ]; then 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 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 else
if ! [[ "$LARVATAGGER_IMAGE" == *:* ]]; then LARVATAGGER_IMAGE="${LARVATAGGER_IMAGE}:latest"; fi
if [ -z "$LARVATAGGER_DEFAULT_BRANCH" ]; then LARVATAGGER_DEFAULT_BRANCH=dev; 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 fi
#rm -rf ./external #rm -rf ./external
;; ;;
......
...@@ -25,7 +25,8 @@ using Pkg ...@@ -25,7 +25,8 @@ using Pkg
Pkg.add([\"$client\",\"PackageCompiler\"]) Pkg.add([\"$client\",\"PackageCompiler\"])
using PackageCompiler using PackageCompiler
println(\"🢃 🢃 🢃 Includes logs from coverage script. Please ignore 🢃 🢃 🢃\") 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 🢁 🢁 🢁\") println(\"🢁 🢁 🢁 Includes logs from coverage script. Please ignore 🢁 🢁 🢁\")
#Pkg.rm([\"PackageCompiler\",\"$client\"])" #Pkg.rm([\"PackageCompiler\",\"$client\"])"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment