Skip to content

Managing overview on amazon

Adam Hooper edited this page Dec 7, 2015 · 29 revisions

Getting a database shell

  1. overview-manage ssh production conglomerate to log in to the conglomerate instance
  2. sudo -u postgres psql overview

Editing Overview configuration files

  1. Pick ENV=(production|staging), SERVER=(worker|frontend)
  2. aws s3 cp s3://overview-$ENV-secrets/$SERVER-env.sh .
  3. edit $SERVER-env.sh
  4. aws s3 cp $SERVER-env.sh s3://overview-$ENV-secrets/$SERVER-env.sh
  5. overview-manage restart $ENV
  6. Important rm $SERVER-env.sh. Do not let our SSL key, API keys or Play application secret get public

Editing non-Overview configuration files

  1. SSH to an instance (e.g., overview-manage ssh production conglomerate) and edit the configuration file.
  2. Test that your edits work.
  3. Copy your edits into aws-overview-tools/script/user-data/$SERVER.txt, which follows Yaml format.

Deploying a new version

overview-manage deploy overview-server@[TAG] staging

Alternatively:

overview-manage publish overview-server@[TAG] staging (slow, undetectable to users) overview-manage restart staging (fast)

Updating overview-manage on the manage instance

  1. Push a new version to Git
  2. overview-manage ssh to connect to the manage instance, then cd /opt/overview/aws-overview-tools && git pull --rebase.
  3. Log out

It wouldn't be the end of the world if you modified the repository directly on the manage instance and then pushed. But there wouldn't be an author in the commit logs.

Granting or revoking access to the manage instance

Edit /home/ubuntu/.ssh/authorized_keys.

After revoking somebody's access, remember that they may still own the manage SSH private key. That shouldn't be a security concern (anything it can ssh into is firewalled), but better safe than sorry. Rotate those keys by editing /home/ubuntu/.ssh/authorized_keys on all instances, making them all use a new private key from the manage instance. Delete and create a new manage key on the EC2 Management Console, too, so future instances will use the new one.

Clearing overview-manage's caches

(Written for https://www.pivotaltracker.com/n/projects/928628/stories/69190832)

overview-manage stores files in a few places.

Let's iterate over them:

The build-cache volume

This stores Ivy and Node caches, so that the build system doesn't need to download the same files over and over again from remote repositories every time you deploy.

To wipe it, just attach the volume on the manage instance, mkfs.ext2 it, and detach it.

/opt/overview/manage

This stores bare git repositories. Just rm -rf /opt/overview/manage.

Clone this wiki locally