Skip to content

OAR Data Distribution Service (oar-distservice)

License

Notifications You must be signed in to change notification settings

usnistgov/oar-distservice

Repository files navigation

OAR Distribution Service - Microservices Architecture

Overview

This repository is for the OAR Distribution Service project, restructured into a microservices architecture to improve scalability, maintainability, and easier troubleshooting. The project is Maven multi-modules project and is divided into several Maven-managed modules, each containing a different component of the OAR Distribution Service:

  • Common Module: shared utilities and libraries.
  • AIP Access Module: handles Access to Archival Information Packages.
  • Bundle Download Plan Module: manages the planning of data bundle downloads.
  • Cache Management Module: contains Cachec Manage implementations and endpoints.
  • Data Bundle Access Module: facilitates access to data bundles.
  • Dataset Access Module: provides services for dataset retrieval.
  • Restricted Access Module: manages access to restricted data.

Each module can be built and deployed independently using Docker containers. This architecture allows for separation of concerns as well as isolated scaling and maintenance, which will eventually improve the system's ability to handle very large data.

Goals:

  • Transition from a monolithic to a microservices architecture.
  • Improve the modularity and scalability of the distribution service.
  • Enable efficient deployment cycles and easier updates.

Technologies Used:

  • Java 17+
  • Maven for dependency management and builds.
  • Spring Boot 3.2+ and Spring Cloud for microservices orchestration.
  • Docker for containerization of the different microservices.

Building and Running without Docker

Locally

  • Prerequisites:
    • Ensure Java 17 and Maven are installed on your machine.
    • All commands should be run from the root of the project directory where the pom.xml is located.

*Step 1: Build the Common Module

Build the common-module first, as it is a dependency for other modules.

cd /path/to/project  # cd to the project root directory
mvn clean install -pl common-module -am -DskipTests

-am means also build other required projects, and -DskipTests skips the testing phase (testes aren't complete yet).

Step 2: Build the Module

After the common-module is successfully built and installed into your local Maven repository, you can proceed to build the others modules.

Example with AIP Module:

mvn clean package -pl aip-access -am -DskipTests

Step 3: Run the AIP-Access Module

Once built, you can run the module directly from the command line using Java. First, locate the built .jar file (found in the target directory of the module), then execute it with Java.

java -jar /path/to/aip-access/target/aip-access-1.0-SNAPSHOT.jar

In this case we assume the output .jar file is named aip-access-1.0-SNAPSHOT.jar. Adjust the path and file name based on your actual Maven build outputs.

Building and Running with Docker

Step 1: Build the Module

Build the aip-access module using Docker:

docker build -t aip-access -f docker/aip-access.dockerfile .

This command does the following:

  • -t aip-access: This tags the built Docker image with the name aip-access
  • -f docker/aip-access.dockerfile: This specifies that Docker should use the Dockerfile located at docker/aip-access.dockerfile.
  • .: This is the build context sent to the Docker daemon. It is set to the current directory.

Before running the build command, make sure you are in the project root directory (the one containing the docker directory).

After building the Docker image, you can run it using:

docker run -p 8087:8080 --name aip-access aip-access

This command runs the aip-access Docker container and maps port 8080 inside the container to port 8087 on the host machine.

This is still work in progress, as the application will complain about missing configuration, since the app container can't reach the Config Server container yet.

About

OAR Data Distribution Service (oar-distservice)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published