Skip to content

Commit e1b5350

Browse files
authored
Merge pull request #24 from KVSlab/dokken/turtle-envs
Add Dockerfile, environment.yml and dependencies to setup.py
2 parents 11c914b + 54200ce commit e1b5350

File tree

4 files changed

+49
-8
lines changed

4 files changed

+49
-8
lines changed

.github/workflows/test_turtle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ on:
1515
- cron: "0 8 * * *"
1616
jobs:
1717
check-code:
18-
1918
runs-on: ubuntu-22.04
20-
container: quay.io/fenicsproject/stable:latest
19+
# Runs against FEniCS main branch built the 08-12-2022
20+
container: ghcr.io/scientificcomputing/fenics:2022-12-08
2121
steps:
2222
# This action sets the current path to the root of your github repo
2323
- uses: actions/checkout@v3
24+
2425

2526
- name: "Install code"
2627
run: python3 setup.py install
27-
2828
- name: Run tests
2929
run: |
3030
python3 -m pytest

docker/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM condaforge/mambaforge
2+
3+
4+
WORKDIR /tmp/
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
8+
# Install ssh (missing dependency to run conda envs)
9+
RUN apt-get update && \
10+
apt-get install -y ssh build-essential
11+
12+
# Upgrade mamba
13+
RUN mamba upgrade -y mamba
14+
15+
# Copy environment and requirements files into docker env
16+
COPY . turtleFSI
17+
18+
# Update environment file with new environment name
19+
RUN mamba env update --file ./turtleFSI/environment.yml --name dockerenv
20+
SHELL ["mamba", "run", "-n", "dockerenv", "/bin/bash", "-c"]
21+
22+
RUN python3 -m pip install ./turtleFSI pytest
23+
24+
# Test turtleFSI
25+
RUN python3 -m pytest ./turtleFSI/tests
26+
27+
RUN echo "source activate dockerenv" > ~/.bashrc

environment.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
name: turtleFSI
3+
channels:
4+
- conda-forge
5+
dependencies:
6+
- fenics-dolfin
7+
- python=3.10
8+
- pip
9+
- git
10+
- scipy
11+
- pip:
12+
- cppimport

setup.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
with open("README.md", "r") as fh:
44
long_description = fh.read()
55

6-
DEPENDENCIES = ['configargparse']
6+
DEPENDENCIES = ['configargparse', "fenics-dolfin",
7+
"scipy", "cppimport", "numpy"]
78
TEST_DEPENDENCIES = ['pytest']
89

910
VERSION = "1.5"
@@ -38,8 +39,9 @@
3839
"turtleFSI.problems",
3940
"turtleFSI.utils"],
4041
package_dir={"turtleFSI": "turtleFSI"},
41-
package_data = {"turtleFSI": ["utils/probe/*.h",
42-
"utils/probe/*.cpp"]},
43-
include_package_data = True,
44-
entry_points={'console_scripts': ['turtleFSI=turtleFSI.run_turtle:main']}
42+
package_data={"turtleFSI": ["utils/probe/*.h",
43+
"utils/probe/*.cpp"]},
44+
include_package_data=True,
45+
entry_points={'console_scripts': ['turtleFSI=turtleFSI.run_turtle:main']},
46+
4547
)

0 commit comments

Comments
 (0)