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

Pass oSparc API necessary environment to all services #5925

Closed
Tracked by #5816
sanderegg opened this issue Jun 7, 2024 · 3 comments · Fixed by #5966
Closed
Tracked by #5816

Pass oSparc API necessary environment to all services #5925

sanderegg opened this issue Jun 7, 2024 · 3 comments · Fixed by #5966
Assignees
Labels
a:director-v2 issue related with the director-v2 service a:pipeline-services issues on non-core services in user's pipeline (use osparc-services repo for specifics)

Comments

@sanderegg
Copy link
Member

sanderegg commented Jun 7, 2024

After some testing the passing of the parent Study ID and Node ID automatically via the osparc client works.

Now the question is:

  • can we make the setting of the OSPARC_API_KEY,_SECRET, OSPARC_STUDY_ID, OSPARC_NODE_ID available to all dynamic services? or is there something against that?

Let's discuss first and then take actions.

@sanderegg sanderegg added the a:pipeline-services issues on non-core services in user's pipeline (use osparc-services repo for specifics) label Jun 7, 2024
@sanderegg sanderegg transferred this issue from ITISFoundation/osparc-issues Jun 7, 2024
@sanderegg sanderegg added the a:director-v2 issue related with the director-v2 service label Jun 7, 2024
@sanderegg sanderegg added this to the South Island Iced Tea milestone Jun 7, 2024
@bisgaard-itis
Copy link
Contributor

bisgaard-itis commented Jun 7, 2024

It would be nice to expose these as readonly variables, which should be possible via the bash readonly command. That would prevent users from changing them

╭─mads@bisgaard-wkst ~/Development/oSparc/osparc-pyapi-tests/noninter1 ‹master → origin {1} U:1 ?:4 ✗›
╰─$ help readonly
readonly: readonly [-aAf] [name[=value] ...] or readonly -p
    Mark shell variables as unchangeable.
    
    Mark each NAME as read-only; the values of these NAMEs may not be
    changed by subsequent assignment.  If VALUE is supplied, assign VALUE
    before marking as read-only.
    
    Options:
      -a	refer to indexed array variables
      -A	refer to associative array variables
      -f	refer to shell functions
      -p	display a list of all readonly variables or functions,
    		depending on whether or not the -f option is given
    
    An argument of `--' disables further option processing.
    
    Exit Status:
    Returns success unless an invalid option is given or NAME is invalid.

Not sure this can be propagated through docker though. To be checked...

@pcrespov
Copy link
Member

if the service defines it, these are passed

@pcrespov
Copy link
Member

pcrespov commented Jun 18, 2024

It would be nice to expose these as readonly variables, which should be possible via the bash readonly command. That would prevent users from changing them

╭─mads@bisgaard-wkst ~/Development/oSparc/osparc-pyapi-tests/noninter1 ‹master → origin {1} U:1 ?:4 ✗›
╰─$ help readonly
readonly: readonly [-aAf] [name[=value] ...] or readonly -p
Mark shell variables as unchangeable.

Mark each NAME as read-only; the values of these NAMEs may not be
changed by subsequent assignment.  If VALUE is supplied, assign VALUE
before marking as read-only.

Options:
  -a	refer to indexed array variables
  -A	refer to associative array variables
  -f	refer to shell functions
  -p	display a list of all readonly variables or functions,
		depending on whether or not the -f option is given

An argument of `--' disables further option processing.

Exit Status:
Returns success unless an invalid option is given or NAME is invalid.

Not sure this can be propagated through docker though. To be checked...

@bisgaard-itis Apparently environment in the compose-specs does not support read-only. An alternative would be to use secrets or mount a read-only file and explicitly call with readonly in the CMD or ENTRYPOINT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:director-v2 issue related with the director-v2 service a:pipeline-services issues on non-core services in user's pipeline (use osparc-services repo for specifics)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants