Skip to content

Commit

Permalink
Merge pull request #2139 from octue/final-dockerfile-updates
Browse files Browse the repository at this point in the history
Add final dockerfile updates
  • Loading branch information
andrew-platt authored Apr 4, 2024
2 parents 85ee2dc + b100421 commit f03df27
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docker-image-automatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 300
env:
DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile
DOCKERHUB_REPOSITORY: octue/openfast
DOCKERFILE_PATH: share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-docker-image-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 300
env:
DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile
DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile
DOCKERHUB_REPOSITORY: octue/openfast
DOCKERFILE_PATH: share/docker/Dockerfile
DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/OpenFAST/openfast/main/share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 300
env:
DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile
DOCKERHUB_REPOSITORY: octue/openfast
DOCKERFILE_PATH: share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ RUN apt-get update -qq && \
gcc \
gfortran \
git \
libblas-dev \
liblapack-dev \
libopenblas-dev \
make \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -50,7 +49,7 @@ WORKDIR /openfast/build
# will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an
# "internal error"
ENV FC=/usr/bin/gfortran
ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE"
ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=OFF -DCMAKE_BUILD_TYPE=RELEASE"
RUN cmake .. ${CMAKE_OPTIONS}

ARG BUILD_CORES=4
Expand All @@ -64,9 +63,9 @@ ARG TIMEZONE=UTC
ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE}

RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
libblas-dev \
liblapack-dev \
apt-get install --no-install-recommends -y \
libopenblas-dev \
libgomp1 \
nano \
&& rm -rf /var/lib/apt/lists/*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ Production images of OpenFAST for the `linux/amd64` platform are available on th
## Build arguments
Provide any of the following build arguments to customise the image at build time.

| Name | Type | Allowed values | Default | Description |
| --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------|
| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. |
| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. |
| `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. |
| `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. |
| Name | Type | Allowed values | Default | Description |
| --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. |
| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=OFF -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. |
| `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. |
| `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. |

For example, to build OpenFAST v3.5.3 for the `linux/amd64` platform and set `CMAKE_OPTIONS` so the testing tree is built:

```shell
# Run from the root of this repository.
git checkout v3.5.3
docker build -f share/docker/openfast_ubuntu/Dockerfile -t openfast:3.5.3 --platform=linux/amd64 --build-arg=CMAKE_OPTIONS='-DBUILD_TESTING=ON' .
docker build -f share/docker/Dockerfile -t openfast:3.5.3 --platform=linux/amd64 --build-arg=CMAKE_OPTIONS='-DBUILD_TESTING=ON' .
```

**NOTE:** This version of the `Dockerfile` is only available in v3.5.3 and up of this repository. To build earlier
Expand Down

0 comments on commit f03df27

Please sign in to comment.