Conversation
|
The style in this PR agrees with This formatting comment was generated automatically by a script in uc-cdis/wool. |
Pull Request Test Coverage Report for Build 14802796595Details
💛 - Coveralls |
682c5f3 to
2a1d4b8
Compare
|
This shall be merged after this cloud automation PR -- uc-cdis/cloud-automation#2762 |
bin/_common_setup.sh
Outdated
|
|
||
| # Source the environment variables from the metrics setup script | ||
| # source "${CURRENT_DIR}/setup_prometheus" | ||
| source "${CURRENT_DIR}/setup_prometheus" |
There was a problem hiding this comment.
This is nice, but bin/_common_setup.sh was never called when the service was launched. Wanted to find out if we are planning to use this script to run the service in the future. If that is the case, then I think we can remove this section in cloud-auto PR
There was a problem hiding this comment.
Let's try to match what's done in gen3-user-data-library if we can
There was a problem hiding this comment.
Copy that! gen3-user-data-library uses a script called run.sh which initates the service, I will update that and invoke the shell script in the Dockerfile (here)[https://github.com/uc-cdis/gen3-workflow/blob/b3004eb0643f00ae5902fbf909ec80374b37b2e3/Dockerfile#L39C1-L41C27]
There was a problem hiding this comment.
Copy that! gen3-user-data-library uses a script called run.sh which is designed to initiate the service, I have included that change and invoked the shell script in the Dockerfile here
bin/_common_setup.sh
Outdated
|
|
||
| # Source the environment variables from the metrics setup script | ||
| # source "${CURRENT_DIR}/setup_prometheus" | ||
| source "${CURRENT_DIR}/setup_prometheus" |
There was a problem hiding this comment.
Let's try to match what's done in gen3-user-data-library if we can
gen3workflow/metrics.py
Outdated
|
|
||
|
|
||
| class Metrics(BaseMetrics): | ||
| def __init__(self, prometheus_dir: str, enabled: bool = True) -> None: |
There was a problem hiding this comment.
i think prometheus_enabled instead of just enabled would be better in case we want to expand the "metrics" class later... but maybe not worth updating cdis-python-utils...
There was a problem hiding this comment.
I can create a PR with this change, but it might not be worth releasing a new version just for this.
bin/_common_setup.sh
Outdated
| echo "Loading environment variables from ${CURRENT_DIR}/.env" | ||
| PROMETHEUS_MULTIPROC_DIR=$(grep 'PROMETHEUS_MULTIPROC_DIR:' /src/gen3-workflow-config.yaml | awk -F': ' '{print $2}' | tr -d '"') |
There was a problem hiding this comment.
mm the config is only at /src/gen3-workflow-config.yaml for cloud-automation deployments. If you run the service locally for example, it's not there.
Also i don't see PROMETHEUS_MULTIPROC_DIR in the default config, should we add it there?
and i don't get the reference to .env since we don't use that here
There was a problem hiding this comment.
Thanks!
- This script is only used when launching the service in an environment with multiple workers using gunicorn. In that scenario, it’s mandatory to have
PROMETHEUS_MULTIPROC_DIRset before the application starts.
For local development, we continue usingpython run.py, where the Prometheus directory is set during the initialization of the metrics object. - The value is already added in the config-default.yaml here and also in config.py here
- The
.envcomment was an oversight -- I'll update that!
There was a problem hiding this comment.
- Gotcha, could you add a comment explaining that it's made to work with cloud-automation
- Not sure how i missed it
paulineribeyre
left a comment
There was a problem hiding this comment.
@nss10 Could you make sure the last bullet in the ticket description is done before we merge this
Link to JIRA ticket if there is one: MIDRC-857
New Features