Skip to content

Running EML CTS as Single Executable JAR

Joo edited this page Oct 22, 2021 · 3 revisions

Docker Files

System Docker File

FROM java:8
WORKDIR <PATH TO JAR & CONF FILE>
ADD parity-system.jar parity-system.jar
ADD system0620.conf system0620.conf
EXPOSE 4000
CMD java -jar parity-system.jar system0620.conf

Client Docker File

FROM java:8
WORKDIR <PATH TO JAR & CONF FILE>
ADD parity-client.jar parity-client.jar
ADD client0620.conf client0620.conf
EXPOSE 39401
EXPOSE 39402
CMD java -jar parity-client.jar 192.168.1.52 client0620.conf

Eml Docker File

FROM java:8
WORKDIR <PATH TO JAR FILE>
ADD eml-cts.jar eml-cts.jar
EXPOSE 8080
EXPOSE 39401
EXPOSE 39402
CMD java -jar eml-cts.jar

Configuration Files

System Configuration File

market-data {
  session             = parity
  multicast-interface = 192.168.1.50
  multicast-group     = 224.0.0.1
  multicast-port      = 5000
  request-address     = 192.168.1.50
  request-port        = 5001
}

market-report {
  session             = parity
  multicast-interface = 192.168.1.50
  multicast-group     = 224.0.0.1
  multicast-port      = 6000
  request-address     = 192.168.1.50
  request-port        = 6001
}

order-entry {
  address = 192.168.1.50
  port    = 4000
}
...

Client Configuration File

order-entry {
  address  = 192.168.1.50
  port     = 4000
  username = parity
  password = parity
}
...

Setup

  1. Create docker images

parity-system:

  • For Windows - docker build -t system:1.0 <PATH TO SYSTEM DOCKER FILE>
  • For Mac - docker build --tag system:1.0 <PATH TO SYSTEM DOCKER FILE>

parity-client:

  • For Windows - docker build -t client:1.0 <PATH TO CLIENT DOCKER FILE>
  • For Mac - docker build --tag client:1.0 <PATH TO CLIENT DOCKER FILE>

eml-cts:

  • For Windows - docker build -t eml:1.0 <PATH TO EML DOCKER FILE>
  • For Mac - docker build --tag eml:1.0 <PATH TO EML DOCKER FILE>
  1. Create a docker network to run the container in with this command: docker network create --subnet=192.168.1.1/24 ctsnet

  2. Run the newly created System Docker image inside a container using the specified IP with this command: docker run --net ctsnet --ip 192.168.1.50 --name systemcontainer1 system:1.0

  3. Run the newly created Client Docker image inside a container using the specified IP with this command: docker run --net ctsnet --ip 192.168.1.51 -i -t --name clientcontainer1 client:1.0

  4. Run MySQL:

    1. Approach 1: using mysql image and set up

      • Pull mysql docker image: docker pull mysql
      • Run the newly created MySQL Docker image inside a container using the specified IP with this command: docker run --net ctsnet --ip 192.168.1.53 --name mysqlctsnet -p 3306:3306 -e MYSQL_ROOT_PASSWORD=capstone@123 mysql
      • Open MySQL console in docker using this command: docker exec -it mysqlctsnet bash
      • Enter credentials in MySQL console using this command: mysql -u root -pcapstone@123
      • Create/setup database and user using following command:
        • To create database: create database nist_cts_eml;
        • To create user: create user eml@192.168.1.52 identified by "";
        • To grant full access of database to user: grant all on nist_cts_eml.* to eml@192.168.1.52;
        • To set password for user: SET PASSWORD FOR 'eml'@'192.168.1.52' = 'capstone@123';
    2. Approach 2: using docker file of MySQL:

      • Download Docker and sql file and keep both files in same directory: Download
      • Build Docker image: docker build --tag mysql:1.0 <PATH TO MYSQL DOCKER FILE>
      • Run MYSQL from docker image: docker run --net ctsnet --ip 192.168.1.53 --rm --name eml-mysql -p 3306:3306 mysql:1.0
      • Note: In case of error (Bind: Address already in use), run sudo service mysql stop then run MYSQL from docker image again.
  5. Run the newly created Eml Docker image inside a container using the specified IP with this command: docker run --net ctsnet --ip 192.168.1.52 -p 8080:8080 --name emlcontainer1 eml:1.0

Clone this wiki locally