Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Publish Docker Image

on:
workflow_call:
inputs:
service_name: { required: true, type: string }
docker_tags: { required: true, type: string }
build_args: { required: false, type: string }
image_title: { required: true, type: string }
image_description: { required: true, type: string }

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Validate context
run: |
[ -d "./${{ inputs.service_name }}" ] || { echo "Directory missing"; exit 1; }
[ -f "./${{ inputs.service_name }}/Dockerfile" ] || { echo "Dockerfile missing"; exit 1; }

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

- name: Build local image
uses: docker/build-push-action@v6
with:
context: ./${{ inputs.service_name }}
load: true # Loads image into local Docker daemon for scanning
tags: local_scan_target:latest
build-args: ${{ inputs.build_args }}

# - name: Scan image with Anchore
# uses: anchore/scan-action@v3
# with:
# image: "local_scan_target:latest"
# fail-build: true
# severity-cutoff: high # Fails on High or Critical
# auto-update: true
# # extra-args: "--skip-db-update-check"

- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./${{ inputs.service_name }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ inputs.docker_tags }}
build-args: ${{ inputs.build_args }}
cache-from: type=gha
cache-to: type=gha,mode=max
43 changes: 43 additions & 0 deletions .github/workflows/hms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Publish auto-fpt-hms Image

on:
push:
branches: ["main"]
tags: ["v*"]
paths: ["hms/**", ".github/workflows/hms.yaml", ".github/workflows/build-and-publish.yaml"]
pull_request:
branches: ["main"]
paths: ["hms/**", ".github/workflows/hms.yaml", ".github/workflows/build-and-publish.yaml"]

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
owner_lc: ${{ steps.set_owner.outputs.owner_lc }}
steps:
- id: set_owner
run: echo "owner_lc=${OWNER,,}" >> $GITHUB_OUTPUT
env:
OWNER: ${{ github.repository_owner }}

build-and-push:
needs: prepare
strategy:
matrix:
hms_version:
- { version: '4.12', tag_suffix: '4.12', is_latest: false }
- { version: '4.13', tag_suffix: '4.13', is_latest: true }
- { version: '4.13-beta.6', tag_suffix: '4.13-beta.6', is_latest: false }
- { version: '4.14-beta.1', tag_suffix: '4.14-beta.1', is_latest: false }
uses: ./.github/workflows/build-and-publish.yaml
with:
service_name: hms
docker_tags: |
ghcr.io/${{ needs.prepare.outputs.owner_lc }}/auto-fpt-hms:${{ matrix.hms_version.tag_suffix }}
${{ matrix.hms_version.is_latest && format('ghcr.io/{0}/auto-fpt-hms:latest', needs.prepare.outputs.owner_lc) || '' }}
build_args: HMS_VERSION=${{ matrix.hms_version.version }}
image_title: auto-fpt-hms
image_description: Docker container for running HEC-HMS hydrological simulations
permissions:
contents: read
packages: write
36 changes: 36 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a
harassment-free experience for everyone.

## Our Standards

Examples of behavior that contributes to a positive environment:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior:

- The use of sexualized language or imagery
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional
setting

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to
the project maintainers. All complaints will be reviewed and investigated promptly and
fairly.

## Attribution

This Code of Conduct is adapted from the
[Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributing

Thank you for your interest in contributing!

## Commit Messages

This project uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
All commit messages **must** follow this format:

```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

### Types

| Type | When to use | Changelog section |
|---|---|---|
| `feat` | A new feature | Added |
| `fix` | A bug fix | Fixed |
| `perf` | A performance improvement | Changed |
| `refactor` | Code restructuring, no behavior change | Changed |
| `revert` | Reverting a previous commit | Fixed |
| `docs` | Documentation only | _(skipped)_ |
| `test` | Adding or updating tests | _(skipped)_ |
| `chore` | Maintenance, dependencies, tooling | _(skipped)_ |
| `ci` | CI/CD changes | _(skipped)_ |

### Breaking Changes

Append `!` after the type, or add `BREAKING CHANGE:` in the footer:

```
feat!: drop support for Python 3.11
```

```
feat: new API

BREAKING CHANGE: `old_function` has been removed.
```

### Examples

```
feat(io): add support for GeoParquet output
fix: handle missing CRS in raster inputs
chore: bump ruff to v0.15.5
docs: add example notebook for elevation grid
```

## Submitting Changes

1. Fork the repository.
1. Create a feature branch.
1. Make your changes with tests.
1. Ensure all checks pass.
1. Submit a pull request.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Dewberry

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# auto-fpt
Automated Flood Prediction Tools

## Directories

- **hms/** - HEC-HMS runner application. Contains Gradle build configuration and Dockerfile for containerized HEC-HMS (Hydrologic Engineering Center's Hydrologic Modeling System) execution.
15 changes: 15 additions & 0 deletions hms/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.git
.gitignore
.gitattributes
.vscode
.idea
*.md
.DS_Store
.gradle
build/
*.iml
.classpath
.project
.settings/
.miniodata/
*.log
47 changes: 47 additions & 0 deletions hms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# Gradle
.gradle/
build/

# IDE
.idea/
.vscode/
*.iml
.classpath
.project
.settings/

# OS
.DS_Store
Thumbs.db

# Environment & Local
.env
.env.local
.miniodata/
main
model/
Loading
Loading