diff --git a/README.md b/README.md index 2a1c575..d587e02 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ This repository consists of the following modules: - [**Parity FIX Gateway**](parity-fix) defines a Docker image for the Financial Information Exchange (FIX) gateway +- [**Nassau SoupBinTCP Gateway**](nassau-soupbintcp-gateway) defines a Docker + image for a NASDAQ SoupBinTCP 3.00 gateway + Links ----- diff --git a/docker-compose.yml b/docker-compose.yml index a9a2c93..118d287 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,21 @@ services: build: 'parity-system' ports: - '4000:4000' - - '5000:5000' - - '6000:6000' parity-fix: build: 'parity-fix' ports: - '4010:4010' + market-data-gateway: + build: 'nassau-soupbintcp-gateway' + ports: + - '5000:5000' + environment: + NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_MULTICAST_PORT: '5000' + NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_PORT: '5001' + market-reporting-gateway: + build: 'nassau-soupbintcp-gateway' + ports: + - '6000:5000' + environment: + NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_MULTICAST_PORT: '6000' + NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_PORT: '6001' diff --git a/nassau-soupbintcp-gateway/Dockerfile b/nassau-soupbintcp-gateway/Dockerfile new file mode 100644 index 0000000..563e63c --- /dev/null +++ b/nassau-soupbintcp-gateway/Dockerfile @@ -0,0 +1,13 @@ +FROM openjdk:8-jre-alpine + +ENV NASSAU_VERSION "0.10.0" + +ADD https://repo1.maven.org/maven2/com/paritytrading/nassau/nassau-soupbintcp-gateway/$NASSAU_VERSION/nassau-soupbintcp-gateway-$NASSAU_VERSION.jar /opt/nassau/nassau-soupbintcp-gateway.jar + +RUN chmod 644 /opt/nassau/nassau-soupbintcp-gateway.jar + +COPY docker-entrypoint.sh / + +EXPOSE 5000 + +ENTRYPOINT [ "/docker-entrypoint.sh" ] diff --git a/nassau-soupbintcp-gateway/README.md b/nassau-soupbintcp-gateway/README.md new file mode 100644 index 0000000..916cdca --- /dev/null +++ b/nassau-soupbintcp-gateway/README.md @@ -0,0 +1,32 @@ +Nassau SoupBinTCP Gateway +========================= + +This directory defines a Docker image for a NASDAQ SoupBinTCP 3.00 gateway. + + +Configuration +------------- + +The Docker container is configured using environment variables. + +The following environment variables are optional: + +- `NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_MULTICAST_GROUP`: The IP address of the + multicast session. + +- `NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_MULTICAST_PORT`: The UDP port of the + multicast session. + +- `NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_ADDRESS`: The IP address of the + request server. + +- `NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_PORT`: The UDP port of the + request server. + + +Build +----- + +Build the Docker image: + + docker build --tag nassau-soupbintcp-gateway . diff --git a/nassau-soupbintcp-gateway/docker-entrypoint.sh b/nassau-soupbintcp-gateway/docker-entrypoint.sh new file mode 100755 index 0000000..9226a01 --- /dev/null +++ b/nassau-soupbintcp-gateway/docker-entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +cat > /opt/nassau/nassau-soupbintcp-gateway.conf <<-EOF +upstream { + multicast-interface = eth0 + multicast-group = ${NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_MULTICAST_GROUP:-"224.0.0.1"} + multicast-port = ${NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_MULTICAST_PORT:-"5000"} + request-address = ${NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_ADDRESS:-"parity-system"} + request-port = ${NASSAU_SOUPBINTCP_GATEWAY_UPSTREAM_REQUEST_PORT:-"5001"} +} + +downstream { + address = 0.0.0.0 + port = 5000 +} +EOF + +exec /usr/bin/java -jar /opt/nassau/nassau-soupbintcp-gateway.jar /opt/nassau/nassau-soupbintcp-gateway.conf diff --git a/parity-system/Dockerfile b/parity-system/Dockerfile index 834d164..993a004 100644 --- a/parity-system/Dockerfile +++ b/parity-system/Dockerfile @@ -1,30 +1,15 @@ FROM openjdk:8-jre-alpine -RUN apk add --no-cache supervisor - -RUN addgroup -S supervisor && adduser -S -G supervisor supervisor - -RUN mkdir /var/log/supervisor && chown supervisor:supervisor /var/log/supervisor -RUN mkdir /var/run/supervisor && chown supervisor:supervisor /var/run/supervisor - -ENV NASSAU_VERSION "0.10.0" ENV PARITY_VERSION "0.5.0" -ADD https://repo1.maven.org/maven2/com/paritytrading/nassau/nassau-soupbintcp-gateway/$NASSAU_VERSION/nassau-soupbintcp-gateway-$NASSAU_VERSION.jar /opt/nassau/nassau-soupbintcp-gateway.jar ADD https://repo1.maven.org/maven2/com/paritytrading/parity/parity-system/$PARITY_VERSION/parity-system-$PARITY_VERSION.jar /opt/parity/parity-system.jar -RUN chmod 644 /opt/nassau/nassau-soupbintcp-gateway.jar RUN chmod 644 /opt/parity/parity-system.jar COPY docker-entrypoint.sh /docker-entrypoint.sh -COPY supervisord.conf /etc/supervisord.conf - -COPY market-data-gateway.conf /opt/nassau/ -COPY market-reporting-gateway.conf /opt/nassau/ - -EXPOSE 4000 -EXPOSE 5000 -EXPOSE 6000 +EXPOSE 4000/tcp +EXPOSE 5001/udp +EXPOSE 6001/udp ENTRYPOINT [ "/docker-entrypoint.sh" ] diff --git a/parity-system/docker-entrypoint.sh b/parity-system/docker-entrypoint.sh index 3f6a383..26b8804 100755 --- a/parity-system/docker-entrypoint.sh +++ b/parity-system/docker-entrypoint.sh @@ -3,7 +3,7 @@ cat > /opt/parity/parity-system.conf <<-EOF market-data { session = parity - multicast-interface = 127.0.0.1 + multicast-interface = eth0 multicast-group = 224.0.0.1 multicast-port = 5000 request-port = 5001 @@ -11,7 +11,7 @@ market-data { market-report { session = parity - multicast-interface = 127.0.0.1 + multicast-interface = eth0 multicast-group = 224.0.0.1 multicast-port = 6000 request-port = 6001 @@ -25,4 +25,4 @@ order-entry { instruments = [ ${PARITY_SYSTEM_INSTRUMENTS:-"FOO,BAR,BAZ"} ] EOF -exec /usr/bin/supervisord --configuration /etc/supervisord.conf +exec /usr/bin/java -jar /opt/parity/parity-system.jar /opt/parity/parity-system.conf diff --git a/parity-system/market-data-gateway.conf b/parity-system/market-data-gateway.conf deleted file mode 100644 index dd0c330..0000000 --- a/parity-system/market-data-gateway.conf +++ /dev/null @@ -1,12 +0,0 @@ -upstream { - multicast-interface = 127.0.0.1 - multicast-group = 224.0.0.1 - multicast-port = 5000 - request-address = 127.0.0.1 - request-port = 5001 -} - -downstream { - address = 0.0.0.0 - port = 5000 -} diff --git a/parity-system/market-reporting-gateway.conf b/parity-system/market-reporting-gateway.conf deleted file mode 100644 index 2b652a2..0000000 --- a/parity-system/market-reporting-gateway.conf +++ /dev/null @@ -1,12 +0,0 @@ -upstream { - multicast-interface = 127.0.0.1 - multicast-group = 224.0.0.1 - multicast-port = 6000 - request-address = 127.0.0.1 - request-port = 6001 -} - -downstream { - address = 0.0.0.0 - port = 6000 -} diff --git a/parity-system/supervisord.conf b/parity-system/supervisord.conf deleted file mode 100644 index b6b0e90..0000000 --- a/parity-system/supervisord.conf +++ /dev/null @@ -1,17 +0,0 @@ -[supervisord] -user=supervisor -logfile=/var/log/supervisor/supervisor.log -pidfile=/var/run/supervisor/supervisor.pid -nodaemon=true - -[program:market-data-gateway] -directory=/opt/nassau -command=/usr/bin/java -jar nassau-soupbintcp-gateway.jar market-data-gateway.conf - -[program:market-reporting-gateway] -directory=/opt/nassau -command=/usr/bin/java -jar nassau-soupbintcp-gateway.jar market-reporting-gateway.conf - -[program:parity-system] -directory=/opt/parity -command=/usr/bin/java -jar parity-system.jar parity-system.conf