diff --git a/src/Taggers.jl b/src/Taggers.jl index 637a90c037bd4fcf774d3a4184087c0cf2bcc552..206406fc76b8e4312a75756cd1311571270bab81 100644 --- a/src/Taggers.jl +++ b/src/Taggers.jl @@ -227,7 +227,7 @@ function parsekwargs!(args, kwargs) end function run(tagger, switch, kwargs, extra...) - args = ["--model-instance", tagger.model_instance] + args = Any["--model-instance", tagger.model_instance] for (p, v) in pairs(extra) if !isnothing(v) push!(args, p) diff --git a/test/deploy_and_test.sh b/test/deploy_and_test.sh index 42a2db685c2f28bdff0a97d47ef549c181182743..91bc7e83f30b5a079cd7bd86b1ab8104fb9c649e 100755 --- a/test/deploy_and_test.sh +++ b/test/deploy_and_test.sh @@ -10,22 +10,21 @@ # * LOCAL_SCENARII: can be set to 1 to overwrite LarvaTagger.jl's test/scenarii.sh file # with the scenarii.sh file that comes along the present script (same directory) # * LAUNCHER: default is "srun" if Slurm is available, otherwise nothing -# * JULIA_PROJECT: where to find PyCall (do not modify) # Example on Maestro (GPU-accelerated): # SLURM_OPTS='-p dbc_pmo -q dbc -c 4' JULIA_THREADS=4 ./deploy_and_test.sh # or (CPU-only): # SLURM_OPTS='-p dedicated -q fast -c 16' JULIA_THREADS=16 ./deploy_and_test.sh -if [ -n "$1" ] && [ "$1" = "-f" ] || [ "$1" = "--force" ]; then - rm -rf LarvaTagger -elif [ -d LarvaTagger ]; then - echo "\`$0\` needs to make a local LarvaTagger directory" - echo "but this directory already exists." - echo "Run \`$0 --force\` or pick another location." +if ! [ -f scripts/install.sh ]; then + echo "Call `basename $0` from the project's root directory:" + echo " test/deploy_and_test.sh" exit 1 fi +scripts/install.sh --uninstall +scripts/install.sh --with-backend --experimental + ############# ## Maestro ## ############# @@ -33,13 +32,6 @@ fi # SSL verification can be disabled for git clone to work: # export GIT_SSL_NO_VERIFY=true -if ! julia -v &> /dev/null; then - # do NOT use juliaup to install Julia - module load Python &> /dev/null # Maestro - python3 -m pip install jill - python3 -m jill install -v 1.10.0 -c -fi - # h5diff (for tests) on Maestro if ! h5diff -V &> /dev/null; then module load hdf5 &> /dev/null @@ -60,68 +52,39 @@ fi ############# CURDIR=$(pwd) - -mkdir -p LarvaTagger && cd $_ +LTROOT=$HOME/.local/share/larvatagger/LarvaTagger.jl # shunit2 is for tests specifically if [ -z "$(which shunit2)" ]; then - git clone -c advice.detachedHead=false -b v2.1.8 https://github.com/kward/shunit2 + (cd "$LTROOT/test" && \ + git clone -c advice.detachedHead=false -b v2.1.8 https://github.com/kward/shunit2) fi -## comment out the below line to build a development environment -#CLONE_OPTS=" --depth 1 --no-tags --single-branch -b dev" -#git clone$CLONE_OPTS https://gitlab.pasteur.fr/nyx/planarlarvae.jl PlanarLarvae -#git clone$CLONE_OPTS https://gitlab.pasteur.fr/nyx/LarvaTagger.jl -BRANCH=dev -wget -O- https://gitlab.pasteur.fr/nyx/planarlarvae.jl/-/archive/${BRANCH}/planarlarvae.jl-${BRANCH}.tar.gz | tar zxv && mv planarlarvae.jl-${BRANCH} PlanarLarvae -wget -O- https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/archive/${BRANCH}/larvatagger.jl-${BRANCH}.tar.gz | tar zxv && mv larvatagger.jl-${BRANCH} LarvaTagger.jl -ln -s $(realpath LarvaTagger.jl) LarvaTagger -#git clone$CLONE_OPTS https://gitlab.pasteur.fr/nyx/TaggingBackends -#git clone$CLONE_OPTS https://gitlab.pasteur.fr/nyx/MaggotUBA-adapter -wget -O- https://gitlab.pasteur.fr/nyx/TaggingBackends/-/archive/${BRANCH}/TaggingBackends-${BRANCH}.tar.gz | tar zxv && mv TaggingBackends-${BRANCH} TaggingBackends -wget -O- https://gitlab.pasteur.fr/nyx/MaggotUBA-adapter/-/archive/${BRANCH}/MaggotUBA-adapter-${BRANCH}.tar.gz | tar zxv && mv MaggotUBA-adapter-${BRANCH} MaggotUBA-adapter -ln -s $(realpath MaggotUBA-adapter) MaggotUBA - -# the poetry install step may not be necessary -(cd TaggingBackends && julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.develop(path="../PlanarLarvae")' && poetry env use python3.8 && poetry install) -# the step below may not be necessary -(cd TaggingBackends && JULIA_PROJECT=$(pwd) poetry run python -c 'import julia; julia.install()') - -(cd MaggotUBA && poetry env use python3.8 && (cat requirements.txt | xargs -I % sh -c 'poetry add "%"') && poetry install -v && poetry remove taggingbackends && poetry add ../TaggingBackends && scripts/make_models.jl default) - -cd LarvaTagger || exit 1 -julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.develop(path="../PlanarLarvae")' - -# the remainder of this script is test-specific - -if [ -f ../../LarvaTagger_test_data.tgz ]; then +if [ -f LarvaTagger_test_data.tgz ]; then # To generate the test data, first run the tests with environment variable KEEP_MODEL_FILES=1 # copy the LarvaTagger/MaggotUBA/models/test_train_* directories into LarvaTagger/LarvaTagger.jl/test/data # and build the archive from the LarvaTagger/LarvaTagger.jl directory. # For example: # KEEP_MODEL_FILES=1 ./deploy_and_test.sh - # cd LarvaTagger/LarvaTagger.jl + # cd ~/.local/share/larvatagger/LarvaTagger/LarvaTagger.jl # rm -rf test/data/test_train_* # cp -Rp ../MaggotUBA/models/test_train_* test/data/ # tar zcvf LarvaTagger_test_data.tgz test/data/* - # mv LarvaTagger_test_data.tgz ../../ - tar zxvf ../../LarvaTagger_test_data.tgz + (cd "$LTROOT" && tar zxvf LarvaTagger_test_data.tgz) else # Not recommended; reproducibility is not guarantee across hosts or architectures yet #wget -O- https://dl.pasteur.fr/fop/8MvgygD4/LarvaTagger_test_data.tgz | tar zxv - wget -O- https://dl.pasteur.fr/fop/WdnyHdKR/240208_LarvaTagger_test_data.tgz | tar zxv + (cd "$LTROOT" && \ + wget -O- https://dl.pasteur.fr/fop/t8CtkCpY/240208_LarvaTagger_test_data.tgz | tar zxv) fi if [ "$LOCAL_SCENARII" = "1" ]; then - if [ -f "$CURDIR/scenarii.sh" ]; then cp "$CURDIR/scenarii.sh" test/ - elif [ -f "$CURDIR/test/scenarii.sh" ]; then cp "$CURDIR/test/scenarii.sh" test/ - else echo "Cannot find a local scenarii.sh file" + if [ -f "test/scenarii.sh" ]; then + cp "test/scenarii.sh" "$LTROOT/test/" + else + echo "Cannot find a local scenarii.sh file" fi fi -if [ -z "$(which shunit2)" ]; then - ln -s "$CURDIR/LarvaTagger/shunit2/shunit2" test/ -fi - echo "${launcher}test/scenarii.sh" -${launcher}test/scenarii.sh +(cd "$LTROOT" && ${launcher}test/scenarii.sh)