update etl configuration input to yml instead of environment variables - #1795
Conversation
|
@dezidizon please review revisions to @RyanM-RMA's initial implementation |
dezidizon
left a comment
There was a problem hiding this comment.
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.
MikeNeilson
left a comment
There was a problem hiding this comment.
Seems reasonable. Mostly commenting to track what I've already looked at.
|
|
||
| ## Configuration Overview | ||
|
|
||
| The main runtime configuration is stored in a YAML file, defaulting to `regi.yml` in the working directory. |
There was a problem hiding this comment.
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.
krowvin
left a comment
There was a problem hiding this comment.
Not sure on a few items
| 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())) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
good catch, updated to consolidate all the failures
| - ./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/} |
There was a problem hiding this comment.
Should we leave this empty here (no default) so we can use the staged files only mode?
There was a problem hiding this comment.
works for me. removed
| ### Run the ETL container | ||
|
|
||
| ```bash | ||
| ./gradlew runEtl |
There was a problem hiding this comment.
I'm not seeing runEtl in the build.gradle
Should this be etlEnvFile or are we missing a task in the build.gradle?
There was a problem hiding this comment.
There is a task registered in cda-etl/build.gradle
| - id: EUFA | ||
| enabled: true | ||
| locations: | ||
| - id: SWT.EUFA-Dam |
There was a problem hiding this comment.
Should this just be EUFA-DAM without the office prefixed in a location?
- 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
Co-authored-by: dezidizon <[email protected]>
d6a4ac7 to
e56f37d
Compare
|
|
||
| ### Other Runtime Settings | ||
|
|
||
| - `REGI_CONFIG_PATH`: Path to the YAML config file. Defaults to `regi.yml`. |
There was a problem hiding this comment.
| - `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.
There was a problem hiding this comment.
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
| ### Run the ETL container | ||
|
|
||
| ```bash | ||
| ./gradlew runEtl |
There was a problem hiding this comment.
There is a task registered in cda-etl/build.gradle
MikeNeilson
left a comment
There was a problem hiding this comment.
Just my one nitpick about the variable name.
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
"SAMPLE_DATA" would also work in that context.
There was a problem hiding this comment.
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
ETL_CONFIG_PATH for env variable sample-data for data directory sample-app.yml to domain the application
| - ./cda-etl/data/regi/regi.yml:/app/regi.yml | ||
| - ./cda-etl/data/regi:/data/regi | ||
| environment: | ||
| - REGI_CONFIG_PATH=/app/regi.yml |
There was a problem hiding this comment.
| - REGI_CONFIG_PATH=/app/regi.yml | |
| - ETL_CONFIG_PATH=/app/sample-app.yml |
... and the volumes above.
There was a problem hiding this comment.
shoulda text searched outside subdirectory...
Summary
Related Issue
Validation
Unit tests and docker compose in local dev environment
Checklist