diff --git a/build-all.sh b/build-all.sh new file mode 100755 index 0000000000000000000000000000000000000000..710e93b205e276879fba49d4ba73404d92bceb25 --- /dev/null +++ b/build-all.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +docker build -t cspp-geo-grb -f cspp_geo_grb/Dockerfile cspp_geo_grb +docker build -t cspp-geo-grb-feeder -f cspp_geo_grb_feeder/Dockerfile cspp_geo_grb_feeder \ No newline at end of file diff --git a/cspp_geo_grb/Dockerfile b/cspp_geo_grb/Dockerfile index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6d51a8ae305e3272d3ef40cd27d0d89f381cf238 100644 --- a/cspp_geo_grb/Dockerfile +++ b/cspp_geo_grb/Dockerfile @@ -0,0 +1,31 @@ +FROM centos:7 + +RUN yum update -y && \ + yum upgrade -y && \ + yum clean all -y + +RUN groupadd -g 600 grb && \ + useradd -r -u 600 -g grb grb && \ + mkdir -p /home/grb && \ + chown grb:grb /home/grb + +USER grb + +RUN cd /home/grb && \ + curl --remote-name-all ftp://ftp.ssec.wisc.edu/pub/CSPP/hidden/GEO/GRB/v1_0/cspp-geo-grb-1.0.14.tar.gz.sha1 \ + ftp://ftp.ssec.wisc.edu/pub/CSPP/hidden/GEO/GRB/v1_0/cspp-geo-grb-1.0.14.tar.gz \ + ftp://ftp.ssec.wisc.edu/pub/CSPP/hidden/GEO/GRB/v1_0/cspp-geo-grb-1.0.23-patch.tar.gz.sha1 \ + ftp://ftp.ssec.wisc.edu/pub/CSPP/hidden/GEO/GRB/v1_0/cspp-geo-grb-1.0.23-patch.tar.gz && \ + sha1sum --check cspp-geo-grb-1.0.14.tar.gz.sha1 && \ + sha1sum --check cspp-geo-grb-1.0.23-patch.tar.gz.sha1 && \ + tar xf cspp-geo-grb-1.0.14.tar.gz && \ + tar xf cspp-geo-grb-1.0.23-patch.tar.gz && \ + rm cspp-geo-grb-*tar.* + +COPY RT-CSPP/jsw/conf/grb-ingestor.conf /home/grb/cspp-geo-grb-1.0/RT-CSPP/jsw/conf/grb-ingestor.conf +COPY grb-wrapper.sh /home/grb/grb-wrapper.sh + +RUN mkdir -p /home/grb/cspp-geo-grb-output +ENV CSPP_GEO_GRB_OUT /home/grb/cspp-geo-grb-output + +CMD ["/home/grb/grb-wrapper.sh"] \ No newline at end of file diff --git a/cspp_geo_grb/RT-CSPP/jsw/conf/grb-ingestor.conf b/cspp_geo_grb/RT-CSPP/jsw/conf/grb-ingestor.conf new file mode 100644 index 0000000000000000000000000000000000000000..93414c8b53b8ab7e60e9b2c28801600829d10534 --- /dev/null +++ b/cspp_geo_grb/RT-CSPP/jsw/conf/grb-ingestor.conf @@ -0,0 +1,162 @@ +#******************************************************************** +# Wrapper Properties - GRB Ingestor, dual channel demod input +#******************************************************************** + +# Working directory. +wrapper.working.dir=../.. + +# Java Application +wrapper.java.command=java + +# Java Main class. This class must implement the WrapperListener interface +# or guarantee that the WrapperManager class is initialized. Helper +# classes are provided to do this for you. See the Integration section +# of the documentation for details. +wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp + +# Java Classpath (include wrapper.jar) Add class path elements as +# needed starting from 1 +wrapper.java.classpath.1=./jsw/lib/wrapper.jar +wrapper.java.classpath.2=./src +wrapper.java.classpath.3=./lib/nsls.jar +wrapper.java.classpath.4=./lib/log4j-1.2.17.jar + +# Java Library Path (location of Wrapper.DLL or libwrapper.so) +wrapper.java.library.path.1=./jsw/lib + +# Java Additional Parameters +# NOTE: Make sure each additional parameter uses a unique, incrementing count +# It is easy to copy-paste, forget to change, and the latter will mask former. + +wrapper.java.additional.1=-server +wrapper.java.additional.2=-Dsetup=./config +wrapper.java.additional.3=-Dconfig=GOES-16-Or-17.xml +wrapper.java.additional.4=-Droot=. + +# This value in seconds, so default gives us a 30 minute timeout +# 30 min recommended by Dan F since he sees APID 0x580 span 20 min +wrapper.java.additional.5=-DMAX_ELAPSED_TIME_PER_BUNDLE=1800 + +# For testing with CADUs from local DOE data sender +# wrapper.java.additional.6=-DsourceIpAddress=localhost +# wrapper.java.additional.7=-DleftPort=5530 +# wrapper.java.additional.8=-DrightPort=5531 + +# A typical configuration for testing with CADUs from quorum demod. +# NOTE: IP is the interface of the ingest machine, not the demod. +# The address below is for sites that configure a separate interface. +# It is a suggestion for consistency, but change this as desired. +wrapper.java.additional.6=-DsourceIpAddress=10.1.1.15 +wrapper.java.additional.7=-DleftPort=50010 +wrapper.java.additional.8=-DrightPort=50020 + +# For testing with full CCSDS packets from Harris simulator +# wrapper.java.additional.6=-DsourceIpAddress=192.168.5.120 +# wrapper.java.additional.7=-DleftPort=50002 +# wrapper.java.additional.8=-DrightPort=50001 + +wrapper.java.additional.9=-Dlog.stdout +wrapper.java.additional.10=-Dsecurity=0 + +# Remove old .ccsds packet bundles after this many minutes + +# Note #1: For real-time systems, try to keep this low, since the high rate of +# accumulation of files (about 150,000 per day) makes the purge method very +# costly as the delay increases. You run risk of dropping packets at some point. + +# Note #2: Setting this to 0 (zero) will completely bypass the purge mechanism +# This is typically used in a testing situation where we want to retain CCSDS +# packet bundles and GRB-R log files for post-test analysis. + +wrapper.java.additional.11=-DpurgeDelay=15 + +# Binary: 0: Do NOT execute GRB-R reconstructors, 1: Do exec GRB-R reconstructors +wrapper.java.additional.12=-DRUN_GRBR=1 + +wrapper.java.additional.13=-XX:+UseConcMarkSweepGC +wrapper.java.additional.14=-Dlog4j.configuration=./config/log4j.conf +# We try to request enough UDP buffer space for 4 seconds of slop +wrapper.java.additional.15=-DDESIRED_UDP_BUF_SIZE=16777216 + +# Unicast or Multicast - default is Unicast +# If using multicast, this must be the valid IP address of the broadcast group +# wrapper.java.additional.16=-DMULTICAST=239.255.123.105 + +# Below line only reserved for profiling at SSEC with JProfiler +# wrapper.java.additional.17=-agentpath:/home/tommyj/jprofiler/bin/linux-x64/libjprofilerti.so=port=8849,nowait + +# Numbers below are our best guess as to peak needs right now +# They are probably on the high side to be safe... +# Initial Java Heap Size (in MB) +wrapper.java.initmemory=4096 + +# Maximum Java Heap Size (in MB) +wrapper.java.maxmemory=4096 + +# Application parameters. Add parameters as needed starting from 1 +wrapper.app.parameter.1=gov.nasa.gsfc.drl.rtstps.server.GRBIngestor +wrapper.app.parameter.2=GRB + +#******************************************************************** +# Wrapper Logging Properties +#******************************************************************** +# Format of output for the console. (See docs for formats) +wrapper.console.format=PM + +# What to do when a Java exception is encountered (Any exception: restart) +wrapper.filter.trigger.1=Exception +wrapper.filter.action.1=RESTART +# below is if you wanted the ingestor to shut down on Exceptions +# wrapper.filter.action.1=SHUTDOWN +wrapper.filter.trigger.2=OutOfMemoryError +wrapper.filter.action.2=RESTART + +# Log Level for console output. (Levels shown below, see docs for details) +# NONE, FATAL, ERROR, STATUS, INFO, or DEBUG +wrapper.console.loglevel=INFO + +# Log file to use for wrapper output logging. +wrapper.logfile=%CSPP_GEO_GRB_LOG%/ingest/grb.log + +# Format of output for the log file. (See docs for formats) +wrapper.logfile.format=PZM + +# Log Level for console output. (Levels shown below, see docs for details) +# NONE, FATAL, ERROR, STATUS, INFO, or DEBUG +wrapper.logfile.loglevel=INFO + +# Maximum size that the log file will be allowed to grow to before +# the log is rolled. Size is specified in bytes. The default value +# of 0, disables log rolling. May abbreviate with the 'k' (kb) or +# 'm' (mb) suffix. For example: 10m = 10 megabytes. +wrapper.logfile.maxsize=100m + +# Maximum number of rolled log files which will be allowed before old +# files are deleted. The default value of 0 implies no limit. +wrapper.logfile.maxfiles=10 + +# Log Level for console output. (Levels shown below, see docs for details) +# NONE, FATAL, ERROR, STATUS, INFO, or DEBUG +wrapper.syslog.loglevel=NONE + +# Try restarting this many times +# This is the only known workaround to never think we hit a restart limit +wrapper.max_failed_invocations=2147483647 + +# request a Thread Dump in the event that the JVM does not exit when requested +wrapper.request_thread_dump_on_failed_jvm_exit=TRUE + +# wait 10 seconds (instead of default 5) between restarts to allow +# OS extra time to reclaim resources. +wrapper.restart.delay=10 + +# wait 45 seconds before deciding JVM is hung up. +wrapper.ping.timeout=45 + +# Restart on all but normal exits (also works around problem where +# wrapper.restart.delay ignored on jvm halts like SIGSEGV) +wrapper.on_exit.default=RESTART + +# TJJ Mar 2017 - below exit value is for any exception which keeps the GRB +# Ingestor from getting off the ground. Need to shutdown and report error +wrapper.on_exit.255=SHUTDOWN \ No newline at end of file diff --git a/cspp_geo_grb/grb-wrapper.sh b/cspp_geo_grb/grb-wrapper.sh new file mode 100755 index 0000000000000000000000000000000000000000..979b5304422c3539b25d5e509b150c0b401d6c6b --- /dev/null +++ b/cspp_geo_grb/grb-wrapper.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +/home/grb/cspp-geo-grb-1.0/cspp-geo-grb.sh start + +while $(/home/grb/cspp-geo-grb-1.0/cspp-geo-grb.sh status &> /dev/null); do + sleep 10 +done \ No newline at end of file diff --git a/cspp_geo_grb_feeder/Dockerfile b/cspp_geo_grb_feeder/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2854fcca16e37f2c674f1f85d8f6905a0f94435d --- /dev/null +++ b/cspp_geo_grb_feeder/Dockerfile @@ -0,0 +1,13 @@ +FROM centos:6 + +RUN yum update -y && \ + yum upgrade -y && \ + yum clean all -y + +RUN yum update -y && \ + yum install nc -y && \ + yum clean all -y + +COPY feed /usr/bin/feed + +CMD ["/usr/bin/feed", "goes16"] diff --git a/cspp_geo_grb_feeder/feed b/cspp_geo_grb_feeder/feed new file mode 100755 index 0000000000000000000000000000000000000000..94e31a3098dedbbeca3216acd096c5494352402c --- /dev/null +++ b/cspp_geo_grb_feeder/feed @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# fanout1 - g16 +# fanout2 - g17 + +# 50010/50020 - raw feed +# 50040/50050 - filter idle frames +# 50060/50070 - filter idle frames and mixed with UCAR + +if [ "$1" == "goes16" ] || [ "$1" == "fanout1" ]; then + FANOUT="fanout1.ssec.wisc.edu" +elif [ "$1" == "goes17" ] || [ "$1" == "fanout2" ]; then + FANOUT="fanout2.ssec.wisc.edu" +else + echo "Unrecognized option: $1" + exit 1 +fi + +while : +do + ( nc -d "$FANOUT" 50070 | dd status=none bs=2k iflag=fullblock | nc -u 10.1.1.15 50020 2>&1 ) & + ( nc -d "$FANOUT" 50060 | dd status=none bs=2k iflag=fullblock | nc -u 10.1.1.15 50010 2>&1 ) & + wait +done \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..b25872801c043ba3a97f9b3fea7bb5214cf14a41 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,43 @@ +version: "3.7" + +services: + + grb-feeder: + image: cspp-geo-grb-feeder + networks: + cspp-geo-grb: + ipv4_address: 10.1.1.10 + depends_on: + - grb + + grb: + image: cspp-geo-grb + networks: + cspp-geo-grb: + ipv4_address: 10.1.1.15 # note: -DsourceIpAddress in grb-ingestor.conf needs to change if this changes + cspp-geo-rabbit: + ipv4_address: 10.0.0.15 + volumes: + - type: "volume" + source: grb + target: /home/grb/cspp-geo-grb-output + +volumes: + grb: + + + +networks: + + cspp-geo-rabbit: + name: cspp-geo-rabbit + ipam: + config: + - subnet: 10.0.0.0/24 + + cspp-geo-grb: + name: cspp-geo-grb + ipam: + config: + - subnet: 10.1.1.0/24 +