From dbd2056c67acce66734548785151b45b5ccacef1 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Tue, 25 Sep 2018 11:19:05 +0200 Subject: [PATCH] Update README.md, add build.sh, set Central TZ Building is now more straightforward and better documented. To quickly see timezone problems we have set Central timezone for various containers. --- README.md | 29 +++++++++++++--- demo/complex/README.md | 9 +++++ demo/complex/grouper-daemon/Dockerfile | 5 +++ demo/complex/grouper-data/Dockerfile | 5 +++ demo/complex/grouper-ui/Dockerfile | 5 +++ demo/complex/idp/Dockerfile | 5 +++ midpoint/README.md | 10 ++++-- midpoint/build.sh | 34 +++++++++++++++++++ midpoint/midpoint-server/Dockerfile | 6 ++-- .../usr-local-bin/set-timezone.sh | 8 ----- 10 files changed, 99 insertions(+), 17 deletions(-) create mode 100644 demo/complex/README.md create mode 100755 midpoint/build.sh delete mode 100755 midpoint/midpoint-server/container_files/usr-local-bin/set-timezone.sh diff --git a/README.md b/README.md index de94626..99ed843 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,28 @@ -# midPoint_container +[![Build Status](https://jenkins.testbed.tier.internet2.edu/job/docker/job/midPoint_container/job/master/badge/icon)](https://jenkins.testbed.tier.internet2.edu/job/docker/job/midPoint_container/job/master/) -In the [grouper-midpoint](grouper-midpoint) directory there is a [midPoint <-> Grouper integration demo](https://spaces.at.internet2.edu/display/TIERENTREG/midPoint+-+Grouper+integration+demo). +This repository contains sources for TIER-supported images related to [Evolveum midPoint](http://midpoint.evolveum.com). -In the [midpoint](midpoint) directory there is a dockerized version of midPoint suitable for the use within TIER environment. +# Images +- `midpoint` contains the midPoint application along with some TIER-specific components: Apache reverse proxy with optional Shibboleth filter and TIER Beacon. +- `midpoint-mariadb` hosts the default MariaDB database tailored to meet midPoint needs. It can be exchanged for another repository implementation. -Both are in progress. +# Supported tags +These tags apply to both containers: +- latest +- midPoint version-specific tags, e.g. 3.9, 3.9.1, 4.0, etc. + +# Content +- `midpoint` directory contains build instructions for both containers (`midpoint` and `midpoint-mariadb`), +- `demo` directory contains three demonstration scenarios: +-- `shibboleth` to show integration with Shibboleth IdP, +-- `postgresql` to show how to change the repository implementation, +-- `complex` to demonstrate more complex deployment of midPoint in a sample university environment, featuring midPoint along with Grouper, LDAP directory, RabbitMQ, Shibboleth IdP, source and target systems. + +# Build instructions +Please see specific subdirectories: [midpoint](midpoint) and [demo/complex](demo/complex). + +# Documentation +- For the `midpoint` and `midpoint-mariadb` containers themselves please see [Dockerized midPoint](https://spaces.at.internet2.edu/display/MID/Dockerized+midPoint) wiki page. +- For the complex demo please see [midPoint - Grouper integration demo](https://spaces.at.internet2.edu/display/MID/midPoint+-+Grouper+integration+demo) wiki page. + +This is a work in progress. For its current status please see [Status of the work](https://spaces.at.internet2.edu/display/MID/Status+of+the+work). diff --git a/demo/complex/README.md b/demo/complex/README.md new file mode 100644 index 0000000..4d99adf --- /dev/null +++ b/demo/complex/README.md @@ -0,0 +1,9 @@ +This is a demonstration of using midPoint dockerization for TIER environment in a broader context. It is a work in progress. + +# Building and execution +``` +$ ../../midpoint/build.sh +$ docker-compose up --build +``` + +Please see a detailed description [here](https://spaces.at.internet2.edu/display/MID/midPoint+-+Grouper+integration+demo). diff --git a/demo/complex/grouper-daemon/Dockerfile b/demo/complex/grouper-daemon/Dockerfile index f620350..04016b9 100644 --- a/demo/complex/grouper-daemon/Dockerfile +++ b/demo/complex/grouper-daemon/Dockerfile @@ -2,4 +2,9 @@ FROM tier/grouper:latest LABEL author="tier-packaging@internet2.edu " +# JUST FOR TESTING - REMOVE BEFORE RELEASE +RUN rm /etc/localtime \ + && ln -s /usr/share/zoneinfo/US/Central /etc/localtime \ + && date + CMD ["daemon"] diff --git a/demo/complex/grouper-data/Dockerfile b/demo/complex/grouper-data/Dockerfile index 5ca6a12..9ceedec 100644 --- a/demo/complex/grouper-data/Dockerfile +++ b/demo/complex/grouper-data/Dockerfile @@ -37,4 +37,9 @@ RUN (mysqld_safe & ) \ EXPOSE 3306 +# JUST FOR TESTING - REMOVE BEFORE RELEASE +RUN rm /etc/localtime \ + && ln -s /usr/share/zoneinfo/US/Central /etc/localtime \ + && date + CMD mysqld_safe diff --git a/demo/complex/grouper-ui/Dockerfile b/demo/complex/grouper-ui/Dockerfile index 8fec2ae..965cd6f 100644 --- a/demo/complex/grouper-ui/Dockerfile +++ b/demo/complex/grouper-ui/Dockerfile @@ -4,4 +4,9 @@ LABEL author="tier-packaging@internet2.edu " #COPY in custom css, images, etc +# JUST FOR TESTING - REMOVE BEFORE RELEASE +RUN rm /etc/localtime \ + && ln -s /usr/share/zoneinfo/US/Central /etc/localtime \ + && date + CMD ["ui"] diff --git a/demo/complex/idp/Dockerfile b/demo/complex/idp/Dockerfile index 7d0b512..35eb456 100644 --- a/demo/complex/idp/Dockerfile +++ b/demo/complex/idp/Dockerfile @@ -2,4 +2,9 @@ FROM unicon/shibboleth-idp:latest LABEL author="tier-packaging@internet2.edu " +# JUST FOR TESTING - REMOVE BEFORE RELEASE +RUN rm /etc/localtime \ + && ln -s /usr/share/zoneinfo/US/Central /etc/localtime \ + && date + COPY shibboleth-idp/ /opt/shibboleth-idp/ diff --git a/midpoint/README.md b/midpoint/README.md index c796407..511f0a6 100644 --- a/midpoint/README.md +++ b/midpoint/README.md @@ -1,5 +1,9 @@ -# Overview - This is a midPoint dockerization for TIER environment. It is a work in progress. -Please see a detailed description, including installation instructions [here](https://spaces.at.internet2.edu/display/MID/Dockerized+midPoint). +# Building and execution +``` +$ ./build.sh +$ docker-compose up +``` + +Please see a detailed description [here](https://spaces.at.internet2.edu/display/MID/Dockerized+midPoint). diff --git a/midpoint/build.sh b/midpoint/build.sh new file mode 100755 index 0000000..760eea6 --- /dev/null +++ b/midpoint/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +function normalize_path() +{ + # Remove all /./ sequences. + local path=${1//\/.\//\/} + + # Remove dir/.. sequences. + while [[ $path =~ ([^/][^/]*/\.\./) ]] + do + path=${path/${BASH_REMATCH[0]}/} + done + echo $path +} + +cd "$(dirname "$0")" +./download-midpoint +cd midpoint-data +docker build --tag tier/midpoint-mariadb:latest . +cd ../midpoint-server +docker build --tag tier/midpoint:latest . +cd .. +echo "---------------------------------------------------------------------------------------" +echo "The midPoint containers were successfully built. To start them, execute the following:" +echo "" +echo "(for standalone execution)" +echo "" +echo "$ cd" `pwd` +echo "$ docker-compose up" +echo "" +echo "(for complex demo)" +echo "" +echo "$ cd" $(normalize_path `pwd`/../demo/complex) +echo "$ docker-compose up --build" diff --git a/midpoint/midpoint-server/Dockerfile b/midpoint/midpoint-server/Dockerfile index 5f0c06c..e1be60b 100644 --- a/midpoint/midpoint-server/Dockerfile +++ b/midpoint/midpoint-server/Dockerfile @@ -98,8 +98,10 @@ ENV TIER_MAINTAINER=tier # requires MP_VERSION and TIER_xyz variables so we have to execute it here -# TODO JUST FOR TESTING -- REMOVE BEFORE RELEASE -RUN /usr/local/bin/set-timezone.sh +# JUST FOR TESTING - REMOVE BEFORE RELEASE +RUN rm /etc/localtime \ + && ln -s /usr/share/zoneinfo/US/Central /etc/localtime \ + && date RUN /opt/tier/setenv.sh diff --git a/midpoint/midpoint-server/container_files/usr-local-bin/set-timezone.sh b/midpoint/midpoint-server/container_files/usr-local-bin/set-timezone.sh deleted file mode 100755 index 3de53ff..0000000 --- a/midpoint/midpoint-server/container_files/usr-local-bin/set-timezone.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# JUST FOR TESTING - REMOVE BEFORE RELEASE - -rm /etc/localtime -ln -s /usr/share/zoneinfo/Europe/Bratislava /etc/localtime -date -