Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
changes needed based on logging impl.
John Gasper committed Apr 3, 2018
1 parent 6f9522c commit dad2cb3
Showing 7 changed files with 54 additions and 33 deletions.
6 changes: 3 additions & 3 deletions README.md
@@ -6,7 +6,7 @@ A set of Grouper images that are used during I2/TIER training.
## Full Demo

```
docker run -d -p 80:80 -p 443:443 -p 4443:4443 -p 3306:3306 \
docker run -d -p 80:80 -p 389:389 -p 443:443 -p 3306:3306 -p 4443:4443 \
--name grouper-demo tier/grouper_training_full_demo:latest
```

@@ -15,8 +15,8 @@ Browse to `https://localhost/grouper`
## Exercises

```
docker run -d -p 80:80 -p 443:443 -p 4443:4443 -p 3306:3306 \
--name grouper-demo tier/grouper_training_full_ex###:latest
docker run -d -p 80:80 -p 389:389 -p 443:443 -p 3306:3306 -p 4443:4443 \
--name grouper tier/grouper_training_ex###:latest
```

Browse to `https://localhost/grouper`
10 changes: 5 additions & 5 deletions base/Dockerfile
@@ -8,6 +8,9 @@ LABEL author="tier-packaging@internet2.edu <tier-packaging@internet2.edu>" \
ImageName=$imagename \
ImageOS=centos7

ENV ENV=training \
USERTOKEN=3.2.0_base

RUN yum install -y epel-release \
&& yum install -y mariadb mariadb-server openldap openldap-clients openldap-servers \
&& yum clean all
@@ -73,15 +76,12 @@ COPY container_files/tier-support/* /opt/tier-support/
COPY container_files/tls/host-key.pem /etc/pki/tls/private/
COPY container_files/tls/* /etc/pki/tls/certs/
COPY container_files/ui/* /opt/grouper/grouper.ui/WEB-INF/
COPY container_files/usr-local-bin/* /usr/local/bin/

RUN cp /opt/tier-support/grouper.xml /opt/tier-support/grouper-ws.xml /opt/tomcat/conf/Catalina/localhost/ \
&& . /usr/local/bin/library.sh \
&& prepUI \
&& prepWS \
&& prepDaemon \
&& chown -R tomcat /opt/shibboleth-idp/ \
&& chmod -R 700 /opt/shibboleth-idp/

EXPOSE 389 3306 4443

CMD LD_LIBRARY_PATH=/opt/shibboleth/lib64:$LD_LIBRARY_PATH && exec /usr/bin/supervisord -c /opt/tier-support/supervisord-training.conf
CMD ["grouper"]
39 changes: 24 additions & 15 deletions base/container_files/tier-support/supervisord-training.conf
@@ -1,5 +1,5 @@
[supervisord]
logfile=/dev/fd/1 ; supervisord log file
logfile=/tmp/logsuperd ; supervisord log file
logfile_maxbytes=0 ; maximum size of logfile before rotation
loglevel=error ; info, debug, warn, trace
nodaemon=true ; run supervisord as a daemon
@@ -16,44 +16,53 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix so

[program:httpd]
command=httpd -DFOREGROUND
stderr_logfile = /dev/fd/2
stderr_logfile = /tmp/loghttpd
stderr_logfile_maxbytes=0
stdout_logfile = /dev/fd/1
stdout_logfile = /tmp/loghttpd
stdout_logfile_maxbytes=0
priority=15

[program:shibbolethsp]
user=shibd
command=/usr/sbin/shibd -f -F
stderr_logfile = /dev/fd/2
stderr_logfile = /tmp/logshidb
stderr_logfile_maxbytes=0
stdout_logfile = /dev/fd/1
stdout_logfile = /tmp/logshidb
stdout_logfile_maxbytes=0
priority=15

[program:tomcat]
user=tomcat
command=/opt/tomcat/bin/catalina.sh run
stderr_logfile = /dev/fd/2
command=bash -c "while ! curl -s localhost:3306 > /dev/null; do echo waiting for mysql to start; sleep 3; done; while ! curl -s ldap://localhost:389 > /dev/null; do echo waiting for ldap to start; sleep 3; done; exec /opt/tomcat/bin/catalina.sh run"
stderr_logfile = /tmp/logtomcat
stderr_logfile_maxbytes=0
stdout_logfile = /dev/fd/1
stdout_logfile = /tmp/logtomcat
stdout_logfile_maxbytes=0
priority=300


[program:mysql]
command=/usr/bin/mysqld_safe
stderr_logfile = /dev/fd/2
stderr_logfile = /tmp/lopipe
stderr_logfile_maxbytes=0
stdout_logfile = /dev/fd/1
stdout_logfile = /tmp/logpipe
stdout_logfile_maxbytes=0
priority=10

[program:openldap]
command=/usr/sbin/slapd -h "ldap:/// ldaps:/// ldapi:///" -u ldap
stderr_logfile = /dev/fd/2
stderr_logfile = /tmp/logpipe
stderr_logfile_maxbytes=0
stdout_logfile = /dev/fd/1
stdout_logfile = /tmp/logpipe
stdout_logfile_maxbytes=0
priority=10


[program:grouperDaemon]
command=sh /opt/grouper/grouper.apiBinary/bin/gsh -loader
stderr_logfile = /dev/fd/2
command=bash -c "while ! curl -s localhost:3306 > /dev/null; do echo waiting for mysql to start; sleep 3; done; while ! curl -s ldap://localhost:389 > /dev/null; do echo waiting for ldap to start; sleep 3; done; exec /opt/grouper/grouper.apiBinary/bin/gsh -loader"
environment=GSH_JVMARGS="-DENV=%(ENV_ENV)s -DUSERTOKEN=%(ENV_USERTOKEN)s"
stderr_logfile = /tmp/loggrouper
stderr_logfile_maxbytes=0
stdout_logfile = /dev/fd/1
stdout_logfile = /tmp/loggrouper
stdout_logfile_maxbytes=0
priority=300
16 changes: 16 additions & 0 deletions base/container_files/usr-local-bin/grouper
@@ -0,0 +1,16 @@
#!/bin/bash

rm /tmp/logpipe

. /usr/local/bin/library.sh

prepDaemon
prepUI
prepWS

export LD_LIBRARY_PATH=/opt/shibboleth/lib64:$LD_LIBRARY_PATH

exec /usr/bin/supervisord -c /opt/tier-support/supervisord-training.conf



2 changes: 2 additions & 0 deletions exercise1/Dockerfile
@@ -5,3 +5,5 @@ LABEL author="tier-packaging@internet2.edu <tier-packaging@internet2.edu>" \
ImageType="Grouper Training" \
ImageName=$imagename \
ImageOS=centos7

ENV USERTOKEN=3.2.0_ex1
7 changes: 2 additions & 5 deletions exercise2/Dockerfile
@@ -6,9 +6,6 @@ LABEL author="tier-packaging@internet2.edu <tier-packaging@internet2.edu>" \
ImageName=$imagename \
ImageOS=centos7

COPY container_files/subject.properties /opt/grouper/conf
ENV USERTOKEN=3.2.0_ex2

RUN . /usr/local/bin/library.sh \
&& prepDaemon \
&& prepUI \
&& prepWS
COPY container_files/subject.properties /opt/grouper/conf
7 changes: 2 additions & 5 deletions full-demo/Dockerfile
@@ -6,6 +6,8 @@ LABEL author="tier-packaging@internet2.edu <tier-packaging@internet2.edu>" \
ImageName=$imagename \
ImageOS=centos7

ENV USERTOKEN=3.2.0_full_demo

COPY container_files/demo.gsh /seed-data/
COPY container_files/grouper-loader.properties /opt/grouper/conf/

@@ -19,8 +21,3 @@ RUN (/usr/sbin/slapd -h "ldap:/// ldaps:/// ldapi:///" -u ldap &) \
&& while curl -s ldap://localhost:389 > /dev/null; do echo waiting for ldap to stop; sleep 1; done; \
pkill -u mysql mysqld \
&& while curl -s localhost:3306 > /dev/null; do echo waiting for mysqld to stop; sleep 1; done

RUN . /usr/local/bin/library.sh \
&& prepDaemon \
&& prepUI \
&& prepWS

0 comments on commit dad2cb3

Please sign in to comment.