From 51a29029fa7e0ef20ab5cb1d2fb20e71e8173dc3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:34:03 +0000 Subject: [PATCH 01/56] FIX: Update dockerfile base to get required `cmake` version --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 8470e56230..01a5391cae 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # -FROM ubuntu:bionic +FROM ubuntu:mantic # Install dependencies @@ -34,7 +34,7 @@ RUN apt update -qq && \ apt install -y git && \ apt install -y nano -RUN pip3 install numpy +# RUN pip3 install numpy # Configure the environment ENV FC=/usr/bin/gfortran From 0184e607cba6ca7335207cafa46830a67d3849f9 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:34:53 +0000 Subject: [PATCH 02/56] CHO: Add `.idea` to `.gitignore` --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 0b6dd4368e..5cf777ca93 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,5 @@ vs-build/ varcache *.slxc +# JetBrains IDEs config +.idea From 290039959deaf1609ce729c738714cec5dcc5209 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:35:46 +0000 Subject: [PATCH 03/56] ENH: Make dockerfile base configurable --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 01a5391cae..eb4e48e142 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -FROM ubuntu:mantic +ARG BASE=ubuntu:mantic +FROM ${BASE} # Install dependencies From 8519687472bc26017186ff211b3887fbcd7749fc Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:38:00 +0000 Subject: [PATCH 04/56] ENH: Make dockerfile timezone configurable --- share/docker/openfast_ubuntu/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index eb4e48e142..66ea123867 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,6 +14,8 @@ # limitations under the License. # ARG BASE=ubuntu:mantic +ARG TIMEZONE=America/Denver + FROM ${BASE} # Install dependencies @@ -22,7 +24,7 @@ FROM ${BASE} # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ENV DEBIAN_FRONTEND=noninteractive TZ=America/Denver +ENV DEBIAN_FRONTEND=noninteractive TZ=TIMEZONE RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ From 79f5910f3963ceaa4e9b5ba79fe0a19b4ba9e6da Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:01:31 +0000 Subject: [PATCH 05/56] FIX: Fix timezone build arg in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 66ea123867..1ca978f5cd 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,17 +14,17 @@ # limitations under the License. # ARG BASE=ubuntu:mantic -ARG TIMEZONE=America/Denver - FROM ${BASE} +ARG TIMEZONE=America/Denver + # Install dependencies # For gfortran-8 # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ENV DEBIAN_FRONTEND=noninteractive TZ=TIMEZONE +ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ From 5dc82f43d1134cc2847cb571c1f1fd018e25d01a Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:05:40 +0000 Subject: [PATCH 06/56] ENH: Make openfast version configurable in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 1ca978f5cd..f359416da4 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,6 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=America/Denver +ARG VERSION='v3.5.2' # Install dependencies @@ -42,7 +43,7 @@ RUN apt update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --recursive https://github.com/openfast/openfast.git openfast +RUN git clone --depth 1 --branch=${VERSION} --recursive https://github.com/openfast/openfast.git WORKDIR /openfast # Build the project From f6bc0cc12182fc0e852270e02318cb9e58b07198 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:09:05 +0000 Subject: [PATCH 07/56] ENH: Make cores available for building configurable in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index f359416da4..c0121a438f 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -53,5 +53,6 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memoery. Otherwise, the gfortran compiler will exit with an # "internal error" +ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO -RUN make -j4 install +RUN make -j${BUILD_CORES} install From 57a1fbdda09754df258c0825df1d3cfb58f42e64 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:34:52 +0000 Subject: [PATCH 08/56] ENH: Clone openfast with shallow submodules in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index c0121a438f..eea305269b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -43,7 +43,7 @@ RUN apt update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --depth 1 --branch=${VERSION} --recursive https://github.com/openfast/openfast.git +RUN git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git WORKDIR /openfast # Build the project From 561eb2207546d8997665e03bc854346ea5959e51 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:06:47 +0000 Subject: [PATCH 09/56] REF: Combine apt installation commands into one --- share/docker/openfast_ubuntu/Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index eea305269b..a72b25dd07 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -30,12 +30,17 @@ ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ - apt install -y python3-pip && \ - apt install -y cmake cmake-curses-gui && \ - apt install -y gcc gfortran make && \ - apt install -y libblas-dev liblapack-dev && \ - apt install -y git && \ - apt install -y nano + apt install -y \ + python3-pip \ + cmake \ + cmake-curses-gui \ + gcc \ + gfortran \ + make \ + libblas-dev \ + liblapack-dev \ + git \ + nano # RUN pip3 install numpy From 0302ea8f441770a11841b9ffb1c74418b5775da3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:24:45 +0000 Subject: [PATCH 10/56] ENH: Use `apt-get` instead of `apt` and remove cache --- share/docker/openfast_ubuntu/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index a72b25dd07..0e8cd2d7d9 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -27,10 +27,10 @@ ARG VERSION='v3.5.2' ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} -RUN apt update -qq && \ - apt install -y software-properties-common build-essential && \ +RUN apt-get update -qq && \ + apt-get install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ - apt install -y \ + apt-get install -y \ python3-pip \ cmake \ cmake-curses-gui \ @@ -40,7 +40,8 @@ RUN apt update -qq && \ libblas-dev \ liblapack-dev \ git \ - nano + nano \ + && rm -rf /var/lib/apt/lists/* # RUN pip3 install numpy From 5e63e58cec048464a421c0f6214af37b15a4a740 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:37:37 +0000 Subject: [PATCH 11/56] ENH: Make `openfast` command available in docker image --- share/docker/openfast_ubuntu/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0e8cd2d7d9..5c54c114a0 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -62,3 +62,6 @@ WORKDIR /openfast/build ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install + +# Make `openfast` command work. +ENV PATH=/openfast/install/bin:$PATH From 965bfa110e09d4f23804baafb4ec5c049daf02fd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:57:07 +0000 Subject: [PATCH 12/56] ENH: Make building testing tree optional --- share/docker/openfast_ubuntu/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 5c54c114a0..0ba4a2dec4 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -57,10 +57,11 @@ RUN mkdir build WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine -# will require about 6GB of memoery. Otherwise, the gfortran compiler will exit with an +# will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_CORES=4 -RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO +ARG BUILD_TESTING=ON +RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install # Make `openfast` command work. From 025f11737357294b9a9ac4e38885152d292c9862 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 17:12:31 +0000 Subject: [PATCH 13/56] ENH: Avoid cloning submodules if not building test tree --- share/docker/openfast_ubuntu/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0ba4a2dec4..4d4616a6f8 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -49,7 +49,12 @@ RUN apt-get update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git +ARG BUILD_TESTING=ON + +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git; \ + else git clone --depth 1 --branch=${VERSION} https://github.com/openfast/openfast.git; \ + fi + WORKDIR /openfast # Build the project @@ -60,7 +65,6 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_CORES=4 -ARG BUILD_TESTING=ON RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install From bfde52767f6fed5c79f7947da1c4dab17de88e37 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 17:28:07 +0000 Subject: [PATCH 14/56] REF: Sort `apt-get install` lines --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 4d4616a6f8..7f3b6fb918 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -31,16 +31,16 @@ RUN apt-get update -qq && \ apt-get install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ apt-get install -y \ - python3-pip \ cmake \ cmake-curses-gui \ gcc \ gfortran \ - make \ + git \ libblas-dev \ liblapack-dev \ - git \ + make \ nano \ + python3-pip \ && rm -rf /var/lib/apt/lists/* # RUN pip3 install numpy From db0a7e7cde04d322e6f58c9c8bf4e828cc3fa067 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:31:02 +0000 Subject: [PATCH 15/56] REF: Factor out repository URL --- share/docker/openfast_ubuntu/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 7f3b6fb918..cac7b0dd4c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -49,10 +49,11 @@ RUN apt-get update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project +ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=ON -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git; \ - else git clone --depth 1 --branch=${VERSION} https://github.com/openfast/openfast.git; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 5eb65aba91080e73dfed00225b05df900e89ec55 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:31:18 +0000 Subject: [PATCH 16/56] ENH: Remove commented out numpy installation --- share/docker/openfast_ubuntu/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index cac7b0dd4c..1963041c88 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -43,8 +43,6 @@ RUN apt-get update -qq && \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# RUN pip3 install numpy - # Configure the environment ENV FC=/usr/bin/gfortran From 38af4130a8f0499fb64e429743632708c40894f3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:34:10 +0000 Subject: [PATCH 17/56] ENH: Set timezone to UTC by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 1963041c88..b8a332309b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -16,7 +16,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} -ARG TIMEZONE=America/Denver +ARG TIMEZONE=UTC ARG VERSION='v3.5.2' # Install dependencies From cc8a9c9ff1d66b05e5fc5483ecf29ee202648c14 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:35:26 +0000 Subject: [PATCH 18/56] ENH: Set `BUILD_TESTING` to "OFF" by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b8a332309b..b16162f8bd 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -48,7 +48,7 @@ ENV FC=/usr/bin/gfortran # Clone the project ENV REPOSITORY_URL=https://github.com/openfast/openfast.git -ARG BUILD_TESTING=ON +ARG BUILD_TESTING=OFF RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ From ce8fa1682208e3e02c80a5f6beefb7906ffe2238 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:36:32 +0000 Subject: [PATCH 19/56] REF: Rename `VERSION` build arg to `OPENFAST_VERSION` --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b16162f8bd..4de78daa12 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,7 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=UTC -ARG VERSION='v3.5.2' +ARG OPENFAST_VERSION='v3.5.2' # Install dependencies @@ -50,8 +50,8 @@ ENV FC=/usr/bin/gfortran ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=OFF -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=${OPENFAST_VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 9822a4c7a04b5389949d79d3520bcc52ee071667 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:44:18 +0000 Subject: [PATCH 20/56] ENH: Remove need to prefix version numbers with `v` --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 4de78daa12..0b1a9a8d0c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,7 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=UTC -ARG OPENFAST_VERSION='v3.5.2' +ARG OPENFAST_VERSION='3.5.2' # Install dependencies @@ -50,8 +50,8 @@ ENV FC=/usr/bin/gfortran ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=OFF -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=${OPENFAST_VERSION} $REPOSITORY_URL; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=v${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=v${OPENFAST_VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 2b976781705c003ba90897eb2f2a88738e1f6c0e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 11:52:41 +0000 Subject: [PATCH 21/56] ENH: Build from local context instead of cloning repository --- .dockerignore | 25 +++++++++++++++++++++++++ share/docker/openfast_ubuntu/Dockerfile | 17 +++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..f4bfc6a972 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +# System, cache and editor files +**/__pycache__ +**/.DS_Store + +.editorconfig +.idea +.git +.github +.gitignore +.pytest_cache +.pre-commit-config.yaml +.readthedocs.yml +.coverage +Procfile +README.md + +# Never bake in environment variables +.env +.env* +google_credentials.json +# See: https://github.com/google-github-actions/auth/issues/123 +gha-creds-*.json +gcp-creds-*.json + +.devcontainer/.zsh_history diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0b1a9a8d0c..27876821e2 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -16,15 +16,12 @@ ARG BASE=ubuntu:mantic FROM ${BASE} -ARG TIMEZONE=UTC -ARG OPENFAST_VERSION='3.5.2' - # Install dependencies - # For gfortran-8 # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 +ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ @@ -46,16 +43,11 @@ RUN apt-get update -qq && \ # Configure the environment ENV FC=/usr/bin/gfortran -# Clone the project -ENV REPOSITORY_URL=https://github.com/openfast/openfast.git -ARG BUILD_TESTING=OFF - -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=v${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=v${OPENFAST_VERSION} $REPOSITORY_URL; \ - fi - WORKDIR /openfast +# Copy in the checked-out code version. +COPY . . + # Build the project RUN mkdir build WORKDIR /openfast/build @@ -63,6 +55,7 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" +ARG BUILD_TESTING=OFF ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install From c8814e07fbbd162d334fef23da417acf57a5aab0 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 13:46:33 +0000 Subject: [PATCH 22/56] ENH: Use a multi-stage build to reduce final image size --- share/docker/openfast_ubuntu/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 27876821e2..e680264217 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # ARG BASE=ubuntu:mantic -FROM ${BASE} +FROM ${BASE} AS build # Install dependencies # For gfortran-8 @@ -56,9 +56,13 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_TESTING=OFF -ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO + +ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install +FROM ${BASE} as production +COPY --from=build /openfast/install /openfast/install + # Make `openfast` command work. ENV PATH=/openfast/install/bin:$PATH From c14609674ee7de09ad5dcd24e5682c91de25f401 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 14:43:53 +0000 Subject: [PATCH 23/56] FIX: Ensure system dependencies are available in final image --- share/docker/openfast_ubuntu/Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index e680264217..7ce1f685af 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -64,5 +64,23 @@ RUN make -j${BUILD_CORES} install FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install +ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} + +RUN apt-get update -qq && \ + apt-get install -y software-properties-common build-essential && \ + add-apt-repository ppa:git-core/ppa -y && \ + apt-get install -y \ + cmake \ + cmake-curses-gui \ + gcc \ + gfortran \ + git \ + libblas-dev \ + liblapack-dev \ + make \ + nano \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* + # Make `openfast` command work. ENV PATH=/openfast/install/bin:$PATH From dc326b3443571e16450cb321a9c982bf8bbe7411 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:03:19 +0000 Subject: [PATCH 24/56] ENH: Reduce docker image size by minimising included packages --- share/docker/openfast_ubuntu/Dockerfile | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 7ce1f685af..a40f1195af 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -67,19 +67,7 @@ COPY --from=build /openfast/install /openfast/install ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y software-properties-common build-essential && \ - add-apt-repository ppa:git-core/ppa -y && \ - apt-get install -y \ - cmake \ - cmake-curses-gui \ - gcc \ - gfortran \ - git \ - libblas-dev \ - liblapack-dev \ - make \ - nano \ - python3-pip \ + apt-get install -y libblas-dev liblapack-dev \ && rm -rf /var/lib/apt/lists/* # Make `openfast` command work. From 19e40510fde326c82627f89f7236a5069b888e7b Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:06:05 +0000 Subject: [PATCH 25/56] ENH: Remove extra packages from first build stage --- share/docker/openfast_ubuntu/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index a40f1195af..c2b5d1706b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,19 +25,14 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y software-properties-common build-essential && \ - add-apt-repository ppa:git-core/ppa -y && \ apt-get install -y \ cmake \ cmake-curses-gui \ gcc \ gfortran \ - git \ libblas-dev \ liblapack-dev \ make \ - nano \ - python3-pip \ && rm -rf /var/lib/apt/lists/* # Configure the environment From fb67cc3105b8ad059c4b02a902f2f36cb2661f5d Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:08:51 +0000 Subject: [PATCH 26/56] ENH: Allow injection of all `cmake` args --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index c2b5d1706b..72b193ad82 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -50,8 +50,8 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" -ARG BUILD_TESTING=OFF -RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO" +RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install From 367aca04938523bb58780b12122da344572164a3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:11:21 +0000 Subject: [PATCH 27/56] REF: Move environment variables and build args to more optimal places --- share/docker/openfast_ubuntu/Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 72b193ad82..f8630b88aa 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -21,8 +21,7 @@ FROM ${BASE} AS build # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ARG TIMEZONE=UTC -ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ apt-get install -y \ @@ -35,21 +34,18 @@ RUN apt-get update -qq && \ make \ && rm -rf /var/lib/apt/lists/* -# Configure the environment -ENV FC=/usr/bin/gfortran - -WORKDIR /openfast - # Copy in the checked-out code version. +WORKDIR /openfast COPY . . -# Build the project +# Build the project. RUN mkdir build WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # 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=RELWITHDEBINFO" RUN cmake .. ${CMAKE_OPTIONS} @@ -59,6 +55,7 @@ RUN make -j${BUILD_CORES} install FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install +ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ From 782041b397706fb4d9eb9ddd72d2d1055a76d432 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:13:02 +0000 Subject: [PATCH 28/56] ENH: Set `CMAKE_BUILD_TYPE` to `RELEASE` by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index f8630b88aa..ea28951f07 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -46,7 +46,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=RELWITHDEBINFO" +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE" RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 From d994413bc7a56f2d20544d22fa48b2a28b84e5f3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:35:14 +0000 Subject: [PATCH 29/56] FIX: Add essential dependencies back to build stage --- share/docker/openfast_ubuntu/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index ea28951f07..e84ff43629 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,6 +25,8 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ apt-get install -y \ + software-properties-common \ + build-essential \ cmake \ cmake-curses-gui \ gcc \ From d1c898284cdd26cb40e06b8a9f67b2c7c1f7e555 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 16:36:36 +0000 Subject: [PATCH 30/56] ENH: Add `nano` back to production image --- share/docker/openfast_ubuntu/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index e84ff43629..b41e25822c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -61,7 +61,10 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y libblas-dev liblapack-dev \ + apt-get install -y \ + libblas-dev \ + liblapack-dev \ + nano \ && rm -rf /var/lib/apt/lists/* # Make `openfast` command work. From 60a689bf94fa7b0cccb13d86da2a72bf0a7b5cfc Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 16:41:40 +0000 Subject: [PATCH 31/56] ENH: Add comments explaining build stages --- share/docker/openfast_ubuntu/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b41e25822c..2341120ed7 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,6 +14,8 @@ # limitations under the License. # ARG BASE=ubuntu:mantic + +# Build stage 1: builds openfast. FROM ${BASE} AS build # Install dependencies @@ -54,6 +56,7 @@ RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install +# Build stage 2: provides built openfast in a small image. FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install From 5ae67cc59d85552d6e745c5946c1ebc05e8b7343 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 17:10:01 +0000 Subject: [PATCH 32/56] CHO: Add dockerfiles to `.dockerignore` --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index f4bfc6a972..1c757d6d4e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,3 +23,4 @@ gha-creds-*.json gcp-creds-*.json .devcontainer/.zsh_history +share/docker From e07542ea53701479507401473374acc65993c769 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 17:10:33 +0000 Subject: [PATCH 33/56] FIX: Add `git` back to build stage --- share/docker/openfast_ubuntu/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 2341120ed7..30812a3a33 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -33,6 +33,7 @@ RUN apt-get update -qq && \ cmake-curses-gui \ gcc \ gfortran \ + git \ libblas-dev \ liblapack-dev \ make \ From 96a33dac3950a2ab69984ac8e2e621ba1b0696a7 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 15:23:10 +0000 Subject: [PATCH 34/56] DOC: Add readme explaining dockerfile --- share/docker/openfast_ubuntu/README.md | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 share/docker/openfast_ubuntu/README.md diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md new file mode 100644 index 0000000000..3f5568f166 --- /dev/null +++ b/share/docker/openfast_ubuntu/README.md @@ -0,0 +1,42 @@ +# OpenFAST docker images + +## Summary +The `Dockerfile` in this directory can be used to reliably build OpenFAST as a docker image that can be run locally and +in the cloud without much setup. By default, it's based on Ubuntu Mantic and is optimised in size and performance for +production use. A multi-stage build is used, producing an Ubuntu image with just `libblas-dev`, `liblapack-dev`, `nano` +and `openfast` added. The image built by this `Dockerfile` can be customised at build time using build arguments. + +## Image registry +Production images of OpenFAST for the `linux/amd64` platform are available on the +[NREL docker hub](https://hub.docker.com/r/nrel/openfast). + +## 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:mantic` | 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. | + +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' . +``` + +**NOTE:** This version of the `Dockerfile` is only available in v3.5.3 and up of this repository. To build earlier +versions of OpenFAST, check out the code at that version and recreate the `Dockerfile` from v3.5.3 (or above) in the +checked-out repository first. + +## Building development images +Development images can be built from the production image as a base. Simply start a new `Dockerfile` with: + +```dockerfile +FROM nrel/openfast:3.5.3 +``` + +Images can be built for different platforms using the `--platform` option when building the image. From b35146fbabafb528f17b17a10780a0df3ba67a9e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 15:51:22 +0000 Subject: [PATCH 35/56] OPS: Add `build-docker-image` workflow --- .github/workflows/build-docker-image.yml | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build-docker-image.yml diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml new file mode 100644 index 0000000000..18cc28aa5b --- /dev/null +++ b/.github/workflows/build-docker-image.yml @@ -0,0 +1,42 @@ +name: build-docker-image + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag for Docker image (excluding the "v" prefix e.g. 3.5.3)' + required: true + ref: + description: 'Branch, tag, or commit SHA to build from' + required: true + default: main + +jobs: + build-and-push: + runs-on: ubuntu-latest + timeout-minutes: 300 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to DockerHub + uses: docker/login-action@v5 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push to registry + uses: docker/build-push-action@v3.1.1 + with: + context: . + file: share/docker/openfast_ubuntu/Dockerfile + platforms: linux/amd64 + tags: nrel/openfast:${{ github.event.inputs.tag }} + push: true + cache-from: type=gha + cache-to: type=gha,mode=max From 392492b6ec6233074480a2b8e488aa64754ddc1e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:05:44 +0000 Subject: [PATCH 36/56] CHO: Update copyright year in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 30812a3a33..40e68e1851 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -1,5 +1,4 @@ -# -# Copyright 2016 National Renewable Energy Laboratory +# Copyright 2024 National Renewable Energy Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 27a5c66a07a3e6f95a612d1c766e9124d5a56255 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:06:29 +0000 Subject: [PATCH 37/56] ENH: Get dockerfile if running workflow on an older version --- .github/workflows/build-docker-image.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 18cc28aa5b..9a8d87be8f 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -15,6 +15,9 @@ jobs: build-and-push: 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 steps: - name: Checkout uses: actions/checkout@v4 @@ -30,11 +33,14 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Get Dockerfile for versions < 3.5.3 + run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi + - name: Build and push to registry uses: docker/build-push-action@v3.1.1 with: context: . - file: share/docker/openfast_ubuntu/Dockerfile + file: $DOCKERFILE_PATH platforms: linux/amd64 tags: nrel/openfast:${{ github.event.inputs.tag }} push: true From e43e760f4e7f718237964f72e759afa949b516cd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:15:13 +0000 Subject: [PATCH 38/56] OPS: Use correct docker action versions --- .github/workflows/build-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 9a8d87be8f..e03ced49d7 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -28,7 +28,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log in to DockerHub - uses: docker/login-action@v5 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -37,7 +37,7 @@ jobs: run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi - name: Build and push to registry - uses: docker/build-push-action@v3.1.1 + uses: docker/build-push-action@v5 with: context: . file: $DOCKERFILE_PATH From a51922aae4b9c26931e35b06390c5454b799316c Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:24:58 +0000 Subject: [PATCH 39/56] OPS: Use environment context instead of environment variables --- .github/workflows/build-docker-image.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index e03ced49d7..2643483304 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -34,13 +34,16 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get Dockerfile for versions < 3.5.3 - run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi + run: | + if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ + then wget -O ${{ env.DOCKERFILE_PATH }} ${{ env.DOCKERFILE_PERMALINK }}; \ + fi - name: Build and push to registry uses: docker/build-push-action@v5 with: context: . - file: $DOCKERFILE_PATH + file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 tags: nrel/openfast:${{ github.event.inputs.tag }} push: true From 24bd1ff914261c6c8fb01b3ada9a4307c96014cd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:43:36 +0000 Subject: [PATCH 40/56] ENH: Use `--no-install-recommends` in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 40e68e1851..2c991eb2c6 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,7 +25,7 @@ FROM ${BASE} AS build ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ - apt-get install -y \ + apt-get install --no-install-recommends -y \ software-properties-common \ build-essential \ cmake \ @@ -64,7 +64,7 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y \ + apt-get install --no-install-recommends -y \ libblas-dev \ liblapack-dev \ nano \ From 8cbac60679b8d64b184b30b4cde550c5afa58cca Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:44:40 +0000 Subject: [PATCH 41/56] OPS: Factor out and fix docker repository in docker workflow --- .github/workflows/build-docker-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 2643483304..393ee1daa0 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -18,6 +18,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile + DOCKER_HUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -45,7 +46,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 - tags: nrel/openfast:${{ github.event.inputs.tag }} + tags: ${{ env.DOCKER_HUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From 8de46aa8fbcdd6b2b87937eb81dc60f2c67f0b1f Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:43:42 +0000 Subject: [PATCH 42/56] OPS: Add comment explaining Dockerfile download step --- .github/workflows/build-docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 393ee1daa0..5dbc379a9c 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -34,6 +34,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + # The updated Dockerfile is only available in the repository at the tag 3.5.3 and above. If we want to build + # versions of OpenFAST that are below this version, we have to get the updated Dockerfile from that tag of the + # repository before building. For versions >= 3.5.3, the Dockerfile is already there so this step does nothing. - name: Get Dockerfile for versions < 3.5.3 run: | if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ From c6aee2b4fa73eb05b5f4cc677a8fa7ce6b327ae1 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:44:26 +0000 Subject: [PATCH 43/56] OPS: Rename environment variable for consistency --- .github/workflows/build-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 5dbc379a9c..f168e08ba1 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -18,7 +18,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile - DOCKER_HUB_REPOSITORY: octue/openfast + DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -49,7 +49,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 - tags: ${{ env.DOCKER_HUB_REPOSITORY }}:${{ github.event.inputs.tag }} + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From 9a121352ca3cb9ae661fba58bf41deb1609e52a3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:45:09 +0000 Subject: [PATCH 44/56] CHO: Move `.idea` into correct section of `.gitignore` --- .gitignore | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5cf777ca93..8004a8eb5d 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,8 @@ vs-build/ .atom .fortls .devcontainer +.idea + # backup files *.asv ~$*.xlsx @@ -54,6 +56,3 @@ vs-build/ #Simulink cache files varcache *.slxc - -# JetBrains IDEs config -.idea From 520931cc001ab3ceea93527f97bc23e2aa472bd7 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:54:05 +0000 Subject: [PATCH 45/56] ENH: Add 2016 to start of copyright notice in Dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 2c991eb2c6..89e5b74ba1 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2024 National Renewable Energy Laboratory +# Copyright 2016-2024 National Renewable Energy Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From aab4a6d66ca92ed81fc0750f41d5091a99424a92 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:54:21 +0000 Subject: [PATCH 46/56] OPS: Build docker image for `linux/aarch64` too --- .github/workflows/build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index f168e08ba1..0452726552 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -48,7 +48,7 @@ jobs: with: context: . file: ${{ env.DOCKERFILE_PATH }} - platforms: linux/amd64 + platforms: linux/amd64,linux/aarch64 tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha From 14e77db76d68e98bdcf9f2e4bac859d1438229a3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 12:06:49 +0000 Subject: [PATCH 47/56] OPS: Add description to docker workflow --- .github/workflows/build-docker-image.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 0452726552..76a8a20060 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -1,3 +1,6 @@ +# This manually-triggered workflow builds OpenFAST docker images for the linux/amd64 and linux/aarch64 architectures for +# the specified git ref (this can be a branch, tag, or commit hash). The image is tagged with the given tag and pushed +# to the `nrel/openfast` repository. The build cache is stored in GitHub actions. name: build-docker-image on: @@ -34,9 +37,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - # The updated Dockerfile is only available in the repository at the tag 3.5.3 and above. If we want to build - # versions of OpenFAST that are below this version, we have to get the updated Dockerfile from that tag of the - # repository before building. For versions >= 3.5.3, the Dockerfile is already there so this step does nothing. + # The updated Dockerfile is only available in the repository at the tag v3.5.3 and above. To build versions of + # OpenFAST that are below this version, the updated Dockerfile from that tag of the repository has to be acquired + # before building. For versions >= v3.5.3, the Dockerfile is already there so this step does nothing. - name: Get Dockerfile for versions < 3.5.3 run: | if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ From 3e06eab46819a2b97fe1f05e58abd12f729ccd7e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 18:11:36 +0000 Subject: [PATCH 48/56] OPS: Add automatic docker build on merge into `main` from RC branches --- .../build-docker-image-automatic.yml | 48 +++++++++++++++++++ ...mage.yml => build-docker-image-manual.yml} | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-docker-image-automatic.yml rename .github/workflows/{build-docker-image.yml => build-docker-image-manual.yml} (98%) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml new file mode 100644 index 0000000000..1eb16128fe --- /dev/null +++ b/.github/workflows/build-docker-image-automatic.yml @@ -0,0 +1,48 @@ +# This workflow builds an OpenFAST docker image for the linux/amd64 and linux/aarch64 architectures on merge into +# `main` from a release candidate branch. The image is tagged both with "latest" and the version extracted from the +# release candidate branch's name (e.g. "rc-3.5.3") before being pushed to the `nrel/openfast` repository. The build +# cache is stored in GitHub actions. +name: build-docker-image-automatic + +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + build-and-push: + if: ${{ (github.event.pull_request.merged == true) && startsWith(github.head_ref, 'rc-') }} + runs-on: ubuntu-latest + timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERHUB_REPOSITORY: octue/openfast + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract tag from release candidate branch name + id: extract-tag + run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + + - name: Build and push to registry + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }} + platforms: linux/amd64,linux/aarch64 + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest + push: true + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image-manual.yml similarity index 98% rename from .github/workflows/build-docker-image.yml rename to .github/workflows/build-docker-image-manual.yml index 76a8a20060..088854ff93 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -1,7 +1,7 @@ # This manually-triggered workflow builds OpenFAST docker images for the linux/amd64 and linux/aarch64 architectures for # the specified git ref (this can be a branch, tag, or commit hash). The image is tagged with the given tag and pushed # to the `nrel/openfast` repository. The build cache is stored in GitHub actions. -name: build-docker-image +name: build-docker-image-manual on: workflow_dispatch: From 0e8a61a5d0c5c2af90f215bb47942343413e0206 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 18:15:00 +0000 Subject: [PATCH 49/56] OPS: Add `test-build-docker-image` workflow --- .github/workflows/test-build-docker-image.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/test-build-docker-image.yml diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml new file mode 100644 index 0000000000..0d4e0b85a6 --- /dev/null +++ b/.github/workflows/test-build-docker-image.yml @@ -0,0 +1,36 @@ +# This workflow tests building an OpenFAST docker image for the linux/amd64 architecture on push to a release candidate +# branch. The build cache is stored in GitHub actions. +name: test-build-docker-image + +on: + pull_request: + branches: + - main + +jobs: + test-build: + if: startsWith(github.head_ref, 'rc-') + runs-on: ubuntu-latest + timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract tag from release candidate branch name + id: extract-tag + run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + + - name: Test building docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }} + platforms: linux/amd64 + push: false + cache-from: type=gha + cache-to: type=gha,mode=max From 4a04caa749887192e2a904b9a3b393d4cbb1d5af Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 10:22:00 +0000 Subject: [PATCH 50/56] ENH: Use long-term-support ubuntu base by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 89e5b74ba1..e4774eb803 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -ARG BASE=ubuntu:mantic +ARG BASE=ubuntu:jammy # Build stage 1: builds openfast. FROM ${BASE} AS build From a6d4197bc67b9abc89684e8af592dbe81578950b Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:02:23 +0000 Subject: [PATCH 51/56] DOC: Update documentation --- docs/source/install/index.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index 9da66481dc..fd06e3b1c6 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -11,8 +11,8 @@ maintained paths for obtaining an OpenFAST executable. Most users of OpenFAST will not require modifying or compiling the source code. **For the simplest installation of OpenFAST without changing the source -code,** refer to the table in the :ref:`download_binaries` section and read -the corresponding documentation for specific instructions. +code,** refer to the table in the :ref:`download_binaries` or :ref:`use_docker` +sections and read the corresponding documentation for specific instructions. For instructions on compiling, see :ref:`compile_from_source`. .. _download_binaries: @@ -154,6 +154,30 @@ containing the executables, and running a simple test command: cd C:\your\path\Desktop\openfast_binaries\ openfast_x64.exe /h + +.. _use_docker: + +Use a docker image +~~~~~~~~~~~~~~~~~~ +Multiple versions of OpenFAST are available as docker images from our `docker registry `_. +To pull and run one with files from your local machine available, run: + +.. code-block::shell + + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 openfast /files/main.fst + +This command deletes the container (but not the image) when the analysis is finished and leaves the outputs in the same +local directory as the input files. You can also run commands inside the container with: + +.. code-block::shell + + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 /bin/bash + +Build your own images +~~~~~~~~~~~~~~~~~~~~~ +You can also build your own custom images using our `Dockerfile` or base your images on ours. See +`here ` for more information on this. + .. _compile_from_source: Compile from source From 6b2e89000d2d8f46aa5fe7943cc922b3e2c77a89 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:03:16 +0000 Subject: [PATCH 52/56] DOC: Update dockerfile readme --- share/docker/openfast_ubuntu/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md index 3f5568f166..371f1a81f1 100644 --- a/share/docker/openfast_ubuntu/README.md +++ b/share/docker/openfast_ubuntu/README.md @@ -2,7 +2,7 @@ ## Summary The `Dockerfile` in this directory can be used to reliably build OpenFAST as a docker image that can be run locally and -in the cloud without much setup. By default, it's based on Ubuntu Mantic and is optimised in size and performance for +in the cloud without much setup. By default, it's based on Ubuntu Jammy and is optimised in size and performance for production use. A multi-stage build is used, producing an Ubuntu image with just `libblas-dev`, `liblapack-dev`, `nano` and `openfast` added. The image built by this `Dockerfile` can be customised at build time using build arguments. @@ -15,7 +15,7 @@ Provide any of the following build arguments to customise the image at build tim | Name | Type | Allowed values | Default | Description | | --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| -| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:mantic` | The docker image to base the OpenFAST image on. | +| `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. | From 26c48da56fa7fb982df63fd6680bf270aff167da Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:06:55 +0000 Subject: [PATCH 53/56] DOC: Fix link in docs --- docs/source/install/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index fd06e3b1c6..50fbb647a9 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -176,7 +176,7 @@ local directory as the input files. You can also run commands inside the contain Build your own images ~~~~~~~~~~~~~~~~~~~~~ You can also build your own custom images using our `Dockerfile` or base your images on ours. See -`here ` for more information on this. +`here `_ for more information on this. .. _compile_from_source: From 11c8cbf76bef6420d048ec19aca43db23e791cfd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:36:49 +0000 Subject: [PATCH 54/56] OPS: Fix version extraction --- .github/workflows/test-build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 0d4e0b85a6..2f4713b0a5 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -23,7 +23,7 @@ jobs: - name: Extract tag from release candidate branch name id: extract-tag - run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + run: echo "openfast-tag=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT - name: Test building docker image uses: docker/build-push-action@v5 From 1c3115f7f366530036a134f08756c2b10fc8a77e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:40:33 +0000 Subject: [PATCH 55/56] OPS: Use extracted tag in test workflow --- .github/workflows/test-build-docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 2f4713b0a5..26652ace25 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -14,6 +14,7 @@ jobs: timeout-minutes: 300 env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -31,6 +32,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }} push: false cache-from: type=gha cache-to: type=gha,mode=max From 5e804279025de38990267210cec761b20502f74e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 14:21:54 +0000 Subject: [PATCH 56/56] OPS: Fix tag extraction in automated docker workflow --- .github/workflows/build-docker-image-automatic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index 1eb16128fe..507d9183b4 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -34,7 +34,7 @@ jobs: - name: Extract tag from release candidate branch name id: extract-tag - run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + run: echo "openfast-tag=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT - name: Build and push to registry uses: docker/build-push-action@v5