Skip to content

Commit 1d2db40

Browse files
committed
Allow RMS branch to be set in CI, passed through Dockerfile.
1 parent b7f1595 commit 1d2db40

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/CI.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ env:
4848
# if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace
4949
# main with the name of the branch
5050
RMG_DATABASE_BRANCH: main
51+
# RMS branch to use for ReactionMechanismSimulator installation
52+
RMS_BRANCH: for_rmg
5153
# julia parallel pre-compilation leads to race conditions and hangs, so we limit it to run in serial
5254
JULIA_NUM_PRECOMPILE_TASKS: 1
5355

56+
5457
jobs:
5558
build-and-push-docker:
5659
# after testing and on pushes to main, build and push docker image
@@ -85,3 +88,4 @@ jobs:
8588
build-args: |
8689
RMG_Py_Branch=${{ github.head_ref || github.ref_name }}
8790
RMG_Database_Branch=${{ env.RMG_DATABASE_BRANCH }}
91+
RMS_Branch=${{ env.RMS_BRANCH }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ SHELL ["/bin/bash", "-c"]
4949
# using the --build-arg option, or in the continous integration CI.yml file.
5050
ARG RMG_Py_Branch=main
5151
ARG RMG_Database_Branch=main
52+
ARG RMS_Branch=for_rmg
5253

5354
# cd
5455
WORKDIR /rmg
@@ -86,6 +87,7 @@ RUN make
8687
# Install and link Julia dependencies for RMS
8788
# setting this env variable fixes an issue with Julia precompilation on Windows
8889
ENV JULIA_CPU_TARGET="x86-64,haswell,skylake,broadwell,znver1,znver2,znver3,cascadelake,icelake-client,cooperlake,generic"
90+
ENV RMS_BRANCH=${RMS_Branch}
8991
RUN source install_rms.sh
9092

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

install_rms.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ conda install -y conda-forge::pyjuliacall
5656
echo "Environment variables referencing JULIA:"
5757
env | grep JULIA
5858

59-
julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl.git", rev="for_rmg")); using ReactionMechanismSimulator; Pkg.instantiate()' || echo "RMS install error - continuing anyway ¯\_(ツ)_/¯"
59+
# Use RMS_BRANCH environment variable if set, otherwise default to for_rmg
60+
RMS_BRANCH=${RMS_BRANCH:-for_rmg}
61+
echo "Installing ReactionMechanismSimulator from branch: $RMS_BRANCH"
62+
63+
julia -e "using Pkg; Pkg.add(Pkg.PackageSpec(name=\"ReactionMechanismSimulator\", url=\"https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl.git\", rev=\"$RMS_BRANCH\")); using ReactionMechanismSimulator; Pkg.instantiate()" || echo "RMS install error - continuing anyway ¯\_(ツ)_/¯"
6064

6165
echo "Checking if ReactionMechanismSimulator is installed in the current conda environment for Python usage..."
6266
python -c "from juliacall import Main; import sys; sys.exit(0 if Main.seval('Base.identify_package(\"ReactionMechanismSimulator\") !== nothing') and print('ReactionMechanismSimulator is installed in $current_env') is None else 1)"

0 commit comments

Comments
 (0)