-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,27 @@ | ||
FROM julia:1.10.0 | ||
|
||
LABEL author="A. Mhamdi <[email protected]>" | ||
LABEL version="latest" | ||
|
||
# Expose ports | ||
EXPOSE 1234 2468 | ||
#= Set ENV variables =# | ||
ENV JULIA_DEPOT_PATH /root/.julia | ||
|
||
WORKDIR /workspace | ||
|
||
# Set ENV variables | ||
ENV USERNAME mhamdi | ||
ENV USER_HOME_DIR /home/${USERNAME} | ||
ENV JULIA_DEPOT_PATH ${USER_HOME_DIR}/.julia | ||
ENV JL ${JULIA_DEPOT_PATH}/conda/3/bin/jupyter\ lab | ||
ARG WORKING_DIR="${USER_HOME_DIR}/work/" | ||
|
||
# Add user and set ownership | ||
RUN useradd -ms /bin/bash -p $(echo ${USERNAME} | openssl passwd -1 -stdin) ${USERNAME} | ||
|
||
# Change user & working directory | ||
USER ${USERNAME} | ||
WORKDIR "${USER_HOME_DIR}" | ||
# Copy needed files and datasets | ||
RUN mkdir -p "${WORKING_DIR}" | ||
# Change working directory | ||
WORKDIR "${WORKING_DIR}" | ||
|
||
# Copy datasets | ||
#= Copy datasets =# | ||
COPY ./Codes/Julia/Datasets ./datasets/ | ||
|
||
# Copy TOML files (deps, ver, pkg, UUID) | ||
#= Copy TOML files (deps, ver, pkg, UUID) =# | ||
COPY ./Codes/Julia/Part-1/Project.toml ./ | ||
# COPY ./Codes/Julia/Manifest.toml ./ | ||
|
||
# Activate environment and add IJulia kernel, Pluto and JupyterLab IDE | ||
RUN julia -e 'import Pkg; Pkg.activate("."); Pkg.instantiate(); Pkg.precompile()' | ||
#= Activate environment and add IJulia kernel, Pluto and JupyterLab IDE =# | ||
RUN julia -e 'import Pkg; Pkg.activate("."); Pkg.resolve(); Pkg.instantiate(); Pkg.precompile()' | ||
RUN julia -e 'import Pkg; Pkg.add(["Conda", "IJulia", "Pluto"]); Pkg.precompile()' | ||
RUN julia -e 'import Conda; Conda.add("JupyterLab")' | ||
|
||
# Default command | ||
CMD julia | ||
#= Expose ports =# | ||
EXPOSE 1234 2468 | ||
|
||
#= Default command =# | ||
CMD [ "julia" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,27 @@ | ||
FROM julia:1.10.0 | ||
|
||
LABEL author="A. Mhamdi <[email protected]>" | ||
LABEL version="latest" | ||
|
||
# Expose ports | ||
EXPOSE 1234 2468 | ||
#= Set ENV variables =# | ||
ENV JULIA_DEPOT_PATH /roo/.julia | ||
|
||
WORKDIR /workspace | ||
|
||
# Set ENV variables | ||
ENV USERNAME mhamdi | ||
ENV USER_HOME_DIR /home/${USERNAME} | ||
ENV JULIA_DEPOT_PATH ${USER_HOME_DIR}/.julia | ||
ENV JL ${JULIA_DEPOT_PATH}/conda/3/bin/jupyter\ lab | ||
ARG WORKING_DIR="${USER_HOME_DIR}/work/" | ||
|
||
# Add user and set ownership | ||
RUN useradd -ms /bin/bash -p $(echo ${USERNAME} | openssl passwd -1 -stdin) ${USERNAME} | ||
|
||
# Change user & working directory | ||
USER ${USERNAME} | ||
WORKDIR "${USER_HOME_DIR}" | ||
# Copy needed files and datasets | ||
RUN mkdir -p "${WORKING_DIR}" | ||
# Change working directory | ||
WORKDIR "${WORKING_DIR}" | ||
|
||
# Copy datasets | ||
#= Copy datasets =# | ||
COPY ./Codes/Julia/Datasets ./datasets/ | ||
|
||
# Copy TOML files (deps, ver, pkg, UUID) | ||
#= Copy TOML files (deps, ver, pkg, UUID) =# | ||
COPY ./Codes/Julia/Part-2/Project.toml ./ | ||
# COPY ./Codes/Julia/Manifest.toml ./ | ||
|
||
# Activate environment and add IJulia kernel, Pluto and JupyterLab IDE | ||
RUN julia -e 'import Pkg; Pkg.activate("."); Pkg.instantiate(); Pkg.precompile()' | ||
#= Activate environment and add IJulia kernel, Pluto and JupyterLab IDE =# | ||
RUN julia -e 'import Pkg; Pkg.activate("."); Pkg.resolve(); Pkg.instantiate(); Pkg.precompile()' | ||
RUN julia -e 'import Pkg; Pkg.add(["Conda", "IJulia", "Pluto"]); Pkg.precompile()' | ||
RUN julia -e 'import Conda; Conda.add("JupyterLab")' | ||
|
||
# Default command | ||
CMD julia | ||
#= Expose ports =# | ||
EXPOSE 1234 2468 | ||
|
||
#= Default command =# | ||
CMD [ "julia" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
FROM julia:1.11.0 | ||
|
||
LABEL author="A. Mhamdi <[email protected]>" | ||
LABEL version="latest" | ||
|
||
#= Set ENV variables =# | ||
ENV USERNAME=mhamdi | ||
ENV USER_HOME_DIR=/home/${USERNAME} | ||
ENV JULIA_DEPOT_PATH=${USER_HOME_DIR}/.julia | ||
ENV JL=${JULIA_DEPOT_PATH}/conda/3/bin/jupyter\ lab | ||
ARG WORKING_DIR="${USER_HOME_DIR}/work/" | ||
|
||
#= Add user and set ownership =# | ||
RUN useradd -ms /bin/bash -p $(echo ${USERNAME} | openssl passwd -1 -stdin) ${USERNAME} | ||
|
||
#= Change user & working directory =# | ||
# USER ${USERNAME} | ||
WORKDIR "${USER_HOME_DIR}" | ||
RUN mkdir -p "${WORKING_DIR}" | ||
WORKDIR "${WORKING_DIR}" | ||
|
||
# Copy TOML files (deps, ver, pkg, UUID) | ||
COPY ../Codes/Julia/Part-3/. ./ | ||
ENV JULIA_DEPOT_PATH=/root/.julia | ||
|
||
WORKDIR /workspace | ||
|
||
#= Copy TOML files (deps, ver, pkg, UUID) =# | ||
COPY ./Codes/Julia/Part-3/. ./ | ||
RUN sh -x script.sh | ||
|
||
#= Expose ports =# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
version: "3.9" | ||
|
||
services: | ||
jupyter: | ||
image: jlai:local | ||
ports: | ||
- "2468:2468" | ||
command: /home/mhamdi/.julia/conda/3/x86_64/bin/jupyter lab --NotebookApp.token='' --ip 0.0.0.0 --port 2468 --allow-root --no-browser | ||
command: /root/.julia/conda/3/x86_64/bin/jupyter lab --NotebookApp.token='' --ip 0.0.0.0 --port 2468 --allow-root --no-browser | ||
volumes: | ||
- /home/mhamdi/.julia/scratchspaces/:/home/mhamdi/.julia/scratchspaces/ | ||
- $HOME/.julia/scratchspaces/:/root/.julia/scratchspaces/ | ||
pluto: | ||
image: jlai:local | ||
ports: | ||
- "1234:1234" | ||
command: julia -e "import Pluto; Pluto.run(host=\"0.0.0.0\", port=1234, launch_browser=false, require_secret_for_open_links=false, require_secret_for_access=false)" | ||
volumes: | ||
- /home/mhamdi/.julia/scratchspaces/:/home/mhamdi/.julia/scratchspaces/ | ||
- $HOME/.julia/scratchspaces/:/root/.julia/scratchspaces/ | ||
|