From 8eb6d7264245aa6ebb3ffd2506ca09d26076d37d Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Sun, 24 May 2020 14:56:45 +0800 Subject: [PATCH 1/3] add docker script for julia mirror --- dockerfiles/julia/Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 dockerfiles/julia/Dockerfile diff --git a/dockerfiles/julia/Dockerfile b/dockerfiles/julia/Dockerfile new file mode 100644 index 0000000..1f39474 --- /dev/null +++ b/dockerfiles/julia/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.6 +LABEL description="A community maintained docker script to set up julia mirror easily." +LABEL maintainer="Johnny Chen " + +ENV JULIA_DEPOT_PATH="/tmp/julia" +ENV JULIA_STATIC_DIR="/julia/static" +ENV JULIA_CLONES_DIR="/julia/clones" + +RUN pip install --upgrade pip && \ + pip install jill==0.6.8 && \ + pip cache purge + +RUN jill install 1.4 --confirm + +WORKDIR /julia +RUN julia -e 'using Pkg; pkg"add https://github.com/johnnychen94/StorageServer.jl#v0.1.0-beta.1"' + +CMD /bin/bash From 6d4c3f81c44240eb99012803980550286f7203b6 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Sun, 24 May 2020 22:12:20 +0800 Subject: [PATCH 2/3] add docstrings --- dockerfiles/julia/Dockerfile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dockerfiles/julia/Dockerfile b/dockerfiles/julia/Dockerfile index 1f39474..fe51b1c 100644 --- a/dockerfiles/julia/Dockerfile +++ b/dockerfiles/julia/Dockerfile @@ -1,3 +1,8 @@ +# For the details and usage of this docker script, please refer to: +# * https://github.com/tuna/tunasync-scripts/pull/71 +# * https://github.com/tuna/issues/issues/837 + +# jill.py requires at least Python 3.6 FROM python:3.6 LABEL description="A community maintained docker script to set up julia mirror easily." LABEL maintainer="Johnny Chen " @@ -6,13 +11,21 @@ ENV JULIA_DEPOT_PATH="/tmp/julia" ENV JULIA_STATIC_DIR="/julia/static" ENV JULIA_CLONES_DIR="/julia/clones" +# jill.py provides two functionalities: +# 1) mirror julia binary releases +# 2) install julia in one line +# FYI: the jill API is quite stable so the version doesn't matter much (it could be okay to set >=0.6.9) RUN pip install --upgrade pip && \ - pip install jill==0.6.8 && \ + pip install jill==0.6.9 && \ pip cache purge +# StorageServer.jl is used to set up a *static* storage server for julia packages, it requires at least Julia 1.4 +# The details of the storage protocol can be found in https://github.com/JuliaLang/Pkg.jl/issues/1377 RUN jill install 1.4 --confirm -WORKDIR /julia +# StorageServer.jl is an experimental toolkit and it won't be registered in General +# The API is likely to be changed in the future, so we fix the version here for stability consideration RUN julia -e 'using Pkg; pkg"add https://github.com/johnnychen94/StorageServer.jl#v0.1.0-beta.1"' +WORKDIR /julia CMD /bin/bash From 61e6c6b359576a8bfa573482277ac56ee3a6d048 Mon Sep 17 00:00:00 2001 From: z4yx Date: Mon, 25 May 2020 11:11:39 +0800 Subject: [PATCH 3/3] Add julia.sh --- julia.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 julia.sh diff --git a/julia.sh b/julia.sh new file mode 100755 index 0000000..bccdd2f --- /dev/null +++ b/julia.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +BASE_URL=${TUNASYNC_UPSTREAM_URL:-"pkg.julialang.org"} +[[ -d "${TUNASYNC_WORKING_DIR}" ]] +cd "${TUNASYNC_WORKING_DIR}" +exec julia -e "using StorageServer; mirror_tarball(\"registries/General\", [\"$BASE_URL\"])" +