Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to skip checks during cluster upgrade #1890

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Next
* Drop support for Python 3.5 and DC/OS 1.9 - 1.11.
These versions may continue to work, but will no longer be tested.
* Drop support for CoreOS on AWS
* Add skip_checks flag for upgrade

2020.08.14.0
------------
Expand Down
6 changes: 6 additions & 0 deletions src/dcos_e2e/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def upgrade_dcos_from_url(
ip_detect_path: Path,
output: Output = Output.CAPTURE,
files_to_copy_to_genconf_dir: Iterable[Tuple[Path, Path]] = (),
skip_checks: bool = False,
) -> None:
"""
Upgrade DC/OS.
Expand All @@ -253,6 +254,7 @@ def upgrade_dcos_from_url(
the installer node. These are files to copy from the host to
the installer node before installing DC/OS.
output: What happens with stdout and stderr.
skip_checks: Set the skip_checks flag to the upgrade script.
"""
for nodes, role in (
(self.masters, Role.MASTER),
Expand All @@ -269,6 +271,7 @@ def upgrade_dcos_from_url(
files_to_copy_to_genconf_dir
),
output=output,
skip_checks=skip_checks,
)

def upgrade_dcos_from_path(
Expand All @@ -278,6 +281,7 @@ def upgrade_dcos_from_path(
ip_detect_path: Path,
output: Output = Output.CAPTURE,
files_to_copy_to_genconf_dir: Iterable[Tuple[Path, Path]] = (),
skip_checks: bool = False,
) -> None:
"""
Upgrade DC/OS.
Expand All @@ -292,6 +296,7 @@ def upgrade_dcos_from_path(
the installer node. These are files to copy from the host to
the installer node before installing DC/OS.
output: What happens with stdout and stderr.
skip_checks: Set the skip_checks flag to the upgrade script.
"""
for nodes, role in (
(self.masters, Role.MASTER),
Expand All @@ -308,6 +313,7 @@ def upgrade_dcos_from_path(
files_to_copy_to_genconf_dir
),
output=output,
skip_checks=skip_checks,
)

def __enter__(self) -> 'Cluster':
Expand Down
12 changes: 12 additions & 0 deletions src/dcos_e2e/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ def upgrade_dcos_from_url(
user: Optional[str] = None,
output: Output = Output.CAPTURE,
transport: Optional[Transport] = None,
skip_checks: bool = False,
) -> None:
"""
Upgrade DC/OS on this node.
Expand All @@ -348,6 +349,7 @@ def upgrade_dcos_from_url(
files_to_copy_to_genconf_dir: Pairs of host paths to paths on
the installer node. These are files to copy from the host to
the installer node before installing DC/OS.
skip_checks: Set the skip_checks flag to the upgrade script.
"""
node_dcos_installer = _node_installer_path(
node=self,
Expand All @@ -373,6 +375,7 @@ def upgrade_dcos_from_url(
output=output,
transport=transport,
files_to_copy_to_genconf_dir=files_to_copy_to_genconf_dir,
skip_checks=skip_checks,
)

def upgrade_dcos_from_path(
Expand All @@ -385,6 +388,7 @@ def upgrade_dcos_from_path(
user: Optional[str] = None,
output: Output = Output.CAPTURE,
transport: Optional[Transport] = None,
skip_checks: bool = False,
) -> None:
"""
Upgrade DC/OS on this node.
Expand All @@ -406,6 +410,7 @@ def upgrade_dcos_from_path(
files_to_copy_to_genconf_dir: Pairs of host paths to paths on
the installer node. These are files to copy from the host to
the installer node before installing DC/OS.
skip_checks: Set the skip_checks flag to the upgrade script.
"""
node_dcos_installer = _node_installer_path(
node=self,
Expand All @@ -430,6 +435,7 @@ def upgrade_dcos_from_path(
output=output,
transport=transport,
files_to_copy_to_genconf_dir=files_to_copy_to_genconf_dir,
skip_checks=skip_checks,
)

def run(
Expand Down Expand Up @@ -1043,6 +1049,7 @@ def _upgrade_dcos_from_node_path(
user: Optional[str],
output: Output,
transport: Optional[Transport],
skip_checks: bool = False,
) -> None:
"""
Upgrade DC/OS on this node.
Expand All @@ -1065,6 +1072,7 @@ def _upgrade_dcos_from_node_path(
files_to_copy_to_genconf_dir: Pairs of host paths to paths on
the installer node. These are files to copy from the host to
the installer node before installing DC/OS.
skip_checks: Set the skip_checks flag to the upgrade script.

Raises:
subprocess.CalledProcessError: One of the upgrade process steps
Expand Down Expand Up @@ -1169,8 +1177,12 @@ def _upgrade_dcos_from_node_path(
'&&',
'bash',
str(upgrade_script_path),
'--verbose',
]

if skip_checks:
setup_args.append('--skip-checks')

node.run(
args=setup_args,
shell=True,
Expand Down