diff --git a/etc/ramble/defaults/spack.yaml b/etc/ramble/defaults/spack.yaml index 76560517c..9e1d214e7 100644 --- a/etc/ramble/defaults/spack.yaml +++ b/etc/ramble/defaults/spack.yaml @@ -1,4 +1,3 @@ spack: - concretized: false packages: {} environments: {} diff --git a/examples/basic_expansion_config.yaml b/examples/basic_expansion_config.yaml index 25e262691..feb40b0de 100644 --- a/examples/basic_expansion_config.yaml +++ b/examples/basic_expansion_config.yaml @@ -29,7 +29,6 @@ ramble: n_ranks: '1' n_nodes: '1' spack: - concretized: true packages: gcc9: spack_spec: gcc@9.3.0 target=x86_64 diff --git a/examples/basic_gromacs_config.yaml b/examples/basic_gromacs_config.yaml index cfd61d6b8..f03b877a6 100644 --- a/examples/basic_gromacs_config.yaml +++ b/examples/basic_gromacs_config.yaml @@ -38,7 +38,6 @@ ramble: size: '0003' type: 'rf' spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 target=x86_64 diff --git a/examples/basic_hostname_config.yaml b/examples/basic_hostname_config.yaml index 7455e585a..4a901f279 100644 --- a/examples/basic_hostname_config.yaml +++ b/examples/basic_hostname_config.yaml @@ -44,6 +44,5 @@ ramble: n_nodes: '1' processes_per_node: '16' spack: - concretized: true packages: {} environments: {} diff --git a/examples/full_expansion_config.yaml b/examples/full_expansion_config.yaml index 58ef3c98e..942ff75e8 100644 --- a/examples/full_expansion_config.yaml +++ b/examples/full_expansion_config.yaml @@ -29,7 +29,6 @@ ramble: #(part1, 16, openfoam-skx, 2), (part1, 16, openfoam-skx, 4) #(part2, 32, openfoam-zen2, 2), (part2, 32, openfoam-zen2, 4) spack: - concretized: true packages: gcc9: spack_spec: gcc@9.3.0 target=x86_64 diff --git a/examples/vector_gromacs_software_config.yaml b/examples/vector_gromacs_software_config.yaml index 2099c7053..2a10e61bb 100644 --- a/examples/vector_gromacs_software_config.yaml +++ b/examples/vector_gromacs_software_config.yaml @@ -26,7 +26,6 @@ ramble: - n_ranks - gromacs_version spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 target=x86_64 diff --git a/examples/vector_matrix_gromacs_config.yaml b/examples/vector_matrix_gromacs_config.yaml index bfa883aec..b1bb2eb9c 100644 --- a/examples/vector_matrix_gromacs_config.yaml +++ b/examples/vector_matrix_gromacs_config.yaml @@ -23,7 +23,6 @@ ramble: - type - n_ranks spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 target=x86_64 diff --git a/lib/ramble/docs/configuration_files.rst b/lib/ramble/docs/configuration_files.rst index 134f7eef7..cefd6f9b4 100644 --- a/lib/ramble/docs/configuration_files.rst +++ b/lib/ramble/docs/configuration_files.rst @@ -471,7 +471,6 @@ environments created from those packages. Its format is as follows: .. code-block:: yaml spack: - concretized: [True/False] # Should be false unless defined in a concretized workspace [variables: {}] packages: : diff --git a/lib/ramble/docs/tutorials/10_using_modifiers.rst b/lib/ramble/docs/tutorials/10_using_modifiers.rst index 68d85ae1b..ed6004c24 100644 --- a/lib/ramble/docs/tutorials/10_using_modifiers.rst +++ b/lib/ramble/docs/tutorials/10_using_modifiers.rst @@ -144,7 +144,6 @@ The resulting configuration file should look like the following. variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -239,7 +238,6 @@ look like the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -309,7 +307,6 @@ configuration file should look like the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 diff --git a/lib/ramble/docs/tutorials/11_using_internals.rst b/lib/ramble/docs/tutorials/11_using_internals.rst index ddf857bb5..c2198e97c 100644 --- a/lib/ramble/docs/tutorials/11_using_internals.rst +++ b/lib/ramble/docs/tutorials/11_using_internals.rst @@ -138,7 +138,6 @@ the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -245,7 +244,6 @@ configuration file should look like the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -337,7 +335,6 @@ following: variables: n_nodes: [1, 2, 4] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 diff --git a/lib/ramble/docs/tutorials/1_hello_world.rst b/lib/ramble/docs/tutorials/1_hello_world.rst index d90f2ccb0..ac6ec9a89 100644 --- a/lib/ramble/docs/tutorials/1_hello_world.rst +++ b/lib/ramble/docs/tutorials/1_hello_world.rst @@ -174,7 +174,6 @@ following contents: variables: n_ranks: '1' spack: - concretized: true packages: {} environments: {} diff --git a/lib/ramble/docs/tutorials/5_changing_your_software_stack.rst b/lib/ramble/docs/tutorials/5_changing_your_software_stack.rst index a2f65c390..9c3543147 100644 --- a/lib/ramble/docs/tutorials/5_changing_your_software_stack.rst +++ b/lib/ramble/docs/tutorials/5_changing_your_software_stack.rst @@ -80,7 +80,6 @@ The relevant portion of the workspace configuration file is: .. code-block:: YAML spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 target=x86_64 diff --git a/lib/ramble/docs/tutorials/6_configuring_a_scaling_study.rst b/lib/ramble/docs/tutorials/6_configuring_a_scaling_study.rst index a5f184b06..fbc3c2b9b 100644 --- a/lib/ramble/docs/tutorials/6_configuring_a_scaling_study.rst +++ b/lib/ramble/docs/tutorials/6_configuring_a_scaling_study.rst @@ -223,7 +223,6 @@ look like the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 diff --git a/lib/ramble/docs/tutorials/7_using_zips_and_matrices.rst b/lib/ramble/docs/tutorials/7_using_zips_and_matrices.rst index 41bca9877..0808909f3 100644 --- a/lib/ramble/docs/tutorials/7_using_zips_and_matrices.rst +++ b/lib/ramble/docs/tutorials/7_using_zips_and_matrices.rst @@ -112,7 +112,6 @@ the above section. The result should look like the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -203,7 +202,6 @@ should have the following in your ``ramble.yaml``: - platform_config - n_nodes spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -266,7 +264,6 @@ Your final configuration file should look something like: - platform_config - n_nodes spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 diff --git a/lib/ramble/docs/tutorials/8_var_expansion_indirection_and_stack_parameterization.rst b/lib/ramble/docs/tutorials/8_var_expansion_indirection_and_stack_parameterization.rst index 96eccdae3..5c321b697 100644 --- a/lib/ramble/docs/tutorials/8_var_expansion_indirection_and_stack_parameterization.rst +++ b/lib/ramble/docs/tutorials/8_var_expansion_indirection_and_stack_parameterization.rst @@ -95,7 +95,6 @@ final configuration from the previous tutorial. - platform_config - n_nodes spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -193,7 +192,6 @@ generation as well. The result might look like the following: - platform_config - n_nodes spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -264,7 +262,6 @@ into the matrix. The result might look like the following: - n_nodes - mpi_name spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -374,7 +371,6 @@ resulting configuration might look like the following: - n_nodes - mpi_name spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -464,7 +460,6 @@ The resulting configuration file might look like the following: - n_nodes - mpi_name spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 diff --git a/lib/ramble/docs/tutorials/9_success_criteria.rst b/lib/ramble/docs/tutorials/9_success_criteria.rst index 4d57b5d68..544a344da 100644 --- a/lib/ramble/docs/tutorials/9_success_criteria.rst +++ b/lib/ramble/docs/tutorials/9_success_criteria.rst @@ -120,7 +120,6 @@ configuration file might look like the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 @@ -195,7 +194,6 @@ resulting configuration file might look like the following: variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 diff --git a/lib/ramble/docs/tutorials/mirrors.rst b/lib/ramble/docs/tutorials/mirrors.rst index c4fcd8858..3e57ad258 100644 --- a/lib/ramble/docs/tutorials/mirrors.rst +++ b/lib/ramble/docs/tutorials/mirrors.rst @@ -65,7 +65,6 @@ Write the following configuration into the file, save, and exit: n_nodes: 1 processes_per_node: 30 spack: - concretized: false packages: {} environments: {} @@ -94,7 +93,6 @@ will look something like this: n_nodes: 1 processes_per_node: 30 spack: - concretized: true packages: gcc9: spack_spec: gcc@9.3.0 diff --git a/lib/ramble/docs/tutorials/shared/wrf_scaling_workspace.rst b/lib/ramble/docs/tutorials/shared/wrf_scaling_workspace.rst index 4695ecacb..d437184cd 100644 --- a/lib/ramble/docs/tutorials/shared/wrf_scaling_workspace.rst +++ b/lib/ramble/docs/tutorials/shared/wrf_scaling_workspace.rst @@ -45,7 +45,6 @@ final configuration from a previous tutorial. variables: n_nodes: [1, 2] spack: - concretized: true packages: gcc9: spack_spec: gcc@9.4.0 diff --git a/lib/ramble/ramble/cmd/workspace.py b/lib/ramble/ramble/cmd/workspace.py index 1265b3409..2d141c20d 100644 --- a/lib/ramble/ramble/cmd/workspace.py +++ b/lib/ramble/ramble/cmd/workspace.py @@ -340,12 +340,21 @@ def workspace_remove(args): def workspace_concretize_setup_parser(subparser): """Concretize a workspace""" - pass + subparser.add_argument( + '-f', '--force-concretize', + dest='force_concretize', + action='store_true', + help='Overwrite software environment configuration with defaults defined in application ' + + 'definition', + required=False) def workspace_concretize(args): ws = ramble.cmd.require_active_workspace(cmd_name='workspace concretize') + if args.force_concretize: + ws.force_concretize = True + logger.debug('Concretizing workspace') ws.concretize() diff --git a/lib/ramble/ramble/language/shared_language.py b/lib/ramble/ramble/language/shared_language.py index 3da98136c..414174ec6 100644 --- a/lib/ramble/ramble/language/shared_language.py +++ b/lib/ramble/ramble/language/shared_language.py @@ -6,10 +6,7 @@ # option. This file may not be copied, modified, or distributed # except according to those terms. -try: - import deprecation -except ImportError: - print('Please use pip to install the requirements.txt') +import deprecation import ramble.language.language_base import ramble.language.language_helpers diff --git a/lib/ramble/ramble/pipeline.py b/lib/ramble/ramble/pipeline.py index b0c45384b..704cf016e 100644 --- a/lib/ramble/ramble/pipeline.py +++ b/lib/ramble/ramble/pipeline.py @@ -118,17 +118,6 @@ def _construct_hash(self): self.workspace.hash_file_name), 'w+') as f: f.write(self.workspace.workspace_hash + '\n') - def _validate(self): - """Perform validation that this pipeline can be executed""" - if not self.workspace.is_concretized(): - error_message = 'Cannot run %s in a ' % self.name + \ - 'non-conretized workspace\n' + \ - 'Run `ramble workspace concretize` on this ' + \ - 'workspace first.\n' + \ - 'Then ensure its spack configuration is ' + \ - 'properly configured.' - logger.die(error_message) - def _prepare(self): """Perform preparation for pipeline execution""" pass @@ -203,7 +192,6 @@ def run(self): ) logger.add_log(self.log_path) - self._validate() self._prepare() self._execute() self._complete() diff --git a/lib/ramble/ramble/schema/spack.py b/lib/ramble/ramble/schema/spack.py index 2a7da3a40..49d093dbb 100644 --- a/lib/ramble/ramble/schema/spack.py +++ b/lib/ramble/ramble/schema/spack.py @@ -23,7 +23,7 @@ 'properties': { 'concretized': { 'type': 'boolean', - 'default': False + 'default': None }, 'variables': ramble.schema.variables.variables_def, 'zips': ramble.schema.zips.zips_def, diff --git a/lib/ramble/ramble/software_environments.py b/lib/ramble/ramble/software_environments.py index 8072b0a91..7e0b5aab5 100644 --- a/lib/ramble/ramble/software_environments.py +++ b/lib/ramble/ramble/software_environments.py @@ -7,6 +7,10 @@ # except according to those terms. from enum import Enum +try: + import deprecation +except ModuleNotFoundError: + raise ModuleNotFoundError('Please use pip to install the requirements.txt') import ramble.repository import ramble.workspace @@ -413,7 +417,8 @@ class SoftwareEnvironments(object): """Class representing a group of software environments""" _deprecated_sections = [namespace.variables, namespace.zips, - namespace.matrix, namespace.matrices, namespace.exclude] + namespace.matrix, namespace.matrices, + namespace.exclude, 'concretized'] def __init__(self, workspace): """SoftwareEnvironments constructor @@ -457,6 +462,10 @@ def __str__(self): """ return self.info(indent=0) + @deprecation.deprecated(deprecated_in="0.4.0", removed_in="0.5.0", + current_version=str(ramble.ramble_version), + details="These Spack config sections no longer required and will " + "be removed from the schema in v0.5.0") def _deprecated_warnings(self): if not self._warn_for_deprecation or hasattr(self, '_warned_deprecation'): return @@ -485,9 +494,12 @@ def _deprecated_warnings(self): sections_to_print.append('spack:packages::exclude') sections_to_print.append('spack:environments::exclude') + if 'concretized' in self._warn_for_deprecation: + sections_to_print.append('spack:concretized') + if not hasattr(self, '_warned_deprecated_variables'): self._warned_deprecated_variables = True - logger.warn('The following config sections are deprecated and ignore:') + logger.warn('The following config sections are deprecated and ignored:') for section in sections_to_print: logger.warn(f' {section}') logger.warn('Please remove from your configuration files.') diff --git a/lib/ramble/ramble/test/application_tests.py b/lib/ramble/ramble/test/application_tests.py index 9ee9e5485..399ffbffc 100644 --- a/lib/ramble/ramble/test/application_tests.py +++ b/lib/ramble/ramble/test/application_tests.py @@ -486,7 +486,6 @@ def test_derive_variables_for_template_path(mutable_mock_apps_repo): n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/cmd/on.py b/lib/ramble/ramble/test/cmd/on.py index febd7226d..7f7e32e91 100644 --- a/lib/ramble/ramble/test/cmd/on.py +++ b/lib/ramble/ramble/test/cmd/on.py @@ -34,9 +34,6 @@ def test_on_command(mutable_mock_workspace_path): ramble.test.cmd.workspace.add_basic(ws) ramble.test.cmd.workspace.check_basic(ws) - workspace('concretize') - assert ws.is_concretized() - workspace('setup') assert os.path.exists(ws.root + '/all_experiments') @@ -58,9 +55,6 @@ def test_execute_pipeline(mutable_mock_workspace_path): ramble.test.cmd.workspace.add_basic(ws) ramble.test.cmd.workspace.check_basic(ws) - ws.concretize() - assert ws.is_concretized() - setup_pipeline = setup_pipeline_class(ws, filters) setup_pipeline.run() assert os.path.exists(ws.root + '/all_experiments') @@ -77,9 +71,6 @@ def test_on_where(mutable_mock_workspace_path): ramble.test.cmd.workspace.add_basic(ws) ramble.test.cmd.workspace.check_basic(ws) - workspace('concretize') - assert ws.is_concretized() - workspace('setup') assert os.path.exists(ws.root + '/all_experiments') @@ -94,9 +85,6 @@ def test_on_executor(mutable_mock_workspace_path): ramble.test.cmd.workspace.add_basic(ws) ramble.test.cmd.workspace.check_basic(ws) - workspace('concretize') - assert ws.is_concretized() - workspace('setup') assert os.path.exists(ws.root + '/all_experiments') diff --git a/lib/ramble/ramble/test/cmd/workspace.py b/lib/ramble/ramble/test/cmd/workspace.py index a2207e6e2..636014457 100644 --- a/lib/ramble/ramble/test/cmd/workspace.py +++ b/lib/ramble/ramble/test/cmd/workspace.py @@ -17,6 +17,7 @@ import ramble.workspace from ramble.main import RambleCommand, RambleCommandError from ramble.test.dry_run_helpers import search_files_for_string +from ramble.namespace import namespace import ramble.config import ramble.filters import ramble.pipeline @@ -195,7 +196,6 @@ def test_workspace_info(): variables: n_nodes: '2' spack: - concretized: true packages: zlib: spack_spec: 'zlib' @@ -249,7 +249,6 @@ def test_workspace_info_prints_all_levels(): variables: n_nodes: '2' spack: - concretized: true packages: zlib: spack_spec: 'zlib' @@ -316,7 +315,6 @@ def test_workspace_info_with_experiment_chain(): n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ @@ -426,14 +424,56 @@ def test_remove_workspace(): def test_concretize_command(): - ws_name = 'test' - workspace('create', ws_name) + test_config = """ +ramble: + variables: + mpi_command: 'mpirun -n {n_ranks} -ppn {processes_per_node}' + batch_submit: 'batch_submit {execute_experiment}' + processes_per_node: '5' + n_ranks: '{processes_per_node}*{n_nodes}' + applications: + basic: + workloads: + test_wl: + experiments: + test_experiment: + variables: + n_nodes: '2' + test_wl2: + experiments: + test_experiment: + variables: + n_nodes: '2' + zlib: + workloads: + ensure_installed: + experiments: + test_experiment: + variables: + n_nodes: '2' + spack: + packages: {} + environments: {} +""" - with ramble.workspace.read('test') as ws: - add_basic(ws) - check_basic(ws) - workspace('concretize') - assert ws.is_concretized() + workspace_name = 'test_concretize_command' + ws1 = ramble.workspace.create(workspace_name) + ws1.write() + + config_path = os.path.join(ws1.config_dir, ramble.workspace.config_file_name) + + with open(config_path, 'w+') as f: + f.write(test_config) + + ws1._re_read() + + assert search_files_for_string([config_path], 'packages: {}') is True + assert search_files_for_string([config_path], 'spack_spec: zlib') is False + + workspace('concretize', global_args=['-w', workspace_name]) + + assert search_files_for_string([config_path], 'packages: {}') is False + assert search_files_for_string([config_path], 'spack_spec: zlib') is True def test_concretize_nothing(): @@ -445,8 +485,126 @@ def test_concretize_nothing(): add_basic(ws) check_basic(ws) + assert search_files_for_string([ws.config_file_path], 'packages: {}') is True + assert search_files_for_string([ws.config_file_path], 'spack_spec:') is False + ws.concretize() - assert ws.is_concretized() + + assert search_files_for_string([ws.config_file_path], 'packages: {}') is True + assert search_files_for_string([ws.config_file_path], 'spack_spec:') is False + + +def test_concretize_concrete_config(): + test_config = """ +ramble: + variables: + mpi_command: 'mpirun -n {n_ranks} -ppn {processes_per_node}' + batch_submit: 'batch_submit {execute_experiment}' + processes_per_node: '5' + n_ranks: '{processes_per_node}*{n_nodes}' + applications: + basic: + workloads: + test_wl: + experiments: + test_experiment: + variables: + n_nodes: '2' + test_wl2: + experiments: + test_experiment: + variables: + n_nodes: '2' + zlib: + workloads: + ensure_installed: + experiments: + test_experiment: + variables: + n_nodes: '2' + spack: + packages: + zlib: + spack_spec: 'zlib' + environments: + zlib: + packages: + - zlib +""" + + workspace_name = 'test_concretize_concrete_config' + ws1 = ramble.workspace.create(workspace_name) + ws1.write() + + config_path = os.path.join(ws1.config_dir, ramble.workspace.config_file_name) + + with open(config_path, 'w+') as f: + f.write(test_config) + + ws1._re_read() + + with pytest.raises(ramble.workspace.RambleWorkspaceError) as e: + workspace('concretize', global_args=['-w', workspace_name]) + assert 'Cannot concretize an already concretized workspace.' in e + + +def test_force_concretize(): + test_config = """ +ramble: + variables: + mpi_command: 'mpirun -n {n_ranks} -ppn {processes_per_node}' + batch_submit: 'batch_submit {execute_experiment}' + processes_per_node: '5' + n_ranks: '{processes_per_node}*{n_nodes}' + applications: + basic: + workloads: + test_wl: + experiments: + test_experiment: + variables: + n_nodes: '2' + test_wl2: + experiments: + test_experiment: + variables: + n_nodes: '2' + zlib: + workloads: + ensure_installed: + experiments: + test_experiment: + variables: + n_nodes: '2' + spack: + packages: + zlib-test: + spack_spec: 'zlib-test' + environments: + zlib-test: + packages: + - zlib-test +""" + + workspace_name = 'test_force_concretize' + ws1 = ramble.workspace.create(workspace_name) + ws1.write() + + config_path = os.path.join(ws1.config_dir, ramble.workspace.config_file_name) + + with open(config_path, 'w+') as f: + f.write(test_config) + + ws1._re_read() + + with pytest.raises(ramble.workspace.RambleWorkspaceError) as e: + workspace('concretize', global_args=['-w', workspace_name]) + assert 'Cannot concretize an already concretized workspace.' in e + + workspace('concretize', '-f', global_args=['-w', workspace_name]) + + assert search_files_for_string([config_path], 'zlib:') is True + assert search_files_for_string([config_path], 'zlib-test') is False def test_setup_command(): @@ -458,7 +616,6 @@ def test_setup_command(): check_basic(ws) workspace('concretize') - assert ws.is_concretized() workspace('setup') assert os.path.exists(ws.root + '/all_experiments') @@ -477,7 +634,6 @@ def test_setup_nothing(): check_basic(ws) ws.concretize() - assert ws.is_concretized() setup_pipeline = pipeline_cls(ws, filters) setup_pipeline.run() @@ -493,7 +649,6 @@ def test_anlyze_command(): check_basic(ws) workspace('concretize') - assert ws.is_concretized() workspace('setup') assert os.path.exists(ws.root + '/all_experiments') @@ -517,7 +672,6 @@ def test_analyze_nothing(): check_basic(ws) ws.concretize() - assert ws.is_concretized() setup_pipeline = setup_cls(ws, filters) setup_pipeline.run() @@ -540,8 +694,6 @@ def test_workspace_flag_named(): check_basic(ws) workspace('concretize', global_args=flag_args) - with ramble.workspace.read(ws_name) as ws: - assert ws.is_concretized() workspace('setup', global_args=flag_args) with ramble.workspace.read(ws_name) as ws: @@ -568,8 +720,6 @@ def test_workspace_flag_anon(tmpdir): check_basic(ws) workspace('concretize', global_args=flag_args) - with ramble.workspace.Workspace(ws_path) as ws: - assert ws.is_concretized() workspace('setup', global_args=flag_args) with ramble.workspace.Workspace(ws_path) as ws: @@ -599,7 +749,6 @@ def test_no_workspace_flag(): workspace('concretize', global_args=flag_args) ramble.workspace.activate(ws) workspace('concretize') - assert ws.is_concretized() with pytest.raises(RambleCommandError): workspace('setup', global_args=flag_args) @@ -670,7 +819,6 @@ def test_dryrun_setup(): variables: n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ @@ -721,7 +869,6 @@ def test_matrix_vector_workspace_full(): - n_nodes - - idx spack: - concretized: true packages: {} environments: {} """ @@ -790,7 +937,6 @@ def test_invalid_vector_workspace(): n_nodes: [1, 2, 4] idx: [1, 2, 3, 4, 5, 6] spack: - concretized: true packages: {} environments: {} """ @@ -839,7 +985,6 @@ def test_invalid_size_matrices_workspace(): - - n_nodes - - idx spack: - concretized: true packages: {} environments: {} """ @@ -884,7 +1029,6 @@ def test_undefined_var_matrices_workspace(): matrices: - - foo spack: - concretized: true packages: {} environments: {} """ @@ -928,7 +1072,6 @@ def test_non_vector_var_matrices_workspace(): matrices: - - foo spack: - concretized: true packages: {} environments: {} """ @@ -973,7 +1116,6 @@ def test_multi_use_vector_var_matrices_workspace(): - - foo - - foo spack: - concretized: true packages: {} environments: {} """ @@ -1021,7 +1163,6 @@ def test_reconcretize_in_configs_dir(tmpdir): variables: foo: 1 spack: - concretized: false packages: {} environments: {} """ @@ -1045,15 +1186,22 @@ def write_config(ws_path, config): with config_path.as_cwd(): write_config(ws_path, test_config) + with ramble.workspace.Workspace(ws_path) as ws: + spack_dict = ws.get_spack_dict() + print(f'spack_dict before = {spack_dict}') + workspace('concretize', global_args=workspace_flags) + with ramble.workspace.Workspace(ws_path) as ws: - assert ws.is_concretized() + spack_dict = ws.get_spack_dict() + assert spack_dict[namespace.environments] write_config(ws_path, test_config) workspace('concretize', global_args=workspace_flags) with ramble.workspace.Workspace(ws_path) as ws: - assert ws.is_concretized() + spack_dict = ws.get_spack_dict() + assert spack_dict[namespace.environments] def test_workspace_archive(): @@ -1073,7 +1221,6 @@ def test_workspace_archive(): variables: n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ @@ -1163,7 +1310,6 @@ def test_workspace_archive_include_secrets(): variables: n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ @@ -1223,7 +1369,6 @@ def test_workspace_tar_archive(): variables: n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ @@ -1301,7 +1446,6 @@ def test_workspace_tar_upload_archive(): variables: n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ @@ -1384,7 +1528,6 @@ def test_workspace_tar_upload_archive_config_url(): variables: n_nodes: '2' spack: - concretized: true packages: {} environments: {} """ @@ -1467,7 +1610,6 @@ def test_dryrun_noexpvars_setup(): experiments: test_experiment: {} spack: - concretized: true packages: {} environments: {} """ @@ -1532,7 +1674,6 @@ def test_workspace_include(): include: - '%s' spack: - concretized: true packages: {} environments: {} """ % inc_file @@ -1568,7 +1709,6 @@ def test_invalid_template_name_errors(tpl_name, capsys): experiments: test_experiment: {} spack: - concretized: true packages: {} environments: {} """ @@ -1631,7 +1771,6 @@ def test_custom_executables_info(): redirect: '{log_file}' output_capture: '&>' spack: - concretized: true packages: {} environments: {} """ @@ -1694,7 +1833,6 @@ def test_custom_executables_order_info(): - wl_level_cmd - app_level_cmd spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/concretize_builtin.py b/lib/ramble/ramble/test/concretize_builtin.py index f4ed4d4ea..27dc09bf7 100644 --- a/lib/ramble/ramble/test/concretize_builtin.py +++ b/lib/ramble/ramble/test/concretize_builtin.py @@ -68,7 +68,6 @@ def test_concretize_does_not_set_required(mutable_config, mutable_mock_workspace matrix: - n_nodes spack: - concretized: false packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/dry_run_helpers.py b/lib/ramble/ramble/test/dry_run_helpers.py index 2b7f68a0f..df98c4887 100644 --- a/lib/ramble/ramble/test/dry_run_helpers.py +++ b/lib/ramble/ramble/test/dry_run_helpers.py @@ -37,7 +37,6 @@ def dry_run_config(section_name, injections, config_path, test_dict['spack'] = syaml.syaml_dict() spack_dict = test_dict['spack'] - spack_dict['concretized'] = False spack_dict['packages'] = syaml.syaml_dict() spack_dict['environments'] = syaml.syaml_dict() diff --git a/lib/ramble/ramble/test/end_to_end/chained_experiment_var_inheritance.py b/lib/ramble/ramble/test/end_to_end/chained_experiment_var_inheritance.py index 92bcf2134..94eece202 100644 --- a/lib/ramble/ramble/test/end_to_end/chained_experiment_var_inheritance.py +++ b/lib/ramble/ramble/test/end_to_end/chained_experiment_var_inheritance.py @@ -94,7 +94,6 @@ def test_chained_experiment_variable_inheritance(mutable_config, variables: n_nodes: '2' spack: - concretized: true packages: gcc: spack_spec: gcc@9.3.0 target=x86_64 diff --git a/lib/ramble/ramble/test/end_to_end/config_section_env_vars.py b/lib/ramble/ramble/test/end_to_end/config_section_env_vars.py index 175a30919..5c7c1247e 100644 --- a/lib/ramble/ramble/test/end_to_end/config_section_env_vars.py +++ b/lib/ramble/ramble/test/end_to_end/config_section_env_vars.py @@ -44,7 +44,6 @@ def test_config_section_env_vars(mutable_config, mutable_mock_workspace_path, mo variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/custom_executables.py b/lib/ramble/ramble/test/end_to_end/custom_executables.py index 35e5a589f..a2f48351b 100644 --- a/lib/ramble/ramble/test/end_to_end/custom_executables.py +++ b/lib/ramble/ramble/test/end_to_end/custom_executables.py @@ -82,7 +82,6 @@ def test_custom_executables(mutable_config, mutable_mock_workspace_path, mock_ap MY_VAR: 'TEST' OTHER_ENV_VAR: 'ANOTHER_TEST' spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/dryrun_chained_experiments.py b/lib/ramble/ramble/test/end_to_end/dryrun_chained_experiments.py index f59f474bd..6f06867eb 100644 --- a/lib/ramble/ramble/test/end_to_end/dryrun_chained_experiments.py +++ b/lib/ramble/ramble/test/end_to_end/dryrun_chained_experiments.py @@ -83,7 +83,6 @@ def test_dryrun_chained_experiments(mutable_config, variables: n_nodes: '2' spack: - concretized: true packages: gcc: spack_spec: gcc@9.3.0 target=x86_64 diff --git a/lib/ramble/ramble/test/end_to_end/dryrun_copies_external_env.py b/lib/ramble/ramble/test/end_to_end/dryrun_copies_external_env.py index cf05a53cd..867529ff1 100644 --- a/lib/ramble/ramble/test/end_to_end/dryrun_copies_external_env.py +++ b/lib/ramble/ramble/test/end_to_end/dryrun_copies_external_env.py @@ -52,7 +52,6 @@ def test_dryrun_copies_external_env(mutable_config, mutable_mock_workspace_path, variables: n_nodes: '1' spack: - concretized: true packages: {{}} environments: wrfv4: diff --git a/lib/ramble/ramble/test/end_to_end/dryrun_series_contains_package_paths.py b/lib/ramble/ramble/test/end_to_end/dryrun_series_contains_package_paths.py index 5c6e50ae4..df7018586 100644 --- a/lib/ramble/ramble/test/end_to_end/dryrun_series_contains_package_paths.py +++ b/lib/ramble/ramble/test/end_to_end/dryrun_series_contains_package_paths.py @@ -46,7 +46,6 @@ def test_dryrun_series_contains_package_paths(mutable_config, n_nodes: '1' test_id: [1, 2] spack: - concretized: true packages: zlib: spack_spec: zlib diff --git a/lib/ramble/ramble/test/end_to_end/env_var_builtin.py b/lib/ramble/ramble/test/end_to_end/env_var_builtin.py index b0060de15..7610c43dc 100644 --- a/lib/ramble/ramble/test/end_to_end/env_var_builtin.py +++ b/lib/ramble/ramble/test/end_to_end/env_var_builtin.py @@ -60,7 +60,6 @@ def test_env_var_builtin(mutable_config, mutable_mock_workspace_path, mock_appli set: MY_VAR: 'TEST' spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/exclusive_filtered_vector_workloads.py b/lib/ramble/ramble/test/end_to_end/exclusive_filtered_vector_workloads.py index 20c561df0..29e8127b1 100644 --- a/lib/ramble/ramble/test/end_to_end/exclusive_filtered_vector_workloads.py +++ b/lib/ramble/ramble/test/end_to_end/exclusive_filtered_vector_workloads.py @@ -42,7 +42,6 @@ def test_exclusive_filtered_vector_workloads(mutable_config, mutable_mock_worksp application_workload: ['parallel' ,'serial', 'local'] n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/expanded_fom_dry_run.py b/lib/ramble/ramble/test/end_to_end/expanded_fom_dry_run.py index 5dd26d2cb..05e069f93 100644 --- a/lib/ramble/ramble/test/end_to_end/expanded_fom_dry_run.py +++ b/lib/ramble/ramble/test/end_to_end/expanded_fom_dry_run.py @@ -43,7 +43,6 @@ def test_expanded_foms_dry_run(mutable_config, n_nodes: 1 n_ranks: 1 spack: - concretized: false packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/experiment_excludes.py b/lib/ramble/ramble/test/end_to_end/experiment_excludes.py index 1c8759993..f1aac4f4e 100644 --- a/lib/ramble/ramble/test/end_to_end/experiment_excludes.py +++ b/lib/ramble/ramble/test/end_to_end/experiment_excludes.py @@ -86,7 +86,6 @@ def test_wrfv4_exclusions(mutable_config, mutable_mock_workspace_path): where: - '{n_nodes} == 16' spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/experiment_repeats.py b/lib/ramble/ramble/test/end_to_end/experiment_repeats.py index cf41edf2f..24bd4809c 100644 --- a/lib/ramble/ramble/test/end_to_end/experiment_repeats.py +++ b/lib/ramble/ramble/test/end_to_end/experiment_repeats.py @@ -61,7 +61,6 @@ def test_gromacs_repeats(mutable_config, mutable_mock_workspace_path): size: '0003' type: 'pme' spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/explicit_zips.py b/lib/ramble/ramble/test/end_to_end/explicit_zips.py index 5100de6a0..a9d134a7d 100644 --- a/lib/ramble/ramble/test/end_to_end/explicit_zips.py +++ b/lib/ramble/ramble/test/end_to_end/explicit_zips.py @@ -80,7 +80,6 @@ def test_wrfv4_explicit_zips(mutable_config, mutable_mock_workspace_path): - environments - partitions spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/formatted_executables.py b/lib/ramble/ramble/test/end_to_end/formatted_executables.py index aa177ec5a..1c69f6bbe 100644 --- a/lib/ramble/ramble/test/end_to_end/formatted_executables.py +++ b/lib/ramble/ramble/test/end_to_end/formatted_executables.py @@ -58,7 +58,6 @@ def test_formatted_executables(mutable_config, mutable_mock_workspace_path, mock variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ @@ -115,7 +114,6 @@ def test_redefined_executable_errors(mutable_config, mutable_mock_workspace_path var_exec_name: 'nothing' n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/gromacs_size_expansion.py b/lib/ramble/ramble/test/end_to_end/gromacs_size_expansion.py index ba208ae29..335f2d678 100644 --- a/lib/ramble/ramble/test/end_to_end/gromacs_size_expansion.py +++ b/lib/ramble/ramble/test/end_to_end/gromacs_size_expansion.py @@ -42,7 +42,6 @@ def test_gromacs_size_expansion(mutable_config, mutable_mock_workspace_path): n_nodes: '1' size: '0000.96' spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/inclusive_filtered_vector_workloads.py b/lib/ramble/ramble/test/end_to_end/inclusive_filtered_vector_workloads.py index 7f7ebf7c1..905b8f8f2 100644 --- a/lib/ramble/ramble/test/end_to_end/inclusive_filtered_vector_workloads.py +++ b/lib/ramble/ramble/test/end_to_end/inclusive_filtered_vector_workloads.py @@ -42,7 +42,6 @@ def test_inclusive_filtered_vector_workloads(mutable_config, mutable_mock_worksp application_workload: ['parallel' ,'serial', 'local'] n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/known_applications.py b/lib/ramble/ramble/test/end_to_end/known_applications.py index 3b001ba5e..e7717e388 100644 --- a/lib/ramble/ramble/test/end_to_end/known_applications.py +++ b/lib/ramble/ramble/test/end_to_end/known_applications.py @@ -71,7 +71,6 @@ def test_known_applications(application, capsys): n_nodes: '1' processes_per_node: '1'\n""") f.write(""" spack: - concretized: false packages: {} environments: {}\n""") diff --git a/lib/ramble/ramble/test/end_to_end/merge_config_files.py b/lib/ramble/ramble/test/end_to_end/merge_config_files.py index 935064cbf..edf16339f 100644 --- a/lib/ramble/ramble/test/end_to_end/merge_config_files.py +++ b/lib/ramble/ramble/test/end_to_end/merge_config_files.py @@ -38,7 +38,6 @@ def test_merge_config_files(mutable_config, mutable_mock_workspace_path, mock_ap test_spack = """ spack: - concretized: true packages: zlib: spack_spec: zlib@1.2.12 @@ -56,7 +55,6 @@ def test_merge_config_files(mutable_config, mutable_mock_workspace_path, mock_ap n_threads: '1' applications: {} spack: - concretized: false packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/missing_required_dry_run.py b/lib/ramble/ramble/test/end_to_end/missing_required_dry_run.py index 3d697b201..25f0334e0 100644 --- a/lib/ramble/ramble/test/end_to_end/missing_required_dry_run.py +++ b/lib/ramble/ramble/test/end_to_end/missing_required_dry_run.py @@ -42,7 +42,6 @@ def test_missing_required_dry_run(mutable_config, mutable_mock_workspace_path): variables: n_nodes: '8' spack: - concretized: true packages: gcc8: spack_spec: gcc@8.2.0 target=x86_64 diff --git a/lib/ramble/ramble/test/end_to_end/nested_compilers_are_installed.py b/lib/ramble/ramble/test/end_to_end/nested_compilers_are_installed.py index ad1cbba7f..522ab3222 100644 --- a/lib/ramble/ramble/test/end_to_end/nested_compilers_are_installed.py +++ b/lib/ramble/ramble/test/end_to_end/nested_compilers_are_installed.py @@ -45,7 +45,6 @@ def test_nested_compilers_are_installed(mutable_config, mutable_mock_workspace_p variables: n_nodes: '1' spack: - concretized: true packages: gcc8: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/package_manager_config.py b/lib/ramble/ramble/test/end_to_end/package_manager_config.py index 2aca09c59..b3ed91e3f 100644 --- a/lib/ramble/ramble/test/end_to_end/package_manager_config.py +++ b/lib/ramble/ramble/test/end_to_end/package_manager_config.py @@ -38,7 +38,6 @@ def test_package_manager_config_zlib(mock_applications): test: variables: {} spack: - concretized: true packages: zlib: spack_spec: 'zlib' diff --git a/lib/ramble/ramble/test/end_to_end/package_manager_requirements.py b/lib/ramble/ramble/test/end_to_end/package_manager_requirements.py index 8c0169ee9..104a3bc0c 100644 --- a/lib/ramble/ramble/test/end_to_end/package_manager_requirements.py +++ b/lib/ramble/ramble/test/end_to_end/package_manager_requirements.py @@ -41,7 +41,6 @@ def test_package_manager_requirements_zlib(mock_applications, mock_modifiers): test: variables: {} spack: - concretized: true packages: {} environments: zlib-configs: @@ -94,7 +93,6 @@ def test_package_manager_requirements_error(mock_applications, mock_modifiers): test: variables: {} spack: - concretized: true packages: {} environments: zlib-configs: diff --git a/lib/ramble/ramble/test/end_to_end/passthrough_variables.py b/lib/ramble/ramble/test/end_to_end/passthrough_variables.py index 6d970c311..29cc0ed76 100644 --- a/lib/ramble/ramble/test/end_to_end/passthrough_variables.py +++ b/lib/ramble/ramble/test/end_to_end/passthrough_variables.py @@ -46,7 +46,6 @@ def test_passthrough_variables(mutable_config, mutable_mock_workspace_path, mock variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ @@ -94,7 +93,6 @@ def test_disable_passthrough(mutable_config, mutable_mock_workspace_path): mpi_command: '{undefined_var}' n_ranks: '1' spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/phase_selection.py b/lib/ramble/ramble/test/end_to_end/phase_selection.py index 57cec6529..4d3081c62 100644 --- a/lib/ramble/ramble/test/end_to_end/phase_selection.py +++ b/lib/ramble/ramble/test/end_to_end/phase_selection.py @@ -78,7 +78,6 @@ def test_workspace_phase_selection(mutable_config, mutable_mock_workspace_path, - n_nodes - env_name spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/phase_selection_with_dependencies.py b/lib/ramble/ramble/test/end_to_end/phase_selection_with_dependencies.py index b847d844f..9d3843053 100644 --- a/lib/ramble/ramble/test/end_to_end/phase_selection_with_dependencies.py +++ b/lib/ramble/ramble/test/end_to_end/phase_selection_with_dependencies.py @@ -79,7 +79,6 @@ def test_workspace_phase_selection_with_dependencies(mutable_config, - n_nodes - env_name spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/shared_context.py b/lib/ramble/ramble/test/end_to_end/shared_context.py index 380d547e2..f3bc1c463 100644 --- a/lib/ramble/ramble/test/end_to_end/shared_context.py +++ b/lib/ramble/ramble/test/end_to_end/shared_context.py @@ -51,7 +51,6 @@ def test_shared_contexts( variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/tag_filtering.py b/lib/ramble/ramble/test/end_to_end/tag_filtering.py index 61ab36eef..e5bc2c220 100644 --- a/lib/ramble/ramble/test/end_to_end/tag_filtering.py +++ b/lib/ramble/ramble/test/end_to_end/tag_filtering.py @@ -74,7 +74,6 @@ def test_workspace_tag_filtering(mutable_config, mutable_mock_workspace_path, variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/test_configvar_dry_run.py b/lib/ramble/ramble/test/end_to_end/test_configvar_dry_run.py index 3523f2287..97b94d4e6 100644 --- a/lib/ramble/ramble/test/end_to_end/test_configvar_dry_run.py +++ b/lib/ramble/ramble/test/end_to_end/test_configvar_dry_run.py @@ -53,7 +53,6 @@ def test_configvar_dry_run(mutable_config, mutable_mock_workspace_path): variables: n_ranks: "{{{var_name}}}" spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/unused_compilers_are_skipped.py b/lib/ramble/ramble/test/end_to_end/unused_compilers_are_skipped.py index 0234d8343..9d056bf7b 100644 --- a/lib/ramble/ramble/test/end_to_end/unused_compilers_are_skipped.py +++ b/lib/ramble/ramble/test/end_to_end/unused_compilers_are_skipped.py @@ -45,7 +45,6 @@ def test_unused_compilers_are_skipped(mutable_config, mutable_mock_workspace_pat variables: n_nodes: '1' spack: - concretized: true packages: gcc8: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/end_to_end/vector_workloads.py b/lib/ramble/ramble/test/end_to_end/vector_workloads.py index c4a1977ef..012ebe2f2 100644 --- a/lib/ramble/ramble/test/end_to_end/vector_workloads.py +++ b/lib/ramble/ramble/test/end_to_end/vector_workloads.py @@ -42,7 +42,6 @@ def test_vector_workloads(mutable_config, mutable_mock_workspace_path): application_workload: ['parallel' ,'serial', 'local'] n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/end_to_end/wrfv4_dry_run.py b/lib/ramble/ramble/test/end_to_end/wrfv4_dry_run.py index fc7df6ab0..3c175c2d1 100644 --- a/lib/ramble/ramble/test/end_to_end/wrfv4_dry_run.py +++ b/lib/ramble/ramble/test/end_to_end/wrfv4_dry_run.py @@ -69,7 +69,6 @@ def test_wrfv4_dry_run(mutable_config, mutable_mock_workspace_path): - n_nodes - env_name spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/mirror_tests.py b/lib/ramble/ramble/test/mirror_tests.py index 703d54645..89df1ad9b 100644 --- a/lib/ramble/ramble/test/mirror_tests.py +++ b/lib/ramble/ramble/test/mirror_tests.py @@ -126,7 +126,6 @@ def test_mirror_create(tmpdir, n_nodes: '1' processes_per_node: '1' spack: - concretized: true packages: {{}} environments: {{}} """ diff --git a/lib/ramble/ramble/test/modifier_application.py b/lib/ramble/ramble/test/modifier_application.py index 17512d4fd..5e7e6b3f5 100644 --- a/lib/ramble/ramble/test/modifier_application.py +++ b/lib/ramble/ramble/test/modifier_application.py @@ -45,7 +45,6 @@ def test_wrfv4_aps_test(mutable_config, mutable_mock_workspace_path): variables: n_nodes: '1' spack: - concretized: true packages: gcc: spack_spec: gcc@8.5.0 diff --git a/lib/ramble/ramble/test/software_environment.py b/lib/ramble/ramble/test/software_environment.py index bf8b6b816..dc666efbe 100644 --- a/lib/ramble/ramble/test/software_environment.py +++ b/lib/ramble/ramble/test/software_environment.py @@ -7,6 +7,7 @@ # except according to those terms. import pytest +import deprecation import ramble.workspace import ramble.software_environments @@ -427,3 +428,40 @@ def test_compiler_in_environment_warns(request, mutable_mock_workspace_path, cap assert 'Environment basic contains packages and their compilers' in captured.err assert 'Package: basic, Compiler: test_comp' in captured.err + + +@deprecation.fail_if_not_removed +def test_deprecation_warning(request, mutable_mock_workspace_path, capsys): + ws_name = request.node.name + + workspace('create', ws_name) + + assert ws_name in workspace('list') + + with ramble.workspace.read(ws_name) as ws: + spack_dict = ws.get_spack_dict() + + spack_dict['concretized'] = True + + spack_dict['packages'] = {} + spack_dict['packages']['basic'] = { + 'spack_spec': 'basic@1.1' + } + spack_dict['environments'] = { + 'basic': { + 'packages': ['basic'] + } + } + + software_environments = ramble.software_environments.SoftwareEnvironments(ws) + + variables = {} + env_expander = ramble.expander.Expander(variables, None) + + _ = software_environments.render_environment('basic', env_expander) + captured = capsys.readouterr() + + print(captured) + + assert 'The following config sections are deprecated' in captured.err + assert 'spack:concretized' in captured.err diff --git a/lib/ramble/ramble/test/success_criteria/always_print_foms.py b/lib/ramble/ramble/test/success_criteria/always_print_foms.py index 25f0e3094..1f788c60e 100644 --- a/lib/ramble/ramble/test/success_criteria/always_print_foms.py +++ b/lib/ramble/ramble/test/success_criteria/always_print_foms.py @@ -43,7 +43,6 @@ def test_always_print_foms(mutable_config, variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/success_criteria/repeat_success_strict.py b/lib/ramble/ramble/test/success_criteria/repeat_success_strict.py index acd1db423..d22b844ee 100644 --- a/lib/ramble/ramble/test/success_criteria/repeat_success_strict.py +++ b/lib/ramble/ramble/test/success_criteria/repeat_success_strict.py @@ -46,7 +46,6 @@ def test_repeat_success_strict(mutable_config, variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/success_criteria/success_functions.py b/lib/ramble/ramble/test/success_criteria/success_functions.py index e4eeadff6..73297832d 100644 --- a/lib/ramble/ramble/test/success_criteria/success_functions.py +++ b/lib/ramble/ramble/test/success_criteria/success_functions.py @@ -43,7 +43,6 @@ def test_success_function(mutable_config, variables: n_nodes: 1 spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py b/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py index de4b94b28..bc3567a27 100644 --- a/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py +++ b/lib/ramble/ramble/test/workspace_hashing/unsetup_workspace_cannot_analyze.py @@ -48,7 +48,6 @@ def test_unsetup_workspace_cannot_analyze(mutable_config, set: MY_VAR: 'TEST' spack: - concretized: true packages: zlib: spack_spec: zlib diff --git a/lib/ramble/ramble/test/workspace_hashing/workspace_name_does_not_change_hash.py b/lib/ramble/ramble/test/workspace_hashing/workspace_name_does_not_change_hash.py index 8e946384d..2ac294920 100644 --- a/lib/ramble/ramble/test/workspace_hashing/workspace_name_does_not_change_hash.py +++ b/lib/ramble/ramble/test/workspace_hashing/workspace_name_does_not_change_hash.py @@ -46,7 +46,6 @@ def test_workspace_name_does_not_change_hash(mutable_config, set: MY_VAR: 'TEST' spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/test/workspace_hashing/workspace_setup_creates_inventory.py b/lib/ramble/ramble/test/workspace_hashing/workspace_setup_creates_inventory.py index be1fed13c..65deb65c6 100644 --- a/lib/ramble/ramble/test/workspace_hashing/workspace_setup_creates_inventory.py +++ b/lib/ramble/ramble/test/workspace_hashing/workspace_setup_creates_inventory.py @@ -47,7 +47,6 @@ def test_workspace_setup_creates_inventory(mutable_config, set: MY_VAR: 'TEST' spack: - concretized: true packages: {} environments: {} """ diff --git a/lib/ramble/ramble/workspace/workspace.py b/lib/ramble/ramble/workspace/workspace.py index b7ad49547..9eed62b47 100644 --- a/lib/ramble/ramble/workspace/workspace.py +++ b/lib/ramble/ramble/workspace/workspace.py @@ -135,7 +135,6 @@ def default_config_yaml(): processes_per_node: -1 applications: {} spack: - concretized: false packages: {} environments: {} """ @@ -453,6 +452,7 @@ def __init__(self, root, dry_run=False, read_default_template=True): self.dry_run = dry_run self.always_print_foms = False self.repeat_success_strict = True + self.force_concretize = False self.read_default_template = read_default_template self.configs = ramble.config.ConfigScope('workspace', self.config_dir) @@ -859,13 +859,17 @@ def external_spack_env(self, env_name): def concretize(self): spack_dict = self.get_spack_dict() - if 'concretized' in spack_dict and spack_dict['concretized']: - raise RambleWorkspaceError('Cannot conretize an ' + - 'already concretized ' + - 'workspace') + if not self.force_concretize: + try: + if spack_dict[namespace.packages] or spack_dict[namespace.environments]: + raise RambleWorkspaceError('Cannot concretize an already concretized ' + 'workspace. To overwrite the current configuration ' + 'with the default software configuration, use ' + '\'ramble workspace concretize -f\'.') + except KeyError: + pass spack_dict = syaml.syaml_dict() - spack_dict['concretized'] = False if namespace.packages not in spack_dict or \ not spack_dict[namespace.packages]: @@ -947,7 +951,6 @@ def concretize(self): if spec_name not in app_packages: app_packages.append(spec_name) - spack_dict['concretized'] = True ramble.config.config.update_config('spack', spack_dict, scope=self.ws_file_config_scope_name()) @@ -1347,13 +1350,6 @@ def _get_application_dict_config(self, key): return self.application_configs[key]['yaml'] if key \ in self.application_configs else None - def is_concretized(self): - spack_dict = self.get_spack_dict() - if 'concretized' in spack_dict: - return (True if spack_dict['concretized'] - else False) - return False - def _get_workspace_section(self, section): """Return a dict of a workspace section""" workspace_dict = self._get_workspace_dict() diff --git a/share/ramble/ramble-completion.bash b/share/ramble/ramble-completion.bash index 766131874..8ab792610 100755 --- a/share/ramble/ramble-completion.bash +++ b/share/ramble/ramble-completion.bash @@ -671,7 +671,7 @@ _ramble_workspace_create() { } _ramble_workspace_concretize() { - RAMBLE_COMPREPLY="-h --help" + RAMBLE_COMPREPLY="-h --help -f --force-concretize" } _ramble_workspace_setup() { diff --git a/var/ramble/repos/builtin/applications/iperf2/examples/manual_run/ramble.yaml b/var/ramble/repos/builtin/applications/iperf2/examples/manual_run/ramble.yaml index 40170f184..663f63a13 100644 --- a/var/ramble/repos/builtin/applications/iperf2/examples/manual_run/ramble.yaml +++ b/var/ramble/repos/builtin/applications/iperf2/examples/manual_run/ramble.yaml @@ -41,7 +41,6 @@ ramble: variables: additional_flags: "-t 120" spack: - concretized: true compilers: gcc9: spack_spec: gcc@9.3.0