Skip to content

update etl configuration input to yml instead of environment variables - #1795

Merged
adamkorynta merged 10 commits into
developfrom
feature/etl_follow_up
Aug 17, 2026
Merged

update etl configuration input to yml instead of environment variables#1795
adamkorynta merged 10 commits into
developfrom
feature/etl_follow_up

Conversation

@adamkorynta

Copy link
Copy Markdown
Member

Summary

  • file system staging update for projects, locations, and timeseries
  • add in REGI files to VCS
  • add in docker environment for running python tests
  • move etl calls to parent docker-compose file
  • let the source URL be optional, if not set only use staged filesystem resources

Related Issue

Validation

Unit tests and docker compose in local dev environment

Checklist

  • AI tools used - GH Copilot for README.md generation, logger messages, yml parsing, and code review

@adamkorynta
adamkorynta requested a review from krowvin June 22, 2026 17:56
@adamkorynta

Copy link
Copy Markdown
Member Author

@dezidizon please review revisions to @RyanM-RMA's initial implementation

@adamkorynta adamkorynta changed the title update configuration input to yml instead of environment variables update etl configuration input to yml instead of environment variables Jun 22, 2026

@dezidizon dezidizon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed code review and only found minor changes to capitalize several print out statements. This code is ready for merging even without implementing the requested updates.

Comment thread cda-etl/src/cda_etl/config.py Outdated
Comment thread cda-etl/src/cda_etl/config.py Outdated
Comment thread cda-etl/src/cda_etl/config.py Outdated
Comment thread cda-etl/src/cda_etl/config.py Outdated
Comment thread cda-etl/src/cda_etl/config.py Outdated

@MikeNeilson MikeNeilson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Mostly commenting to track what I've already looked at.

Comment thread cda-etl/README.md Outdated

## Configuration Overview

The main runtime configuration is stored in a YAML file, defaulting to `regi.yml` in the working directory.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to name this something other than REGI. Not a major issue, but we might get less, I'll go with "side eye", if we use a more generic name.

Comment thread cda-etl/build.gradle

@krowvin krowvin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure on a few items

Comment on lines +63 to +66
for future in as_completed(futures_to_items):
item = futures_to_items[future]
if future.exception():
logger.warning(f"Exception occurred for {item}: {future.exception()}")
logger.warning(_friendly_exception_message(item, future.exception()))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failures looked to be logged within the thread. This looks like an ETL run would be partial and exit with status 0 within the thread.

Should we instead collect the failures and raise after the futures finish? This way compose/CI/operators can see that the migration was not fully successful.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, updated to consolidate all the failures

Comment thread docker-compose.yml Outdated
- ./cda-etl/data/regi:/data/regi
environment:
- REGI_CONFIG_PATH=/app/regi.yml
- SOURCE_CDA_URL=${SOURCE_CDA_URL:-https://cwms-data-test.cwbi.us/cwms-data/}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we leave this empty here (no default) so we can use the staged files only mode?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me. removed

Comment thread cda-etl/README.md
### Run the ETL container

```bash
./gradlew runEtl

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing runEtl in the build.gradle

Should this be etlEnvFile or are we missing a task in the build.gradle?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a task registered in cda-etl/build.gradle

Comment thread cda-etl/README.md Outdated
- id: EUFA
enabled: true
locations:
- id: SWT.EUFA-Dam

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just be EUFA-DAM without the office prefixed in a location?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, fixed that

adamkorynta and others added 4 commits August 17, 2026 10:59
- file system staging update for projects, locations, and timeseries
- add in REGI files to VCS
- add in docker environment for running python tests
- move etl calls to parent docker-compose file
- let the source URL be optional, if not set only use staged filesystem resources
@adamkorynta
adamkorynta force-pushed the feature/etl_follow_up branch from d6a4ac7 to e56f37d Compare August 17, 2026 17:59
Comment thread cda-etl/README.md Outdated

### Other Runtime Settings

- `REGI_CONFIG_PATH`: Path to the YAML config file. Defaults to `regi.yml`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `REGI_CONFIG_PATH`: Path to the YAML config file. Defaults to `regi.yml`.
- `ETL_CONFIG_PATH`: Path to the YAML config file. Defaults to `etl.yml`.

That seems like a reasonably generic name.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on our previous discussion I renamed to sample-app in: #1856 just haven't had a chance to bring that change into this PR yet

Comment thread cda-etl/README.md
### Run the ETL container

```bash
./gradlew runEtl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a task registered in cda-etl/build.gradle

@MikeNeilson MikeNeilson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my one nitpick about the variable name.

Comment thread cda-etl/README.md Outdated
The main runtime configuration is stored in a YAML file, defaulting to `sample-app.yml` in the working directory.

The application reads the YAML path from the `REGI_CONFIG_PATH` environment variable. If the variable is not set, it looks for `regi.yml` next to where the process starts.
The application reads the YAML path from the `SAMPLE_APP_CONFIG_PATH` environment variable. If the variable is not set, it looks for `sample-app.yml` next to where the process starts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to suggest "ETL_CONFIG_PATH" again. Calling the sample "sample-app" seems reasonable but it doesn't really make sense the variable pointing to the configuration would be called sample app. I would think we'd want the same program to target different configurations, not have to make adjustments to the program to point to different variables to make sense in the given usage.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"SAMPLE_DATA" would also work in that context.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I like ETL_CONFIG_PATH

so what do you think about:

ETL_CONFIG_PATH for the env var name
sample-data for the data directory
sample-app.yml for the yml file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's works.

ETL_CONFIG_PATH for env variable
sample-data for data directory
sample-app.yml to domain the application
Comment thread docker-compose.yml Outdated
- ./cda-etl/data/regi/regi.yml:/app/regi.yml
- ./cda-etl/data/regi:/data/regi
environment:
- REGI_CONFIG_PATH=/app/regi.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- REGI_CONFIG_PATH=/app/regi.yml
- ETL_CONFIG_PATH=/app/sample-app.yml

... and the volumes above.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoulda text searched outside subdirectory...

@adamkorynta
adamkorynta merged commit d0f9391 into develop Aug 17, 2026
10 checks passed
@adamkorynta
adamkorynta deleted the feature/etl_follow_up branch August 17, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants