Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The purpose of this page is to show how to run the Blueprints Processor microservice locally, using the docker-compose.yaml file provided in the project.

Check out the CDS

...

code

Check out the latest code from Gerrit: https://gerrit.onap.org/r/#/admin/projects/ccsdk/cds

...

Pre-requisite: Use attached settings.xml to have recommended repository settings locally.

In Build the checked out directory, typecds repository by running below:

    mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:nonePq

Create the needed Docker images

The Blueprints Processor microservice project has a module, called distributionapplication, that provides a docker-compose.yaml file that can be used to spin up Docker containers to run this microservice.

The first step is to create any custom image needed, by building the distribution application module.  From the CDS home directory (where the code was checked out), navigate to the module:

    cd ms/blueprintsprocessor/distributionapplication/

Build it using the Maven profile called Docker:

    mvn clean install -PdockerImage Removed -Ddocker.skip.push=true

Image Added

Deck
idstart-docker-containers


Card
labelEl Alto

Start Docker containers using docker-composer

Navigate to the docker-compose file in the distribution application module:

    cd ~/cds/ms/blueprintsprocessor/application/src/main/dc/

Edit docker-compose.yaml as below

Code Block
languageyml
themeDJango
titledocker-compose.yaml
version: '3.37'

services:
  db:
    image: mariadb:latest
    container_name: ccsdk-mariadb
    networks:
      - cds-network
    ports:
    - "3306:3306"
    volumes:
    - ~/vm_mysql:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: sdnctl
      MYSQL_DATABASE: sdnctl
      MYSQL_USER: sdnctl
      MYSQL_PASSWORD: sdnctl
      MYSQL_INITDB_SKIP_TZINFO: 1
  blueprintscds-controller-processordefault:
    depends_on:
      - db
      - nats
    image: onap/ccsdk-blueprintsprocessor:latest
    container_name: bp-rest: cds-controller-default
    hostname: cds-controller-default
    networks:
      - cds-network
    ports:
    - "8000:8080"
      - "9111:9111"
    restart: always
    volumes:
      - target: /opt/app/onap/blueprints/deploy
        type: volume
        source: blueprints-deploy
      - target: /opt/app/onap/config
        type: volume
        source: controller-config
    environment:
      APPLICATIONNAMEAPP_NAME: BlueprintsProcessorcds-controller
      BUNDLEVERSION: 1.0.0
      APP_CONFIG_HOME: /opt/app/onap/config
      STICKYSELECTORKEY:
      ENVCONTEXT: dev

From there, start the containers:

    docker-compose up -d

This will spin the Docker containers declared inside the docker-compose.yaml file in the background:

Image Removed

To verify the logs generated by docker-composer, type:

    docker-compose logs -f


volumes:
  mysql-data:
    driver: local
    driver_opts:
      type: none
      device: /opt/app/cds/mysql/data
      o: bind
  blueprints-deploy:
    driver: local
    driver_opts:
      type: none
      device: /opt/app/cds/blueprints/deploy
      o: bind
  controller-config:
    driver: local
    driver_opts:
      type: none
      device: /opt/app/cds/cds-controller/config
      o: bind

networks:
  cds-network:
    driver: bridge


Card
labelDublin

Start Docker containers using docker-composer

Navigate to the docker-compose file in the distribution application module:

    cd ~/cds/ms/blueprintsprocessor/application/src/main/dc/

From there, start the containers:

    docker-compose up -d

This will spin the Docker containers declared inside the docker-compose.yaml file in the background:

To verify the logs generated by docker-composer, type:

    docker-compose logs -f


...