Skip to content

Latest commit

 

History

History
231 lines (151 loc) · 6.09 KB

INSTALL.md

File metadata and controls

231 lines (151 loc) · 6.09 KB

  Digital Product Pass Application

Application Installation

Pre-requisites

You must have Helm, Minikube and Maven to follow this steps.

Start Minikube Cluster

# start minikube cluster
minikube start --cpus 4 --memory 8096

# enable minikube ingress addon
minikube addons enable ingress

Install

Configuration

First configure the values.yaml file with the secrets and the necessary configuration for starting the application correctly.

The documentation of the backend configuration is available here README.md

TIP: For a correct Catena-X integration, get the appropriate credentials from the Portal! You can also place secrets in a Vault so that the credentials are safe!

Deployment

Before the application is deployed, the persistance is necessary and must be existed.

# Launch persistent volume
kubectl apply -f ./deployment/local/storage/pv-data.yaml

Use the following command to install the application as configured helm deployment:

helm install digital-product-pass ./charts/digital-product-pass -f charts/digital-product-pass/values.yaml

NOTE: This command will deploy the complete application. However, it would take some minutes until all the pods are up and in running state. You can check the pod state repeatedly by the following command.

# To check the pod status
kubectl get pods

Expose necessary ports

Once the application is running, in order for you to access it, we need to expose the ports. Following this commands we will be able to access it.

Get pod name

Search for the application name: The default value of is default.

kubectl get pods -n <YOUR-NAMESPACE> --no-headers |  awk '{if ($1 ~ "dpp-backend-") print $1}'

Example:

img4.png

Copy the pod name with the prefix dpp-backend

Port forward

Paste the pod name after the port-forward parameter.

kubectl -port-forward dpp-backend-95b5d4989-xvbkq 8888:8888 -n default

NOTE: The default port set is 8888 however it can be changed in the configuration.

Check if the application is running

Go to the following url to check the health status:

localhost:8888/health

Frequently asked questions

How to install the application and run it locally without docker and helm charts?

Use the following commands to install/compile the application:

Compile Backend

cd dpp-backend/digitalproductpass 
mvn clean install test

Run the JAR file

Substitute the <version> variable with the current version of the Digital Product Pass Backend and run the jar:

./target/digitalproductpass-<version>-SNAPSHOT.jar

Configure the secrets

Once the application is running a tmp file will be created in the following directory: data/VaultConfig/vault.token.yml

client:
  id: <Add the Keycloak client.id here>
  secret: <Add the Keycloak client.secret here>
edc: 
  apiKey: <Add the Keycloak edc.apiKey here>
  participantId: <Add the Keycloak edc.participantId here>

How to start the application locally using Spring Boot?

Use the following command using maven to start the application

mvn clean spring-boot:run

Compile Frontend Installation

Prerequisites:

  • Git
  • Code editor (VS Code/ IntelliJ recommended)
  • Nodejs 16 (Node Package Manager - npm)
  • Vuejs
  • Docker
  • Git Bash (for windows operating system only)

Installation

Clone project repository

git clone https://github.com/eclipse-tractusx/digital-product-pass.git

Install dependencies

cd digital-product-pass/
npm install --legacy-peer-deps

Run Project

Compiles and minifies for production

npm run build

Method 1: Without Docker

Compiles and hot-reloads for development

npm run serve

Method 2: With Docker

The following environment variables must be set in build and deploy script:

  • PASS_VERSION
  • APP_VERSION
  • APP_API_TIMEOUT
  • APP_API_MAX_RETRIES
  • APP_API_DELAY
  • IDENTITY_PROVIDER_URL
  • HOST_URL
  • DATA_URL
  • KEYCLOAK_CLIENTID
  • KEYCLOAK_REALM
  • KEYCLOAK_ONLOAD
# run script
../buildAndDeploy.sh consumer-frontend

You can run the application in docker container with existing image docker.io/tractusx/digital-product-pass-frontend:latest from GitHub packages. You need to update the build and deploy script.

The consumer frontend is available in browser at http://localhost:8080

What must you do if you encounter problems like "the docker service isn't running. Try restarting the docker service."?

You need to start/restart your docker daemon, and then run the command (mentioned in pre-requisites) to the start minikube cluster.

Local Setup

If you would like to run the entire application locally, please have a look at the GETTING-STARTED.md

Coding styles

How to set up a code editor

See VSCode configuration.