Skip to content

Process: Testing Dock AMI

Ryan Sandor Richards edited this page Apr 21, 2016 · 3 revisions

Process: Testing Dock AMI

Herein lie the steps to test new dock AMIs

Step 1: Create AMI to test

The first thing you must inorder to test a new AMI is to create one.

  1. create a new server in EC2 from base ubuntu image
  2. run the docks.yml ansible role with like so `ansible-playbook -i -hosts docks.yml -e dock:

Step 2: Create Launch Configuration

After you have created the ami you must create a launch config

  1. visit EC2 "Launch Configurations" page
  2. select the latest launch config for your env and right-click and select copy launch configuration
  3. change the AMI to the one you build above
  4. ensure you have 1 ebs volume mounted at /dev/sdb
  5. ensure you have <env>-dock security group attached

Step 3: Modify Auto Scale Group

After you have created your Launch Config, you now need to use it. If you do not have a org to test with, you will first need to whitelist a org you plan to test with. (ask someone if you do not know how to do this). Once you have a test org you need to update the LC of your test org to use your newly created Launch Configuration.

  1. Run docks asg lc -e <env> <orgId> <Launch Configuration ID>
  2. to ensure you this worked wait 1 minute then run docks asg list -e <env> | grep <orgId>
  3. If it did not update, look at shiva logs and file a bug, then change the autoscale group to point to your new Launch Configuration using AWS

Step 4: Create a test dock

After you have setup your auto scaling group you need to spin up your dock. You can do so by scaling up your Auto Scaling Group by 1

  1. run docks asg list -e <env> | grep <orgId>, and note down your current cluster size
  2. run docks asg scale-out <orgId> 1 -e <env>
  3. Wait 1 minute then run docks asg list -e <env> | grep <orgId> again and ensure your cluster size went up by 1
  4. If it did not update, look at shiva logs and file a bug, then increment the Desired and Min of your autoscale group by 1 using AWS

Step 5: Ensure dock initialized

After you have make your Auto Scale Group spin up a new instance you must now test it to ensure it works!

  1. Wait 15 minutes for the new dock to spin up
  2. run docks aws -e <env> | <orgId>
  3. find your newly crated dock (should gave your new AMI id listed)
  4. ssh into that dock
  5. cat /var/log/user-script-dock-init.log
  6. read the above log and look for the words error, If you do not see anything then you are good
  7. run docker ps and you should see a weave and swarm container running
  8. exit the server and run docks list -e <env>, your dock should show up in the list

Step 6: Test the dock

After you have verified your dock has connected to the system it is time to test!

  1. Run all these test: https://github.com/CodeNow/devops-scripts/wiki/How-to-Test-an-API-Pull-Request

Step 7: Success!

After you have successfully tested your dock you are ready to deploy it!!!

  1. Update Astral configs to have your new Launch Configuration
  2. Update existing Auto Scaling Groups to use your new Launch Configuration
Clone this wiki locally