Skip to content

Commit

Permalink
ci(k8s-eks): add ARM CI jobs configurations
Browse files Browse the repository at this point in the history
Add following CI jobs configurations:
- Longevity K8S EKS 3h, full ARM
- Functional K8S EKS tests, full ARM

Also, update the EKS module by adding detection of the ARM instance
types and selecting proper image for VM.
  • Loading branch information
vponomaryov authored and fruch committed Dec 18, 2023
1 parent 1df9dcf commit a02daf3
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
5 changes: 5 additions & 0 deletions configurations/arm/eks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
k8s_instance_type_auxiliary: 't4g.large'
k8s_instance_type_monitor: 't4g.large'
instance_type_loader: 'c6gn.xlarge'
instance_type_db: 'im4gn.4xlarge'
k8s_scylla_disk_gi: 6900
6 changes: 6 additions & 0 deletions configurations/operator/functional-eks-arm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
user_prefix: 'functional-arm'
k8s_instance_type_auxiliary: 't4g.large'
k8s_instance_type_monitor: 't4g.large'
instance_type_loader: 'c6gn.xlarge'
instance_type_db: 'im4gn.xlarge'
k8s_scylla_disk_gi: 1600
11 changes: 11 additions & 0 deletions functional_tests/scylla_operator/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
SCYLLA_OPERATOR_NAMESPACE
)
from sdcm.mgmt import TaskStatus
from sdcm.utils.aws_utils import get_arch_from_instance_type
from sdcm.utils.common import ParallelObject
from sdcm.utils.k8s import (
convert_cpu_units_to_k8s_value,
Expand Down Expand Up @@ -754,6 +755,16 @@ def test_deploy_helm_with_default_values(db_cluster: ScyllaPodCluster):
Deploy Scylla using helm chart with only default values.
Storage capacity expected to be 10Gi
"""
# TODO: remove this skip when https://github.com/scylladb/scylla-operator/pull/1603 gets merged
if "eks" in db_cluster.params.get("cluster_backend"):
for k8s_cluster in db_cluster.k8s_clusters:
instance_type_db = k8s_cluster.params.get("instance_type_db")
region_name = k8s_cluster.region_name
if get_arch_from_instance_type(instance_type=instance_type_db, region_name=region_name) == "arm64":
pytest.skip(
"Scylla-manager default version must be 3.2.5 or greater."
" See https://github.com/scylladb/scylla-operator/pull/1603")

target_chart_name, namespace = ("t-default-values",) * 2
expected_capacity = '10Gi'
need_to_collect_logs, k8s_cluster = True, db_cluster.k8s_cluster
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!groovy

def lib = library identifier: 'sct@snapshot', retriever: legacySCM(scm)

longevityPipeline(
backend: 'k8s-eks',
region: 'eu-west-2',
availability_zone: 'c',
test_name: 'longevity_test.LongevityTest.test_custom_time',
test_config: '''["test-cases/scylla-operator/longevity-scylla-operator-3h.yaml", "configurations/arm/eks.yaml"]''',
email_recipients: '[email protected],[email protected]',
post_behavior_db_nodes: 'destroy',
post_behavior_loader_nodes: 'destroy',
post_behavior_monitor_nodes: 'destroy',
post_behavior_k8s_cluster: 'destroy',
k8s_log_api_calls: false,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!groovy

def lib = library identifier: 'sct@snapshot', retriever: legacySCM(scm)

longevityPipeline(
backend: 'k8s-eks',
region: 'eu-west-2',
availability_zone: 'c',
functional_test: true,
test_name: 'functional_tests/scylla_operator',
test_config: '''["test-cases/scylla-operator/functional.yaml", "configurations/operator/functional-eks-arm.yaml"]''',
email_recipients: '[email protected],[email protected]',
post_behavior_db_nodes: 'destroy',
post_behavior_loader_nodes: 'destroy',
post_behavior_monitor_nodes: 'destroy',
post_behavior_k8s_cluster: 'destroy',
k8s_log_api_calls: false,
)
9 changes: 8 additions & 1 deletion sdcm/cluster_k8s/eks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
)
from sdcm.remote import LOCALRUNNER
from sdcm.utils.aws_utils import (
get_arch_from_instance_type,
get_ec2_network_configuration,
tags_as_ec2_tags,
EksClusterCleanupMixin,
Expand All @@ -55,6 +56,8 @@

EC2_INSTANCE_UPDATE_LOCK = Lock()

ARCH_TO_IMAGE_TYPE_MAPPING = {'arm64': 'AL2_ARM_64', 'x86_64': 'AL2_x86_64'}


def init_k8s_eks_cluster(region_name: str, availability_zone: str, params: dict,
credentials: List[cluster.UserRemoteCredentials],
Expand Down Expand Up @@ -171,12 +174,16 @@ def __init__(
ssh_key_pair_name: str = None,
provision_type: Literal['ON_DEMAND', 'SPOT'] = 'ON_DEMAND',
launch_template: str = None,
image_type: Literal['AL2_x86_64', 'AL2_x86_64_GPU', 'AL2_ARM_64'] = 'AL2_x86_64',
image_type: Literal['AL2_x86_64', 'AL2_x86_64_GPU', 'AL2_ARM_64'] = None,
disk_type: Literal["standard", "io1", "io2", "gp2", "sc1", "st1"] = None,
k8s_version: str = None,
is_deployed: bool = False,
user_data: str = None,
):
if not image_type:
current_arch = get_arch_from_instance_type(
instance_type=instance_type, region_name=k8s_cluster.region_name)
image_type = ARCH_TO_IMAGE_TYPE_MAPPING.get(current_arch, "AL2_x86_64")
super().__init__(
k8s_cluster=k8s_cluster,
name=name,
Expand Down

0 comments on commit a02daf3

Please sign in to comment.