]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1888068: out-of-the-box Docker to demo Bugzilla (#118)
authorDave Miller <justdave@bugzilla.org>
Sat, 30 Mar 2024 06:18:10 +0000 (02:18 -0400)
committerGitHub <noreply@github.com>
Sat, 30 Mar 2024 06:18:10 +0000 (02:18 -0400)
13 files changed:
.github/workflows/ci.yml
Dockerfile
Dockerfile.bugzilla-slim [moved from Dockerfile.bmo-slim with 100% similarity]
Dockerfile.mysql8 [new file with mode: 0644]
RELEASE_BLOCKERS.md
docker-compose.test-pg.yml
docker-compose.test.yml
docker-compose.yml
docker/gen-bugzilla-perl-slim.sh
docker/mysql/bugzilla-mysql56.cnf [moved from docker/mysql/bmo.cnf with 100% similarity]
docker/mysql/bugzilla-mysql8.cnf [new file with mode: 0644]
docker/run-tests-in-docker.sh
scripts/entrypoint.pl

index b3a6a5ba3e8a497b1ce88c13334fac43dba7c9cd..8ded772fb7a7bb1e0d0b24c894ec47c9cad9455a 100644 (file)
@@ -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
 
index 6c034efb2504d9452119ae3dd292e5a270aa3295..85fdc8a7bc4dae06fbf7f54001a92d5ec4d7d613 100644 (file)
@@ -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
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 (file)
index 0000000..522278d
--- /dev/null
@@ -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/
index faee7503d33f1accc70251653c54a2675c653ddb..79de51634665df81789d8ac11408119fec7f4f87 100644 (file)
@@ -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
index cfa0576fb830ab813402d493a7c91abe25fea681..8a66a7904bbfda6fdabc84d1ea2c5e78308422d2 100644 (file)
@@ -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:
index 7bbedee745ec07c52b40f77cde2d05de515abc90..abe7a3b67c7495b290e26e19697e9e2567f68dab 100644 (file)
@@ -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:
index 5acb0cd194ab09700ba0d5097348df0203649a4b..e8b331305ede647a69f0e672f6de26e467638f3d 100644 (file)
 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:
index 25a4acdc0ba1812c4ebdea3559b125fef31b3ab8..c1d757d79a7e660eebc0a2d525815064825d7535 100644 (file)
@@ -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/bugzilla-mysql8.cnf b/docker/mysql/bugzilla-mysql8.cnf
new file mode 100644 (file)
index 0000000..68cb9a7
--- /dev/null
@@ -0,0 +1,5 @@
+[mysqld]
+max_allowed_packet = 64M
+
+[mysql]
+max_allowed_packet = 64M
index 5a17256d08696b58bdf4146d70cda7e0b39288d2..6bb4d75de9ca53658f2f58e531539f9fbf58c9aa 100644 (file)
@@ -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
index dead761a2b7ad06df0da9715fcdaf0be5bb9e4d5..dc5facf6a2457d305e5788b3f18ec3c0c5a01007 100755 (executable)
@@ -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 <<EOF;
+#########################################
+##                                     ##
+##  Your Bugzilla installation should  ##
+##         now be reachable at:        ##
+##                                     ##
+EOF
+printf "##%s%s%s##\n", ' ' x int((37 - length($BZ_URLBASE)) / 2), $BZ_URLBASE, ' ' x (int((37 - length($BZ_URLBASE)) / 2) + (1 - length($BZ_URLBASE)%2));
+  print <<EOF;
+##                                     ##
+EOF
+printf "##%s%s%s##\n", ' ' x int((37 - length($LOGIN_USER)) / 2), $LOGIN_USER, ' ' x (int((37 - length($LOGIN_USER)) / 2) + (1 - length($LOGIN_USER)%2));
+printf "##%s%s%s##\n", ' ' x int((37 - length($LOGIN_PASS)) / 2), $LOGIN_PASS, ' ' x (int((37 - length($LOGIN_PASS)) / 2) + (1 - length($LOGIN_PASS)%2));
+print <<EOF;
+##                                     ##
+##   user/password only valid if you   ##
+##    haven't already changed them.    ##
+##                                     ##
+#########################################
+EOF
   my $httpd_exit_f = run_cereal_and_httpd('-DACCESS_LOGS');
   assert_httpd()->get;
   exit $httpd_exit_f->get;