Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/director v2 loop #2356

Merged
merged 9 commits into from
May 31, 2021

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented May 28, 2021

What do these changes do?

director-v2 startup script creates 2 event loops when in production mode.

Also fixes other fastapi-based applications (catalog, api-server, dynamic-sidecar).

Related issue/s

How to test

Checklist

@sanderegg sanderegg added a:catalog catalog service a:director-v2 issue related with the director-v2 service a:apiserver api-server service a:dynamic-sidecar dynamic-sidecar service labels May 28, 2021
@sanderegg sanderegg added this to the Chinchilla milestone May 28, 2021
@sanderegg sanderegg self-assigned this May 28, 2021
@codecov
Copy link

codecov bot commented May 28, 2021

Codecov Report

Merging #2356 (f755b39) into master (6a51091) will increase coverage by 0.1%.
The diff coverage is 0.0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2356     +/-   ##
========================================
+ Coverage    74.8%   75.0%   +0.1%     
========================================
  Files         513     513             
  Lines       20036   19998     -38     
  Branches     1967    1967             
========================================
+ Hits        14992   15003     +11     
+ Misses       4527    4484     -43     
+ Partials      517     511      -6     
Flag Coverage Δ
integrationtests 67.4% <0.0%> (+0.1%) ⬆️
unittests 68.4% <0.0%> (+0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...er/src/simcore_service_api_server/core/settings.py 97.2% <ø> (-0.1%) ⬇️
.../api-server/src/simcore_service_api_server/main.py 0.0% <0.0%> (ø)
...talog/src/simcore_service_catalog/core/settings.py 96.2% <ø> (-0.2%) ⬇️
...rvices/catalog/src/simcore_service_catalog/main.py 0.0% <0.0%> (ø)
...2/src/simcore_service_director_v2/core/settings.py 95.6% <ø> (-0.1%) ⬇️
...irector-v2/src/simcore_service_director_v2/main.py 0.0% <0.0%> (ø)
...idecar/src/simcore_service_dynamic_sidecar/main.py 0.0% <ø> (ø)
... and 4 more

@sanderegg sanderegg requested review from GitHK, pcrespov and mguidon May 28, 2021 16:23
Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Pair reviewed.

I wonder if we should then remove these fields from the AppSettings related to uvicorn since they are now

    # SERVICE SERVER (see : https://www.uvicorn.org/settings/)
    host: str = "0.0.0.0"  # nosec
    port: int = 8000

since now they are fix values in the docker/boot.sh

services/api-server/src/simcore_service_api_server/main.py Outdated Show resolved Hide resolved
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

👍

services/api-server/src/simcore_service_api_server/main.py Outdated Show resolved Hide resolved
@GitHK
Copy link
Contributor

GitHK commented May 31, 2021

Pair reviewed.

I wonder if we should then remove these fields from the AppSettings related to uvicorn since they are now

    # SERVICE SERVER (see : https://www.uvicorn.org/settings/)
    host: str = "0.0.0.0"  # nosec
    port: int = 8000

since now they are fix values in the docker/boot.sh

If they are not used and it is not possible to overwrite them via env vars, I would remove them.

@pcrespov
Copy link
Member

pcrespov commented May 31, 2021

If they are not used and it is not possible to overwrite them via env vars, I would remove them.

@GitHK What do you mean? All attributes of pydantic setting classes can be set via environment variables

@pcrespov pcrespov closed this May 31, 2021
@GitHK
Copy link
Contributor

GitHK commented May 31, 2021

If they are not used and it is not possible to overwrite them via env vars, I would remove them.

@GitHK What do you mean? All attributes of pydantic setting classes can be set via environment variables

Yes that's what my understanding of the BaseSettings class is. Read more here. You can see in the example they state that if there is env_prefix all names will be fetched form the environment without using one. In this case hostand port, if they are defined they will be fetched from there.

@sanderegg sanderegg reopened this May 31, 2021
@sanderegg sanderegg force-pushed the bugfix/director_v2_loop branch from 8b8cc4c to 80a11f0 Compare May 31, 2021 07:52
@sanderegg sanderegg merged commit 5e50637 into ITISFoundation:master May 31, 2021
@sanderegg sanderegg deleted the bugfix/director_v2_loop branch May 31, 2021 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:apiserver api-server service a:catalog catalog service a:director-v2 issue related with the director-v2 service a:dynamic-sidecar dynamic-sidecar service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants