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

Undeploy: Export DEPLOYMENT_TARGET before removing environments #243

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

CodeGat
Copy link
Member

@CodeGat CodeGat commented Mar 7, 2025

Closes #242

Background

A curious regression introduced in #218, is that now that we can (and have, in ACCESS-TEST Prereleases) use the set-at-install-time environment variable DEPLOYMENT_TARGET in our spack.yamls, spack expects it to be set. Interestingly, spack now errors out when it can't find it, since it loads config from all existing environments spack.yaml while uninstalling some environments, including ones that require DEPLOYMENT_TARGET.

The PR

In this PR:

  • export DEPLOYMENT_TARGET before undeploying environments

Testing

Tested uninstallation of a dummy enviroment in Prerelease without exporting DEPLOYMENT_TARGET which fails as expected.
Exported DEPLOYMENT_TARGET and then attempted uninstallation, which succeeded.

@CodeGat CodeGat added type:bug priority:blocker version:MINOR Doesn't require update to Model Deployment Repositories for:v4 Applies to `v4` labels Mar 7, 2025
@CodeGat CodeGat self-assigned this Mar 7, 2025
@atteggiani atteggiani self-requested a review March 7, 2025 00:51
Copy link
Contributor

@harshula harshula left a comment

Choose a reason for hiding this comment

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

🤞

Copy link

@atteggiani atteggiani left a comment

Choose a reason for hiding this comment

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

Looks good!

Just a general comment on DEPLOYMENT_TARGET and the spack.yaml file.
I am not sure of all the possible values of DEPLOYMENT_TARGET but I believe it would be something like Gadi, Setonix, etc.
Isn't there a way to have spack automatically detect the DEPLOYMENT_TARGET (from the hostname of the machine where it is run for example), if no explicit DEPLOYMENT_TARGET is set within the environment?

@CodeGat
Copy link
Member Author

CodeGat commented Mar 7, 2025

That is true @atteggiani, and indeed users can specify that in their spack.yaml via when: re.match("gadi.nci.org.au", hostname), but there may be a time where we have multiple spack instances outside of the Gadi [Pre]Release ones on Gadi. For example, maybe a Test spack instance or something, that has different requirements than Prerelease.

@CodeGat CodeGat merged commit 9bf3773 into v4 Mar 7, 2025
@CodeGat CodeGat deleted the 242-export-deployment-target-for-undeploy branch March 7, 2025 00:59
@CodeGat
Copy link
Member Author

CodeGat commented Mar 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for:v4 Applies to `v4` priority:blocker type:bug version:MINOR Doesn't require update to Model Deployment Repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deployment Removal Workflow silently failing due to 'DEPLOYMENT_TARGET' being unset
3 participants