Skip to content

Commit

Permalink
use clj bridge and cache classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
behrica committed Feb 22, 2022
1 parent ff59b0b commit f9ed48b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions docker-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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'
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<url>https://github.com/behrica/clj-py-r-template</url>
<connection>scm:git:git://github.com/behrica/clj-py-r-template.git</connection>
<developerConnection>scm:git:ssh://[email protected]/behrica/clj-py-r-template.git</developerConnection>
<tag>e6bf9efde821e1cd69fbaf0e2126632ea540b2fa</tag>
<tag>b7e84c8ec36cf162a8337e208bafa90ffb18c037</tag>
</scm>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down

0 comments on commit f9ed48b

Please sign in to comment.