Skip to content

Commit

Permalink
Merge pull request #10 from OPENDAP/hyrax-1.15.3
Browse files Browse the repository at this point in the history
Hyrax 1.15.3
  • Loading branch information
ndp-opendap authored Feb 26, 2019
2 parents eaf381a + c3b3ed3 commit fce6151
Show file tree
Hide file tree
Showing 40 changed files with 2,848 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Current Version:

**Hyrax-1.15.2** \[libdap-3.20.2 :
besd-3.20.2 :
olfs-1.18.2 :
**Hyrax-1.15.3** \[libdap-3.20.3 :
besd-3.20.3 :
olfs-1.18.3 :
ncWMS-2.2.2\]

## Overview
Expand Down
55 changes: 55 additions & 0 deletions docker_handy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
# Docker Tricks
# Source this file and read it to see what's up.
# And then use the functions on the command line
#


#
# Stop all running containers
#
function dhalt() {
docker stop $(docker ps -aq);
}

#
# Remove all containers
#
function drmc(){
docker rm $(docker ps -aq);
}

#
# Remove all images
#
function drmi(){
docker rmi $(docker images -q);
}

#
# List all containers (only IDs)
#
function dlist(){
docker ps -aq;
}

#
# Interactive Login Shell
#
function dlogin(){
docker exec -ti $1 bash;
}

#
# stop, cleanup container and image, build, run, login interactive shell
#
function dscbrl() {
package=$1;
tag=`echo "${package}" | tr '[:upper:]' '[:lower:]'`
docker container stop ${tag}
docker rm $(docker ps -aq)
docker rmi ${tag}
docker build -t ${tag} ${package}
docker run --name ${tag} -d -p 8080:8080 ${tag}
docker exec -ti ${tag} bash
}
93 changes: 93 additions & 0 deletions hyrax-1.15.3/besd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
###############################################################################################
#
# Dockerfile for besdaemon image
#
#
# Some shell state reference:
# set -f # "set -o noglob" Disable file name generation using metacharacters (globbing).
# set -v # "set -o verbose" Prints shell input lines as they are read.
# set -x # "set -o xtrace" Print command traces before executing command.
# set -e # Exit on error.
#
# In general use "set -e" when running commands that matter and don't use
# it for debugging stuff.
#
# Set one or more individual labels
FROM centos:7

# HYRAX VERSION INFO
ENV HYRAX_VERSION=1.15
ENV LIBDAP_VERSION=3.20.3-1
ENV BES_VERSION=3.20.3-1
ENV RELEASE_DATE=2019-02-25

# RELEASE URLs
# https://www.opendap.org/pub/binary/hyrax-1.15/centos-7.x/libdap-3.20.1-1.el7.x86_64.rpm
# https://www.opendap.org/pub/binary/hyrax-1.15/centos-7.x/bes-3.20.1-1.static.el7.x86_64.rpm

ENV LIBDAP_RPM="https://www.opendap.org/pub/binary/hyrax-${HYRAX_VERSION}/centos-7.x/libdap-${LIBDAP_VERSION}.el7.x86_64.rpm"
ENV BES_RPM="https://www.opendap.org/pub/binary/hyrax-${HYRAX_VERSION}/centos-7.x/bes-${BES_VERSION}.static.el7.x86_64.rpm"

LABEL vendor="OPeNDAP Incorporated"
LABEL org.opendap.besdaemon.version=3.20.3-1
LABEL org.opendap.besdaemon.release-date=2019-02-25
LABEL org.opendap.hyrax.version.is-production="true"

MAINTAINER support@opendap.org

USER root

# Update and install the needful.
RUN set -e \
&& yum -y install which \
&& yum -y update \
&& yum clean all

# Installs the OPeNDAP security public key.
# TODO: We should get this from a well known key-server instead.
RUN echo "Adding OPeNDAP Public Security Key"
ENV OPENDAP_PUBLIC_KEY_FILE="security_at_opendap.org.pub.asc"
ENV OPENDAP_PUBLIC_KEY_URL="https://www.opendap.org/${OPENDAP_PUBLIC_KEY_FILE}"
RUN set -e \
&& curl -s $OPENDAP_PUBLIC_KEY_URL > $OPENDAP_PUBLIC_KEY_FILE \
&& gpg --import $OPENDAP_PUBLIC_KEY_FILE

###############################################################
# Retrieve, verify, and install Libdap
RUN set -e \
&& echo "Retrieving, verifying, and installing libdap. rpm: $LIBDAP_RPM" \
&& curl -s $LIBDAP_RPM > ./libdap.rpm \
&& curl -s $LIBDAP_RPM.sig > ./libdap.rpm.sig \
&& gpg -v --verify ./libdap.rpm.sig ./libdap.rpm \
&& ls -l ./libdap* \
&& yum -y install ./libdap.rpm \
&& rm -f libdap.*


###############################################################
# Retrieve, verify, and install the BES
RUN set -e \
&& echo "Retrieving, verifying, and installing besd. rpm: $BES_RPM" \
&& curl -s ${BES_RPM} > ./bes.rpm \
&& curl -s ${BES_RPM}.sig > ./bes.rpm.sig \
&& gpg -v --verify ./bes.rpm.sig ./bes.rpm \
&& ls -l ./bes* \
&& yum -y install ./bes.rpm \
&& rm -f bes.*

RUN echo "besdaemon is here: "`which besdaemon`

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 10022
EXPOSE 11002

# can't use USER with entrypoint that needs root
# use gosu or, as done, enable bes user write so the entrypoint doe snot need root
RUN chown -R bes /etc/bes
USER root

CMD ["-"]

100 changes: 100 additions & 0 deletions hyrax-1.15.3/besd/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash
# This is the entrypoint.sh file for the besd container.
#
#
# set -f # "set -o noglob" Disable file name generation using metacharacters (globbing).
# set -v # "set -o verbose" Prints shell input lines as they are read.
# set -x # "set -o xtrace" Print command traces before executing command.
# set -e # Exit on error.

#echo "Command line: \"$@\""
echo "############################## BESD ##################################"; >&2
echo "Greetings, I am "`whoami`"."; >&2

if [ $SERVER_HELP_EMAIL ] && [ -n $SERVER_HELP_EMAIL ] ; then
echo "Found exisiting SERVER_HELP_EMAIL: $SERVER_HELP_EMAIL"
else
SERVER_HELP_EMAIL="not_set"
echo "SERVER_HELP_EMAIL is $SERVER_HELP_EMAIL"
fi
if [ $FOLLOW_SYMLINKS ] && [ -n $FOLLOW_SYMLINKS ] ; then
echo "Found exisiting FOLLOW_SYMLINKS: $FOLLOW_SYMLINKS"
else
FOLLOW_SYMLINKS="not_set";
echo "FOLLOW_SYMLINKS is $FOLLOW_SYMLINKS"
fi
debug=false;



debug=false;

while getopts "e:sd" opt; do
case $opt in
e)
#echo "Setting server admin contact email to: $OPTARG" >&2
SERVER_HELP_EMAIL=$OPTARG
;;
s)
#echo "Setting FollowSymLinks to: Yes" >&2
FOLLOW_SYMLINKS="Yes"
;;
d)
debug=true;
echo "Debug is enabled" >&2;
;;
\?)
echo "Invalid option: -$OPTARG" >&2
echo "options: [-e email_address] [-s] [-d] "
echo " -e xxx where xxx is the email address of the admin contact for the server."
echo " -s When present causes the BES to follow symbolic links."
echo " -d Enables debugging output for this script."
exit 2;
;;
esac
done
set -e
# echo "$@"


# modify bes.conf based on environment variables before startup. These are set in
# the Docker file to "not_set" and are overriden by the commandline here
#
if [ $SERVER_HELP_EMAIL != "not_set" ]; then
echo "Setting Admin Contact To: $SERVER_HELP_EMAIL"
sed -i "s/admin.email.address@your.domain.name/$SERVER_HELP_EMAIL/" /etc/bes/bes.conf
fi
if [ $FOLLOW_SYMLINKS != "not_set" ]; then
echo "Setting BES FollowSymLinks to YES."
sed -i "s/^BES.Catalog.catalog.FollowSymLinks=No/BES.Catalog.catalog.FollowSymLinks=Yes/" /etc/bes/bes.conf
fi


# Start the BES daemon process
# /usr/bin/besdaemon -i /usr -c /etc/bes/bes.conf -r /var/run/bes.pid
/usr/bin/besctl start;
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start BES: $status"
exit $status
fi
besd_pid=`ps aux | grep /usr/bin/besdaemon | grep -v grep | awk '{print $2;}' - `;
echo "The besdaemon is UP! pid: $besd_pid";

echo "BES Has Arrived...";

while /bin/true; do
sleep 60
besd_ps=`ps -f $besd_pid`;
BESD_STATUS=$?
if [ $BESD_STATUS -ne 0 ]; then
echo "BESD_STATUS: $BESD_STATUS bes_pid:$bes_pid"
echo "The BES daemon appears to have died! Exiting."
exit -1;
fi
if [ $debug = true ];then
echo "-------------------------------------------------------------------"
date
echo "BESD_STATUS: $BESD_STATUS besd_pid:$besd_pid"
fi
done
43 changes: 43 additions & 0 deletions hyrax-1.15.3/developer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
version: '3'
services:
olfs:
build: ./olfs
build:
context: ./olfs
args:
DEVELOPER_MODE: "true"
USE_NCWMS: "true"
env_file: ${PWD}/local.env
image: olfs:latest
ports:
- "80:8080"
tty: true
volumes:
- ./logs/olfs_tomcat:/usr/local/tomcat/logs
- ./logs:/usr/local/tomcat/webapps/opendap/WEB-INF/conf/logs
# command: -n http://localhost:8080 # This is the publicly accessible host for ncWMS
besd:
build: ./besd
env_file: ${PWD}/local.env
image: besd:latest
ports:
- "10022:10022"
volumes:
- ./logs:/var/log/bes/
# - ./cache:/var/cache/bes # maps the BES cache directory to the local filesystem
# - ./conf:/etc/bes # Maps a local BES configuration directory onto the bes in docker.
# command: -e admin_contact@email.org -s
ncwms:
build:
context: ./ncWMS
args:
DEVELOPER_MODE: "true"
env_file: ${PWD}/local.env
image: ncwms:latest
ports:
- "8080:8080"
tty: true
volumes:
- ./logs/ncwms_tomcat:/usr/local/tomcat/logs
- ./logs/ncwms:/root/.ncWMS2/logs
24 changes: 24 additions & 0 deletions hyrax-1.15.3/hyrax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
version: '3'
services:
olfs:
build: ./olfs
env_file: ${PWD}/local.env
image: olfs:latest
ports:
- "8080:8080"
tty: true
volumes:
- ./logs/olfs_tomcat:/usr/local/tomcat/logs
- ./logs:/usr/local/tomcat/webapps/opendap/WEB-INF/conf/logs
besd:
build: ./besd
env_file: ${PWD}/local.env
image: besd:latest
ports:
- "10022:10022"
volumes:
- ./logs:/var/log/bes/
# - ./cache:/var/cache/bes # maps the BES cache directory to the local filesystem
# - ./conf:/etc/bes # Maps a local BES configuration directory onto the bes in docker.
# command: -e admin_contact@email.org -s
Loading

0 comments on commit fce6151

Please sign in to comment.