This chapter answers frequently asked questions.

Question: How do I work with tmux?

Answer: Tmux is a Linux utility that keeps a terminal session running, which helps in taking care of long running processes. This can prove helpful in deployment scripts and data extraction processes.

To start a tmux session named “sample”, type the following command:

tmux new -s sample

You should see a terminal window with a green bar below it. Whatever command you run here runs in the background when you detach from it. This enables multiple extractions in parallel. To detach from that session use the following keys:

“Ctrl+B” followed by “D”

To check on progress/ attach to container again, use the following:

tmux attach-session -t sample

Question: How do I upgrade data released on a monthly basis?

Answer: In the Black Duck Air-gapped KnowledgeBase, the volumes for the KnowledgeBase data and your Black Duck SCA instance are separate. To update old data with the new data set, use the following commands in accordance to your system.

  1. Navigate to the docker-compose folder, bring down the docker containers and list the docker volumes using the following commands:

    cd ~/software/Orchestration/hub-*/docker-swarm/
    docker stack rm hub
    docker volume ls
    Note:

    Note down any volumes with the prefix “kb_” as these volumes are for the KB services.

  2. Using the docker volume rm command to remove the associated volumes. To remove match data, api data, solr data use the following command:

    docker volume rm -f kb_pg_api kb_api_snippet

    When the volumes are removed, which might take a while, expect to see some space free up on your mounted device.

  3. Copy the new data for the new month; refer to steps in Chapter 2 for copying data.

    1. Copy over data, extract it, use the create and mount scripts, and mount into the database containers.

  4. Bring the docker containers up for the on-premise system using a command similar to the following:

    docker stack deploy -c docker-compose.yml -c docker-compose.bdba.yml hub

Question: How do I update the software only?

Answer: To ensure that the volumes are maintained, do not use any docker volume commands in this procedure.

Note:

The assumption is that a software update with changes to the KB services and Black Duck SCA are coming being consumed.

  1. Go to the docker-compose folder and bring down the containers.

    cd ~/software/Orchestration/hub-*/docker-swarm/docker stack rm hub
  2. Optional: You can remove the images from docker on your system as well.
    docker images
    docker rmi <image_id>

    The docker images command returns an image id, which is associated with either a Black Duck SCA instance, or a KB service.

    Note: Be careful with removing anything that indicates the possibility of the image being a database holder, for example, blackducksoftware/kb_api_db (note anything that ends with “db”).
  3. When the containers are down, place the new artifacts into the software folder and follow instructions to bring docker containers up in Chapter 3.

  4. Go to the docker-compose folder and bring up the containers for Black Duck SCA and KB Services by using the following commands:

    cd ~/software/Orchestration/hub-*/docker-swarm/
    docker stack deploy -c docker-compose.yml -c docker-compose.bdba.yml hub

    The correlation between the volume mount and where you extract data can be changed. Ensure that you modify the location in the docker-compose.onprem.externalHub.yml file