Skip to content

Commit

Permalink
Adapt demo/complex to new conventions
Browse files Browse the repository at this point in the history
Changes are in the naming of containers and secrets;
some environment variables were changed as well.
  • Loading branch information
mederly committed Oct 3, 2018
1 parent bbf649d commit 0e5b5bd
Show file tree
Hide file tree
Showing 32 changed files with 68 additions and 60 deletions.
9 changes: 5 additions & 4 deletions demo/complex/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ ENV=demo
USERTOKEN=
REPO_DATABASE_TYPE=mariadb
REPO_JDBC_URL=default
REPO_HOST=midpoint-data
REPO_HOST=midpoint_data
REPO_PORT=default
REPO_DATABASE=registry
REPO_USER=registry_user
REPO_MISSING_SCHEMA_ACTION=create
REPO_UPGRADEABLE_SCHEMA_ACTION=stop
REPO_PASSWORD_FILE=/run/secrets/m_database_password.txt
KEYSTORE_PASSWORD_FILE=/run/secrets/m_keystore_password.txt
MEM=2048m
REPO_PASSWORD_FILE=/run/secrets/mp_database_password.txt
MP_KEYSTORE_PASSWORD_FILE=/run/secrets/mp_keystore_password.txt
MP_MEM_MAX=2048m
MP_MEM_INIT=1024m
LOGOUT_URL=https://localhost:8443/Shibboleth.sso/Logout
SSO_HEADER=uid
2 changes: 1 addition & 1 deletion demo/complex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This is a demonstration of using midPoint dockerization for TIER environment in

# Building and execution
```
$ ../../midpoint/build.sh
$ ../../build.sh
$ docker-compose up --build
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ grouperClient.ldap.password =
# url of web service, should include everything up to the first resource to access
# e.g. http://groups.school.edu:8090/grouper-ws/servicesRest
# e.g. https://groups.school.edu/grouper-ws/servicesRest
grouperClient.webService.url = https://grouper-ws/grouper-ws/servicesRest
grouperClient.webService.url = https://grouper_ws/grouper-ws/servicesRest

# kerberos principal used to connect to web service
grouperClient.webService.login = banderson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# e.g. hsqldb (b): jdbc:hsqldb:hsql://localhost:9001/grouper
# e.g. postgres: jdbc:postgresql://localhost:5432/database
# e.g. mssql: jdbc:sqlserver://localhost:3280;databaseName=grouper
hibernate.connection.url = jdbc:mysql://grouper-data:3306/grouper?CharSet=utf8&useUnicode=true&characterEncoding=utf8
hibernate.connection.url = jdbc:mysql://grouper_data:3306/grouper?CharSet=utf8&useUnicode=true&characterEncoding=utf8

hibernate.connection.username = root
# If you are using an empty password, depending upon your version of
Expand Down
104 changes: 55 additions & 49 deletions demo/complex/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
version: "3.3"

services:
grouper-daemon:
build: ./grouper-daemon/
command: bash -c "while ! curl -s grouper-data:3306 > /dev/null; do echo waiting for mysql on grouper-data to start; sleep 3; done; while ! curl -s ldap://directory:389 > /dev/null; do echo waiting for ldap on directory to start; sleep 3; done; exec daemon"
grouper_daemon:
build: ./grouper_daemon/
command: bash -c "while ! curl -s grouper_data:3306 > /dev/null; do echo waiting for mysql on grouper_data to start; sleep 3; done; while ! curl -s ldap://directory:389 > /dev/null; do echo waiting for ldap on directory to start; sleep 3; done; exec daemon"
depends_on:
- grouper-data
- grouper_data
- directory
environment:
- ENV=demo
- ENV
- USERTOKEN
- GROUPER_CLIENT_WEBSERVICE_PASSWORD_FILE=password
- GROUPER_DATABASE_PASSWORD_FILE=/run/secrets/g_database_password.txt
- RABBITMQ_PASSWORD_FILE=/run/secrets/rabbitmq_password.txt
- SUBJECT_SOURCE_LDAP_PASSWORD=password
- USERTOKEN=build-2
networks:
- back
- net
secrets:
- g_database_password.txt
- rabbitmq_password.txt
Expand All @@ -34,21 +34,21 @@ services:
target: /opt/grouper/conf/grouper.client.properties


grouper-ui:
build: ./grouper-ui/
command: bash -c "while ! curl -s grouper-data:3306 > /dev/null; do echo waiting for mysql on grouper-data to start; sleep 3; done; while ! curl -s ldap://directory:389 > /dev/null; do echo waiting for ldap on directory to start; sleep 3; done; exec ui"
grouper_ui:
build: ./grouper_ui/
command: bash -c "while ! curl -s grouper_data:3306 > /dev/null; do echo waiting for mysql on grouper_data to start; sleep 3; done; while ! curl -s ldap://directory:389 > /dev/null; do echo waiting for ldap on directory to start; sleep 3; done; exec ui"
depends_on:
- grouper-data
- grouper_data
- directory
environment:
- ENV=demo
- ENV
- USERTOKEN
- GROUPER_DATABASE_PASSWORD_FILE=/run/secrets/g_database_password.txt
- SUBJECT_SOURCE_LDAP_PASSWORD=password
- USERTOKEN=build-2
networks:
- back
- net
ports:
- "443:443"
- 443:443
secrets:
- g_database_password.txt
- source: grouper.hibernate.properties
Expand Down Expand Up @@ -84,57 +84,60 @@ services:
source: ./configs-and-secrets/grouper/httpd/host-cert.pem
target: /etc/pki/tls/certs/cachain.pem

grouper-data:
build: ./grouper-data/
grouper_data:
build: ./grouper_data/
networks:
- back
- net
ports:
- "3306:3306"
- 3306:3306
volumes:
- grouper_data:/var/lib/mysql

directory:
build: ./directory/
ports:
- "389:389"
- 389:389
networks:
- back
- net
volumes:
- ldap:/var/lib/dirsrv

sources:
build: ./sources/
ports:
- "13306:3306"
- 13306:3306
networks:
- back
- net
volumes:
- source_data:/var/lib/mysql

targets:
build: ./targets/
ports:
- "23306:389"
- 23306:389
networks:
- back
- net
volumes:
- target_data:/var/lib/mysql

midpoint-data:
midpoint_data:
image: tier/mariadb:mariadb10
ports:
- "33306:3306"
- 33306:3306
networks:
- back
- net
volumes:
- midpoint_data:/var/lib/mysql
- midpoint_mysql:/var/lib/mysql
- midpoint_data:/var/lib/mysqlmounted
environment:
- CREATE_NEW_DATABASE=if_needed

midpoint-server:
build: ./midpoint-server/
midpoint_server:
build: ./midpoint_server/
depends_on:
- midpoint-data
- midpoint_data
ports:
- "8443:443"
- 8443:443
environment:
- AUTHENTICATION
- ENV
Expand All @@ -150,18 +153,20 @@ services:
- REPO_UPGRADEABLE_SCHEMA_ACTION
- REPO_SCHEMA_VERSION_IF_MISSING
- REPO_SCHEMA_VARIANT
- KEYSTORE_PASSWORD_FILE
- MEM
- MP_KEYSTORE_PASSWORD_FILE
- MP_MEM_MAX
- MP_MEM_INIT
- MP_JAVA_OPTS
- SSO_HEADER
- LOGOUT_URL
- TIER_BEACON_OPT_OUT
networks:
- back
- net
secrets:
- m_database_password.txt
- m_keystore_password.txt
- m_sp-key.pem
- m_host-key.pem
- mp_database_password.txt
- mp_keystore_password.txt
- mp_sp-key.pem
- mp_host-key.pem
volumes:
- midpoint_home:/opt/midpoint/var
- type: bind
Expand Down Expand Up @@ -189,22 +194,22 @@ services:
- JETTY_BROWSER_SSL_KEYSTORE_PASSWORD=password
- JETTY_BACKCHANNEL_SSL_KEYSTORE_PASSWORD=password
networks:
- back
- net
ports:
- "4443:4443"
- 4443:4443

mq:
image: rabbitmq:management
environment:
- RABBITMQ_NODENAME=docker-rabbit
hostname: rabbitmq
networks:
- back
- net
ports:
- "15672:15672"
- 15672:15672

networks:
back:
net:
driver: bridge

secrets:
Expand All @@ -224,13 +229,13 @@ secrets:
subject.properties:
file: ./configs-and-secrets/grouper/application/subject.properties
# midPoint
m_host-key.pem:
mp_host-key.pem:
file: ./configs-and-secrets/midpoint/httpd/host-key.pem
m_sp-key.pem:
mp_sp-key.pem:
file: ./configs-and-secrets/midpoint/shibboleth/sp-key.pem
m_database_password.txt:
mp_database_password.txt:
file: ./configs-and-secrets/midpoint/application/database_password.txt
m_keystore_password.txt:
mp_keystore_password.txt:
file: ./configs-and-secrets/midpoint/application/keystore_password.txt

volumes:
Expand All @@ -239,4 +244,5 @@ volumes:
target_data:
ldap:
midpoint_data:
midpoint_mysql:
midpoint_home:
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<icfc:configurationProperties
xmlns:icscscriptedsql="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/net.tirasa.connid.bundles.db.scriptedsql/net.tirasa.connid.bundles.db.scriptedsql.ScriptedSQLConnector">
<icscscriptedsql:host>grouper-data</icscscriptedsql:host>
<icscscriptedsql:host>grouper_data</icscscriptedsql:host>
<icscscriptedsql:port>3306</icscscriptedsql:port>
<icscscriptedsql:quoting></icscscriptedsql:quoting>
<icscscriptedsql:user>root</icscscriptedsql:user>
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions demo/complex/tests/main.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ load ../../../library
@test "000 Cleanup before running the tests" {
(cd ../simple ; docker-compose down -v)
(cd ../shibboleth ; docker-compose down -v)
(cd ../postgresql ; docker-compose down -v)
docker-compose down -v
}

@test "010 Initialize and start the composition" {
docker ps -a >> /tmp/log
docker ps
! (docker ps | grep -E "shibboleth_(idp|directory)_1|complex_(midpoint-server|midpoint-data)_1|simple_(midpoint-server|midpoint-data)_1")
! (docker ps | grep -E "shibboleth_(idp|directory)_1|(complex|simple|shibboleth|postgresql)_(midpoint_server|midpoint_data)_1")
cp tests/resources/sql/* sources/container_files/seed-data/
docker-compose up -d --build
}

@test "020 Wait until components are started" {
touch $BATS_TMPDIR/not-started
wait_for_midpoint_start complex_midpoint-server_1 complex_midpoint-data_1
wait_for_midpoint_start complex_midpoint_server_1 complex_midpoint_data_1
wait_for_shibboleth_idp_start complex_idp_1
wait_for_grouper_ui_start complex_grouper-ui_1
wait_for_grouper_ui_start complex_grouper_ui_1
rm $BATS_TMPDIR/not-started
}

Expand Down

0 comments on commit 0e5b5bd

Please sign in to comment.