Skip to content

Commit

Permalink
MDBF-841 - Evaluate .env file for PROD
Browse files Browse the repository at this point in the history
- MQ_ROUTER_URL for PROD will be the same as DEV, on 8080
- define NGINX_CR_HOST_WG_ADDR . For PROD is hz-bbw5 on 8080. For DEV we should deploy CR on hz-dev-bbm and choose another port (8081) because 8080 is already in use by CrossBar (MQ_ROUTER_URL)
- enable proxy pass to CrossReference in NGINX bb.conf.template and define ENV variable in docker-compose.
  • Loading branch information
RazvanLiviuVarzaru committed Nov 29, 2024
1 parent d2bde09 commit d0614da
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docker-compose/.env
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
TITLE="MariaDB CI"
TITLE_URL=https://github.com/MariaDB/server
BUILDMASTER_URL=https://buildbot.mariadb.org/
CR_HOST_WG_ADDR="hz-bbw5=100.64.100.20"
MQ_ROUTER_URL=ws://localhost:8085/ws
MQ_ROUTER_URL=ws://localhost:8080/ws
MASTER_PACKAGES_DIR="/mnt/autofs/master_packages"
MASTER_CREDENTIALS_DIR="/srv/buildbot/master/master-credential-provider"
GALERA_PACKAGES_DIR="/mnt/autofs/galera_packages"
ARTIFACTS_URL="https://ci.mariadb.org"
NGINX_ARTIFACTS_VHOST="ci.mariadb.org"
NGINX_BUILDBOT_VHOST="buildbot.mariadb.org"
NGINX_CR_HOST_WG_ADDR="100.64.100.20:8080"
ENVIRON="PROD"
BRANCH="main"
MASTER_NONLATENT_DOCKERLIBRARY_WORKER="bb-rhel8-docker"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/.env.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
TITLE="MariaDB CI (DEV)"
TITLE_URL=https://github.com/MariaDB/server
BUILDMASTER_URL=https://buildbot.dev.mariadb.org/
CR_HOST_WG_ADDR="hz-bbw5=127.0.0.1"
BUILDMASTER_WG_IP=100.64.101.1
MQ_ROUTER_URL=ws://127.0.0.1:8080/ws
MASTER_PACKAGES_DIR="/mnt/autofs/master_dev_packages"
Expand All @@ -10,6 +9,7 @@ GALERA_PACKAGES_DIR="/mnt/autofs/galera_dev_packages"
ARTIFACTS_URL="https://ci.dev.mariadb.org"
NGINX_ARTIFACTS_VHOST="ci.dev.mariadb.org"
NGINX_BUILDBOT_VHOST="buildbot.dev.mariadb.org"
NGINX_CR_HOST_WG_ADDR="127.0.0.1:8081"
ENVIRON="DEV"
BRANCH="dev"
MASTER_NONLATENT_DOCKERLIBRARY_WORKER="bb-rhel9-docker"
Expand Down
15 changes: 1 addition & 14 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
environment:
- NGINX_ARTIFACTS_VHOST
- NGINX_BUILDBOT_VHOST
- NGINX_CR_HOST_WG_ADDR
network_mode: host
logging:
driver: journald
Expand All @@ -69,7 +70,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -105,7 +105,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -145,7 +144,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -184,7 +182,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -223,7 +220,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -262,7 +258,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -301,7 +296,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -340,7 +334,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -379,7 +372,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -418,7 +410,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -457,7 +448,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -496,7 +486,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -535,7 +524,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down Expand Up @@ -574,7 +562,6 @@ services:
- BUILDMASTER_URL
- BUILDMASTER_WG_IP
- CONTAINER_REGISTRY_URL
- CR_HOST_WG_ADDR
- ENVIRON
- GALERA_PACKAGES_DIR
- MASTER_CREDENTIALS_DIR
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/generate-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
environment:
- NGINX_ARTIFACTS_VHOST
- NGINX_BUILDBOT_VHOST
- NGINX_CR_HOST_WG_ADDR
network_mode: host
logging:
driver: journald
Expand Down Expand Up @@ -193,7 +194,6 @@ def main(args):
file.write(
start_template.format(
port=master_web_port,
cr_host_wg_addr=env_vars["CR_HOST_WG_ADDR"],
environment="" if args.env == "prod" else "dev_",
)
)
Expand Down
4 changes: 4 additions & 0 deletions docker-compose/nginx/templates/bb.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ server {
alias /srv/cr/static;
}

location /cr/ {
proxy_pass http://${NGINX_CR_HOST_WG_ADDR}
}

# logging
access_log /var/log/nginx/${NGINX_BUILDBOT_VHOST}.access.log;
error_log /var/log/nginx/${NGINX_BUILDBOT_VHOST}.error.log;
Expand Down

0 comments on commit d0614da

Please sign in to comment.