Setting up a Manifold EC2 Instance (For Pico Lab Employees)

Launching The EC2 Instance

  1. Go to the AWS EC2 service page by clicking the “Services“ drop-down and then clicking “EC2“

  2. Once in the EC2 service page, click the “Launch Instance“ button.

  3. Now you must select an “Amazon Machine Image“. Click on the “My AMIs“ tab and select the “Manifold Image“ AMI. This AMI comes with with NodeJS, NPM, Pico Engine, and Nginx all configured.

  4. When it comes to choosing an instance type, we use the “t2.medium“ in order to support our Manifold users. If desired, set the storage to a larger amount in the “Add Storage” section of the ec2.

  5. Next hit the “Review and Launch button“ (This will go straight to the Review step skipping the steps before).

 

 

6. Navigate back to the ec2 Management Console. Click “Security Groups” on the left side. Modify the ec2 instance’s security group to allow ssh connections and open the port 9090

Getting Pico Engine Back Up

This is from https://github.com/Picolab/documentation-is-automation/blob/master/production-pico-engine/backups.md but was copied here for convenience. Thanks Bruce.

On the pico-engine machine

ssh to the machine where it is running

mkdir backups in the home folder (needs to be done once)

tar czf backups/$(date +%F-%H%M%S).tgz .pico-engine/db/ with a name of current date and time

exit

On the machine where backups will be kept

scp -i <path to certificate> <machine>:<path from root>/backups/*.tgz .

Ensuring the backup works

mkdir huh make a test folder

cd huh and go into it

tar -xvzf ../2020-02-06-143125.tgz using the name of the latest backup file

This will recreate the data from the production pico-engine:

$ tree -a huh huh └── .pico-engine └── db ├── 005195.ldb ├── 005210.ldb ├── 005211.ldb ├── 005214.ldb ├── 005217.log ├── 005218.ldb ├── 005219.ldb ├── 005220.ldb ├── CURRENT ├── LOCK ├── LOG ├── LOG.old └── MANIFEST-005215

PICO_ENGINE_HOME=<path from root>/huh/.pico-engine node packages/pico-engine/src/cli.js

This will allow you to work with the snapshot of the production pico-engine.

Copyright Picolabs | Licensed under Creative Commons.