Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Dockerfile based on AWS Lambda Python 3.8 Runtime with GFortran + netCDF + FCM Make

License

Notifications You must be signed in to change notification settings

matthewrmshin/lambda-gfortran-fcm-make-netcdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions status

lambda-gfortran-fcm-make-netcdf

Dockerfile based on AWS Lambda Python 3.8 runtime Environment with:

The aim is to provide an easy way to use FCM Make and GFortran to build a Fortran executable that has a dependency on the netCDF library.

The shared libraries are placed under /var/task/, which can then be extracted easily to be part of a lambda package.

The container is currently based on the Python 3.8 lambda runtime, so the Fortran executable is expected to run as a subprocess invoked by a Python lambda handler function.

Usage

Get the image from Docker Hub:

docker pull matthewrmshin/lambda-gfortran-fcm-make-netcdf

docker run --rm -t -i -u "$(id -u):$(id -g)" -v "/path/to/source:/opt/myapp" -v "/path/to/package:/tmp/package" 'matthewrmshin/lambda-gfortran-fcm-make-netcdf' -F '/opt/myapp'

On running the container, it will do:

  • Call fcm make.
    • Any trailing arguments are given to fcm make.
    • Use docker run -e KEY=VALUE ... options to define environment variables.
    • The default working directory is under /tmp/myapp.
  • If /tmp/package exists:
    • Copy /var/task/lib/*.so* to /tmp/package/lib/.
    • Copy /tmp/myapp/build/{bin,etc,lib} to /tmp/package/{bin,etc,lib}.

To package things up...

  • Add a Python module with a lambda handler function to the root of package directory. It should do:
    • Invoke /var/task/bin/... with subprocess.run or otherwise.
    • Turn event + input into input to the Fortran executable.
    • Send output from the Fortran executable to a suitable location.
  • Create a zip file with content of the package directory.
  • Deploy the package.

The lambda-jules repository contains some example usage.

About

Dockerfile based on AWS Lambda Python 3.8 Runtime with GFortran + netCDF + FCM Make

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published