Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions reframe/core/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,6 @@ class ContainerPlatform(abc.ABC):
#: :default: :class:`None`
command = fields.TypedField(str, type(None))

_commands = fields.TypedField(typ.List[str])
#: The commands to be executed within the container.
#:
#: .. deprecated:: 3.5.0
#: Please use the `command` field instead.
#:
#: :type: :class:`list[str]`
#: :default: ``[]``
commands = fields.DeprecatedField(
_commands,
'The `commands` field is deprecated, please use the `command` field '
'to set the command to be executed by the container.',
fields.DeprecatedField.OP_SET, from_version='3.5.0'
)

#: Pull the container image before running.
#:
#: This does not have any effect for the `Singularity` container platform.
Expand Down Expand Up @@ -80,34 +65,10 @@ class ContainerPlatform(abc.ABC):
#: :default: ``[]``
options = fields.TypedField(typ.List[str])

_workdir = fields.TypedField(str, type(None))
#: The working directory of ReFrame inside the container.
#:
#: This is the directory where the test's stage directory is mounted inside
#: the container. This directory is always mounted regardless if
#: :attr:`mount_points` is set or not.
#:
#: .. deprecated:: 3.5
#: Please use the `options` field to set the working directory.
#:
#: :type: :class:`str`
#: :default: ``/rfm_workdir``
workdir = fields.DeprecatedField(
_workdir,
'The `workdir` field is deprecated, please use the `options` field to '
'set the container working directory',
fields.DeprecatedField.OP_SET, from_version='3.5.0'
)

def __init__(self):
self.image = None
self.command = None

# NOTE: Here we set the target fields directly to avoid the deprecation
# warnings
self._commands = []
self._workdir = _STAGEDIR_MOUNT

self.mount_points = []
self.options = []
self.pull_image = True
Expand Down Expand Up @@ -171,10 +132,6 @@ def launch_command(self, stagedir):
return (f'docker run --rm {" ".join(run_opts)} '
f'{self.image} {self.command}')

if self.commands:
return (f"docker run --rm {' '.join(run_opts)} {self.image} "
f"bash -c 'cd {self.workdir}; {'; '.join(self.commands)}'")

return f'docker run --rm {" ".join(run_opts)} {self.image}'


Expand Down Expand Up @@ -216,10 +173,6 @@ def launch_command(self, stagedir):
return (f'{self._command} run {" ".join(run_opts)} {self.image} '
f'{self.command}')

if self.commands:
return (f"{self._command} run {' '.join(run_opts)} {self.image} "
f"bash -c 'cd {self.workdir}; {'; '.join(self.commands)}'")

return f'{self._command} run {" ".join(run_opts)} {self.image}'


Expand Down Expand Up @@ -262,10 +215,6 @@ def launch_command(self, stagedir):
return (f'singularity exec {" ".join(run_opts)} '
f'{self.image} {self.command}')

if self.commands:
return (f"singularity exec {' '.join(run_opts)} {self.image} "
f"bash -c 'cd {self.workdir}; {'; '.join(self.commands)}'")

return f'singularity run {" ".join(run_opts)} {self.image}'


Expand Down
21 changes: 0 additions & 21 deletions reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,17 +1434,6 @@ def run_complete(self):

return self._job.finished()

@final
def poll(self):
'''See :func:`run_complete`.

.. deprecated:: 3.2

'''
user_deprecation_warning('calling poll() is deprecated; '
'please use run_complete() instead')
return self.run_complete()

@final
def run_wait(self):
'''Wait for the run phase of this test to finish.
Expand All @@ -1465,16 +1454,6 @@ def run_wait(self):
'''
self._job.wait()

@final
def wait(self):
'''See :func:`run_wait`.

.. deprecated:: 3.2
'''
user_deprecation_warning('calling wait() is deprecated; '
'please use run_wait() instead')
self.run_wait()

@final
def sanity(self):
self.check_sanity()
Expand Down
14 changes: 0 additions & 14 deletions reframe/core/systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,20 +346,6 @@ def launcher_type(self):
'''
return self._launcher_type

@property
def launcher(self):
'''See :attr:`launcher_type`.

.. deprecated:: 3.2
Please use :attr:`launcher_type` instead.
'''

from reframe.core.warnings import user_deprecation_warning

user_deprecation_warning("the 'launcher' attribute is deprecated; "
"please use 'launcher_type' instead")
return self.launcher_type

def get_resource(self, name, **values):
'''Instantiate managed resource ``name`` with ``value``.

Expand Down
21 changes: 0 additions & 21 deletions unittests/test_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest

import reframe.core.containers as containers
import reframe.core.warnings as warn
from reframe.core.exceptions import ContainerError


Expand Down Expand Up @@ -271,23 +270,3 @@ def expected_run_with_workdir(container_variant_noopt):
elif container_variant_noopt == 'Singularity':
return ("singularity exec -B\"/foo:/rfm_workdir\" --foo image:tag "
"bash -c 'cd foodir; cmd1; cmd2'")


def test_run_with_commands(container_platform_noopt,
expected_run_with_commands):
with pytest.warns(warn.ReframeDeprecationWarning):
container_platform_noopt.commands = ['cmd1', 'cmd2']

found_commands = container_platform_noopt.launch_command('/foo')
assert found_commands == expected_run_with_commands


def test_run_with_workdir(container_platform_noopt, expected_run_with_workdir):
with pytest.warns(warn.ReframeDeprecationWarning):
container_platform_noopt.commands = ['cmd1', 'cmd2']

with pytest.warns(warn.ReframeDeprecationWarning):
container_platform_noopt.workdir = 'foodir'

found_commands = container_platform_noopt.launch_command('/foo')
assert found_commands == expected_run_with_workdir