Skip to content

Commit

Permalink
Bug 1888068: out-of-the-box Docker to demo Bugzilla (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
justdave authored Mar 30, 2024
1 parent e6cec93 commit 690d0e4
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 110 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@ jobs:
test_sanity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install docker-compose
run: sudo apt update && sudo apt install -y docker-compose
- name: Build the Docker images
run: docker compose -f docker-compose.test.yml build
- name: Run sanity tests
run: docker-compose -f docker-compose.test.yml run --no-deps bmo.test test_sanity t/*.t extensions/*/t/*.t
run: docker compose -f docker-compose.test.yml run --no-deps bugzilla6.test test_sanity t/*.t extensions/*/t/*.t

# test_webservices:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# - name: Install docker-compose
# run: sudo apt update && sudo apt install -y docker-compose
# - name: Build the Docker images
# run: docker compose -f docker-compose.test.yml build
# - name: Run webservice tests
# run: docker-compose -f docker-compose.test.yml run bmo.test test_webservices
# run: docker-compose -f docker-compose.test.yml run bugzilla6.test test_webservices

test_bmo:
test_bugzilla6:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install docker-compose
run: sudo apt update && sudo apt install -y docker-compose
- name: Build the Docker images
run: docker compose -f docker-compose.test.yml build
- name: Run bmo specific tests
run: docker-compose -f docker-compose.test.yml run -e CI=1 bmo.test test_bmo -q -f t/bmo/*.t
run: docker-compose -f docker-compose.test.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

8 changes: 0 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ FROM bugzilla/bugzilla-perl-slim:20240322.1

ENV DEBIAN_FRONTEND noninteractive

ARG CI
ARG CIRCLE_SHA1
ARG CIRCLE_BUILD_URL

ENV CI=${CI}
ENV CIRCLE_BUILD_URL=${CIRCLE_BUILD_URL}
ENV CIRCLE_SHA1=${CIRCLE_SHA1}

ENV LOG4PERL_CONFIG_FILE=log4perl-json.conf

RUN apt-get install -y rsync
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions Dockerfile.mysql8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mysql:8
# We do this because we don't want everything in the docker/mysql folder, just the one
COPY docker/mysql/bugzilla-mysql8.cnf /etc/mysql/conf.d/
2 changes: 2 additions & 0 deletions RELEASE_BLOCKERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ bugzilla.pl sub-commands can be defined in the Bugzilla::App::Cmd::* namespace.
If we release harmony and it has a good (and small!) container, it will look
good.

**[COMPLETED]**

# Documentation

BMO gutted some of upstream's documentation about Bugzilla, so the entirety of
Expand Down
16 changes: 5 additions & 11 deletions docker-compose.test-pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
version: '3.6'

services:
bmo.test:
build: &bmo_build
bugzilla6.test:
build:
context: .
dockerfile: Dockerfile
command: dev_httpd
Expand All @@ -16,7 +16,7 @@ services:
environment:
- 'BMO_inbound_proxies=*'
- BMO_db_driver=pg
- BMO_db_host=bmo.db
- BMO_db_host=bugzilla6.db
- BMO_db_name=bugs
- BMO_db_pass=bugs
- BMO_db_user=bugs
Expand All @@ -30,9 +30,6 @@ services:
- BZ_QA_ANSWERS_FILE=/app/.circleci/checksetup_answers.txt
- BZ_QA_CONF_FILE=/app/.circleci/selenium_test.conf
- BZ_QA_CONFIG=1
- CI=${CI}
- CIRCLE_SHA1=${CIRCLE_SHA1}
- CIRCLE_BUILD_URL=${CIRCLE_BUILD_URL}
- LOCALCONFIG_ENV=1
- LOG4PERL_CONFIG_FILE=log4perl-test.conf
- LOGGING_PORT=5880
Expand All @@ -41,11 +38,11 @@ services:
- TWD_HOST=selenium
- TWD_PORT=4444
depends_on:
- bmo.db
- bugzilla6.db
- memcached
- selenium

bmo.db:
bugzilla6.db:
image: postgres:9.0
tmpfs:
- /tmp
Expand All @@ -64,6 +61,3 @@ services:
shm_size: '512m'
ports:
- "5900:5900"

volumes:
bmo-pg-db:
16 changes: 5 additions & 11 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
version: '3.6'

services:
bmo.test:
build: &bmo_build
bugzilla6.test:
build:
context: .
dockerfile: Dockerfile
command: dev_httpd
Expand All @@ -15,7 +15,7 @@ services:
- /run
environment:
- 'BMO_inbound_proxies=*'
- BMO_db_host=bmo.db
- BMO_db_host=bugzilla6.db
- BMO_db_name=bugs
- BMO_db_pass=bugs
- BMO_db_user=bugs
Expand All @@ -30,9 +30,6 @@ services:
- BZ_QA_ANSWERS_FILE=/app/.github/checksetup_answers.txt
- BZ_QA_CONF_FILE=/app/.github/selenium_test.conf
- BZ_QA_CONFIG=1
- CI=${CI}
- CIRCLE_SHA1=${CIRCLE_SHA1}
- CIRCLE_BUILD_URL=${CIRCLE_BUILD_URL}
- LOCALCONFIG_ENV=1
- LOG4PERL_CONFIG_FILE=log4perl-test.conf
- LOGGING_PORT=5880
Expand All @@ -41,11 +38,11 @@ services:
- TWD_HOST=selenium
- TWD_PORT=4444
depends_on:
- bmo.db
- bugzilla6.db
- memcached
- selenium

bmo.db:
bugzilla6.db:
image: mysql:8
tmpfs:
- /tmp
Expand All @@ -65,6 +62,3 @@ services:
shm_size: '512m'
ports:
- "5900:5900"

volumes:
bmo-mysql-db:
146 changes: 75 additions & 71 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,97 +5,101 @@
version: '3.6'

services:
bmo.test:
build: &bmo_build
bugzilla6.web:
build: &bz_build
context: .
dockerfile: Dockerfile
command: dev_httpd
volumes:
- bmo-data-dir:/app/data
- bugzilla6-data-dir:/app/data
- .:/mnt/sync
tmpfs:
- /tmp
- /run
environment: &bmo_env
environment: &bz_env
- 'BMO_inbound_proxies=*'
- BMO_db_host=bmo.db
- BMO_db_host=bugzilla6.db
- BMO_db_name=bugs
- BMO_db_pass=bugs
- BMO_db_user=bugs
- BMO_db_mysql_ssl_get_pubkey=1
- BMO_memcached_namespace=bugzilla
- BMO_memcached_servers=memcached:11211
- [email protected]
- BMO_ses_password=password123456789!
- BMO_urlbase=http://bmo.test/
- BMO_urlbase=http://127.0.0.1:8000/
- BUGZILLA_ALLOW_INSECURE_HTTP=1
- BZ_ANSWERS_FILE=/app/conf/checksetup_answers.txt
- HTTP_BACKEND=morbo
- LOCALCONFIG_ENV=1
- LOG4PERL_CONFIG_FILE=log4perl-docker.conf
- MOJO_LISTEN=http://*:80
- PORT=80
- MOJO_LISTEN=http://*:8000
- PORT=8000
depends_on:
- bmo.db
- bugzilla6.db
- memcached
- tinyproxy
# - tinyproxy
ports:
- "8000:8000"

bmo.jobqueue:
build: *bmo_build
command: jobqueue
volumes:
- bmo-data-dir:/app/data
tmpfs:
- /tmp
- /run
environment: *bmo_env
restart: always
depends_on:
- bmo.db
- memcached
# bugzilla6.jobqueue:
# build: *bz_build
# command: jobqueue
# volumes:
# - bugzilla6-data-dir:/app/data
# tmpfs:
# - /tmp
# - /run
# environment: *bz_env
# restart: always
# depends_on:
# - bugzilla6.db
# - memcached

bmo.feed:
build: *bmo_build
command:
- perl
- extensions/PhabBugz/bin/phabbugz_feed.pl
- start
- '-d'
- '-f'
volumes:
- bmo-data-dir:/app/data
tmpfs:
- /tmp
- /run
environment: *bmo_env
restart: always
depends_on:
- bmo.db
- memcached
# bugzilla6.feed:
# build: *bz_build
# command:
# - perl
# - extensions/PhabBugz/bin/phabbugz_feed.pl
# - start
# - '-d'
# - '-f'
# volumes:
# - bugzilla6-data-dir:/app/data
# tmpfs:
# - /tmp
# - /run
# environment: *bz_env
# restart: always
# depends_on:
# - bugzilla6.db
# - memcached

bmo.pushd:
build: *bmo_build
command:
- perl
- extensions/Push/bin/bugzilla-pushd.pl
- start
- '-d'
- '-f'
volumes:
- bmo-data-dir:/app/data
tmpfs:
- /tmp
- /run
environment: *bmo_env
restart: always
depends_on:
- bmo.db
- memcached
# bugzilla6.pushd:
# build: *bz_build
# command:
# - perl
# - extensions/Push/bin/bugzilla-pushd.pl
# - start
# - '-d'
# - '-f'
# volumes:
# - bugzilla6-data-dir:/app/data
# tmpfs:
# - /tmp
# - /run
# environment: *bz_env
# restart: always
# depends_on:
# - bugzilla6.db
# - memcached

bmo.db:
image: mysql:8
bugzilla6.db:
build:
context: .
dockerfile: Dockerfile.mysql8
volumes:
- bmo-mysql-db:/var/lib/mysql
- ./docker/mysql:/etc/mysql/conf.d
- bugzilla6-mysql-db:/var/lib/mysql
tmpfs:
- /tmp
logging:
Expand All @@ -109,13 +113,13 @@ services:
memcached:
image: memcached:latest

tinyproxy:
build:
context: docker/tinyproxy
dockerfile: ./Dockerfile
ports:
- "1080:1080"
# tinyproxy:
# build:
# context: docker/tinyproxy
# dockerfile: ./Dockerfile
# ports:
# - "1080:1080"

volumes:
bmo-mysql-db:
bmo-data-dir:
bugzilla6-mysql-db:
bugzilla6-data-dir:
2 changes: 1 addition & 1 deletion docker/gen-bugzilla-perl-slim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ while [ $? == 0 ]; do
((ITER++))
$DOCKER pull bugzilla/bugzilla-perl-slim:${DATE}.${ITER} >/dev/null 2>/dev/null
done
$DOCKER build -t bugzilla/bugzilla-perl-slim:${DATE}.${ITER} -f Dockerfile.bmo-slim .
$DOCKER build -t bugzilla/bugzilla-perl-slim:${DATE}.${ITER} -f Dockerfile.bugzilla-slim .
if [ $? == 0 ]; then
echo
echo "The build appears to have succeeded. Don't forget to change the FROM line"
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions docker/mysql/bugzilla-mysql8.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[mysqld]
max_allowed_packet = 64M

[mysql]
max_allowed_packet = 64M
3 changes: 2 additions & 1 deletion docker/run-tests-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export CIRCLE_SHA1=""
export CIRCLE_BUILD_URL=""
$DOCKER compose -f docker-compose.test.yml build
if [ $? == 0 ]; then
$DOCKER compose -f docker-compose.test.yml run bmo.test test_bmo -q -f t/bmo/*.t
$DOCKER compose -f docker-compose.test.yml run --rm --name bugzilla6.test bugzilla6.test test_bmo -q -f t/bmo/*.t
$DOCKER compose -f docker-compose.test.yml stop
else
echo "docker compose build failed."
fi
Loading

0 comments on commit 690d0e4

Please sign in to comment.