diff --git a/recipes/wcp/icon/v1/a100/post-install b/recipes/wcp/icon/v1/a100/post-install index 75b68666..bd7d6a8b 100644 --- a/recipes/wcp/icon/v1/a100/post-install +++ b/recipes/wcp/icon/v1/a100/post-install @@ -1,7 +1,10 @@ #!/usr/bin/python3 import yaml +import hashlib + +# Add cuda_arch to packages.yaml with open("{{ env.mount }}/config/packages.yaml", mode='r') as file: packages = yaml.safe_load(file) @@ -9,3 +12,12 @@ packages['packages']['all'] = {'variants': 'cuda_arch=80'} with open("{{ env.mount }}/config/packages.yaml", mode='w') as file: yaml.dump(packages, file) + + +# Generate a hash to make the uenv uniquely identifiable +with open("{{ env.mount }}/meta/configure.json", mode='rb') as f: + sha = hashlib.sha256(f.read()).hexdigest() + +with open("{{ env.mount }}/meta/hash", mode='w') as f: + f.write(sha) +