From: Dave Miller Date: Sat, 30 Mar 2024 06:18:10 +0000 (-0400) Subject: Bug 1888068: out-of-the-box Docker to demo Bugzilla (#118) X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=690d0e4fe93c0361ab83602d4db78a6f5cdd4748;p=thirdparty%2Fbugzilla.git Bug 1888068: out-of-the-box Docker to demo Bugzilla (#118) --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3a6a5ba3..8ded772fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 6c034efb2..85fdc8a7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile.bmo-slim b/Dockerfile.bugzilla-slim similarity index 100% rename from Dockerfile.bmo-slim rename to Dockerfile.bugzilla-slim diff --git a/Dockerfile.mysql8 b/Dockerfile.mysql8 new file mode 100644 index 000000000..522278de1 --- /dev/null +++ b/Dockerfile.mysql8 @@ -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/ diff --git a/RELEASE_BLOCKERS.md b/RELEASE_BLOCKERS.md index faee7503d..79de51634 100644 --- a/RELEASE_BLOCKERS.md +++ b/RELEASE_BLOCKERS.md @@ -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 diff --git a/docker-compose.test-pg.yml b/docker-compose.test-pg.yml index cfa0576fb..8a66a7904 100644 --- a/docker-compose.test-pg.yml +++ b/docker-compose.test-pg.yml @@ -5,8 +5,8 @@ version: '3.6' services: - bmo.test: - build: &bmo_build + bugzilla6.test: + build: context: . dockerfile: Dockerfile command: dev_httpd @@ -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 @@ -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 @@ -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 @@ -64,6 +61,3 @@ services: shm_size: '512m' ports: - "5900:5900" - -volumes: - bmo-pg-db: diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 7bbedee74..abe7a3b67 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -5,8 +5,8 @@ version: '3.6' services: - bmo.test: - build: &bmo_build + bugzilla6.test: + build: context: . dockerfile: Dockerfile command: dev_httpd @@ -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 @@ -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 @@ -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 @@ -65,6 +62,3 @@ services: shm_size: '512m' ports: - "5900:5900" - -volumes: - bmo-mysql-db: diff --git a/docker-compose.yml b/docker-compose.yml index 5acb0cd19..e8b331305 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 - BMO_ses_username=ses@mozilla.bugs - 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: @@ -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: diff --git a/docker/gen-bugzilla-perl-slim.sh b/docker/gen-bugzilla-perl-slim.sh index 25a4acdc0..c1d757d79 100644 --- a/docker/gen-bugzilla-perl-slim.sh +++ b/docker/gen-bugzilla-perl-slim.sh @@ -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" diff --git a/docker/mysql/bmo.cnf b/docker/mysql/bugzilla-mysql56.cnf similarity index 100% rename from docker/mysql/bmo.cnf rename to docker/mysql/bugzilla-mysql56.cnf diff --git a/docker/mysql/bugzilla-mysql8.cnf b/docker/mysql/bugzilla-mysql8.cnf new file mode 100644 index 000000000..68cb9a73d --- /dev/null +++ b/docker/mysql/bugzilla-mysql8.cnf @@ -0,0 +1,5 @@ +[mysqld] +max_allowed_packet = 64M + +[mysql] +max_allowed_packet = 64M diff --git a/docker/run-tests-in-docker.sh b/docker/run-tests-in-docker.sh index 5a17256d0..6bb4d75de 100644 --- a/docker/run-tests-in-docker.sh +++ b/docker/run-tests-in-docker.sh @@ -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 diff --git a/scripts/entrypoint.pl b/scripts/entrypoint.pl index dead761a2..dc5facf6a 100755 --- a/scripts/entrypoint.pl +++ b/scripts/entrypoint.pl @@ -38,6 +38,7 @@ BEGIN { use constant CI => $ENV{CI}; my $cmd = shift @ARGV; +print "cmd = $cmd\n"; my $opts = __PACKAGE__->can("opt_$cmd") // sub {@ARGV}; my $func = __PACKAGE__->can("cmd_$cmd") // sub { check_data_dir(); @@ -126,6 +127,31 @@ sub cmd_dev_httpd { ); } + require Bugzilla; + my $answers = Bugzilla->installation_answers($ENV{BZ_ANSWERS_FILE}); + my $BZ_URLBASE = $::ENV{'BMO_urlbase'}; + my $LOGIN_USER = "Admin user: $answers->{'ADMIN_EMAIL'}"; + my $LOGIN_PASS = "Admin password: $answers->{'ADMIN_PASSWORD'}"; + print <get; exit $httpd_exit_f->get;