Versions Compared

Key

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

This topic provides high-level information about deploying DTP to Docker and cloud environments. In this section:

Table of Contents
maxLevel1

Download

You can download a ready-to-use DTP container image from Docker Hub: https://hub.docker.com/r/parasoft/dtp.  If you intend on deploying Extension Designer, download the image with Extension Designer.

Architecture Considerations

...

Your container images must meet the same requirements specified in the Requirements section. Refer to the Docker or cloud environment vendor documentation for information on configuring images or VMs that meet DTP's requirements. 

...

There is no difference between installing DTP on a containerized and a static system. Refer to the New DTP Installations section for information about the installation process. Refer to the documentation for your cloud environment vendor for information about configuring server instances.

...

You can deploy containerized instances of DTP to dynamic infrastructure, such as Amazon AWS or Microsoft Azure, which enables you to alleviate management overhead associated with maintaining your own host environment. Refer to the documentation for your cloud environment for additional information.

Deploying DTP in Docker

To deploy DTP in Docker, follow the process outlined below.

Create a Docker volume and start DTP

First, you need to create a Docker volume called "parasoft-volume" as shown below.

Code Block
languagetext
docker volume create parasoft-volume

Then start DTP.  Please note the following:

  • Certain conditions must be met for the machineId to remain the same when new containers are started. Those conditions are:
    • The container must be created and started with the root user.
    • The Docker socket must be mounted.
    • The Docker volume "parasoft-volume" created previously must be mounted.
  • DTP_DATA_DIR:/usr/local/parasoft/data
    • Mount persistent volume at DTP_DATA_DIR.

You can inject JAVA_CONFIG_ARGS and JAVA_DC_CONFIG_ARGS environment variables into the DTP docker container. For example:

Code Block
languagetext
-e JAVA_CONFIG_ARGS="-Dcom.parasoft.sdm.storage.managers.admin.enable.delete.project.data=true" -e JAVA_DC_CONFIG_ARGS="-Dcom.parasoft.sdm.dc.traffic.max.length=250000"

An example of starting DTP with these considerations is shown below. If you are deploying Extension Designer, see Starting Extension Designer below for additional commands you might need to include.

Code Block
languagetext
docker run --name dtp -p 8080:8080 -p 8082:8082 -p 8443:8443 --user root:root -v /var/run/docker.sock:/var/run/docker.sock -v parasoft-volume:/mnt/parasoft -v DTP_DATA_DIR:/usr/local/parasoft/data -d DTP_DOCKER_IMAGE

...

Parasoft has published official Docker images to Docker Hub for your convenience. Full installation instructions are included in the readme with each image. There are two versions available, one with Extension Designer and one without. Follow the link below that best suits your needs:

...

If you are deploying Extension Designer, add the following port to the Docker run command above: 

Code Block
languagetext
-p 8314:8314

Once the container is started, you will need to modify the reverse proxy settings in the Extension Designer UI to have the correct hostname. Extension Designer does not assume the Docker container ID is the hostname, so without this modification the application may malfunction. In addition, if you have published non-default ports for DTP and/or Extension Designer (for example, -p 8400:8314), then these ports will need to be reflected in the reverse proxy settings as well.

Note that, while modifying the reverse proxy settings is the recommended configuration option, if all default ports are used for DTP and Extension Designer it is possible to avoid having to configure reverse proxy settings and pass in the hostname when running the container for the first time. Keep in mind that the hostname flag is only available with the docker run command.

Example:

Code Block
languagetext
--hostname foobar.example.com 

If you are using a remote MongoDB database, you should configure the necessary environment variables using the -e flag when starting the Docker container.
Example:

Code Block
languagetext
-e DEP_USE_REMOTE_DB=true -e DEP_DB_HOSTNAME=mongo-db -e DEP_DB_PORT=27017 

Set up DTP to connect to your database

After starting the DTP container, initialize DTP_DATA_DIR directory to connect to your database.

Code Block
languagetext
cd DTP_DATA_DIR/lib/thirdparty/

Then download the correct connector driver for your database. Note that "sudo" needs to be used any time volume data is modified externally since it is owned by the root user.  An example of downloading the MySQL connector driver is shown below.  

Code Block
languagetext
sudo wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar

As sudo, modify DTP_DATA_DIR/conf/PSTRootConfig.xml to point to the database server.  By default, it points to a localhost URL for MySQL.

Initialize the DTP database.  An example using MySQL is shown below.

Code Block
languagetext
docker exec dtp cat dtp/grs/db/dtp/mysql/create.sql | docker exec -i mysql mysql -uroot -proot 

Restart the DTP container

Once the changes are completed, restart the DTP container for them to take effect.

Code Block
languagetext
docker container restart dtp

The DTP deployment is now complete and DTP should be accessible via browser now.

Configuring Tomcat Settings, Keystore, and Truststore

If you need to configure Tomcat settings, keystore, and truststore, there are many ways to do so. Because these files are persisted in the container and not in a mounted persistent storage, configuration changes will not be automatically applied when you start a new container. Below are a couple ways you can ensure configuration changes are applied to new containers.

The easiest way to configure ports and keystores is to use a reverse proxy. This eliminates the need to make changes to the default Tomcat settings and keystore in the container. 

In lieu of using a reverse proxy, you can save the configuration files to a persistent storage and mount them when starting the container. First, note the locations of these files in the docker container:

  • server.xml -  /usr/local/parasoft/dtp/tomcat/conf/server.xml
  • keystore - /usr/local/parasoft/dtp/tomcat/conf/.keystore
  • truststore - /usr/local/parasoft/dtp/jre/lib/security/cacerts

Then, save these files to your persistent storage and mount them when starting the container by adding the following arguments:

-v /<persistent_storage>/.keystore:/usr/local/parasoft/dtp/tomcat/conf/.keystore

-v /<persistent_storage>/server.xml:/usr/local/parasoft/dtp/tomcat/conf/server.xml

...

Deploying DTP in Kubernetes

...

Code Block
languagetext
kubectl exec <POD_NAME> -c <CONTAINER_NAME> -- printenv

Setup DTP to connect to your database

Download and install the relevant JDBC driver in the persistent volume that is mounted to the DTP data directory.

...