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

enable rhel/centos agent-cgroups #2922

Merged
merged 2 commits into from
Oct 3, 2023
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
3 changes: 2 additions & 1 deletion azurelinuxagent/ga/cgroupapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def cgroups_supported():
distro_version = FlexibleVersion(distro_info[1])
except ValueError:
return False
return distro_name.lower() == 'ubuntu' and distro_version.major >= 16
return (distro_name.lower() == 'ubuntu' and distro_version.major >= 16) or \
(distro_name.lower() in ('centos', 'redhat') and 8 <= distro_version.major < 9)

@staticmethod
def track_cgroups(extension_cgroups):
Expand Down
14 changes: 8 additions & 6 deletions tests/ga/test_cgroupapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,19 @@ def test_cgroups_should_be_supported_only_on_ubuntu16_centos7dot4_redhat7dot4_an
(['ubuntu', '18.10', 'cosmic'], True),
(['ubuntu', '20.04', 'focal'], True),
(['ubuntu', '20.10', 'groovy'], True),
(['centos', '7.8', 'Source'], False),
(['redhat', '7.8', 'Maipo'], False),
(['redhat', '7.9.1908', 'Core'], False),
(['centos', '8.1', 'Source'], False),
(['redhat', '8.2', 'Maipo'], False),
(['redhat', '8.2.2111', 'Core'], False),
(['centos', '7.4', 'Source'], False),
(['redhat', '7.4', 'Maipo'], False),
(['centos', '7.5', 'Source'], False),
(['centos', '7.3', 'Maipo'], False),
(['redhat', '7.2', 'Maipo'], False),
(['centos', '7.8', 'Source'], False),
(['redhat', '7.8', 'Maipo'], False),
(['redhat', '7.9.1908', 'Core'], False),
(['centos', '8.1', 'Source'], True),
(['redhat', '8.2', 'Maipo'], True),
(['redhat', '8.2.2111', 'Core'], True),
(['redhat', '9.1', 'Core'], False),
(['centos', '9.1', 'Source'], False),
(['bigip', '15.0.1', 'Final'], False),
(['gaia', '273.562', 'R80.30'], False),
(['debian', '9.1', ''], False),
Expand Down
4 changes: 4 additions & 0 deletions tests_e2e/test_suites/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ image-sets:
#
- "alma_9"
- "centos_79"
- "centos_82"
- "debian_9"
- "debian_10"
- "debian_11"
Expand Down Expand Up @@ -39,6 +40,8 @@ image-sets:

# As of today agent only support and enabled resource governance feature on following distros
cgroups-endorsed:
- "centos_82"
- "rhel_82"
- "ubuntu_1604"
- "ubuntu_1804"
- "ubuntu_2004"
Expand Down Expand Up @@ -78,6 +81,7 @@ images:
AzureChinaCloud: []
centos_610: "OpenLogic CentOS 6.10 latest"
centos_79: "OpenLogic CentOS 7_9 latest"
centos_82: "OpenLogic CentOS 8_2 latest"
debian_8: "credativ Debian 8 latest"
debian_9: "credativ Debian 9 latest"
debian_10: "Debian debian-10 10 latest"
Expand Down
3 changes: 3 additions & 0 deletions tests_e2e/tests/agent_cgroups/agent_cgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def __init__(self, context: AgentTestContext):
self._ssh_client = self._context.create_ssh_client()

def run(self):
log.info("=====Prepare agent=====")
log.info("Restarting agent service to make sure service starts with new configuration that was setup by the cgroupconfigurator")
self._ssh_client.run_command("agent-service restart", use_sudo=True)
log.info("=====Validating agent cgroups=====")
self._run_remote_test("agent_cgroups-check_cgroups_agent.py")
log.info("Successfully Verified that agent present in correct cgroups")
Expand Down
Loading