-
Notifications
You must be signed in to change notification settings - Fork 312
(3.8.0 ‐ 3.9.3) ParallelCluster Build Image Failing during Installation of Minitar Ruby Gem Dependency
During pcluster build-image
, ParallelCluster installs Berkshelf gems for dependency management. Minitar
is a dependency of Berkshelf. On Tuesday, August 6, Minitar released 2 different versions, v1.0.0 and last version of minitar v0.12 with the deprecated archive-tar-minitar v0.12.
The latest minitar v1.0.0 removed the Archive::Tar
namespace and archive/tar
path as they have been deprecated since 2017. And moved the executable in a separate minitar-cli
package. These changes in minitar
v 1.0.0+ causes failure in Berkshelf installation and hence the ParallelCluster Build Image fails.
Reference to Berkshelf Installation Failure https://github.com/chef/berkshelf/issues/26
ParallelCluster fails to build images. The error surfaced by ParallelCluster Build Image is:
pcluster describe-image --image-id $IMAGE_ID | jq ".imagebuilderImageStatusReason"
Error occurred during operation 'Workflow Execution ID: 'wf-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx' failed with reason: Document arn:<APRTITION>:imagebuilder:<REGION>:<ACCOUNT_ID>:component/parallelclusterimage-*/<parallelcluster-version>/1 failed!'
And, below is the snippet of the failure in ParallelCluster Build Image Logs which you can capture using pcluster export-image-logs - AWS ParallelCluster
LANG=en_US.UTF-8 sudo /opt/cinc/embedded/bin/berks vendor /etc/chef/cookbooks --delete || (echo 'Vendoring cookbook failed.' && exit 1)
done;
<internal:/opt/cinc/embedded/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- archive/tar/minitar (LoadError)
from <internal:/opt/cinc/embedded/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/lib/berkshelf/packager.rb:1:in `<top (required)>'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/lib/berkshelf/berksfile.rb:1:in `require_relative'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/lib/berkshelf/berksfile.rb:1:in `<top (required)>'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/lib/berkshelf.rb:222:in `require_relative'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/lib/berkshelf.rb:222:in `<top (required)>'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/lib/berkshelf/cli.rb:1:in `require_relative'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/lib/berkshelf/cli.rb:1:in `<top (required)>'
from <internal:/opt/cinc/embedded/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/opt/cinc/embedded/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /opt/cinc/embedded/lib/ruby/gems/3.1.0/gems/berkshelf-8.0.7/bin/berks:3:in `<top (required)>'
from /opt/cinc/embedded/bin/berks:25:in `load'
from /opt/cinc/embedded/bin/berks:25:in `<main>'
This issue impacts ParallelCluster versions from 3.8.0 to 3.9.3, across all OSes, schedulers.
The mitigation is to pin the Minitar version to v0.12 which is the latest version with archive-tar-minitar and doesn’t break ParallelCluster Build Image. Choose one of the below 2 Options for mitigating the issue.
Since ParallelCluster version 3.10.0, we download the dependencies using S3 bucket. This bucket doesn't contain the Minitar v1.0.0 version, which is why the ParallelCluster Build Image is not breaking. See v3.10.0
To mitigate this issue on older supported versions of ParallelCluster you can make changes in parallelcluster.yaml
file to pin Minitar v0.12
- Download the source code zip file of aws-parallelcluster for any version you want from here Releases · aws/aws-parallelcluster · GitHub
- Unzip the file and go into the root folder
unzip aws-parallelcluster-<version>.zip -d aws-parallelcluster && cd aws-parallelcluster
- Make changes in parallelcluster.yaml file located in aws-parallelcluster/cli/src/pcluster/resources/imagebuilder/parallelcluster.yaml
## Replace below Line in InstallCinc Step
/opt/cinc/embedded/bin/gem install --no-document berkshelf:{{ BerkshelfVersion }}
## Replace with below line, effectively Pin the Minitar version to 0.12
/opt/cinc/embedded/bin/gem install --no-document minitar:0.12
/opt/cinc/embedded/bin/gem install --no-document berkshelf:{{ BerkshelfVersion }}
- To use the modified aws-parallelcluster code, run below command
pip install ./cli