Skip to content

Commit

Permalink
Merge pull request #278 from Telecominfraproject/WIFI-13866-remove-rr…
Browse files Browse the repository at this point in the history
…m-dc

Remove rrm, wait for kafka and postgres to be available
  • Loading branch information
carsten989 authored Jul 25, 2024
2 parents 3d791d3 + fd7288f commit 034ed6a
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 216 deletions.
8 changes: 3 additions & 5 deletions docker-compose/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Image tags
COMPOSE_PROJECT_NAME=openwifi

# Image tags
OWGW_TAG=master
OWGWUI_TAG=main
OWSEC_TAG=main
Expand All @@ -8,12 +9,10 @@ OWPROV_TAG=main
OWPROVUI_TAG=main
OWANALYTICS_TAG=main
OWSUB_TAG=main

KAFKA_TAG=2.8.0-debian-10-r43
ZOOKEEPER_TAG=3.8
POSTGRESQL_TAG=15.0
MYSQL_TAG=latest
# NOTE currently OWRRM is only supported in LB installations
#OWRRM_TAG=main

# Microservice root/config directories
OWGW_ROOT=/owgw-data
Expand All @@ -36,4 +35,3 @@ INTERNAL_OWFMS_HOSTNAME=owfms.wlan.local
INTERNAL_OWPROV_HOSTNAME=owprov.wlan.local
INTERNAL_OWANALYTICS_HOSTNAME=owanalytics.wlan.local
INTERNAL_OWSUB_HOSTNAME=owsub.wlan.local
#INTERNAL_OWRRM_HOSTNAME=owrrm.wlan.local
3 changes: 0 additions & 3 deletions docker-compose/.env.letsencrypt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ OWPROV_TAG=main
OWPROVUI_TAG=main
OWANALYTICS_TAG=main
OWSUB_TAG=main
OWRRM_TAG=main
KAFKA_TAG=2.8.0-debian-10-r43
ZOOKEEPER_TAG=3.8
ACMESH_TAG=latest
TRAEFIK_TAG=latest
MYSQL_TAG=latest

# Microservice root/config directories
OWGW_ROOT=/owgw-data
Expand All @@ -39,5 +37,4 @@ INTERNAL_OWPROVUI_HOSTNAME=owprov-ui.wlan.local
INTERNAL_OWANALYTICS_HOSTNAME=owanalytics.wlan.local
INTERNAL_RTTYS_HOSTNAME=rttys.wlan.local
INTERNAL_OWSUB_HOSTNAME=owsub.wlan.local
INTERNAL_OWRRM_HOSTNAME=owrrm.wlan.local
SDKHOSTNAME=
3 changes: 0 additions & 3 deletions docker-compose/.env.selfsigned
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ OWPROV_TAG=main
OWPROVUI_TAG=main
OWANALYTICS_TAG=main
OWSUB_TAG=main
OWRRM_TAG=main
KAFKA_TAG=2.8.0-debian-10-r43
ZOOKEEPER_TAG=3.8
ACMESH_TAG=latest
TRAEFIK_TAG=latest
MYSQL_TAG=latest

# Microservice root/config directories
OWGW_ROOT=/owgw-data
Expand All @@ -38,4 +36,3 @@ INTERNAL_OWPROV_HOSTNAME=owprov.wlan.local
INTERNAL_OWPROVUI_HOSTNAME=owprov-ui.wlan.local
INTERNAL_OWANALYTICS_HOSTNAME=owanalytics.wlan.local
INTERNAL_OWSUB_HOSTNAME=owsub.wlan.local
INTERNAL_OWRRM_HOSTNAME=owrrm.wlan.local
19 changes: 0 additions & 19 deletions docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export FLAGS="-s --cacert <your-wlan-cloud-ucentral-deploy-location>/docker-comp
| `INTERNAL_OWPROV_HOSTNAME` | Set this to your OWProv hostname, for example `owprov.example.com`. |
| `INTERNAL_OWANALYTICS_HOSTNAME` | Set this to your OWAnalytics hostname, for example `owanalytics.example.com`. |
| `INTERNAL_OWSUB_HOSTNAME` | Set this to your OWSub hostname, for example `owsub.example.com`. |
| `INTERNAL_OWRRM_HOSTNAME` | Set this to your OWRRM hostname, for example `owrrm.example.com`. |
### owgw.env
| Variable | Description |
| ---------------------------------------- | ----------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -83,15 +82,6 @@ export FLAGS="-s --cacert <your-wlan-cloud-ucentral-deploy-location>/docker-comp
| ---------------------------------------- | -------------------------------------------------------------------------------------- |
| `SYSTEM_URI_PRIVATE`,`SYSTEM_URI_PUBLIC` | Set this to your OWAnalytics URL, for example `https://owanalytics.example.com:16009`. |
| `SYSTEM_URI_UI` | Set this to your OWProv-UI URL, for example `https://owprov-ui.example.com`. |
### owrrm.env
| Variable | Description |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `SERVICECONFIG_PRIVATEENDPOINT`, `SERVICECONFIG_PUBLICENDPOINT` | Set this to your OWRRM URL, for example https://owrrm.example.com:16789. |
| `DATABASECONFIG_PASSWORD` | Set this to a random and safe password. |
### mysql.env
| Variable | Description |
| ---------------- | ------------------------------------------------------------------------ |
| `MYSQL_PASSWORD` | Set this to the same value as `$DATABASECONFIG_PASSWORD` in `owrrm.env`. |

3. Spin up the deployment with `docker-compose up -d`.
4. Check if the containers are up and running with `docker-compose ps`.
Expand Down Expand Up @@ -218,15 +208,6 @@ For the Let's Encrypt challenge to work you need a public IP address. The hostna
| -------------------- | ----------------------------------------------------------------------------- |
| `SYSTEM_URI_PUBLIC` | Set this to your OWSub URL, for example `https://openwifi.example.com:16006`. |
| `SYSTEM_URI_UI` | Set this to your OWGW-UI URL, for example `https://openwifi.example.com`. |
### owrrm.env
| Variable | Description |
| ---------------------------------------- | ------------------------------- |
| `SERVICECONFIG_PUBLICENDPOINT` | Set this to your OWRRM URL, for example https://openwifi.example.com:16789. |
| `DATABASECONFIG_PASSWORD` | Set this to a random and safe password. |
### mysql.env
| Variable | Description |
| ---------------- | ------------------------------------------------------------------------ |
| `MYSQL_PASSWORD` | Set this to the same value as `$DATABASECONFIG_PASSWORD` in `owrrm.env`. |
### traefik.env
| Variable | Description |
| --------------------------------------------------- | ----------------------------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Parameters:
ExistingHostedZoneId:
Description: |
If you want to create the Route53 record in an existing hosted zone,
please specify the according hosted zone ID.
please specify the according hosted zone ID.
Type: String
# MinLength: 21
# MaxLength: 21
Expand Down Expand Up @@ -235,8 +235,6 @@ Resources:
OWPROV_SYSTEM_URI_PUBLIC: !Sub "https://${SDKHostname}:16005"
OWANALYTICS_SYSTEM_URI_PUBLIC: !Sub "https://${SDKHostname}:16009"
OWSUB_SYSTEM_URI_PUBLIC: !Sub "https://${SDKHostname}:16006"
OWRRM_SERVICECONFIG_PRIVATEENDPOINT: !Sub "http://owrrm.wlan.local:17007"
OWRRM_SERVICECONFIG_PUBLICENDPOINT: !Sub "https://${SDKHostname}:16789"
TRAEFIK_ACME_EMAIL: !Sub "${TraefikAcmeEmail}"
cwd: "~/wlan-cloud-ucentral-deploy/docker-compose"
Properties:
Expand Down Expand Up @@ -293,10 +291,6 @@ Resources:
FromPort: "16009"
ToPort: "16009"
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: "16789"
ToPort: "16789"
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: "5912"
ToPort: "5913"
Expand All @@ -308,7 +302,7 @@ Resources:
CloudSDKHostedZone:
Condition: HasHostedZoneName
Type: AWS::Route53::HostedZone
Properties:
Properties:
Name: !Ref HostedZoneName
CloudSDKRoute53RecordExistingHostedZone:
Condition: CreateRecordInExistingZone
Expand Down
9 changes: 0 additions & 9 deletions docker-compose/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ usage () {
# echo "- OWSUB_SYSTEM_URI_PRIVATE - private URL to be used for OWSub";
echo "- OWSUB_SYSTEM_URI_PUBLIC - public URL to be used for OWSub";
echo;
echo "- OWRRM_SERVICECONFIG_PRIVATEENDPOINT - private URL to be used for OWRRM";
echo "- OWRRM_SERVICECONFIG_PUBLICENDPOINT - public URL to be used for OWRRM";
echo;
echo "Optional environment variables:"
echo "- WEBSOCKET_CERT - Your Digicert-signed websocket certificate"
echo "- WEBSOCKET_KEY - The key to your Digicert-signed websocket certificate"
Expand Down Expand Up @@ -91,9 +88,6 @@ usage () {
## OWSub configuration variables
#[ -z ${OWSUB_SYSTEM_URI_PRIVATE+x} ] && echo "OWSUB_SYSTEM_URI_PRIVATE is unset" && usage && exit 1
[ -z ${OWSUB_SYSTEM_URI_PUBLIC+x} ] && echo "OWSUB_SYSTEM_URI_PUBLIC is unset" && usage && exit 1
## OWRRM configuration variables
[ -z ${OWRRM_SERVICECONFIG_PRIVATEENDPOINT+x} ] && echo "OWRRM_SERVICECONFIG_PRIVATEENDPOINT is unset" && usage && exit 1
[ -z ${OWRRM_SERVICECONFIG_PUBLICENDPOINT+x} ] && echo "OWRRM_SERVICECONFIG_PUBLICENDPOINT is unset" && usage && exit 1

# Search and replace image version tags if set
if [[ ! -z "$OWGW_VERSION" ]]; then
Expand Down Expand Up @@ -181,9 +175,6 @@ sed -i "s~.*SYSTEM_URI_UI=.*~SYSTEM_URI_UI=$SYSTEM_URI_UI~" owanalytics.env
sed -i "s~.*SYSTEM_URI_PUBLIC=.*~SYSTEM_URI_PUBLIC=$OWSUB_SYSTEM_URI_PUBLIC~" owsub.env
sed -i "s~.*SYSTEM_URI_UI=.*~SYSTEM_URI_UI=$SYSTEM_URI_UI~" owsub.env

sed -i "s~.*SERVICECONFIG_PRIVATEENDPOINT=.*~SERVICECONFIG_PRIVATEENDPOINT=$OWRRM_SERVICECONFIG_PRIVATEENDPOINT~" owrrm.env
sed -i "s~.*SERVICECONFIG_PUBLICENDPOINT=.*~SERVICECONFIG_PUBLICENDPOINT=$OWRRM_SERVICECONFIG_PUBLICENDPOINT~" owrrm.env

if [[ ! -z "$TRAEFIK_ACME_EMAIL" ]]; then
sed -i "s~.*TRAEFIK_CERTIFICATESRESOLVERS_OPENWIFI_ACME_EMAIL=.*~TRAEFIK_CERTIFICATESRESOLVERS_OPENWIFI_ACME_EMAIL=$TRAEFIK_ACME_EMAIL~" traefik.env
fi
Expand Down
53 changes: 14 additions & 39 deletions docker-compose/docker-compose.lb.letsencrypt.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

volumes:
owgw_data:
driver: local
Expand All @@ -13,16 +11,12 @@ volumes:
driver: local
owsub_data:
driver: local
owrrm_data:
driver: local
zookeeper_data:
driver: local
zookeeper_datalog:
driver: local
kafka_data:
driver: local
mysql_data:
driver: local
letsencrypt_certs:
driver: local

Expand All @@ -40,7 +34,8 @@ services:
- .env.letsencrypt
- owgw.env
depends_on:
- kafka
init-kafka:
condition: service_completed_successfully
restart: unless-stopped
volumes:
- owgw_data:${OWGW_ROOT}/persist
Expand Down Expand Up @@ -75,7 +70,8 @@ services:
- .env.letsencrypt
- owsec.env
depends_on:
- kafka
init-kafka:
condition: service_completed_successfully
restart: unless-stopped
volumes:
- owsec_data:${OWSEC_ROOT}/persist
Expand All @@ -91,7 +87,8 @@ services:
- .env.letsencrypt
- owfms.env
depends_on:
- kafka
init-kafka:
condition: service_completed_successfully
restart: unless-stopped
volumes:
- owfms_data:${OWFMS_ROOT}/persist
Expand All @@ -107,7 +104,8 @@ services:
- .env.letsencrypt
- owprov.env
depends_on:
- kafka
init-kafka:
condition: service_completed_successfully
restart: unless-stopped
volumes:
- owprov_data:${OWPROV_ROOT}
Expand Down Expand Up @@ -138,7 +136,8 @@ services:
- .env.letsencrypt
- owanalytics.env
depends_on:
- kafka
init-kafka:
condition: service_completed_successfully
restart: unless-stopped
volumes:
- owanalytics_data:${OWANALYTICS_ROOT}
Expand All @@ -154,27 +153,13 @@ services:
- .env.letsencrypt
- owsub.env
depends_on:
- kafka
init-kafka:
condition: service_completed_successfully
restart: unless-stopped
volumes:
- owsub_data:${OWSUB_ROOT}
- ./certs:/${OWSUB_ROOT}/certs

owrrm:
image: "tip-tip-wlan-cloud-ucentral.jfrog.io/owrrm:${OWRRM_TAG}"
networks:
openwifi:
aliases:
- ${INTERNAL_OWRRM_HOSTNAME}
env_file:
- owrrm.env
depends_on:
- mysql
- kafka
restart: unless-stopped
volumes:
- owrrm_data:/owrrm-data

zookeeper:
image: "zookeeper:${ZOOKEEPER_TAG}"
networks:
Expand Down Expand Up @@ -208,23 +193,15 @@ services:
- /bin/sh
- -c
- |
echo "Sleeping to allow kafka to start up..."
sleep 20
echo "Creating all required Kafka topics..."
for topic in $$TOPICS; do
/opt/bitnami/kafka/bin/kafka-topics.sh \
--create --if-not-exists --topic $$topic --replication-factor 1 \
--partitions 1 --bootstrap-server kafka:9092
done && echo "Successfully created Kafka topics, exiting." && exit 0
mysql:
image: "mysql:${MYSQL_TAG}"
networks:
openwifi:
env_file:
- mysql.env
restart: unless-stopped
volumes:
- mysql_data:/var/lib/mysql

traefik:
image: "traefik:${TRAEFIK_TAG}"
networks:
Expand All @@ -241,7 +218,6 @@ services:
- owprov-ui
- owanalytics
- owsub
- owrrm
restart: unless-stopped
volumes:
- "./traefik/openwifi_letsencrypt.yaml:/etc/traefik/openwifi.yaml"
Expand All @@ -268,7 +244,6 @@ services:
- "16006:16006"
- "5912:5912"
- "5913:5913"
- "16789:16789"
- "1812:1812/udp"
- "1813:1813/udp"
- "3799:3799/udp"
Loading

0 comments on commit 034ed6a

Please sign in to comment.