Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3 from paritytrading/features/soupbintcp-gateway
Browse files Browse the repository at this point in the history
Add 'nassau-soupbintcp-gateway' module
  • Loading branch information
jvirtanen authored Nov 5, 2016
2 parents d259efd + e61a5a3 commit 0c7b855
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 64 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
16 changes: 14 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
13 changes: 13 additions & 0 deletions nassau-soupbintcp-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
32 changes: 32 additions & 0 deletions nassau-soupbintcp-gateway/README.md
Original file line number Diff line number Diff line change
@@ -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 .
20 changes: 20 additions & 0 deletions nassau-soupbintcp-gateway/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
21 changes: 3 additions & 18 deletions parity-system/Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
6 changes: 3 additions & 3 deletions parity-system/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
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
}
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
Expand All @@ -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
12 changes: 0 additions & 12 deletions parity-system/market-data-gateway.conf

This file was deleted.

12 changes: 0 additions & 12 deletions parity-system/market-reporting-gateway.conf

This file was deleted.

17 changes: 0 additions & 17 deletions parity-system/supervisord.conf

This file was deleted.

0 comments on commit 0c7b855

Please sign in to comment.