Skip to content

Conversation

ckunki
Copy link
Contributor

@ckunki ckunki commented Oct 1, 2025

Closes #271


def verify_connection(scs: Secrets) -> int:
if BackendSelector(scs).use_itde:
# Question: Is it OK, to let bring_itde_up modify the SCS content, here?
Copy link
Contributor Author

@ckunki ckunki Oct 1, 2025

Choose a reason for hiding this comment

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

Is it OK, to let bring_itde_up() modify the SCS content, here?

Copy link
Contributor Author

@ckunki ckunki Oct 1, 2025

Choose a reason for hiding this comment

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

Additional question:

  • Should the command line really launch the IDTE only for verifying the connection parameters?
  • As actually the ITDE does not require actual connection parameters but only offers optional(!) configuration of disk and mem size.

Copy link
Collaborator

Choose a reason for hiding this comment

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

See my comment above.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, we need to bring the ITDE up and take it down, in a try .. finally manner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the docstring.
But the question regarding the ITDE is still pending.

def check(self):
"""
Check if the content of the SCS is complete wrt. the selected
backend as the required options depend on the selected backend.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please say that the function raises the ScsCliError if the check fails. I have to look at the code to figure this out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks.
Please see next push updating the docstring.

def get_option_set(scs_file: Path) -> OptionSet:
"""
Return an instance of an OptionSet if the SCS contains a proper
backend selection. Otherwise report an error and return None.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update the docstring according to your latest changes.

Copy link
Contributor Author

@ckunki ckunki Oct 2, 2025

Choose a reason for hiding this comment

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

See next push.

@add_params(SCS_OPTIONS)
@click.option(
"--connect/--no-connect",
is_flag=True,
Copy link
Collaborator

@ahsimb ahsimb Oct 2, 2025

Choose a reason for hiding this comment

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

Can we make the default depend on the backend?

For a DB that is already running it would be a good idea to check that the configuration works. However, for the Docker DB it's a different story. On one hand, starting it up takes time. On the other hand, all you need to check is that the memory parameters are with reasonable range. If we can't start the ITDE it must be for some unrelated reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I very much agree on your statements.
So what should we do then?
Not verify Docker DB?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would make the default = False for the DockerDB and True otherwise. Maybe slightly awkward to implement, but not too difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCS CLI: Implement checking options for completeness and correctness
2 participants