Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python 3.9] Overhaul RMG-RMS Python-Julia dependencies (juliaup and pythoncall), Add Tests for Arkane Network Algorithms #2687

Closed
wants to merge 171 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
b5d3040
update environment file, CI, Dockerfile to install optional Julia deps
JacksonBurns Mar 11, 2024
9382ad9
reorder build steps to ensure julia deps are installed in rmg_env
JacksonBurns Mar 11, 2024
4f97ef4
add NO_JULIA and requires_rms throughout
JacksonBurns Jun 12, 2024
6f8780c
bury the import of Julia in Arkane, add helpful error if missing
JacksonBurns Jun 12, 2024
40b368c
point to the installation documentation if user attempts to use RMS -
JacksonBurns Jun 12, 2024
9c8667d
`conda` now uses `libmamba` by default, update docs
JacksonBurns Jun 12, 2024
24a0731
indicate that Julia is optional but recommended, list features
JacksonBurns Jun 12, 2024
dcef9ab
Apply suggestions from code review
JacksonBurns Jun 12, 2024
d541afc
remove unnesecary `NO_JULIA` check
JacksonBurns Jun 12, 2024
d8607f9
import `logging` instead of `warnings`
JacksonBurns Jun 12, 2024
363e2a6
Merge branch 'main' into fix/avoid_unnecessary_julia
JacksonBurns Jun 18, 2024
798a1b0
switch to branch
hwpang Mar 22, 2024
8b4f136
Use pyjuliacall instead of pyjulia
hwpang Mar 22, 2024
b3796da
No need to install julia from conda
hwpang Mar 22, 2024
d4c539e
update
hwpang Mar 22, 2024
e8faefb
update
hwpang Mar 22, 2024
f52d0d7
Swap the order
hwpang Mar 22, 2024
c1f2017
update
hwpang Mar 22, 2024
a11a96d
doc
hwpang Mar 22, 2024
05d1772
Use the preexisting mamba
hwpang Apr 1, 2024
6f5612c
Use JULIA_CONDAPKG_EXE=$CONDA/condabin/conda
hwpang Apr 1, 2024
be3e424
Add channels
hwpang Apr 1, 2024
a812cab
skip make for now for debugging
hwpang Apr 1, 2024
0a165ee
Trying to use juliaup
hwpang Apr 1, 2024
bf7017b
Don't need to install diffeqpy
hwpang Apr 1, 2024
b312ca1
Uncomment make step
hwpang Apr 1, 2024
c4fc809
Don't need julia plug in
hwpang Apr 1, 2024
3ce04fd
Use mamba
hwpang Apr 1, 2024
17f397b
No need to add channels
hwpang Apr 1, 2024
f65d07d
import juliacall
hwpang Apr 2, 2024
d52efbf
Don't track coverage
hwpang Apr 2, 2024
c7c0632
debug
hwpang Apr 2, 2024
7e770fb
debug
hwpang Apr 2, 2024
29e6c43
convert empty list
hwpang Apr 2, 2024
7a473df
Add additional test file for sls
hwpang Apr 2, 2024
09c45bf
Should be seval
hwpang Apr 2, 2024
cd219c2
debug
hwpang Apr 2, 2024
ff81064
update doc
hwpang Apr 2, 2024
11f0923
Add tests
hwpang Apr 3, 2024
332d8c0
Don't track plots
hwpang Apr 3, 2024
0369843
don't track yaml files
hwpang Apr 3, 2024
5723de3
update name
hwpang Apr 3, 2024
117926b
track yaml files
hwpang Apr 3, 2024
55c462f
See where we get julia from
hwpang Apr 3, 2024
d4d0a06
Add Pkg.
hwpang Apr 3, 2024
45fda81
debug
hwpang Apr 3, 2024
c5fbaa5
update
hwpang Apr 3, 2024
4167d4c
debug
hwpang Apr 4, 2024
2a81c71
use Sundials solver and convert list to julia vector
hwpang Apr 4, 2024
1d4005a
Resolve AttributeError: 'Interface' object has no attribute 'species'
hwpang Apr 4, 2024
cae6444
Convert to julia object
hwpang Apr 4, 2024
5dabe3b
Remove duplicate test
hwpang Apr 25, 2024
a6efb3f
Add comments and juliaup status
hwpang Apr 25, 2024
419adb5
Add back changes mistakenly done by formatter
hwpang Apr 25, 2024
3b46fff
Don't change release note
hwpang Apr 25, 2024
b5b4ba0
Add docstring
hwpang Apr 25, 2024
65575ca
Update rmgpy/rmg/reactors.py
hwpang Apr 25, 2024
0e90ea0
Fix
hwpang Apr 25, 2024
19ae82b
Avoid duplicating
hwpang Apr 25, 2024
0d593a9
Avoid casting to list
hwpang Apr 25, 2024
ac7ef7d
Switch to use SciMLBase and Sundials under RMS
hwpang May 14, 2024
5fb30a1
Add changelog
hwpang May 14, 2024
7130186
Add comment and docstring to emphasize only supporting native python …
hwpang May 14, 2024
078b93f
run complete CI on macos and ubuntu, bump python to 3.9
JacksonBurns Jun 27, 2024
54a1d8c
bump python, encourage higher versions for other deps, remove `pip` deps
JacksonBurns Jun 27, 2024
72d23a0
increment python version in docs build
JacksonBurns Jul 1, 2024
3943c63
make muq optional (like the docs say!) and add a helpful msg if missing
JacksonBurns Jul 1, 2024
a8ef015
fix cython compilation errors (0.23 -> 3.n), SEE EXTENDED!!
JacksonBurns Jul 1, 2024
0aabfe8
add newly defined functions to `pxd` files
JacksonBurns Jul 1, 2024
ff46749
Switch to use official juliaup
hwpang Jul 2, 2024
c4b7db1
Export JULIAUP_DEPOT_PATH and fix typo
hwpang Jul 2, 2024
edd4ade
Use Sundials from RMS
hwpang Jul 2, 2024
582d1ec
DROP ME don't capture output during testing, need debug
JacksonBurns Jul 2, 2024
b3a1365
DROP ME comment out failing lpsolve test for now
JacksonBurns Jul 2, 2024
f45f7bd
Consolidate the export of Julia paths
hwpang Jul 3, 2024
7d3a765
Merge branch 'feat/py39' of https://github.com/ReactionMechanismGener…
hwpang Jul 3, 2024
bff1865
add step to make ARM mac use intel mac packages
JacksonBurns Jul 8, 2024
0f87f76
passthrough args to same_object
JacksonBurns Jul 8, 2024
7b2296d
Merge branch 'feat/py39' of https://github.com/ReactionMechanismGener…
JacksonBurns Jul 8, 2024
e07e6af
Refactoring clar optimization and utilize scipy MILP
xiaoruiDong Mar 5, 2024
0f9dcc0
Update pxd of clar optimization after reimplement with scipy MILP
xiaoruiDong Mar 5, 2024
919448b
Remove the redundant ILPSolutionError
xiaoruiDong Mar 5, 2024
517debe
Fix typos in resonance clar optimization
xiaoruiDong Mar 5, 2024
756439f
Fix list style in clar optimization
xiaoruiDong Mar 5, 2024
ca0091a
Update year in license
hwpang Jan 24, 2024
bd60215
imports sorting by formatter
hwpang Jan 24, 2024
d90e4fb
Add improvements by @amarkpayne
hwpang Jan 25, 2024
b78765f
Add constraints for element balance
hwpang Jan 24, 2024
1b052aa
Add pyutilib to catch ApplicationError
hwpang Jan 25, 2024
a929f2c
Formatting by formatter
hwpang Jan 25, 2024
57faf2f
Catch TypeError
hwpang Jan 25, 2024
6938a88
WIP
hwpang Jan 30, 2024
bd7f2b5
Modify based on review comment
hwpang Jun 11, 2024
bbc0030
Better way to initialize empty list
hwpang Jun 11, 2024
7fa4cf1
Improve code readability to get enumerated constraints
hwpang Jun 11, 2024
b28281d
Constraint cation/anion/neutral target to cation/anion/neutral refere…
hwpang Jun 11, 2024
3544b2f
Add warning for easy debugging
hwpang Jun 11, 2024
24bf4e5
Switch to use scipy
hwpang Jun 11, 2024
59e0cf1
Remove unused imports and correct obj fnc
hwpang Jun 11, 2024
fd96df6
Remove unused package, add version constraint to scipy
hwpang Jun 11, 2024
e75c15e
Remove options of solver
hwpang Jun 11, 2024
46e930f
Add comment to make test more readable
hwpang Jun 11, 2024
a61e34b
Use keyword variable
hwpang Jun 11, 2024
05a7d49
Add comment
hwpang Jun 11, 2024
e3cc59e
Add comment to test
hwpang Jun 11, 2024
bb44414
remove lpsolve55 from environments, tests, functions, docstrings, & docs
JacksonBurns Jul 24, 2024
d47a1f5
convert helper function args to kwargs for partial to work, hide func…
JacksonBurns Jul 24, 2024
54efa64
re-try running M1 macs on native hardware rather than x86 emulation
JacksonBurns Jul 24, 2024
12f2968
ugh, typo
JacksonBurns Jul 24, 2024
5407567
pass constraints as a tuple
JacksonBurns Jul 25, 2024
baf260a
fix return type for clar call
JacksonBurns Jul 25, 2024
db6e632
update return types in cython header
JacksonBurns Jul 25, 2024
91d74cd
yet more incorrect return types
JacksonBurns Jul 25, 2024
fb19d02
use python warnings module instead of removed numpy warnings passthrough
JacksonBurns Jul 25, 2024
f30b04a
fix incorrect use of `getattr`
JacksonBurns Jul 25, 2024
ff4ef4e
add back the cclib version restriction
JacksonBurns Jul 25, 2024
28d2fbf
allow empty return to be properly excepted
JacksonBurns Jul 25, 2024
be69fb2
fix usage of `n` for iteration
JacksonBurns Jul 25, 2024
5e7b266
make dict_keys -> str conversion explicit so it will run
JacksonBurns Jul 25, 2024
551926d
re-limit the version of cantera to undo the API breaks
JacksonBurns Jul 25, 2024
c1d6902
incorrect placement of parens
JacksonBurns Jul 25, 2024
10e79c2
make tuple cast more explicit
JacksonBurns Jul 26, 2024
46b9c92
explicit cast of set to str
JacksonBurns Aug 5, 2024
9092cd5
remove disused pyomo components
JacksonBurns Aug 5, 2024
4f8f268
fix usage of warning
JacksonBurns Aug 5, 2024
56efc1a
Merge pull request #2695 from ReactionMechanismGenerator/feat/isodesm…
JacksonBurns Aug 5, 2024
2b4885f
why did we use to do this like this? total bonds = bonds (what bonds?…
JacksonBurns Aug 21, 2024
82638fc
sign error in objective, clarify some variable names
JacksonBurns Oct 29, 2024
78ac67f
add gcc to environment file for rdkit
JacksonBurns Oct 29, 2024
efea287
Merge remote-tracking branch 'ReactionMechanismGenerator/main' into f…
JacksonBurns Oct 29, 2024
c4c6a0f
I don't think all these vars are requried
JacksonBurns Oct 30, 2024
7f425a1
chatgpt says attached error might be because boost is missing
JacksonBurns Oct 30, 2024
1d71ec4
i don't think we need this one either
JacksonBurns Oct 30, 2024
a450a48
install libstdcxx in cond env? or is this a LD path issue?
JacksonBurns Oct 30, 2024
4cefabf
try using cross-platform compilers package
JacksonBurns Oct 30, 2024
b2ba22f
set ld_library_path
JacksonBurns Oct 30, 2024
3a6b595
use julia 1.9, set depot path for juliaup
JacksonBurns Oct 30, 2024
040f03d
also set the julia depot path
JacksonBurns Oct 30, 2024
b8817ad
don't set ld_library_path
JacksonBurns Oct 30, 2024
67aff20
try a different configuration of environment variables
JacksonBurns Oct 30, 2024
cbb91fa
also set julia depot?
JacksonBurns Oct 31, 2024
9df0540
revert to only setting the current condapkg which should be the only …
JacksonBurns Oct 31, 2024
fabc0f8
add `libstdcxx-ng` to see if the CI will pass on Linux at least
JacksonBurns Oct 31, 2024
081ef32
Merge remote-tracking branch 'ReactionMechanismGenerator/main' into f…
JacksonBurns Nov 20, 2024
8e9f4ec
Merge branch 'fix/avoid_unnecessary_julia' into feat/resonance_scipy
JacksonBurns Nov 20, 2024
a3283b3
remove old julia install step
JacksonBurns Nov 20, 2024
3605e25
add a test run that doesn't need julia
JacksonBurns Nov 20, 2024
02e4140
name the tests based on if julia is installed or not
JacksonBurns Nov 20, 2024
d7274ef
remove libstdcxx and add the new julia conda package (not actually julia
JacksonBurns Nov 20, 2024
de206e4
fix if comparison for matrix
JacksonBurns Nov 20, 2024
cce1f4b
disable running on push, enable running on dispatch
JacksonBurns Nov 20, 2024
eccab98
avoid bugged versions of `quantities`
JacksonBurns Nov 20, 2024
0ba84b3
fix default require_rms values for pdepnetwork update
JacksonBurns Nov 20, 2024
1bd7037
remove the now disallowed array cast
JacksonBurns Nov 20, 2024
0d5a3bc
set allowed version of graphviz, fix list indexeing syntax, fix impor…
JacksonBurns Nov 21, 2024
7fbc38d
get ffmpeg from conda-forge instead of rmg to (hopefully) fix usage e…
JacksonBurns Nov 21, 2024
952b396
disable `shell`, also print `stdout`
JacksonBurns Nov 22, 2024
53325b0
ignore flux diagram dot testing files
JacksonBurns Dec 2, 2024
8bf6bfa
stop grabbing rmg versions of common packages
JacksonBurns Dec 2, 2024
5bd2f4a
incorrect failure condition in liquid test
JacksonBurns Dec 2, 2024
7fe0345
fix re-runs with existing output directory
JacksonBurns Dec 2, 2024
d34a4be
move surface site check to after requires_rms has been set
JacksonBurns Dec 2, 2024
eb9bd74
update expected values for new version of coolprop
JacksonBurns Dec 3, 2024
df81684
update expected reproducibility for new dep changes
JacksonBurns Dec 3, 2024
2ba37e2
skip julia install in docs build
JacksonBurns Dec 3, 2024
91881f6
WIP milp debugging
JacksonBurns Dec 3, 2024
dee596b
sqwuash me
JacksonBurns Dec 3, 2024
3706870
fix literal comparison
JacksonBurns Dec 3, 2024
c308095
squash as well
JacksonBurns Dec 3, 2024
10ddb5c
Merge pull request #2694 from ReactionMechanismGenerator/feat/resonan…
JacksonBurns Dec 3, 2024
e5d71e4
Merge remote-tracking branch 'ReactionMechanismGenerator/main' into f…
JacksonBurns Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ requirements:
- {{ compiler('c') }} # [unix]
host:
- cython >=0.25.2
- lpsolve55
- numpy
- openbabel >=3
- pydas >=1.0.2
Expand All @@ -39,7 +38,6 @@ requirements:
- h5py
- jinja2
- jupyter
- lpsolve55
- markupsafe
- matplotlib >=1.5
- mopac
Expand Down
118 changes: 47 additions & 71 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 8 * * *"
# runs on all branches on both RMG-Py and forks
push:
# allow running on RMG-Py on a pushed branch, only if triggered manually
workflow_dispatch:
# runs on PRs against RMG-Py (and anywhere else, but we add this for RMG-Py)
pull_request:

Expand All @@ -51,66 +51,15 @@ env:


jobs:
build-osx:
runs-on: macos-13
# skip scheduled runs from forks
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout RMG-Py
uses: actions/checkout@v4

# Step to create a custom condarc.yml before setting up conda
- name: Create custom conda config file
run: |
RUNNER_CWD=$(pwd)
echo "channels:" > $RUNNER_CWD/condarc.yml
echo " - conda-forge" >> $RUNNER_CWD/condarc.yml
echo " - rmg" >> $RUNNER_CWD/condarc.yml
echo " - cantera" >> $RUNNER_CWD/condarc.yml
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml

# configures the mamba environment manager and builds the environment
- name: Setup Miniforge Python 3.7
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
condarc-file: condarc.yml
activate-environment: rmg_env
use-mamba: true

# list the environment for debugging purposes
- name: mamba info
run: |
mamba info
mamba list

# Clone RMG-database
- name: Clone RMG-database
run: |
cd ..
git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git

# modify env variables as directed in the RMG installation instructions
- name: Set Environment Variables
run: |
RUNNER_CWD=$(pwd)
echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV
echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH

# RMG build step
- name: make RMG
run: |
make clean
make

build-and-test-linux:
runs-on: ubuntu-latest
build-and-test:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: [macos-13, macos-latest, ubuntu-latest]
test_julia: [yes, no]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Build and Test Python ${{ matrix.python-version }} (Julia? ${{ matrix.test_julia }})
# skip scheduled runs from forks
if: ${{ !( github.repository != 'ReactionMechanismGenerator/RMG-Py' && github.event_name == 'schedule' ) }}
env:
Expand All @@ -134,13 +83,13 @@ jobs:
echo "show_channel_urls: true" >> $RUNNER_CWD/condarc.yml

# configures the mamba environment manager and builds the environment
- name: Setup Miniforge Python 3.7
- name: Setup Mambaforge Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
python-version: ${{ matrix.python-version }}
condarc-file: condarc.yml
activate-environment: rmg_env
use-mamba: true
Expand Down Expand Up @@ -170,12 +119,39 @@ jobs:
make clean
make

# Setup Juliaup
- name: Set Julia paths
if: matrix.test_julia == 'yes'
run: |
# echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV
# echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH
# echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV
# echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV
# echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH
echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV
# echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH

- name: Setup Juliaup
if: matrix.test_julia == 'yes'
uses: julia-actions/install-juliaup@v2
with:
channel: '1.9'

- name: Check Julia version
if: matrix.test_julia == 'yes'
run: julia --version

# RMS installation and linking to Julia
- name: Install and link Julia dependencies
if: matrix.test_julia == 'yes'
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
# JULIA_CONDAPKG_EXE points to the existing conda/mamba to avoid JuliaCall from installing their own. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment.
run: |
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'
mamba install conda-forge::pyjuliacall
julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator'

- name: Install Q2DTor
run: echo "" | make q2dtor
Expand All @@ -192,7 +168,7 @@ jobs:
run: |
for regr_test in aromatics liquid_oxidation nitrogen oxidation sulfur superminimal RMS_constantVIdealGasReactor_superminimal RMS_CSTR_liquid_oxidation RMS_liquidSurface_ch4o2cat fragment RMS_constantVIdealGasReactor_fragment minimal_surface;
do
if python-jl rmg.py test/regression/"$regr_test"/input.py; then
if python rmg.py test/regression/"$regr_test"/input.py; then
echo "$regr_test" "Executed Successfully"
else
echo "$regr_test" "Failed to Execute" | tee -a $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -282,7 +258,7 @@ jobs:

echo "<details>"
# Compare the edge and core
if python-jl scripts/checkModels.py \
if python scripts/checkModels.py \
"$regr_test-core" \
$REFERENCE/"$regr_test"/chemkin/chem_annotated.inp \
$REFERENCE/"$regr_test"/chemkin/species_dictionary.txt \
Expand All @@ -299,7 +275,7 @@ jobs:
cat "$regr_test-core.log" || (echo "Dumping the whole log failed, please download it from GitHub actions. Here are the first 100 lines:" && head -n100 "$regr_test-core.log")
echo "</details>"
echo "<details>"
if python-jl scripts/checkModels.py \
if python scripts/checkModels.py \
"$regr_test-edge" \
$REFERENCE/"$regr_test"/chemkin/chem_edge_annotated.inp \
$REFERENCE/"$regr_test"/chemkin/species_edge_dictionary.txt \
Expand All @@ -320,7 +296,7 @@ jobs:
if [ -f test/regression/"$regr_test"/regression_input.py ];
then
echo "<details>"
if python-jl rmgpy/tools/regression.py \
if python rmgpy/tools/regression.py \
test/regression/"$regr_test"/regression_input.py \
$REFERENCE/"$regr_test"/chemkin \
test/regression/"$regr_test"/chemkin
Expand Down Expand Up @@ -384,7 +360,7 @@ jobs:
# who knows ¯\_(ツ)_/¯
#
# taken from https://github.com/docker/build-push-action
needs: build-and-test-linux
needs: build-and-test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py'
steps:
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
with:
fetch-depth: 0

- name: Setup Mambaforge Python 3.7
uses: conda-incubator/setup-miniconda@v3
- name: Setup Mambaforge Python 3.9
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
python-version: 3.7
python-version: 3.9
activate-environment: rmg_env
use-mamba: true

Expand Down Expand Up @@ -60,12 +60,6 @@ jobs:
make clean
make

- name: Install and link Julia dependencies
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
run: |
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'

- name: Checkout gh-pages Branch
uses: actions/checkout@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ nbproject/*
.vscode/*

# Unit test files
.coverage
.coverage*
testing/*
htmlcov/*

Expand Down Expand Up @@ -103,6 +103,7 @@ test/rmgpy/test_data/temp_dir_for_testing/cantera/chem001.yaml
rmgpy/test_data/copied_kinetic_lib/
testing/qm/*
test_log.txt
rmgpy/tools/data/flux/flux/1/*.dot

# example directory - save the inputs but not the outputs
# cantera input files
Expand All @@ -117,3 +118,4 @@ examples/**/dictionary.txt
examples/**/reactions.py
examples/**/RMG_libraries
examples/**/species
examples/**/plots
30 changes: 14 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ RUN ln -snf /bin/bash /bin/sh
# - libxrender1 required by RDKit
RUN apt-get update && \
apt-get install -y \
make \
gcc \
wget \
git \
g++ \
libxrender1 && \
make \
gcc \
wget \
git \
g++ \
libxrender1 && \
apt-get autoremove -y && \
apt-get clean -y

Expand All @@ -28,10 +28,6 @@ RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mini
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 && \
conda config --set solver libmamba

# Set Bash as the default shell for following commands
SHELL ["/bin/bash", "-c"]

Expand All @@ -50,8 +46,7 @@ RUN git clone --single-branch --branch ${RMG_Py_Branch} --depth 1 https://github

WORKDIR /rmg/RMG-Py
# build the conda environment
RUN conda env create --file environment.yml && \
conda clean --all --yes
RUN conda env create --file environment.yml

# This runs all subsequent commands inside the rmg_env conda environment
#
Expand All @@ -60,6 +55,10 @@ RUN conda env create --file environment.yml && \
# in a Dockerfile build script)
SHELL ["conda", "run", "--no-capture-output", "-n", "rmg_env", "/bin/bash", "-c"]

RUN conda install -c conda-forge julia=1.9.1 pyjulia>=0.6 && \
conda install -c rmg pyrms diffeqpy && \
conda clean --all --yes

# Set environment variables as directed in the RMG installation instructions
ENV RUNNER_CWD=/rmg
ENV PYTHONPATH="$RUNNER_CWD/RMG-Py:$PYTHONPATH"
Expand All @@ -70,16 +69,15 @@ 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=ENV["rmsbranch"])); using ReactionMechanismSimulator' && \
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'ENV["JULIA_CONDAPKG_BACKEND"] = "Current"; using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator'

# RMG-Py should now be installed and ready - trigger precompilation and test run
RUN python-jl rmg.py examples/rmg/minimal/input.py
RUN python rmg.py examples/rmg/minimal/input.py
# delete the results, preserve input.py
RUN mv examples/rmg/minimal/input.py . && \
rm -rf examples/rmg/minimal/* && \
mv input.py examples/rmg/minimal/

# when running this image, open an interactive bash terminal inside the conda environment
RUN echo "source activate rmg_env" > ~/.bashrc
RUN echo "source activate rmg_env" >~/.bashrc
ENTRYPOINT ["/bin/bash", "--login"]
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ decython:
find . -name *.pyc -exec rm -f '{}' \;

test-all:
python-jl -m pytest
python -m pytest

test test-unittests:
python-jl -m pytest -m "not functional and not database"
python -m pytest -m "not functional and not database"

test-functional:
python-jl -m pytest -m "functional"
python -m pytest -m "functional"

test-database:
python-jl -m pytest -m "database"
python -m pytest -m "database"

eg0: all
mkdir -p testing/eg0
Expand Down
Loading
Loading