Skip to content

Commit

Permalink
Correct file permissions of docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
rs028 committed Aug 14, 2024
1 parent 8f32f96 commit 5e09b0e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13]
fortran: [10, 11]
# exclude: # gfortran-11, gfortran-12 not available for ubuntu-20.04
# - os: ubuntu-20.04
# fortran: 11
exclude: # gfortran-11, gfortran-12 not available for ubuntu-20.04
- os: ubuntu-20.04
fortran: 12
fail-fast: false

# -------------------------------------------------------------
Expand All @@ -73,9 +73,9 @@ jobs:
# and the AtChem2 dependencies: CVODE, openlibm, numdiff, FRUIT

# gfortran on ubuntu
#- name: Install gfortran-11 (ubuntu-20.04)
# if: matrix.os == 'ubuntu-20.04' && matrix.fortran == 11
# run: sudo apt-get install gfortran-11
- name: Install gfortran-11 (ubuntu-20.04)
if: matrix.os == 'ubuntu-20.04' && matrix.fortran == 11
run: sudo apt-get install gfortran-11

# gfortran on macos
- name: Install gfortran-10 (macos-12)
Expand Down
26 changes: 13 additions & 13 deletions docker/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/sh
# -----------------------------------------------------------------------------
#
# Copyright (c) 2009 - 2012 Chris Martin, Kasia Boronska, Jenny Young,
Expand All @@ -16,41 +16,41 @@
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# This script is run everytime the container is run.
# This script is run everytime the container is run.
#
# First it copies the /atchem/ directory that is created during the build to
# First it copies the /atchem/ directory that is created during the build to
# the home directory of the user running the container. This is for
# compatibility with singularity, where the user running the container is not
# root, and therefore cannot modify the model files in place.
# root, and therefore cannot modify the model files in place.
#
# Next it moves the user configuration from /data_transfer/ and copies it into
# the ~/atchem/ directory. This /data_transfer/ directory is created when the
# the user mounts a volume when running the container (e.g `docker run -v...`)
#
# We then move to the ~/atchem directory and build the model using the mechanism
# specified by the user as a runtime argument to `docker run`.
# specified by the user as a runtime argument to `docker run`.
#
# Then the model is run by executing the newly built atchem2 file.
# Then the model is run by executing the newly built atchem2 file.
#
# On completion the atchem model output directory is copied to the data_transfer
# directory and as such onto the host filesystem
# -----------------------------------------------------------------------------

# make a copy to home to allow for compatibility with singularity
\command cp -rf /atchem/ ~/
# Make a copy to home to allow for compatibility with singularity
\command cp -rf /atchem/ ~/

# Transfer in user config
\command cp -rf /data_transfer/* ~/atchem/

# move into atchem dir
# Move into atchem dir
cd ~/atchem/

# build model using user specified mechanism
# Build model using user specified mechanism
./build/build_atchem2.sh $1
echo $1

# run model
# Run model
./atchem2

# copy outputs to data_transfer / host filesystem
\command cp -rf ~/atchem/model/output /data_transfer/model/
# Copy outputs to data_transfer / host filesystem
\command cp -rf ~/atchem/model/output /data_transfer/model/
24 changes: 12 additions & 12 deletions docker/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# -----------------------------------------------------------------------------
#
# Copyright (c) 2009 - 2012 Chris Martin, Kasia Boronska, Jenny Young,
Expand All @@ -16,34 +16,34 @@
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# This is the install script that is run when the container is built. It
# This is the install script that is run when the container is built. It
# installs the necessary dependacies for installing AtChem2 (gcc-gfortran,
# wget, cmake and python3.11).
#
# It then runs the install scripts provided with the model (install_cvode.sh
# It then runs the install scripts provided with the model (install_cvode.sh
# and install_openlibm.sh) to install additional dependancies required to build
# the model.
#
# Next it produces the Makefile from the skeleton, and amends the dependancy
#
# Next it produces the Makefile from the skeleton, and amends the dependancy
# paths.
#
#
# Finally it does some housekeeping, updating the build_atchem2.sh to be able
# to find the python installation, and makes the docker entrypoint script
# executable.
# to find the python installation, and makes the docker entrypoint script
# executable.
# -----------------------------------------------------------------------------

# Install dependancies from package repository
dnf install -y which gcc-gfortran wget cmake python3.11

# make directories
# Make directories
mkdir /atchem-lib
# mkdir /atchem

# move to /atchem so the dependacy installation scripts work correctly.
# Move to /atchem so the dependacy installation scripts work correctly.
cd atchem

# Install dependancies to /atchem-lib
./tools/install/install_cvode.sh /atchem-lib/
./tools/install/install_cvode.sh /atchem-lib/
./tools/install/install_openlibm.sh /atchem-lib/

# Change atchem dependancy paths and create Makefile from skeleton
Expand All @@ -52,4 +52,4 @@ sed -i 's,openlibm-0.8.1,/atchem-lib/openlibm-0.8.1,g' ./Makefile

# Fix python command to match installed version
sed -i "s/python/python3/g" ./build/build_atchem2.sh
chmod +x docker/entrypoint.sh
chmod +x docker/entrypoint.sh

0 comments on commit 5e09b0e

Please sign in to comment.