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

Update spack stack extension for containers: make specs configurable, clean up arguments for env/ctr #333

Merged

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Oct 3, 2023

Description

This PR makes specs for containers configurable, allowing us to build containers with different specs stored in separate files in a subdirectory. It also cleans up the arguments for spack stack create [env|ctr] so that only arguments applicable for containers are available for spack stack create ctr, and similar for spack stack create env. We could do more cleanup on the env side by stripping out options we don't use.

I tested these changes manually (building container on the Ubuntu CI instance) and they are also tested in CI as part of JCSDA/spack-stack#805.

Issue(s) addressed

Resolves JCSDA/spack-stack#774

Dependencies

n/a

Impact

n/a

Checklist

@climbfuji climbfuji force-pushed the feature/container_env_updates branch from 5ef344f to 6c02740 Compare October 3, 2023 03:19
@climbfuji climbfuji force-pushed the feature/container_env_updates branch from 2aa856c to f4d7b6c Compare October 3, 2023 17:16
@climbfuji climbfuji force-pushed the feature/container_env_updates branch from f4d7b6c to bea1111 Compare October 3, 2023 17:21
@climbfuji climbfuji self-assigned this Oct 3, 2023
@climbfuji climbfuji added the INFRA JEDI Infrastructure label Oct 3, 2023
@climbfuji climbfuji marked this pull request as ready for review October 3, 2023 19:03
@@ -51,44 +51,80 @@ def container_config_help():
help_string = "Pre-configured container." + os.linesep
help_string += "Available options are: " + os.linesep
for config in container_configs:
if config == "README.md":
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alternatively, we could use the logic from lib/jcsda-emc/spack-stack/tests/test_stack_create.py:

        _, _, containers = next(os.walk(container_path))
        # Exclude files like "README.md"
        containers = [x for x in containers if x.endswith(".yaml")]

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this alternate logic would be better as long as we know that config is always going to be in files with a .yaml extension. That way we don't pick up an undesirable file if something besides README.md shows up.

Would there be cases of config files using a .yml extension, ie is it worthwhile to add the check x.endswith(".yml") to the test in the alternate logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, the alternate logic is better. The spack convention is to always use .yaml, I don't think we need .yml. (Also, the logic in the create container code assumes .yaml, because that's what it appends to the arguments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

help_string += "\t" + config.rstrip(".yaml") + os.linesep
return help_string


def container_specs_help():
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The diffs in this file are confusing. It may be better checking out the current code and this PR and verify side by side in meld (which sometimes does a better job with diffs). Most of the common arguments on the left moved down into the env section, and ctr got its own arguments.

Copy link
Collaborator

@srherbener srherbener left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments!

@climbfuji climbfuji merged commit 779847b into JCSDA:jcsda_emc_spack_stack Oct 4, 2023
13 checks passed
@climbfuji climbfuji deleted the feature/container_env_updates branch October 4, 2023 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INFRA JEDI Infrastructure
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

spack stack create ctr has invalid options
2 participants