How to use Atomic App

as of the writing of this document, the Atomic App is not yet ready for on demand spin up.

There are 4 static applications:

  • vega1, client-vega1
  • vega2, client-vega2
  • vega3, client-vega3
  • vega4, client-vega4
  • vega5-front, client-vega5-front (dedicated to FE team)

Each assigned to a developer.
By default the application is on branch main.
There are a few scenarios to using the atomic app we will cover in this guide.

NOTE: before you start, make sure to run these commands:

tsh login --proxy=vega.teleport.sh:443 --auth=okta-integration
tsh kube login dev
kubectx vega.teleport.sh-dev
kubens vega1    # or the name of the application you are running against

1. Developer wants to test their changes to a service

using the atomic app and mirrord, the developer can test their changes to a service.

  • develop locally

  • enable mirrord

  • run the service using mirrord in your IDE

  • debug the service

video-example

2. Developer wants to run tests

  • develop locally

  • run the service using mirrord in your IDE

  • save an env file:

RunInCluster=true
DESCOPE_ACCESS_KEY=K2hm6gyNjU27zp3tyLjnAppVcUKCgq0TZUQ6E7zbUXtMECEGQKtTLT0mTTtKN6QgLGiKiTX
DESCOPE_MANAGEMENT_KEY=K2c2JwbfxHLZ8IcUhZR6HxsXFzQl5NFjvErlFORWEU95kR3DzSgJfvpNnm1Rk9P7ispDqxH
DESCOPE_PROJECT_ID=P2bx2DsZOmKc5BvNfSoTv7eTbIaL
DESCOPE_VIEWER_ACCESS_KEY=K2kH6OWneh2oYPaPuVrSvptCjv7OTTNyUqfWJ9nfxD3C3L4ffXf52hlMsJbGcoiw8F363dS
InstanceName=vega3
  • run the test with mirrord:
mirrord exec  --env-file ../env -- go test ./tests/integration -v -run '^TestOktaSystemLogView$' -count=1

video-example

3. Developer wants to run all the integration tests

  • develop locally

  • build and push the docker images using github actions on your branch Build Push

  • go to your argocd application, change its branch to your branch, sync the application

  • run the script to run all the integration tests:

vega/scripts/go-test-job.sh

video-example

4. Developer wants to run E2E tests

  • build and push the docker images using github actions on your branch Build Push
  • go to your argocd application, change its branch to your branch, sync the application
  • configure a proxy to the atomic app
tsh proxy app vega1 --port 1337
  • run the e2e tests
npm run test:e2e:atomic:ui

video-example

5. Developer wants to run local frontend against the atomic app

  • Develop locally
  • configure a proxy to the atomic app
tsh proxy app vega1 --port 1337     # replace vega1 with the name of the application you are running against
  • run task to start the frontend atomic:
npm run dev:atomic      # from services/remix

6. Developer wants to add env vars to the atomic app

  • You can add or change env vars using argocd app manifest editing
  • Change the default image tag in the app manifest. video-example
  • Add or change env vars in the app manifest. video-example

7. connecting to the db

  • we are running our db in the cluster, and we are using a service to access it.
kubectl port-forward svc/postgresql 5432:5432

you can now connect to the db using your favorite db client on localhost:5432

username: postgres
password: postgres
db name: vega/postgres

in a case where you want a clean db:

  • connect to the db on localhost:5432
PGPASSWORD=password psql postgres://postgres@localhost:5432/postgres
  • run the following command to reset the db:
DROP DATABASE VEGA WITH (FORCE)
  • run the dbmigrator job by syncing the application(full sync)
  • dbmigrator will create the db and run the migrations.