Skip to content

ci: add packer definition for creating ec2 AMIs

Warren Gifford requested to merge packer-test into master

Created by: ggilmore

Adds a packer template that programmatically creates new AWS, GCP, etc. machine images for each Sourcegraph release. This has the following advantages:

  1. Customers no longer have to go through the boilerplate of setting up docker + pulling the sourcegraph/server image when setting up a new VM
  2. Docker configuration across all cloud providers will be standardized
  3. Startup times are improved over cloud-init scripts since the docker image is already baked into the VM
  4. (most important IMO) Creating VMs in CI is essentially a pre-requisite to being able to submit Sourcegeraph to the AWS marketplace - which should greatly boost our discoverability

TODO:

  • Actually add this to buildkite

    • Actually building the new AMI takes several minutes, and the AMI needs to be copied to each region
    • We need new AWS credentials for buildkite (packer works by actually spinning up a new EC2 instance for each job)
  • set up environment variable hooks for names, sourcegraph/server version, etc. instead of hard-coding it

  • think through how server upgrades would work

  • how do external EBS volumes factor into this

Merge request reports

Loading