# frozen_string_literal: true # # Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "LICENSE.txt" file accompanying this file. # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. # See the License for the specific language governing permissions and limitations under the License. def dcv_sha256sum if arm_instance? '162396cad72bd357bd7aba8c01eeb60d4efec955cfec0bf456fbbd7c3801b79a' else '50eb5e645f549e8a51ff64ede2d85e0a8051c7d929295fe3319dc23ba73d5c1d' end end def dcv_package "nice-dcv-#{node['cluster']['dcv']['version']}-el7-#{dcv_url_arch}" end def dcv_server "nice-dcv-server-#{node['cluster']['dcv']['server']['version']}.el7.#{dcv_url_arch}.rpm" end def xdcv "nice-xdcv-#{node['cluster']['dcv']['xdcv']['version']}.el7.#{dcv_url_arch}.rpm" end def dcv_web_viewer "nice-dcv-web-viewer-#{node['cluster']['dcv']['web_viewer']['version']}.el7.#{dcv_url_arch}.rpm" end def dcv_gl "nice-dcv-gl-#{node['cluster']['dcv']['gl']['version']}.el7.#{dcv_url_arch}.rpm" end action_class do def pre_install # Install the desktop environment and the desktop manager packages execute 'Install gnome desktop' do command 'yum -y install @gnome' retries 3 retry_delay 5 end # Install X Window System (required when using GPU acceleration) package "xorg-x11-server-Xorg" do retries 3 retry_delay 5 end # libvirtd service creates virtual bridge interfaces. # It's provided by libvirt-daemon, installed as requirement for gnome-boxes, included in @gnome. # Open MPI does not ignore other local-only devices other than loopback: # if virtual bridge interface is up, Open MPI assumes that that network is usable for MPI communications. # This is incorrect and it led to MPI applications hanging when they tried to send or receive MPI messages # see https://www.open-mpi.org/faq/?category=tcp#tcp-selection for details service 'libvirtd' do action %i(disable stop) end end def post_install # stop firewall service "firewalld" do action %i(disable stop) end include_recipe 'aws-parallelcluster-platform::disable_selinux' end def install_dcv_gl package = "#{node['cluster']['sources_dir']}/#{dcv_package}/#{dcv_gl}" package package do action :install source package end end end