Deployment

Deployment Guide (AWS, single instance, Ubuntu 18.04 LTS)

Keywords & Official Docs

What to Do on the EC2 Instance

The ec2 instance should be at least 2 CPUs and 4~8 GB RAM.
GraphDB requires a lot of RAM, i.e. typically 3GB.

  1. SSH to the ec2 instance using private key aws provided.

    ssh -i .\path-to-the-key.pem ubuntu@12.34.56.789
  2. Install docker, for more details, see the official guide

    sudo apt update
    sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
    stable"
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io
  3. Install docker-compose, for more details, see the official guide

    # To install a different version of Compose, substitute 1.27.2 with the version of Compose you want to use.
    sudo curl -L "https://github.com/docker/compose/releases/download/1.27.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
  4. Install CodeDeploy Agent, for more details, see the official guide

    sudo apt-get update
    sudo apt-get install ruby wget
    cd /home/ubuntu
    # https://docs.aws.amazon.com/codedeploy/latest/userguide/resource-kit.html#resource-kit-bucket-names
    # For us-east-2 region only, if you are in other region replace us-east-2 with the region name.
    wget https://aws-codedeploy-us-east-2.s3.us-east-2.amazonaws.com/latest/install
    chmod +x ./install
    sudo ./install auto
  5. Set up swap file

    sudo fallocate -l 4G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    sudo echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab

What to Do on the AWS Console (Webpage)

  1. Login

Set up Secrets on the Github Repository

To create secrets for a user account repository, you must be the repository owner
See the official documentation

  1. You will need an IAM account that has Access key ID and Secret access key. The IAM user should have the access to CodeDeploy.

  2. Set AWS_ACCESS_KEY_ID to your Access key ID.
    Example:

    Github secrets
  3. Set AWS_SECRET_ACCESS_KEY to your Secret access key