From f9ed48ba1305ac46917f06a15dae62cfa12003c3 Mon Sep 17 00:00:00 2001 From: Carsten Behring Date: Tue, 22 Feb 2022 23:28:45 +0100 Subject: [PATCH] use clj bridge and cache classpath --- docker-base/Dockerfile | 17 ++++++++++------- pom.xml | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docker-base/Dockerfile b/docker-base/Dockerfile index ec57884..d2d3da6 100644 --- a/docker-base/Dockerfile +++ b/docker-base/Dockerfile @@ -1,6 +1,8 @@ FROM rocker/r-ver:4.1.1 RUN apt-get update && apt-get -y install --reinstall ca-certificates && update-ca-certificates -RUN apt-get update && apt-get -y install openjdk-11-jdk curl rlwrap libssl-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libffi-dev libbz2-dev automake-1.15 git +RUN apt-get update && apt-get -y install openjdk-11-jdk curl rlwrap libssl-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libreadline-dev libffi-dev libbz2-dev \ + automake-1.15 git liblzma-dev + # python RUN curl -O https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz @@ -15,17 +17,18 @@ RUN pip3 install -U numpy wheel scikit-learn cython RUN git clone https://git.savannah.gnu.org/git/apl.git RUN cd apl/trunk && ./configure && make develop_lib && make install -RUN export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 && pip3 install python-javabridge - - RUN curl -O https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.3-linux-x86_64.tar.gz \ && tar -xvzf julia-1.5.3-linux-x86_64.tar.gz RUN mv julia-1.5.3/ /opt/ RUN ln -s /opt/julia-1.5.3/bin/julia /usr/local/bin/julia -RUN curl https://raw.githubusercontent.com/clj-python/libpython-clj/dcdcc77ba582a7a09d698d80c2a991cf3d8e151a/cljbridge.py -o /usr/local/lib/python3.10/cljbridge.py +RUN export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 && pip3 install cljbridge==0.0.7 COPY deps.edn . -RUN clj -P +RUN clj -P -Srepro -Sdeps '{:mvn/local-repo "/tmp/.m2/repository"}' + +EXPOSE 12345 +ENV JULIA_HOME=/opt/julia-1.5.3 +CMD ["python3", "-c", "from clojurebridge import cljbridge;cljbridge.init_jvm(start_repl=True,port=12345,bind='0.0.0.0',mvn_local_repo='/tmp/.m2/repository')"] -CMD ["python3", "-c", "import cljbridge\ncljbridge.init_jvm(start_repl=True,port=12345,bind='0.0.0.0')"] +#clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.5"}}}' -Sdeps '{:mvn/local-repo "/tmp/.m2/repository"}' '-Spath' diff --git a/pom.xml b/pom.xml index c4e733a..9d6d2c2 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ https://github.com/behrica/clj-py-r-template scm:git:git://github.com/behrica/clj-py-r-template.git scm:git:ssh://git@github.com/behrica/clj-py-r-template.git - e6bf9efde821e1cd69fbaf0e2126632ea540b2fa + b7e84c8ec36cf162a8337e208bafa90ffb18c037 src