buildkite / elastic-ci-stack-for-ec2-mac

CloudFormation template for Auto Scaling AWS EC2 Mac based Buildkite Agents
MIT License
9 stars 5 forks source link

initial feedbacks #1

Closed OliverKoo closed 1 year ago

OliverKoo commented 3 years ago

Hi again @keithduncan 👋

We e-met before on other buildkite thread, nice work you got here! Libby Graham asked me to provide some feedback. I thought I can summarize them in this issue.

  1. Does the LaunchTemplate in template.yml needs to have a license_specification field? I use Terraform to provision my EC2 Mac auto-scaling group, and my LaunchTemplate looks like this

    resource "aws_launch_template" "buildkite_agent" {
    instance_type = "mac1.metal"
    ...
    license_specification {
    license_configuration_arn = aws_licensemanager_license_configuration.buildkite_ios_agent.arn
    }
    
    placement {
    tenancy = host
    host_resource_group_arn = aws_cloudformation_stack.ios_agent_resource_group.outputs["ResourceGroupId"]
    }
    }

    Forgive me I didn't use CloudFormation to provision my EC2 Mac auto-scaling group. So I could totally be wrong 😛

  2. In the README lets link macOS buildkite agent set up https://buildkite.com/docs/agent/v3/macos

  3. Link EC2 Mac doc https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-mac-instances.html

Below is not directly related to elastic CI but more related to buildkite-agent running on mac

  1. buildkite-agent need FDA granted via mac security setting otherwise people would see inconsistent result between building on the machine during testing (from user login session) and in production (run as service) (example) - I had to VNC in to turn on FDA (how to VNC into EC2 Mac as part of the AMI creation

  2. iOS CI jobs often need to run and UI test in the iOS simulator. For some reason the UI tests gets flaky after the machine went to sleep. set mac to neversleep sudo systemsetup -setcomputersleep never solves this.

  3. The plist refrenced from https://buildkite.com/docs/agent/v3/macos should include

    <key>SessionCreate</key>
    <true/>

    so buildkite-agent can be launched with user-session which makes accessing keychain and certitifcate possible when user trys to codesign their app. (see reference https://github.com/buildkite/agent/issues/1423)

  4. (Nice to Have) Like you did with Linux and Windows - provide a Packer script for mac. Maybe for starter we can provide an AMI with Xcode installed or better a install-xcode.sh so people have the flexibility to swap out the base AMI with the new macOS version (like 11.5 -> 11.6). I can help with this

  5. (Nice to Have) I love buildkite-auto-scalar. Would be nice to include the provision of a Lambda that runs the auto scalar.

keithduncan commented 3 years ago

Thank you so much for taking the time to look at the project and provide your feedback @OliverKoo 🙌 😄 we’ll be reviewing it for future works :bow: