Skip to content

Commit

Permalink
Merge branch 'dev-unstable-pointers' into f/AD-shear
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Branlard committed May 6, 2024
2 parents 49956a5 + 2e34f34 commit 8fd88d1
Show file tree
Hide file tree
Showing 104 changed files with 6,818 additions and 2,464 deletions.
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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
share/docker
57 changes: 19 additions & 38 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ jobs:
products: Simulink
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
- name: Setup workspace
Expand Down Expand Up @@ -137,8 +136,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
- name: Setup workspace
Expand Down Expand Up @@ -187,8 +185,7 @@ jobs:
products: Simulink
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev # gcovr
Expand Down Expand Up @@ -242,8 +239,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -280,8 +276,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -318,8 +313,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand All @@ -344,7 +338,7 @@ jobs:
### BUILD AND TEST JOBS

build-test-uadriver-debug:
# UA driver requires -DUA_OUTS, cannot be compiled with other
# UA driver used to require -DUA_OUTS
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -358,8 +352,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev
- name: Setup workspace
Expand All @@ -379,7 +372,6 @@ jobs:
-DVARIABLE_TRACKING=OFF \
-DBUILD_TESTING:BOOL=ON \
-DCTEST_PLOT_ERRORS:BOOL=ON \
-DCMAKE_Fortran_FLAGS="-DUA_OUTS=ON" \
${GITHUB_WORKSPACE}
- name: Build all
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -420,8 +412,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -478,8 +469,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -539,8 +529,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" vtk
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -587,8 +576,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -721,8 +709,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -771,8 +758,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -821,8 +807,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -871,8 +856,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -921,8 +905,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -971,8 +954,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down Expand Up @@ -1020,8 +1002,7 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3"
pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev libopenmpi-dev libyaml-cpp-dev
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/build-docker-image-automatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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:
release:
types:
- released

jobs:
build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 300
env:
DOCKERFILE_PATH: share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
GH_REGISTRY: ghcr.io/OpenFAST/openfast
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Commenting out until we get the NREL DockerHub credentials
# - name: Log in to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract tag from release candidate branch name
id: extract-tag
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
with:
context: .
file: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/aarch64
tags: |
${{ env.GH_REGISTRY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest
# ${{ 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
72 changes: 72 additions & 0 deletions .github/workflows/build-docker-image-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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-manual

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
env:
DOCKERFILE_PATH: share/docker/Dockerfile
DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/OpenFAST/openfast/main/share/docker/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
GH_REGISTRY: ghcr.io/OpenFAST/openfast
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Commenting out until we get the NREL DockerHub credentials
# - name: Log in to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# 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 }} ]; \
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: ${{ env.DOCKERFILE_PATH }}
platforms: linux/amd64,linux/aarch64
tags: |
${{ env.GH_REGISTRY }}:${{ github.event.inputs.tag }}
# ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
38 changes: 38 additions & 0 deletions .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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/Dockerfile
DOCKERHUB_REPOSITORY: nrel/openfast
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=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT

- name: Test building docker image
uses: docker/build-push-action@v5
with:
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
Loading

0 comments on commit 8fd88d1

Please sign in to comment.