Skip to content

Conversation

@francesco-giordano
Copy link
Contributor

Description of changes

  • Disable aws-ubuntu-eni-helper service during image-build to avoid conflict with the script configure_nw_interface.sh that configure multiple nic on the instance
  • Added kitchen test to verify the disabling

Tests

  • Manually tested on a DLAMI ubuntu OS
  • Automated tests the next build cycle

Please review the guidelines for contributing and Pull Request Instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@demartinofra demartinofra left a comment

Choose a reason for hiding this comment

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

Can you please add a changelog entry?

end

# Disable DLAMI multi eni helper
# no further only_if because if the service is not present the action disable do not return error
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: does not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

mode "0644"
end

# Disable DLAMI multi eni helper
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we generalize the disable_log4j_patcher recipe to something like disable_services and add this there so that we don't overload the base recipe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

CHANGELOG.md Outdated
- selinux-6.0.4 (from selinux-3.1.1)
- yum-7.4.0 (from yum-6.1.1)
- yum-epel-4.5.0 (from yum-epel-4.1.2)
- Disable `aws-ubuntu-eni-helper` service in DLAMI to avoid conflicts with `configure_nw_interface.sh`
Copy link
Contributor

Choose a reason for hiding this comment

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

append something like: when configuring instances with multiple network cards.

Also please add an entry for the MTU related change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 584 to 605

#
# Disable service
#
def disable_service(service, platform_families = %i(rhel amazon debian), operations = :disable)
if platform_family?(platform_families)
service service do
action operations
end
end
end

#
# Check if a service is disabled
#
def service_is_disabled(service, platform_families = %i(rhel amazon debian))
if platform_family?(platform_families)
execute "check #{service} service is disabled" do
command "systemctl is-enabled #{service} && exit 1 || exit 0"
end
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move disable_service in an helpers file for the install cookbook and service_is_disabled in an helpers file for the test cookbook?

Copy link
Contributor

Choose a reason for hiding this comment

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

minor: I'd rename to is_service_disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

# new one is installed in /opt/amazon/efa/bin/
# Disable DLAMI multi eni helper
# no only_if statement because if the service is not present the action disable does not return error
disable_service('aws-ubuntu-eni-helper', 'debian')
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to mask the service so that if not present at AMI build but installed at a later stage it will stay disabled? also we could do the same for alinux2 in case the service gets added there too

CHANGELOG.md Outdated
- selinux-6.0.4 (from selinux-3.1.1)
- yum-7.4.0 (from yum-6.1.1)
- yum-epel-4.5.0 (from yum-epel-4.1.2)
- Disable `aws-ubuntu-eni-helper` service in DLAMI to avoid conflicts with `configure_nw_interface.sh`
Copy link
Contributor

Choose a reason for hiding this comment

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

  • I'd write: Disable aws-ubuntu-eni-helper service, available in Deep Learning AMIs, to avoid conflicts with configure_nw_interface.sh.
  • minor: missing final period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

ethernets:
${DEVICE_NAME}:
$STATIC_IP_CONFIG
mtu: '9001'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd extend the commit message adding more information about this change. What we were missing and why we're introducing it (with a link to MTU best practices).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

…_nw_interface.sh

Refactor of log4j-cve-2021-44228-hotpatch service disabling
@enrico-usai enrico-usai merged commit f812368 into aws:develop Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants