ITISFoundation / osparc-simcore

🐼 osparc-simcore simulation framework
https://osparc.io
MIT License
43 stars 27 forks source link

✨ Auto inject osparc environments to dynamic services #5966

Closed pcrespov closed 3 months ago

pcrespov commented 3 months ago

What do these changes do?

Injects automatically

environment:
    OSPARC_API_BASE_URL: "$OSPARC_VARIABLE_API_HOST"
    OSPARC_API_KEY: "$OSPARC_VARIABLE_API_KEY"
    OSPARC_API_SECRET: "$OSPARC_VARIABLE_API_SECRET"
    OSPARC_NODE_ID: "$OSPARC_VARIABLE_NODE_ID"
    OSPARC_STUDY_ID: "$OSPARC_VARIABLE_STUDY_UUID"

to all services in a dynamic-service compose. I.e. all dynamic services get automatically access to these environs. NOTE that the key/secrets are customised per user.

@sanderegg @mguidon should we only inject in the "main" service, i.e. the one specified by simcore.service.container-http-entrypoint?

Related issue/s

How to test

Dev-ops checklist

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.5%. Comparing base (cafbf96) to head (eb42cc4). Report is 290 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966/graphs/tree.svg?width=650&height=150&src=pr&token=h1rOE8q7ic&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation)](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) ```diff @@ Coverage Diff @@ ## master #5966 +/- ## ========================================= + Coverage 84.5% 88.5% +3.9% ========================================= Files 10 1053 +1043 Lines 214 46585 +46371 Branches 25 562 +537 ========================================= + Hits 181 41248 +41067 - Misses 23 5214 +5191 - Partials 10 123 +113 ``` | [Flag](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | Coverage Δ | | |---|---|---| | [integrationtests](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | `65.5% <91.6%> (?)` | | | [unittests](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | `86.1% <87.5%> (+1.5%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation) | Coverage Δ | | |---|---|---| | [...rary/src/models\_library/service\_settings\_labels.py](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966?src=pr&el=tree&filepath=packages%2Fmodels-library%2Fsrc%2Fmodels_library%2Fservice_settings_labels.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#diff-cGFja2FnZXMvbW9kZWxzLWxpYnJhcnkvc3JjL21vZGVsc19saWJyYXJ5L3NlcnZpY2Vfc2V0dGluZ3NfbGFiZWxzLnB5) | `91.8% <100.0%> (ø)` | | | [...v2/modules/dynamic\_sidecar/docker\_compose\_specs.py](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966?src=pr&el=tree&filepath=services%2Fdirector-v2%2Fsrc%2Fsimcore_service_director_v2%2Fmodules%2Fdynamic_sidecar%2Fdocker_compose_specs.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#diff-c2VydmljZXMvZGlyZWN0b3ItdjIvc3JjL3NpbWNvcmVfc2VydmljZV9kaXJlY3Rvcl92Mi9tb2R1bGVzL2R5bmFtaWNfc2lkZWNhci9kb2NrZXJfY29tcG9zZV9zcGVjcy5weQ==) | `97.9% <100.0%> (ø)` | | | [...ector\_v2/modules/osparc\_variables/substitutions.py](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966?src=pr&el=tree&filepath=services%2Fdirector-v2%2Fsrc%2Fsimcore_service_director_v2%2Fmodules%2Fosparc_variables%2Fsubstitutions.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation#diff-c2VydmljZXMvZGlyZWN0b3ItdjIvc3JjL3NpbWNvcmVfc2VydmljZV9kaXJlY3Rvcl92Mi9tb2R1bGVzL29zcGFyY192YXJpYWJsZXMvc3Vic3RpdHV0aW9ucy5weQ==) | `74.2% <90.9%> (ø)` | | ... and [1044 files with indirect coverage changes](https://app.codecov.io/gh/ITISFoundation/osparc-simcore/pull/5966/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ITISFoundation)
pcrespov commented 3 months ago

that is very nice! thanks! Now regarding your question, I think for example in s4l the variables are probably needed in the core service which I do not think is the main one. but @mguidon can enlighten us

If that is the case, I do not have the info to know which service is "the core" service

pcrespov commented 3 months ago

Very nice, thanks!

Minor thought on the name of the variable OSPARC_NODE_ID: I guess in the code you normally say "node" and this word is mostly used by devs. For user-facing docs, etc... we tend to use more "Service". But I assume users who will use this envs are enough dev-oriented to understand what that variable represent. 😉

@elisabettai Unfortunately this is already decided and used in the client side. Can you perhaps follow up with a small entry in the manual at some time? Not urgent