Skip to content

Commit

Permalink
Merge pull request #2724 from ReactionMechanismGenerator/docker_minif…
Browse files Browse the repository at this point in the history
…orge

Changed Dockerfile to use Miniforge3
  • Loading branch information
JacksonBurns authored Oct 28, 2024
2 parents 704632d + 3660d8f commit 43d5bf8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
tags: reactionmechanismgenerator/rmg:latest
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ RUN apt-get update && \
apt-get clean -y

# Install conda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda && \
rm Miniconda3-latest-Linux-x86_64.sh
ENV PATH="$PATH:/miniconda/bin"
RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" && \
bash Miniforge3-Linux-x86_64.sh -b -p /miniforge && \
rm Miniforge3-Linux-x86_64.sh
ENV PATH="$PATH:/miniforge/bin"

# Set solver backend to mamba for speed
RUN conda install -n base conda-libmamba-solver && \
Expand All @@ -35,12 +35,18 @@ RUN conda install -n base conda-libmamba-solver && \
# Set Bash as the default shell for following commands
SHELL ["/bin/bash", "-c"]

# Add build arguments for RMG-Py, RMG-database, and RMS branches.
ARG RMG_Py_Branch=main
ARG RMG_Database_Branch=main
ARG RMS_Branch=main
ENV rmsbranch=${RMS_Branch}

# cd
WORKDIR /rmg

# Clone the RMG base and database repositories
RUN git clone --single-branch --branch main --depth 1 https://github.com/ReactionMechanismGenerator/RMG-Py.git && \
git clone --single-branch --branch main --depth 1 https://github.com/ReactionMechanismGenerator/RMG-database.git
RUN git clone --single-branch --branch ${RMG_Py_Branch} --depth 1 https://github.com/ReactionMechanismGenerator/RMG-Py.git && \
git clone --single-branch --branch ${RMG_Database_Branch} --depth 1 https://github.com/ReactionMechanismGenerator/RMG-database.git

WORKDIR /rmg/RMG-Py
# build the conda environment
Expand All @@ -64,7 +70,7 @@ ENV PATH="$RUNNER_CWD/RMG-Py:$PATH"
# setting this env variable fixes an issue with Julia precompilation on Windows
ENV JULIA_CPU_TARGET="x86-64,haswell,skylake,broadwell,znver1,znver2,znver3,cascadelake,icelake-client,cooperlake,generic"
RUN make && \
julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master")); Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator' && \
julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master")); Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev=ENV["rmsbranch"])); using ReactionMechanismSimulator' && \
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"

# RMG-Py should now be installed and ready - trigger precompilation and test run
Expand Down

0 comments on commit 43d5bf8

Please sign in to comment.