Skip to content

Commit

Permalink
fix(manager_versions.yaml): remove duplicate, leave only base distros
Browse files Browse the repository at this point in the history
we keep updating this file, on every adding of a new distro release
it's not really needed, we have only two types of supported RPMs (rhel)
and DEBs (debian), and that's enough for picking the repo/list
we don't need to map each distro release, since we have it mapped
already.

at a point there were diffrent DEB repositories for scylla/manager
it was unified years back.
  • Loading branch information
fruch committed Aug 1, 2024
1 parent fb368a4 commit 3eefb3c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 74 deletions.
59 changes: 14 additions & 45 deletions defaults/manager_versions.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,24 @@
manager_repos_by_version:
"master_latest":
centos7: 'https://downloads.scylladb.com/manager/rpm/unstable/centos/master/latest/scylla-manager.repo'
centos8: 'https://downloads.scylladb.com/manager/rpm/unstable/centos/master/latest/scylla-manager.repo'
debian10: 'https://downloads.scylladb.com/manager/deb/unstable/unified-deb/master/latest/scylla-manager.list'
debian11: 'https://downloads.scylladb.com/manager/deb/unstable/unified-deb/master/latest/scylla-manager.list'
ubuntu20: 'https://downloads.scylladb.com/manager/deb/unstable/unified-deb/master/latest/scylla-manager.list'
ubuntu22: 'https://downloads.scylladb.com/manager/deb/unstable/unified-deb/master/latest/scylla-manager.list'
ubuntu24: 'https://downloads.scylladb.com/manager/deb/unstable/unified-deb/master/latest/scylla-manager.list'
rhel: 'https://downloads.scylladb.com/manager/rpm/unstable/centos/master/latest/scylla-manager.repo'
debian: 'https://downloads.scylladb.com/manager/deb/unstable/unified-deb/master/latest/scylla-manager.list'
"3.3":
centos7: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.3.repo'
centos8: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.3.repo'
debian10: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.3.list'
debian11: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.3.list'
ubuntu20: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.3.list'
ubuntu22: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.3.list'
ubuntu24: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.3.list'
rhel: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.3.repo'
debian: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.3.list'
"3.2":
centos7: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.2.repo'
centos8: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.2.repo'
debian10: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.2.list'
debian11: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.2.list'
ubuntu20: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.2.list'
ubuntu22: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.2.list'
ubuntu24: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.2.list'
rhel: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.2.repo'
debian: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.2.list'
"3.1":
centos7: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.1.repo'
centos8: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.1.repo'
debian10: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.1.list'
debian11: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.1.list'
ubuntu20: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.1.list'
ubuntu22: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.1.list'
ubuntu24: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.1.list'
rhel: 'http://downloads.scylladb.com.s3.amazonaws.com/rpm/centos/scylladb-manager-3.1.repo'
debian: 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.1.list'

scylla_backend_repo_by_version:
"2022":
centos7: 'https://downloads.scylladb.com/rpm/centos/scylla-2022.1.repo'
centos8: 'https://downloads.scylladb.com/rpm/centos/scylla-2022.1.repo'
debian10: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2022.1.list'
debian11: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2022.1.list'
ubuntu20: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2022.1.list'
ubuntu22: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2022.1.list'
rhel: 'https://downloads.scylladb.com/rpm/centos/scylla-2022.1.repo'
debian: 'https://downloads.scylladb.com/deb/debian/scylla-2022.1.list'
"2023":
centos7: 'https://downloads.scylladb.com/rpm/centos/scylla-2023.1.repo'
centos8: 'https://downloads.scylladb.com/rpm/centos/scylla-2023.1.repo'
debian10: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2023.1.list'
debian11: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2023.1.list'
ubuntu20: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2023.1.list'
rhel: 'https://downloads.scylladb.com/rpm/centos/scylla-2023.1.repo'
debian: 'https://downloads.scylladb.com/deb/debian/scylla-2023.1.list'
"2024":
centos7: 'https://downloads.scylladb.com/rpm/centos/scylla-2024.1.repo'
centos8: 'https://downloads.scylladb.com/rpm/centos/scylla-2024.1.repo'
debian10: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2024.1.list'
debian11: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2024.1.list'
ubuntu20: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2024.1.list'
ubuntu22: 'https://downloads.scylladb.com/deb/ubuntu/scylla-2024.1.list'
rhel: 'https://downloads.scylladb.com/rpm/centos/scylla-2024.1.repo'
debian: 'https://downloads.scylladb.com/deb/debian/scylla-2024.1.list'
38 changes: 11 additions & 27 deletions sdcm/mgmt/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import datetime
import yaml
from typing import Optional
from pathlib import Path

from pydantic import BaseModel, Extra

from sdcm.utils.distro import Distro
from sdcm.utils.common import get_sct_root_path


DEFAULT_TASK_TIMEOUT = 7200 # 2 hours
Expand All @@ -19,31 +21,13 @@ def get_persistent_snapshots(): # Snapshot sizes (dict keys) are in GB
return persistent_manager_snapshots_dict


def get_distro_name(distro_object):
known_distro_dict = {
Distro.AMAZON2: "centos8",
Distro.AMAZON2023: "centos8",
Distro.CENTOS7: "centos7",
Distro.CENTOS8: "centos8",
Distro.CENTOS9: "centos8",
Distro.DEBIAN10: "debian10",
Distro.DEBIAN11: "debian11",
Distro.UBUNTU20: "ubuntu20",
Distro.UBUNTU22: "ubuntu22",
Distro.UBUNTU24: "ubuntu24",
Distro.OEL7: "centos7",
Distro.OEL8: "centos8",
Distro.ROCKY8: "centos8",
Distro.ROCKY9: "centos8",
Distro.FEDORA34: "centos8",
Distro.FEDORA35: "centos8",
Distro.FEDORA36: "centos8",
Distro.MINT20: "mint20",
Distro.MINT21: "mint21",
}
distro_name = known_distro_dict.get(distro_object, None)
assert distro_name, f"Unfamiliar distribution: {distro_object}"
return distro_name
def get_distro_name(distro_object: Distro) -> str:
if distro_object.is_debian_like:
return "debian"
if distro_object.is_rhel_like:
return "rhel"

raise ValueError(f"Unsupported distribution for installing manager: {distro_object}")


def duration_to_timedelta(duration_string):
Expand All @@ -69,7 +53,7 @@ def create_cron_list_from_timedelta(minutes=0, hours=0):


def get_manager_repo_from_defaults(manager_version_name, distro):
with open("defaults/manager_versions.yaml", encoding="utf-8") as mgmt_config:
with (Path(get_sct_root_path()) / "defaults/manager_versions.yaml").open(encoding="utf-8") as mgmt_config:
manager_repos_by_version_dict = yaml.safe_load(mgmt_config)["manager_repos_by_version"]

version_specific_repos = manager_repos_by_version_dict.get(manager_version_name, None)
Expand All @@ -84,7 +68,7 @@ def get_manager_repo_from_defaults(manager_version_name, distro):


def get_manager_scylla_backend(scylla_backend_version_name, distro):
with open("defaults/manager_versions.yaml", encoding="utf-8") as mgmt_config:
with (Path(get_sct_root_path()) / "defaults/manager_versions.yaml").open(encoding="utf-8") as mgmt_config:
scylla_backend_repos_by_version_dict = yaml.safe_load(mgmt_config)["scylla_backend_repo_by_version"]

version_specific_repos = scylla_backend_repos_by_version_dict.get(scylla_backend_version_name, None)
Expand Down
4 changes: 2 additions & 2 deletions unit_tests/test_sdcm_mgmt_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class TestManagerVersions:
def test_get_manager_scylla_backend_returns_repo_address(self): # pylint: disable=no-self-use
url = get_manager_scylla_backend("2024", Distro.UBUNTU22)

assert url == 'https://downloads.scylladb.com/deb/ubuntu/scylla-2024.1.list'
assert url == 'https://downloads.scylladb.com/deb/debian/scylla-2024.1.list'

def test_get_manager_repo_from_defaults_returns_repo_address(self): # pylint: disable=no-self-use
url = get_manager_repo_from_defaults("3.2", Distro.UBUNTU22)

assert url == 'http://downloads.scylladb.com.s3.amazonaws.com/deb/ubuntu/scylladb-manager-3.2.list'
assert url == 'http://downloads.scylladb.com.s3.amazonaws.com/deb/debian/scylladb-manager-3.2.list'

0 comments on commit 3eefb3c

Please sign in to comment.