Skip to content
Snippets Groups Projects

Dedal Release

Merged Adrian Ciu requested to merge dev into master
Compare and
45 files
+ 2673
125
Compare changes
  • Side-by-side
  • Inline
Files
45
+ 35
0
import os
from dedal.model.SpackDescriptor import SpackDescriptor
from dedal.spack_factory.SpackOperationCreator import SpackOperationCreator
from dedal.configuration.SpackConfig import SpackConfig
class SpackManager:
"""
This class defines the logic used by the CLI
"""
def __init__(self, spack_config: SpackConfig = None, use_cache=False):
self._spack_config = spack_config
self._use_cache = use_cache
def _get_spack_operation(self):
return SpackOperationCreator.get_spack_operator(self._spack_config, self._use_cache)
def install_spack(self, version: str, bashrc_path=os.path.expanduser("~/.bashrc")):
self._get_spack_operation().install_spack(spack_version=f'v{version}', bashrc_path=bashrc_path)
def add_spack_repo(self, repo: SpackDescriptor):
"""
After additional repo was added, setup_spack_env must be invoked
"""
self._spack_config.add_repo(repo)
def setup_spack_env(self):
self._get_spack_operation().setup_spack_env()
def concretize_spack_env(self):
self._get_spack_operation().concretize_spack_env()
def install_packages(self, jobs: int):
self._get_spack_operation().install_packages(jobs=jobs)