Skip to content
Snippets Groups Projects
Select Git revision
  • a90e2efe8dc9f76ba1b944da6f73bb172937c3b0
  • main default protected
2 results

__init__.py

Blame
  • extract_current_pinnings.py 693 B
    #!/usr/env/python
    
    ''''Util to extract a list of pinnings from the current container'''
    
    import yaml
    import argparse
    
    
    apps = ['wafer', 'dls', 'simulation', 'slurmviz']
    
    
    for app in apps:
        speclist = ''
        try:
            spec = yaml.load(open(f'/opt/spack_views/visionary-{app}/.spack/visionary-{app}/spec.yaml'))
            for singlespec in spec['spec'][1:]:
                for k, v in singlespec.items():
                    speclist += f'{k}@{v["version"]}\n'
    
            print(f'Writing dependency list "{spec-dep-{app}.list}"')
            with open(f'spec-dep-{app}.list', 'w') as f:
                f.write(speclist)
        except:
            print('Script must be run from within a container.')
            raise