Skip to content

Commit

Permalink
Add a sample dolphin_config.yaml to the docs, GHA to auto-update (#438
Browse files Browse the repository at this point in the history
)

* Add a sample `dolphin_config.yaml` to the docs, GHA to auto-update

* add link to readme to sample file

* fix two warnings from mkdocs

* update for merged main

* remove actual creation time, subject to change

* move the new job into existing workflow

* Revert "move the new job into existing workflow"

This reverts commit a0b0b2c.

* add bash line

* fix the `work_directory` resolving

* add `base` to PR GHA

* cache mamba envs for the day
  • Loading branch information
scottstanie authored Oct 1, 2024
1 parent 5849d7c commit bd9be1d
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
with:
environment-file: conda-env.yml
environment-name: dolphin-env
# persist on the same day.
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
generate-run-shell: false
create-args: ${{ matrix.deps.spec }}
condarc: |
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/update-sample-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Update Default Config

on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
update-config:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda-env.yml
environment-name: dolphin-env
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
generate-run-shell: false
create-args: ${{ matrix.deps.spec }}
condarc: |
channels:
- conda-forge
- name: Install
run: |
pip install --no-deps .
- name: Generate default config
run: |
dolphin config --print-empty -o temp_config.yaml
sed -e '/creation_time_utc:/d' \
-e 's|work_directory:.*|work_directory: .|' \
temp_config.yaml > docs/sample_dolphin_config.yaml
- name: Check for changes
id: git-check
run: |
git add docs/sample_dolphin_config.yaml
git diff --staged --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.git-check.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update sample_dolphin_config.yaml
title: 'Update `sample_dolphin_config.yaml`'
body: |
This is an auto-update docs/sample_dolphin_config.yaml file based on the latest changes.
branch: update-default-config
delete-branch: true
base: ${{ github.head_ref || github.ref_name }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dolphin config --slc-files /path/to/slcs/*tif
dolphin run dolphin_config.yaml
```

The `config` command creates a YAML file (by default `dolphin_config.yaml` in the current directory). If you'd like to see an empty YAML with all defaults filled in, you can run `dolphin config --print-empty`
The `config` command creates a YAML file (by default `dolphin_config.yaml` in the current directory). If you'd like to see an empty YAML with all defaults filled in, you can run `dolphin config --print-empty`, which creates a [sample file like the one here](https://raw.githubusercontent.com/isce-framework/dolphin/refs/heads/main/docs/sample_dolphin_config.yaml)

The only required inputs for the workflow are the paths to the coregistered SLC files (in either geographic or radar coordinates).
If the SLC files are spread over multiple files, you can either
Expand Down
Loading

0 comments on commit bd9be1d

Please sign in to comment.