Commit Graph

67 Commits

Author SHA1 Message Date
David Taylor 3715498fc1
Update firefox tar format (#939)
Firefox started distributing `.tar.xz` instead of `.tar.bz2`
2025-02-11 12:11:29 +00:00
Alan Guo Xiang Tan 0d0e1eb1de
Clean up firefox tar file in `discourse/discourse_test` image (#904) 2024-12-27 12:51:33 +08:00
David Taylor 928adfd09f
Suppress pnpm upgrade notices in logs (#866) 2024-09-06 10:28:15 +01:00
David Taylor 87871bc430
Make compatible with pnpm (#854)
Switches behavior based on the presence of `yarn.lock`

See https://github.com/discourse/discourse/pull/28671
2024-09-02 20:55:57 +01:00
Alan Guo Xiang Tan 4c58e2b75b
Switch to debian:bookworm-slim image (#831)
Debian Bullseye is EOL.
2024-08-22 10:57:56 +08:00
Alan Guo Xiang Tan 494e353c2d
Revert "Switch to Chrome for Testing and drop support for Chromium (#824)" (#826)
This reverts commit bdfcc8ad23.

Broke the test build
2024-08-09 11:05:25 +08:00
Alan Guo Xiang Tan bdfcc8ad23
Switch to Chrome for Testing and drop support for Chromium (#824)
We started installing Chromium because there is no linux ARM support
for Chrome yet. However, trying to run tests on Chromium seems to be
extra challenging. For example, upgrading to Debian 12 causes our
Javascript tests to fail on Chromium but not on Chrome.

Chrome for Testing was built specifically for web app testing so let's
follow Google's recommendation.
2024-08-09 09:55:50 +08:00
Alan Guo Xiang Tan 9e253b704c
FIX: Remove `bundle config jobs` (#821)
This fixes a regression introduced in
bbefa1e5f3. Basically, we cannot configure
the default bundle jobs when building the image because the number of
cores used to build the image can be different from the number of cores
on the machine running the image.
2024-08-08 11:23:54 +08:00
Loïc Guitaut 2f14e3d5e3 DEV: Add a default browser for testem in discourse_test
Related to https://github.com/discourse/discourse/pull/26244
2024-03-25 18:04:36 +01:00
Loïc Guitaut 961a4a13ca Add Chromium to our images
Chrome isn’t available for aarch64 yet, but Chromium (which is basically
the same browser without the proprietary bits from Google) is shipped by
Debian. They also ship a Chrome driver compiled for aarch64.

This patch adds Chromium to our images without removing Chrome on
x86_64, allowing a smooth transition to using Chromium only.
2024-03-25 11:20:56 +01:00
Alan Guo Xiang Tan 68d150d372
Revert "Use Chromium instead of Chrome (#782)" (#783)
This reverts commit e6ffa64d9d.

We need to fix the various Chrome assumptions in Discourse core.
2024-03-21 07:46:57 +08:00
Loïc Guitaut e6ffa64d9d
Use Chromium instead of Chrome (#782)
Chrome isn’t available yet for aarch64, but Chromium (which is basically
the same browser without the proprietary bits from Google) is shipped by
Debian. They also ship a Chrome driver compiled for aarch64.

By using Chromium instead of Chrome, we unify how we do things
regardless of the architecture used in the generated image.
2024-03-21 05:48:52 +08:00
Alan Guo Xiang Tan 4bece5f47e
Refactor Github action build workflow to build for both arm64/amd64 (#781)
Why this change?

Now that we can efficiently build Docker images targeted at `linux/arm64`,
we will start to release images for `linux/arm64` in the same way we do
for `linux/amd64` images.

Images released for `linux/amd64` are tagged as follows:

1. discourse/base:2.0.\<datetime\>-slim
2. discourse/base:slim
3. discourse/base:2.0.\<datetime\>
4. discourse/base:release

For `linux/arm64`, the images are tagged as follows:

1. discourse/base:2.0.\<datetime\>-slim-arm64
2. discourse/base:slim-arm64
3. discourse/base:2.0.\<datetime\>-arm64
4. discourse/base:release-arm64
5. discourse/base:aarch64 (For backwards compatibility)

For `linux/arm64`, we unfortunately cannot install chrome because chrome
does not currently release binaries for the arch. Therefore, we install
chromium which chrome is based off and also install the chromedriver
binary for `linux/arm64` released by the electron project.
2024-03-20 06:26:36 +08:00
Alan Guo Xiang Tan e06026b97c
FIX: Install plugin gems in `discourse/discourse_test` image (#758)
Why this change?

In
dec68d780c,
the `plugin:install_all_gems` Rake task was made a noop because the Rake
task itself was flawed and running a Rake task will actually activate
all plugins which installs the required gems in the process. However,
plugins are not automatically activated in the test environment which
this image operates in. As such, we need to set `LOAD_PLUGINS=1` to when
running the `plugin:install_all_gems` Rake task.
2023-11-23 18:12:37 +08:00
Daniel Waterworth 1d43194992
DEV: Switch test container to use exec instead of shell entrypoint (#734)
This allows command line arguments to be passed.
2023-09-11 11:24:21 -05:00
Martin Brennan 2fe72f123b
DEV: Add minio install to test image (#726)
Relies on discourse/discourse#22975 to be merged first;
the minio_runner gem can self-install minio, but it's better to just bake the binaries
into the test image. Just uses the script/install_minio.rb script to use the gem to
install required binaries.

We are adding minio to the core project to run system tests for S3 uploads
using minio as a mock S3 store.
2023-08-30 10:47:32 +10:00
David Taylor 6fd2f37d65
discourse_test: Only apply `ENTRYPOINT` to release image (#663)
The slim images aren't able to run the full `rake docker:test` task, so having it as the entrypoint doesn't make sense. We only want it as the entrypoint on `discourse_test:release`
2023-01-03 17:20:49 +00:00
Jarek Radosz 727dad5c48
DEV: Make wget consistently quiet (#612)
That firefox download is ~1.5k log lines long. 😅
2022-03-15 10:43:10 +01:00
David Taylor 1b2c026c2a
DEV: Provide slim versions of the discourse_test image (#586)
Also moves the discourse_test image to use a multi-stage build
2021-12-14 14:53:20 +00:00
David Taylor ab881fd316
discourse_test: re-use bundled gems from the base file (#587)
By doing `rm -rf .bundle` and `bundle install --standalone`, we were setting up bundle to install gems in `./bundle`. The base file installs gems in `./vendor/bundle`. That means that the test image was ending up with two complete copies of our dependencies.

This commit removes the `--standalone` command, and allows the `./vendor/bundle` artifacts to be re-used in the test image.
2021-12-13 11:56:57 +00:00
Rafael dos Santos Silva 4f29decec9 DEV: Install evergreen Firefox in test image 2021-09-08 14:11:19 -03:00
Rafael dos Santos Silva a627e99b38 DEV: Add firefox for Ember tests
Also removes install of nodejs/yarn since they are already provided
by the base image.
2021-08-20 14:28:52 -03:00
Penar Musaraj c26084b19a
Install libxss1 for the test image, looks like it is needed by Chrome
See also https://github.com/puppeteer/puppeteer/issues/6192
2020-08-30 10:30:20 -04:00
Rafael dos Santos Silva b95ea6f77a Revert "Revert "First pass in moving to debian""
This reverts commit 29204e4158.
2019-08-19 15:17:01 -03:00
Rafael dos Santos Silva 29204e4158 Revert "First pass in moving to debian"
This reverts commit 223b69e775.
2019-08-16 18:03:14 -03:00
Rafael dos Santos Silva 223b69e775 First pass in moving to debian 2019-08-16 14:57:36 -03:00
Penar Musaraj d5d1fb63b8
Include official plugins and install their gems in discourse_test (#431) 2019-06-14 08:40:57 -04:00
Guo Xiang Tan b9175b877b Set the right RAILS_ENV for other base images.
Follow up to c2c7a3d8f3.
2019-05-03 12:52:31 +08:00
Gerhard Schlager ff9ddabe38 Update dependencies (#429)
* Ruby 2.6.3 which has a couple of Unicode improvements

* nginx from 1.5.9 to 1.5.12 (http://nginx.org/en/CHANGES)

* ImageMagick 7.0.8-42 and switch it back to using GitHub, because only the latest release is available on the official site and this regularly breaks our build

* libpng from 1.6.36 to 1.6.37 (security fix)

* gifsicle from 1.91 to 1.92 (http://www.lcdf.org/gifsicle/changes.html)

* Node.js v10, the latest active LTS (https://nodejs.org/en/about/releases/)
2019-04-27 18:08:16 +10:00
Guo Xiang Tan 7087639f3e Run `bundle install` with 4 jobs. 2019-04-20 09:03:41 +08:00
Arpit Jalan 737e653447 Configure Git for `discourse` user 2019-01-29 16:13:25 +05:30
Arpit Jalan 83c157a363 Configure Git in test image (#418) 2019-01-28 12:40:46 +02:00
Gerhard Schlager 2da30c242f Upgrade node to v10 for test and dev
This fixes the following error during image build:

sane@4.0.2: The engine "node" is incompatible with this module. Expected version "6.* || 8.* || >= 10.*". Got "9.11.2"
2019-01-15 17:33:33 +01:00
Guo Xiang Tan 6b67357d82 Add missing dependency for chrome. 2018-03-07 14:10:16 +08:00
Guo Xiang Tan ad75bfac75 Fix permission issues when running smoke test. 2017-12-20 15:17:07 +08:00
Guo Xiang Tan 45ef1e7c19 Install yarn in `discourse_test` image. 2017-12-20 14:37:03 +08:00
Guo Xiang Tan 1eb6826319 Add ability to run JS tests in chrome headless. 2017-12-15 12:24:12 +08:00
Gerhard Schlager 9da5d8abd8 Force installation of bundler
fix for https://github.com/rubygems/rubygems/issues/2058
2017-11-12 01:07:27 +01:00
Guo Xiang Tan dbbc26f9dd Revert "Add google chrome and NPM modules to discourse_test image"
This reverts commit 050a1a6a83.
2017-08-21 15:57:17 +09:00
David Taylor 050a1a6a83 Add google chrome and NPM modules to discourse_test image 2017-08-18 17:42:58 +01:00
Sam 874689153a we have to have a home 2017-07-25 11:46:32 -04:00
Rafael dos Santos Silva 8797fd1653 FEATURE: Customizable FROM on test image 2017-06-21 20:22:42 -03:00
Rafael dos Santos Silva 7e364d47b3 Make auto_build do less, and keep it simple 2017-02-07 23:48:13 -02:00
Rafael dos Santos Silva d288199f66 More work to make automatic build easier 2017-02-01 00:41:39 -02:00
Rafael dos Santos Silva 674468764e Move everything to a complete base image 2017-01-31 13:21:00 -02:00
Rafael dos Santos Silva 0dbab775b0 Bumps image version to 1.3.10 2016-12-28 16:29:13 -02:00
Rafael dos Santos Silva 5369fa7aca Bumps version to 1.3.9 2016-12-06 22:52:33 -02:00
Rafael dos Santos Silva 2aa612fecf Bumps images to 1.3.8 2016-11-16 22:49:19 -02:00
Jared Reisinger 3447089f9e Improve image building (primarily for discourse_dev)
Move "discourse" user and "/var/www" directory creation into base image
so that discourse_dev can build from base image directly instead of
requiring the overhead of the full discourse image.

Remove discourse_fast_switch dependency from discourse_dev, and remove
the ruby 2.2/2.0 logic, as Discourse already appears to require 2.3.0 or
greater.

Remove discourse_dev's independent `postgres.template.yml` and
`redis.template.yml` files, and instead derive them from the top-level
templates directory.  This ensures that the discourse_dev image is
always up-to-date with the discourse main image.

Add password-less "sudo" permissions for the "discourse" user in the
discourse_dev image.  This simplifies (fixes) the "bundle install"
command (and others) as implemented by discourse/bin/docker utilities.

Add image/Makefile so that images can be built even on machines without
Ruby installed.  Logic is replicated from `image/build.rb`, and should
result in equivalent images.  (Perhaps build.rb should be removed?)

Add automation in Makefile to ensure that all Dockerfiles are updated to
match the version number in the Makefile.  (This includes the `/VERSION`
file written into the base image.)

Add image/README.md to describe the images and process.

Update ImageMagick to 6.9.5-9 in the base Dockerfile because 6.9.5-8 is
no longer available. (Perhaps this dependency should be vendored.)

Fix base "boot" failure caused by missing log files on a new instance
(in `base/runit-1.d-00-fix-var-logs`).  Before chowning the log files,
"touch" them to ensure they exist.  This failure previously prevented
the discourse_dev `ensure-database` script from running, which made
development use of discourse_dev very difficult.

Update to version 1.3.7.  (Driven by IMAGE_VERSION in the Makefile.
Mostly, this is to ensure that the next official build of the images
will be *at least* 1.3.7, superseding any previous versions.)
2016-09-20 15:02:31 -07:00
Sam 089e57a231 base image update 2016-09-01 10:18:32 +10:00