Skip to content

Latest commit

 

History

History
170 lines (108 loc) · 5.11 KB

SETUP.md

File metadata and controls

170 lines (108 loc) · 5.11 KB

SETUP

Updated: June 7, 2022

This guide is to get you setup with the tools you'll need for development.

  1. Install Java 11, link.
  2. Install SBT, link.

Fedora Linux

  1. Install Docker Engine.
  2. Carry out the post install steps, link.
  3. Install kubectl.

Alternatively, simply install Docker Desktop and enable Kubernetes.

MacOS

  1. Install Docker Desktop.
  2. Enable Kubernetes via Docker Desktop, link.

Installing Java 11

Installing Java 11 can vary depending on your operating system and chosen methodology. The recommended version to install is OpenJDK 11.

Fedora Linux

Installing via DNF is the recommended method for Fedora Linux. Instructions for that can be found here.

Mac OS

Installing via Homebrew is the recommended method for Mac, though it can be used for other operating systems as well. To install OpenJDK 11, go here.

SDKMan

SDKMan is a cross-platform tool for managing SDK versions. Instructions for using it are here. As with the other methods, OpenJDK 11 is the recommended Java version to install. For instances where that is not an option, other quality JDK 11 implementations (e.g., Coretto Java 11, Liberica Java 11, or Zulu Java 11) will suffice.

Installing SBT

Install the latest version of SBT in order to compile the code base and run unit tests.

After SBT is installed, it needs to be configured. The instructions for that are in CONTRIBUTING.md.

Fedora Linux

On Linux, you can follow the instructions provided by SBT, link.

Mac OS

On Mac OS, SBT provides instructions here. It can be installed via Homebrew as well. It is also recommended that SBTEnv be installed as well, link. It can help configure the SBT environment.

Running L0 & L1 on EKS cluster

Prerequisites

  1. sbt
  2. Docker Desktop with Kubernetes enabled
  3. Skaffold CLI
  4. AWS CLI version 2

AWS setup

aws configure   # requires AWS Access Key(s)
aws eks --region us-west-1 update-kubeconfig --name eks-dev

Kubernetes cluster setup

Update your kubeconfig

kubectl config rename-context $(kubectl config current-context) eks-dev

Create your namespace

IAM_USER=$(aws sts get-caller-identity --query Arn --output text | sed 's/.*\///g')

kubectl create namespace $IAM_USER
kubectl config set-context --current --namespace=$IAM_USER

Verify kubernetes setup

kubectl get pods

Should return:

No resources found in <your-namespace-name> namespace.

Docker image repository setup

Install Docker credential helper

brew install docker-credential-helper-ecr

Update Docker config

Add this to your ~/.docker/config.json -- if there is already a config.json file then only add the credHelpers property.

{
  "credHelpers": {
    "public.ecr.aws": "ecr-login",
    "150340915792.dkr.ecr.us-west-1.amazonaws.com": "ecr-login"
  }
}

Update Skaffold config

skaffold config set default-repo 150340915792.dkr.ecr.us-west-1.amazonaws.com

Verify docker setup

docker image ls 150340915792.dkr.ecr.us-west-1.amazonaws.com/l0-validator

Should list existing l0-validator images.

Build images and start cluster

skaffold dev --trigger manual --tail=false

You should see docker images successfully uploaded to the container registry and then kubernetes resources successfully deployed on the EKS cluster. Open grafana to monitor the L0 and L1 clusters performance http://localhost:3000.

To access the API of individual pods you can use an http proxy. First get the IP address of a pod in a cluster.

kubectl get pods -o wide

Then set the env variable http_proxy and use curl to query a pod.

export http_proxy=8080

curl <pod-ip-address>:9000/cluster/info

Using profiles

Profile activation

Activate profiles using option -p. Profiles can also be manually deactivated by prefixing the profile name with -.

skaffold dev -p foo,-bar

Profiles

  • chaos - inject chaos experiments into the cluster (like a failure of some number of pods)