Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Incus Checklists

Jacob Greenleaf edited this page Sep 30, 2015 · 9 revisions

Deploying a new version

Huzzah! Just merge the pull request, and Travis will automatically deploy it.

Sometimes the deployment will fail on the CodeDeploy side because of timeouts. Just redeploy it (go to Applications -> Incus -> most recent revision -> Deploy This Revision).

If that doesn't work because Travis is down or has gone out of business or gets bought and killed by Yahoo:

(Manual) What you will need

  • An S3 access token with at least the policies that the CodeDeploy role has. It might be sufficient to just have s3:* and codedeploy:*.

(Manual) Steps

  • Install the AWS CLI and configure with an access key with [appropriate permissions
  • Set up your GOPATH
  • Check out the code
  • Run $ ./scripts/build.sh. An archive file has been created at $GOPATH/incus.tar with a CodeDeploy appspec file.
  • Run $ TRAVIS_PULL_REQUEST=false TRAVIS_BRANCH=master ./scripts/deploy.sh. This uploads the archive created in the prior step to S3, and notifies CodeDeploy about the uploaded archive, and deploys it to all the Incus machines.

Rotating instances

For each running instance,

  • Remove it from ELB (incus)
  • Wait 10 seconds for connections to drain
  • Terminate the instance.
  • Wait until autoscaling re-creates it.

Try to keep at least one instance alive at a time.

Changing the configuration

The configuration file is located at /etc/incus/config.yml and is read by Incus at startup. There is no graceful reload of configuration, so a restart is necessary. Since the user data script downloads the initial configuration from S3, below are instructions to rotate it without updating existing images. You can of course update the existing file on disk and do a rolling restart by /etc/init.d/incus stop and letting monit handle the start.

  • Download the current configuration from s3://imgur-incus/config.yml.
  • Your change here
  • Upload the new configuration to s3://imgur-incus/config.yml.
  • Follow "rotation" above

Creating a new AMI

  • Create new instance from current AMI
  • Wait for CloudWatch health checks to pass
  • Remove newly created instance from ELB, if present
  • Stop monit (sudo /etc/init.d/monit stop)
  • Stop incus (sudo /etc/init.d/incus stop)
  • Remove config file (sudo rm /etc/incus/config.yml)
  • Remove CodeDeploy-downloaded incus binary (sudo rm /usr/sbin/incus)
  • Your change here
  • Create new AMI using EC2 Console, making sure NOT to check No reboot. Name the AMI incus_YYYYMMDD_XX, where XX is how many bad AMIs you have created today
  • When the AMI completes, terminate the newly created instance.
  • Create a new launch configuration
    • Copy the old one (incus_YYYYMMDD_XX)
    • Change the AMI to be your newly created AMI
    • Change the name of the launch configuration to match the AMI
    • Defaults should be fine until security group. Choose Filter by EC2 Classic, choose incus for the security group
  • Update the incus-a, incus-c, and incus-d autoscaling groups to use your new launch configuration
  • Follow "rotation" above