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

account for the possibility of there being no aws cli binary #1719

Closed
wants to merge 1 commit into from

Conversation

joelddiaz
Copy link

Issue #, if available:

N/A

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

the generate-version-info.sh script presently assumes that the aws binary will be present. but this isn't always the case depending on the base AMI being used. allow for the possibility that we will not have an aws binary so the script doesn't error out.

otherwise we end up with errors like so:

2024-03-08T13:48:36-05:00: ==> amazon-ebs: Provisioning with shell script:
/home/jo.diaz/projects/amazon-eks-ami/templates/al2/../shared/provisioners/generate-version-info.sh
2024-03-08T13:48:37-05:00: amazon-ebs:
/home/ec2-user/script_1364.sh: line 26: aws: command not found
2024-03-08T13:48:37-05:00: ==> amazon-ebs: Provisioning step had errors:
Running the cleanup provisioner, if present...
2024-03-08T13:48:37-05:00: ==> amazon-ebs: Terminating the source AWS
instance...

Testing Done

Ran a build with a base AMI that didn't include the aws CLI w/o running into this issue.

the generate-version-info.sh script presently assumes that the aws
binary will be present. but this isn't always the case depending on the
base AMI being used. allow for the possibility that we will not have an
aws binary so the script doesn't error out.

otherwise we end up with errors like so:

2024-03-08T13:48:36-05:00: ==> amazon-ebs: Provisioning with shell
script:
/home/jo.diaz/projects/amazon-eks-ami/templates/al2/../shared/provisioners/generate-version-info.sh
2024-03-08T13:48:37-05:00:     amazon-ebs:
/home/ec2-user/script_1364.sh: line 26: aws: command not found
2024-03-08T13:48:37-05:00: ==> amazon-ebs: Provisioning step had errors:
Running the cleanup provisioner, if present...
2024-03-08T13:48:37-05:00: ==> amazon-ebs: Terminating the source AWS
instance...
@cartermckinnon
Copy link
Member

cartermckinnon commented Mar 14, 2024

A previous provisioner installs the AWS CLI, so I think you're actually running into a PATH problem. We do want the build to fail if the CLI isn't installed successfully -- it's a runtime dependency of the bootstrap scripts.

@joelddiaz
Copy link
Author

A previous provisioner installs the AWS CLI, so I think you're actually running into a PATH problem. We do want the build to fail if the CLI isn't installed successfully -- it's a runtime dependency of the bootstrap scripts.

I see now what was going on. Installing the aws CLI from the downloaded zip file (instead of from the yum repo) leaves the aws CLI unusable because of the default umask on the AMI base image being used. I've updated the PR #1717 with the other umask changes to also include changes so that the aws CLI isn't installed in a broken state.

Closing this one out..

@joelddiaz joelddiaz closed this Mar 14, 2024
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.

2 participants