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

Update test-kitchen requirement from ~> 3.0.0 to ~> 3.5.0 #41

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ group :test do
gem 'chefspec', '~> 9.3.0'
gem 'kitchen-vagrant', '~> 1.12.0'
gem 'safe_yaml', '~> 1.0.5'
gem 'test-kitchen', '~> 3.0.0'
gem 'test-kitchen', '~> 3.5.0'
end

group :aws do
Expand Down
8 changes: 8 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@
default['cluster']['efa']['installer_url'] = "https://efa-installer.amazonaws.com/aws-efa-installer-#{node['cluster']['efa']['installer_version']}.tar.gz"
default['cluster']['efa']['unsupported_aarch64_oses'] = %w(centos7)

# EFS Utils and its dependency stunnel
default['cluster']['efs_utils']['version'] = '1.33.3'
default['cluster']['efs_utils']['url'] = "https://github.com/aws/efs-utils/archive/v#{node['cluster']['efs_utils']['version']}.tar.gz"
default['cluster']['efs_utils']['sha256'] = '8bf9703d1dfc5cdd5e98539194cb9086873bdc2d938664356a94a727a78d40b6'
default['cluster']['stunnel']['version'] = '5.66'
default['cluster']['stunnel']['url'] = "https://www.stunnel.org/downloads/stunnel-#{node['cluster']['stunnel']['version']}.tar.gz"
default['cluster']['stunnel']['sha256'] = '558178704d1aa5f6883aac6cc5d6bbf2a5714c8a0d2e91da0392468cee9f579c'

# NICE DCV
default['cluster']['dcv_port'] = 8443
default['cluster']['dcv']['installed'] = 'yes'
Expand Down
3 changes: 3 additions & 0 deletions cookbooks/aws-parallelcluster-install/recipes/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@
# Install FSx options
include_recipe "aws-parallelcluster-install::lustre"

# Install EFS Utils
include_recipe "aws-parallelcluster-install::efs"

# Install the AWS cloudwatch agent
include_recipe "aws-parallelcluster-install::cloudwatch_agent"

Expand Down
118 changes: 118 additions & 0 deletions cookbooks/aws-parallelcluster-install/recipes/efs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# frozen_string_literal: true

#
# Cookbook:: aws-parallelcluster
# Recipe:: efs
#
# Copyright:: 2013-2022 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.

efs_utils_tarball = "#{node['cluster']['sources_dir']}/efs-utils-#{node['cluster']['efs_utils']['version']}.tar.gz"
stunnel_tarball = "#{node['cluster']['sources_dir']}/stunnel-#{node['cluster']['stunnel']['version']}.tar.gz"

# Get EFS Utils tarball
remote_file efs_utils_tarball do
source node['cluster']['efs_utils']['url']
mode '0644'
retries 3
retry_delay 5
not_if { ::File.exist?(efs_utils_tarball) }
end

# Verify tarball
ruby_block "verify EFS Utils checksum" do
block do
require 'digest'
checksum = Digest::SHA256.file(efs_utils_tarball).hexdigest
raise "Downloaded EFS Utils package checksum #{checksum} does not match expected checksum #{node['cluster']['efs_utils']['sha256']}" if checksum != node['cluster']['efs_utils']['sha256']
end
end

# Install EFS Utils
case node['platform']
when 'amazon', 'centos'
bash "install efs utils" do
cwd node['cluster']['sources_dir']
code <<-EFSUTILSINSTALL
set -e

# python3.4 or later is required
source #{node['cluster']['cookbook_virtualenv_path']}/bin/activate

tar xf #{efs_utils_tarball}
cd efs-utils-#{node['cluster']['efs_utils']['version']}
make rpm
yum -y install ./build/amazon-efs-utils*rpm
EFSUTILSINSTALL
end
when 'ubuntu'
bash "install efs utils" do
cwd node['cluster']['sources_dir']
code <<-EFSUTILSINSTALL
set -e

# python3.4 or later is required
source #{node['cluster']['cookbook_virtualenv_path']}/bin/activate

tar xf #{efs_utils_tarball}
cd efs-utils-#{node['cluster']['efs_utils']['version']}
./build-deb.sh
apt-get -y install ./build/amazon-efs-utils*deb
EFSUTILSINSTALL
end
end

# Get dependencies of stunnel
package "Install dependencies of stunnel" do
case node['platform']
when 'amazon', 'centos'
package_name 'tcp_wrappers-devel'
when 'ubuntu'
package_name 'libwrap0-dev'
end
retries 3
retry_delay 5
end

# Get stunnel tarball
remote_file stunnel_tarball do
source node['cluster']['stunnel']['url']
mode '0644'
retries 3
retry_delay 5
not_if { ::File.exist?(stunnel_tarball) }
end

# Verify tarball
ruby_block "verify stunnel checksum" do
block do
require 'digest'
checksum = Digest::SHA256.file(stunnel_tarball).hexdigest
raise "Downloaded stunnel package checksum #{checksum} does not match expected checksum #{node['cluster']['stunnel']['sha256']}" if checksum != node['cluster']['stunnel']['sha256']
end
end

bash "install stunnel" do
cwd node['cluster']['sources_dir']
code <<-STUNNELINSTALL
set -e

tar xvfz #{stunnel_tarball}
cd stunnel-#{node['cluster']['stunnel']['version']}
./configure
make
if [[ -f /bin/stunnel ]]; then
rm /bin/stunnel
fi
make install
ln -s /usr/local/bin/stunnel /bin/stunnel
STUNNELINSTALL
end