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
19 changes: 10 additions & 9 deletions release_tester/arangodb/installers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ def __repr__(self):

def check_installed(self, version, enterprise, check_stripped, check_symlink):
""" check all attributes of this file in reality """
#TODO consider only certain versions
#use semver package

self.check_path(enterprise)
if semver.compare(self.version_min, version) == 1:
self.check_path(enterprise, False)
return
else:
self.check_path(enterprise)

if not enterprise and self.enterprise:
#checks do not need to continue in this case
Expand All @@ -91,10 +92,10 @@ def check_installed(self, version, enterprise, check_stripped, check_symlink):
self.check_symlink()


def check_path(self, enterprise):
def check_path(self, enterprise, in_version = True):
""" check whether the file rightfully exists or not """
if enterprise and self.enterprise:
if not self.path.is_file():
if not self.path.is_file() and in_version:
raise Exception("Binary missing from enterprise package!" + str(self.path))

#file must not exist
Expand Down Expand Up @@ -224,7 +225,7 @@ def get_arangod_conf(self):

def supports_hot_backup(self):
""" by default hot backup is supported by the targets, there may be execptions."""
return True
return semver.compare(self.cfg.version, "3.5.1") >=0

def calc_config_file_name(self):
""" store our config to disk - so we can be invoked partly """
Expand Down Expand Up @@ -354,7 +355,7 @@ def caclulate_file_locations(self):
# enterprise
self.arango_binaries.append(BinaryDescription(
self.cfg.real_bin_dir, 'arangobackup',
True, True, "1.0.0", "4.0.0", [], 'c++'))
True, True, "3.5.1", "4.0.0", [], 'c++'))

self.arango_binaries.append(BinaryDescription(
self.cfg.real_sbin_dir, 'arangosync',
Expand All @@ -364,7 +365,7 @@ def caclulate_file_locations(self):

self.arango_binaries.append(BinaryDescription(
self.cfg.real_sbin_dir, 'rclone-arangodb',
True, True, "1.0.0", "4.0.0", [], 'go'))
True, True, "3.5.1", "4.0.0", [], 'go'))

def check_installed_files(self):
""" check for the files whether they're installed """
Expand Down
2 changes: 1 addition & 1 deletion release_tester/arangodb/installers/tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def install_package(self):
logging.debug("package dir: {0.cfg.package_dir}- server_package: {0.server_package}".format(self))

cmd = [self.tar,
'-xzf',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this works. we deliver zip-compressed tar.
Yes, this will only work with gnutar - if the system doesn't have this, self.tar needs to be set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually works.

'-xf',
str(self.cfg.package_dir / self.server_package),
'-C',
'/tmp/']
Expand Down
3 changes: 2 additions & 1 deletion release_tester/arangodb/starter/deployments/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import requests
import time
import platform
import semver

from arangodb.installers.base import InstallerBase
from arangodb.installers import InstallerConfig
Expand Down Expand Up @@ -402,7 +403,7 @@ def check_data_impl(self):
raise Exception("no frontend found.")

def supports_backup_impl(self):
return True
return semver.compare(self.cfg.version, "3.5.1") >= 0

def create_non_backup_data(self):
for starter in self.makedata_instances:
Expand Down
5 changes: 3 additions & 2 deletions release_tester/arangodb/starter/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# from typing import List, Dict, NamedTuple

import psutil
import semver

import http.client as http_client
from tools.asciiprint import ascii_print, print_progress as progress
Expand Down Expand Up @@ -57,7 +58,7 @@ def __init__(self,
self.moreopts += ["--starter.port", "%d" % self.starter_port]

self.hotbackup = []
if self.cfg.enterprise:
if self.cfg.enterprise and semver.compare(self.cfg.version, "3.5.1") >=0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should rather be done at a central place:

release_tester/arangodb/starter/deployments/runner.py:        self.hot_backup = cfg.enterprise and self.supports_backup_impl() and self.old_installer.supports_hot_backup()

on the cfg object, and then used here.

self.hotbackup = ['--all.rclone.executable', self.cfg.real_sbin_dir / 'rclone-arangodb']

# arg - jwtstr
Expand Down Expand Up @@ -328,7 +329,7 @@ def replace_binary_for_upgrade(self, new_install_cfg):
"""
# On windows the install prefix may change, since we can't overwrite open files:
self.cfg.set_directories(new_install_cfg)
if self.cfg.enterprise:
if self.cfg.enterprise and semver.compare(self.cfg.version, "3.5.1") >= 0:
self.hotbackup = ['--all.rclone.executable', self.cfg.sbin_dir / 'rclone-arangodb']
logging.info("StarterManager: Killing my instance [%s]", str(self.instance.pid))
self.kill_instance()
Expand Down