Simplify build process.

This commit is contained in:
Fern Garden 2025-09-07 20:19:47 +08:00
parent ab797443f2
commit 4c5ead65c7
6 changed files with 24 additions and 11 deletions

1
.env
View file

@ -1 +0,0 @@
MODEL=

1
.gitignore vendored
View file

@ -1 +0,0 @@
/models

View file

@ -17,7 +17,7 @@ RUN apt-get install -y \
openmpi-bin libopenmpi-dev
# Add python user.
RUN groupadd --force "${GID}"
RUN groupadd --force -g "${GID}" python
RUN useradd --create-home --no-log-init -u "${UID}" -g "${GID}" python
# Create build directory

View file

@ -1,15 +1,15 @@
# 🌏️ ExoPlaSim Docker
## Environment Variables
## Instructions
1. Create an ExoPlaSim model.
2. Replace the example model in the `build` directory with your own model (keeping the filename `model.py`).
3. Run the docker container (eg. `docker compose run -it --rm exoplasim`).
## Optional Environment Variables
**UID:** UID of host/guest user.
**GID:** GID of host/guest user.
**MODEL:** Path to model (required).
**BUILD_DIR:** Path to build directory.
## Instructions
1. Create an ExoPlaSim model
2. Save it somewhere with the filename `model.py`
3. Edit the `.env` file and add the directory containing `model.py` after `MODEL=`
4. Run the docker container (eg. `docker compose run -it --rm exoplasim`)

15
build/model.py Normal file
View file

@ -0,0 +1,15 @@
import exoplasim as exo
toi700d = exo.Model(workdir="toi700d_run",modelname="TOI-700d",
ncpus=8,resolution="T21",outputtype=".nc")
toi700d.configure(startemp=3480.0, flux=1167.0, # Stellar parameters
eccentricity=0.,obliquity=0.,fixedorbit=True, # Orbital parameters
synchronous=True,rotationperiod=37.426, # Rotation
radius=1.19,gravity=11.9,aquaplanet=True, # Bulk properties
pN2=1.47*(1-360e-6),pCO2=1.47*360e-6,ozone=False, # Atmosphere
timestep=30.0,snapshots=720,physicsfilter="gp|exp|sp") # Model dynamics
toi700d.exportcfg()
toi700d.run(years=10,crashifbroken=True)

View file

@ -10,4 +10,4 @@ services:
UID: "${UID:-1001}"
GID: "${GID:-1001}"
volumes:
- "${MODEL:?error}:/build"
- "${BUILD_DIR:-./build}:/build"