Closed meyer9 closed 2 years ago
looks like this is resolved on the macos docs
@meyer9 , where did you see this added in the docs? For context, I also ran into this and was about to file an issue when I saw this one already created. My workaround was to add -i
to the UserData commands so it loaded the path correctly so the brew command was found. So su - "${user}" -c 'brew install buildkite/buildkite/buildkite-agent'
became su - "${user}" -i -c 'brew install buildkite/buildkite/buildkite-agent'
for the two su commands.
The setup instructions and script for OSX seem like they could be improved for ARM-based Macs.
In the install script, there are a few commands that invoke brew. On ARM-based Macs, Homebrew is installed to a different location (
/opt/homebrew
) and isn't accessible without running the user'szshrc
file.I'm not sure what the preferred way of clarifying this is. I wrote a small wrapper script to just invoke
/opt/homebrew/bin/brew
with the same arguments, but it seems like the script should just run the brew commands from the user's shell.su - ec2-user -c
seems to run commands with a stripped down path.Also, since brew is required, maybe it should be added as a step to the docs when building the AMI: https://buildkite.com/docs/agent/v3/elastic-ci-stack-for-ec2-mac/autoscaling-mac-metal#step-2-build-an-ami.
Logs from
/var/log/amazon/ec2/ec2-macos-init.log
:My workaround (added to
/usr/local/bin/brew
):