Skip to content

Commit

Permalink
Fix issue with deployments push on spack packages
Browse files Browse the repository at this point in the history
Previsouly a shadowed pipeline meant this code was never run

This PR fixes that, and fixes the code so it works and successfully
pushes package definition
  • Loading branch information
rfbgo committed Jan 16, 2025
1 parent f74a69c commit ae7053f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 6 additions & 2 deletions lib/ramble/ramble/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,12 @@ def __init__(
self.action_string = "Pushing deployment of"
self.require_inventory = True
self.create_tar = create_tar
expanded_url = workspace_expander.expand_var(upload_url)
self.upload_url = ramble.util.path.normalize_path_or_url(expanded_url)

if upload_url:
expanded_url = workspace_expander.expand_var(upload_url)
self.upload_url = ramble.util.path.normalize_path_or_url(expanded_url)
else:
self.upload_url = None

if deployment_name:
expanded_name = workspace_expander.expand_var(deployment_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,12 @@ def _clean_hash_variables(self, workspace, variables):
super()._clean_hash_variables(workspace, variables)

register_phase(
"deploy_artifacts",
"deploy_spack_artifacts",
pipeline="pushdeployment",
run_after=["software_create_env"],
run_after=["software_create_env", "deploy_artifacts"],
)

def _deploy_artifacts(self, workspace, app_inst=None):
super()._deploy_artifacts(workspace, app_inst=app_inst)
def _deploy_spack_artifacts(self, workspace, app_inst=None):
env_path = self.app_inst.expander.env_path

try:
Expand Down Expand Up @@ -1039,7 +1038,7 @@ def generate_env_file(self):
env_data = syaml.load_config(
syaml.dump_config(env_file, default_flow_style=False)
)
with open(spack_env_file) as f:
with open(spack_env_file, "r") as f:
existing_data = syaml.load_config(f)
gen_env_hash = ramble.util.hashing.hash_json(env_data)
existing_env_hash = ramble.util.hashing.hash_json(
Expand Down Expand Up @@ -1269,7 +1268,9 @@ def package_definitions(self):
for pkg in self.env_contents:
args = location_args.copy()
args.append(pkg)
path = self.execute(self.spack, args, return_output=True)

path = self.execute(self.spack, args, return_output=True).rstrip()

if path is not None:
yield pkg, os.path.join(path, package_def_name)

Expand Down

0 comments on commit ae7053f

Please sign in to comment.