Local Setup - department-of-veterans-affairs/abd-vro GitHub Wiki

If you are on a Windows machine, take a look at Setup on Windows first.

IDE

VRO is architected to be language agnostic though you should always confirm with maintainers that a language is supported before using it.

If a language is supported, you should feel free to use your preferred IDE for your language. However, it is recommended to use an IDE which supports an integration with Gradle (VRO's build system), like IntelliJ (Community Edition):

Required Dependencies

Directory setup

Make sure you have both abd-vro and abd-vro-dev-secrets cloned in sibling directories.

path/to/code/
         |-----abd-vro/
         |-----abd-vro-dev-secrets/

Software Packages

See Ubuntu VM Setup for detailed software setup instructions on Ubuntu.

Before you run this application locally, you will need to make sure you have all the following required dependencies available in your local environment:

Note for Apple Silicon Macs: export DOCKER_DEFAULT_PLATFORM=linux/amd64 Note that you do not need to install Docker Desktop only the docker command and a container runtime manager which can be Docker Dekstop but could also be something like colima

Recommended Kubernetes GUI:

The VRO Team recommends Lens app as the preferred UI for interacting with LHDI. Important: Lens used to be an opensource project. However the rights to it were purchased in late 2023 and the process of obtaining a personal license seems to have been removed from their website. The good news is that you can still subscribe with a personal license for free using the following steps:

  1. Login with or sign up for a Lens ID via https://k8slens.dev/.
  2. Keep your logged in tab open to ensure your login remains active for the remainder of the steps.
  3. Opening a new tab, go to https://app.k8slens.dev/subscribe/personal/login and re-enter your Lens credentials
  4. Upon successful login, you have now subscribed with a personal license which has been added to Lens ID you used in step one.

It is possible this is a recent bug that the company introduced accidentally, but it is more likely an intentional step to reduce the use of personal licenses. I've found no other way to reach this subscription page but fortunately someone on Reddit still knew the URL.

LHDI has additional setup documentation for Mac OS and Other Operating Systems.

GitHub Permissions

This should no longer be needed:

  • Create a GitHub personal access token with read:packages permission.
  • Add the newly created token to your shell
# add this to your shell profile (e.g. ~/.zprofile)
export GITHUB_ACCESS_TOKEN=<replace-with-token-from-github>

You should also be added to the VA-ABD-RRD GitHub team.

Running the Application

You'll need port 5432 (default for postgres) available/not-in-use when running the code.

Also, be sure that you have a docker daemon running on your machine. If you use Docker Desktop, having the application running will run the daemon. However, if you are using a different Docker runtime like Colima, you will need to manually start the daemon process configure it to always run at boot time.

Once you have all the required dependencies, you can start the application in your local environment by navigating to the root of your application directory and running the following command:

./gradlew clean
./gradlew build check docker

This will build all the application artifacts and docker images.

Note: Due to the way Gradle computes dependencies, the clean command must always be separate from build commands

You can then start the application by running (more details at Docker Compose):

./gradlew :dockerComposeUp
./gradlew :app:dockerComposeUp

Note: Make sure you have completed the instructions in the abd-vro-dev-secrets README

This should bring up a docker container with the app running at http://localhost:8111

Verifying the Application is Running

You can verify that the application is up and running by issuing the following commands in your terminal:

curl http://localhost:8111/actuator/health
curl http://localhost:8111/actuator/info

You should get back responses similar to the following:

curl http://localhost:8111/actuator/health

{
    "status":"UP",
    "components":{
        "db":{
            "status":"UP",
            "details":{
                "database":"PostgreSQL",
                "validationQuery":"isValid()"
            }
        },
        "diskSpace":{
            "status":"UP",
            "details":{
                "total":62725623808,
                "free":53279326208,
                "threshold":10485760,
                "exists":true
            }
        },
        "livenessState":{
            "status":"UP"
        },
        "ping":{
            "status":"UP"
        },
        "readinessState":{
            "status":"UP"
        }
    },
    "groups":[
        "liveness",
        "readiness"
    ]
}
curl http://localhost:8111/actuator/info

{
    "app": {
        "description": "Java API Starter from Template",
        "name": "abd_vro"
    }
}

Running app container locally

The above instructions should give you enough to get all the necessary docker containers running to test new functionality in abd-vro. However, developers may wish to run the vro-app-1 container with a run configuration to more quickly iterate on changes being made as opposed to performing a full ./gradlew dockerComposeUp every time.

  • Refer to Docker Compose
  • Find instructions for setting up a jetbrains run configuration for vro-app-1 HERE.

Tips

Refer to Running Kafka Services/Tests Locally for information on how to run the bie-kafka microservice(s), specifically helpful for when there are issues with our messing system.

  • RabbitMq occasionally segfaults during startup if using apple silicon. Restarting the container will resolve this issue.
  • Check if the svc-bie-kafka docker container is running and causing failures in mock-bie-kafka:dockerComposeUp, if not restart it.

If you are having issues installing ruby3.3.0 there might be an openssl issue. Run the following commands to fix it.

brew install openssl@3 rvm install 3.3.0 --with-openssl-dir=$(brew --prefix openssl@3)

WIP

Breakdown of RabbitMq Messaging, Exchanges, queues, and routes