Skip to content

Commit 5c9b2f9

Browse files
committed
adding docker workflow
Signed-off-by: Paulito Palmes, PhD <ppalmes@gmail.com>
1 parent f2a5597 commit 5c9b2f9

File tree

9 files changed

+48496
-0
lines changed

9 files changed

+48496
-0
lines changed

docker/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM debian:buster AS build
2+
LABEL maintainer="paulpalmes@ie.ibm.com"
3+
4+
WORKDIR /
5+
6+
RUN set -ex
7+
8+
RUN apt-get update --allow-releaseinfo-change && apt-get -y upgrade && \
9+
apt-get install -y tzdata git wget build-essential
10+
11+
RUN apt-get clean -y && apt-get autoremove -y && apt-get autoclean -y
12+
13+
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.1/julia-1.1.1-linux-x86_64.tar.gz && tar xzvf julia-1.1.1-linux-x86_64.tar.gz
14+
ENV PATH="$PATH:/julia-1.1.1/bin"
15+
16+
RUN git clone https://github.com/JuliaLang/PackageCompiler.jl.git
17+
18+
COPY main.jl /
19+
RUN /julia-1.1.1/bin/julia -e 'using Pkg; pkg"up; add TSML#docker_packagecompiler PackageCompiler#sd-notomls ArgParse"'
20+
RUN /julia-1.1.1/bin/julia -e 'using TSML, PackageCompiler; sysnew,sysold = compile_incremental(:TSML;install=true); cp(sysnew,sysold,force=true)'
21+
RUN /julia-1.1.1/bin/julia /PackageCompiler.jl/juliac.jl -vae /main.jl
22+
ENTRYPOINT ["/builddir/main"]
23+
24+
#FROM debian:buster
25+
#WORKDIR /
26+
#COPY --from=build /julia-1.1.1 /julia-1.1.1
27+
#COPY --from=build /root/.julia /root/.julia
28+
#ENV PATH="$PATH:/julia-1.1.1/bin"
29+
#COPY tsmldockermain.jl /tsmldockermain.jl
30+
#RUN chmod +x /tsmldockermain.jl
31+
#ENTRYPOINT ["/tsmldockermain.jl"]

docker/Dockerfile.incremental

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM debian:buster AS build
2+
LABEL maintainer="paulpalmes@ie.ibm.com"
3+
4+
WORKDIR /
5+
6+
RUN set -ex
7+
8+
RUN apt-get update --allow-releaseinfo-change && apt-get -y upgrade && \
9+
apt-get install -y tzdata git wget build-essential
10+
11+
RUN apt-get clean -y && apt-get autoremove -y && apt-get autoclean -y
12+
13+
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.1/julia-1.1.1-linux-x86_64.tar.gz && tar xzvf julia-1.1.1-linux-x86_64.tar.gz
14+
15+
RUN /julia-1.1.1/bin/julia -e 'using Pkg; pkg"up; add TSML#docker_packagecompiler PackageCompiler#sd-notomls"'
16+
RUN /julia-1.1.1/bin/julia -e 'using TSML, PackageCompiler; sysnew,sysold = compile_incremental(:TSML;install=true); cp(sysnew,sysold,force=true)'
17+
18+
FROM debian:buster
19+
WORKDIR /
20+
COPY --from=build /julia-1.1.1 /julia-1.1.1
21+
COPY --from=build /root/.julia /root/.julia
22+
ENV PATH="$PATH:/julia-1.1.1/bin"
23+
COPY tsmldockermain.jl /tsmldockermain.jl
24+
RUN chmod +x /tsmldockermain.jl
25+
ENTRYPOINT ["/tsmldockermain.jl"]

docker/NotebookDockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From ubuntu:18.04
2+
LABEL maintainer="paulpalmes@ie.ibm.com"
3+
4+
WORKDIR /
5+
6+
RUN set -ex
7+
8+
ENV CONDA_JL_VERSION "3"
9+
ENV PYTHON ""
10+
11+
RUN apt-get update && apt-get install -y --allow-unauthenticated tzdata
12+
13+
RUN apt-get update && apt-get -y --allow-unauthenticated upgrade && \
14+
apt-get install -y --allow-unauthenticated git r-base r-base-dev r-recommended wget
15+
16+
RUN apt-get clean -y && apt-get autoremove -y && apt-get autoclean -y
17+
18+
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.3-linux-x86_64.tar.gz
19+
20+
RUN tar xzvf julia-1.0.3-linux-x86_64.tar.gz
21+
22+
RUN /julia-1.0.3/bin/julia -e 'using Pkg;Pkg.add("Conda");using Conda'
23+
24+
RUN /julia-1.0.3/bin/julia -e 'using Pkg;Pkg.add(PackageSpec(url="https://github.com/IBM/TSML.jl",rev="master"));Pkg.build("TSML");using TSML'
25+
26+
RUN /julia-1.0.3/bin/julia -e 'using Pkg;Pkg.add(["DataFrames","CSV","Plots","GR"]);using CSV;using Plots;using DataFrames;using GR'
27+
28+
RUN /julia-1.0.3/bin/julia -e 'using Pkg;Pkg.add("IJulia");using IJulia'
29+
30+
RUN /root/.julia/conda/3/bin/conda install -y jupyter
31+
RUN /root/.julia/conda/3/bin/conda install -y jupyterlab
32+
33+
COPY testdata.csv TSML_Demo.ipynb ./
34+
35+
# docker build -t tsml . && docker run --rm -p 8888:8888 -p 4040:4040 -it tsml
36+
CMD ["/root/.julia/conda/3/bin/jupyter-lab","--ip=0.0.0.0","--allow-root","--NotebookApp.token=''","--NotebookApp.password=''","--no-browser","TSML_Demo.ipynb"]
37+

docker/main.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using TSML
2+
using TSML.ArgumentParsers
3+
4+
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
5+
tsmlmain()
6+
end

docker/notes.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
https://nextjournal.com/julia-environments/datascience-environment?change-id=CTtF6xQrPhCRkb9u3cQneo&node-id=758ec5ab-8cc7-4e01-ba79-3f95ada429b0
2+
https://github.com/JuliaLang/PackageCompiler.jl/issues/215
3+
4+
5+
]add TSML#docker_packagecompiler
6+
]add PackageCompiler#sd-notomls
7+
using PackageCompiler
8+
compile_incremental(:TSML,install=true)

docker/run.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/julia-1.0.3/bin/julia
2+
3+
using TSML
4+
using DataFrames
5+
using TSML.CLIWrappers
6+
7+
8+
function runme(args)
9+
res=DataFrames.DataFrame()
10+
if length(args) == 0
11+
println("no input/output filename")
12+
println("syntax: /run.jl input output dateformat")
13+
elseif length(args) == 1
14+
res=tsmlrun(args[1])
15+
elseif length(args) == 2
16+
res=tsmlrun(args[1],args[2])
17+
elseif length(args) == 3
18+
res=tsmlrun(args[1],args[2],args[3])
19+
elseif length(args) == 4
20+
res=tsmlrun(args[1],args[2],args[3],args[4])
21+
end
22+
res
23+
end
24+
25+
runme(ARGS)

0 commit comments

Comments
 (0)