David Taylor [Tue, 14 Jan 2025 16:44:52 +0000 (16:44 +0000)]
Revert "Add nginx config file and support for outlets (#871)" (#912)
This reverts commit
01cbf07622c45106109e6339c8a65e957b6fed5d.
Bianca Nenciu [Tue, 14 Jan 2025 15:56:45 +0000 (17:56 +0200)]
Add nginx config file and support for outlets (#871)
The nginx config file used to be copied from the discourse/discourse
repository, but it has been now moved in this project, closer to the
place where it is used.
The config has several 'include' statements that implement support for
outlets that templates can then use to extend the default configuration
for various features. This is an alternative to the "find & replace"
hacks.
Jarek Radosz [Tue, 14 Jan 2025 13:56:33 +0000 (14:56 +0100)]
Bump default base image to discourse/base:2.0.
20250114-0014
Jarek Radosz [Mon, 13 Jan 2025 13:01:08 +0000 (14:01 +0100)]
FEATURE: Update node to version 22.x (#910)
Alan Guo Xiang Tan [Tue, 7 Jan 2025 06:18:56 +0000 (14:18 +0800)]
DEV: Periodic bump of launcher (#906)
Alan Guo Xiang Tan [Tue, 7 Jan 2025 05:46:53 +0000 (13:46 +0800)]
Bump Redis to 7.0.15 (#907)
Pulls in bug and security fixes since 7.0.7
Alan Guo Xiang Tan [Fri, 27 Dec 2024 04:51:33 +0000 (12:51 +0800)]
Clean up firefox tar file in `discourse/discourse_test` image (#904)
Alan Guo Xiang Tan [Mon, 23 Dec 2024 08:52:19 +0000 (16:52 +0800)]
Remove `git reset --hard` command in web template to reduce layer size (#903)
I noticed that use running `git reset --hard` results in ~133MB being
added to the final layer generated by `launcher bootstrap`. However, I
can not figure out why we would need to run `git reset --hard` at all.
Even if there is a reason to run `git reset --hard`, it should not be
the default. If someone for whatever reason needs to run `git reset
--hard`, they should do so using the `before_code` hook.
To replicate the problem, one can run the following steps:
1. In the `discourse_docker` repository, create a file named `containers/test.yml` with the following contents:
```
base_image: discourse/base:2.0.
20241223-0016
run:
- exec: sudo -H -E -u discourse bash -c "cd /var/www/discourse && git reset --hard"
```
2. Run `./launcher bootstrap test`
3. Run `docker history local_discourse/test` and see that the new layer created by `./launcher bootstrap` is roughly 133MB.
```
IMAGE CREATED CREATED BY SIZE COMMENT
012471f3c5e4 2 minutes ago /bin/bash -c /usr/local/bin/pups --stdin 133MB
```
Alan Guo Xiang Tan [Mon, 23 Dec 2024 08:38:59 +0000 (16:38 +0800)]
Run `npmp prune` and `bundle clean` to clean up unused files (#902)
pnpm packages and bundle gems can add significant size to the Docker
image. Ensure that we clean up those unused files to ensure we don't
add extra diskspace to the final layer when bootstrapping.
Michael Brown [Thu, 19 Dec 2024 20:49:36 +0000 (15:49 -0500)]
Revert "FIX: Set the Host header in the nginx.conf upstream block"
This reverts commit
d8a363b60e92fff3ba2338daa6cdb1b04bff3680.
Support for this was removed in nginx - I was unintentionally testing on an old version
Michael Brown [Thu, 19 Dec 2024 19:53:04 +0000 (14:53 -0500)]
FIX: Set the Host header in the nginx.conf upstream block
Using e.g. `proxy_pass http://discourse` resets the Host header on the upstream
request to `discourse`.
This would break multisites, so we don't want that; the most effetive way to
ensure it's set properly is to `set_header` in the upstream block.
Alan Guo Xiang Tan [Thu, 19 Dec 2024 02:19:13 +0000 (10:19 +0800)]
Revert "Move nginx installation into another build step (#897)" (#899)
This reverts commit
d9633894300a55ab2bc3d35a4b986a11d4bc1fa6.
This broke certain assumptions like the `/etc/nginx` directory
exists.
Alan Guo Xiang Tan [Wed, 18 Dec 2024 01:09:50 +0000 (09:09 +0800)]
Print docker history summary in build actions (#898)
It is useful to know what the size of each layer is after the image has
been built.
Alan Guo Xiang Tan [Tue, 17 Dec 2024 23:07:26 +0000 (07:07 +0800)]
Move nginx installation into another build step (#897)
Avoids polluting the main image with nginx's build dependencies
Alan Guo Xiang Tan [Tue, 17 Dec 2024 06:54:12 +0000 (14:54 +0800)]
Remove updating of rubygems (#896)
This adds an additional layer of 20mb for no reason. We don't need to be
running the latest version of rubygems all the time.
Even if we need to update rubygems, it should be updated in https://github.com/discourse/docker-ruby
Gullumluvl [Tue, 17 Dec 2024 06:02:21 +0000 (07:02 +0100)]
Only parse a single line from lscpu to get the Cpu(s) count. Avoid localization. (#879)
Jeff Wong [Tue, 17 Dec 2024 05:28:54 +0000 (21:28 -0800)]
Imagemagick enable delegate build and disabled using shared libraries (#889)
compiles to a single portable binary
Create a base builder package with compile time dependencies. Create an
imagemagick_builder to build imagemagick.
The base builder can be extended for other builders.
Add imagemagick runtime dependencies to discourse_dependencies image
avoid -dev libs
Statically compile as much as possible with --disable-shared and
--enable-delegate-build flags.
References:
https://stackoverflow.com/questions/
47031789/imagemagick-100-static-build-for-linux
https://www.imagemagick.org/discourse-server/viewtopic.php?t=14259
Add fonts-urw-base35 for NimbusSans-Regular, needed for letter avatar generation
Copy over the resulting magick bin, as well as etc and share files from the
compilation. etc is needed for magick to run, share is not, but contains
translations for errors which Discourse tests are dependent on reading from.
Create symlinks for other magick tooling - imagemagick creates symlink tool
names that Discourse uses. These *could* be dropped if Discourse decided to use
`magick {toolname}` rather than `{toolname}`.
Add nginx compile dependency - building nginx still needs libfreetype6
This was implicitly installed previously. Removing the imagemagick build from
base broke the next nginx build. Add this dependency back in. This dependency
can be removed once we build nginx separately as well.
Alan Guo Xiang Tan [Mon, 16 Dec 2024 23:57:38 +0000 (07:57 +0800)]
DEV: Bump rust version to 1.82.0 (#894)
This is to resolve an error we are seeing in our arm64 dev builds
```
24 49.46 error: package `apple-xar v0.20.0` cannot be built because it requires rustc 1.81 or newer, while the currently active rustc version is 1.75.0
24 49.46 Either upgrade to rustc 1.81 or newer, or use
```
Alan Guo Xiang Tan [Tue, 10 Dec 2024 02:39:20 +0000 (10:39 +0800)]
DEV: Periodic bump of launcher base image (#893)
Pulls in various fixes and updates
Alan Guo Xiang Tan [Tue, 3 Dec 2024 02:51:15 +0000 (10:51 +0800)]
Install `postgresql-client-${PG_MAJOR}` instead of `postgresql-client` (#892)
This ensures that the client tools we installed are compatible with the
version of the Postgres cluster.
Jeff Wong [Tue, 19 Nov 2024 04:37:27 +0000 (20:37 -0800)]
Move source for launcher2 to its own repository. (#890)
Jeff Wong [Wed, 13 Nov 2024 01:54:29 +0000 (17:54 -0800)]
jemalloc build with install_lib_shared libraries (#888)
Only output shared lib libraries, we should not need static libraries
Alan Guo Xiang Tan [Wed, 13 Nov 2024 00:49:34 +0000 (08:49 +0800)]
Bump Ruby to 3.3.6 (#885)
This is a routine update that includes minor bug fixes.
See https://www.ruby-lang.org/en/news/2024/11/05/ruby-3-3-6-released/
Jeff Wong [Mon, 11 Nov 2024 07:10:49 +0000 (23:10 -0800)]
FEATURE: print out compressed image sizes for amd64 (#887)
print out compressed image sizes for amd64 in a build step for PRs. Allows for PRs to be automatically reviewed for space efficiency
Jeff Wong [Fri, 8 Nov 2024 03:41:21 +0000 (19:41 -0800)]
DEV: slim image by dropping building jhead from source, and dropping optipng (#884)
jhead from apt pulls in a ton of packages, and optipng isn't used. Reduces compressed image size by 8MB.
main: 648.38MB
compiling jhead + dropping optipng: 640.14MB
Alan Guo Xiang Tan [Thu, 7 Nov 2024 23:27:55 +0000 (07:27 +0800)]
DEV: Remove cache mounts from image/base Dockerfile (#883)
There are no substantial benefits from using cache mounts here so we
are dropping those mounts.
Jeff Wong [Mon, 4 Nov 2024 18:49:58 +0000 (10:49 -0800)]
DEV: slim image, drop unused packages and use cache mounts (#880)
* DEV: slim image, drop unused packages and use cache mounts
apt using caches for /var/cache/apt, /var/cache/debconf, and var/lib/apt.
Drop autoconf and build-essential from installs, in favor of selective cmake,
g++, pkg-config, and patch packages.
drop apt-get -y upgrade in dockerfile. We should inherit upgrades from base
images. No need to apt-mark hold initscripts now that we're not running `upgrade`
Remove calls to vim as we no longer install vim here. Remove comment for
slimming locales as we have now done so.
merge all apt layers, minimizing amount of --mount arguments in dockerfile
Tealk [Wed, 16 Oct 2024 02:17:43 +0000 (04:17 +0200)]
Fix Warnung: the "listen ... http2" directive is deprecated (#873)
* Fix Warnung: the "listen ... http2" directive is deprecated
Signed-off-by: Tealk <tealk@anzah.email>
* Update templates/web.ssl.template.yml
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
* add on to http2
---------
Signed-off-by: Tealk <tealk@anzah.email>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
Jeff Wong [Tue, 15 Oct 2024 06:19:13 +0000 (15:19 +0900)]
DEV: generate only en_us locales (#855)
install locales-all installs 245MB
Generating common and en_us locales installs 22MB
update locales for postgres templates
`locale-gen $LANG` doesn't seem to actually do anything without updates to
`/etc/locale.gen`. Update the scripts to uncomment $LANG before running `update-locale`.
Jeff Wong [Mon, 30 Sep 2024 12:46:23 +0000 (05:46 -0700)]
DEV: force disable precompile on configure (#876)
Configure option does a precompile, which should forcefully disable
`PRECOMPILE_ON_BOOT` to prevent unnecessary precompile on boot when
`PRECOMPILE_ON_BOOT` env is set in templates.
Alan Guo Xiang Tan [Mon, 9 Sep 2024 12:47:50 +0000 (20:47 +0800)]
Fix the broken build (#870)
Follow-up to
b47bd562cc03961f3208d09c7e00cbbe40b94092
`Error response from daemon: No such image:
discourse/base:2.0.
20240909-1149-arm6`
Alan Guo Xiang Tan [Mon, 9 Sep 2024 11:49:14 +0000 (19:49 +0800)]
Release `discourse/base` images for `discourse/discourse` stable branch (#864)
This commit updates our `build` workflow to push the following manifests
which can be used to run Discourse against the stable branch.
1. discourse/base:2.0.$TIMESTAMP-stable
2. discourse/base:release-stable
Co-authored-by: David Taylor <david@taylorhq.com>
David Taylor [Mon, 9 Sep 2024 10:13:18 +0000 (11:13 +0100)]
Improve node_modules cleanup logic for stable branch (#869)
- makes decision based on current state of directory, instead of `$version`
- cleans up the correct directories
- only cleans up the contents. This is important if node_modules directores are mounted volumes (e.g. in devcontainer)
Jeff Wong [Mon, 9 Sep 2024 06:11:55 +0000 (23:11 -0700)]
DEV: export default base image (#868)
allows default base image to be more portable.
cheungtitus [Mon, 9 Sep 2024 02:09:20 +0000 (10:09 +0800)]
Added support of Linux on Mac with ARM processors (#631)
Co-authored-by: TItus Cheung <cheungtitus@kenrui-group.com>
Jeremy [Fri, 6 Sep 2024 16:10:52 +0000 (00:10 +0800)]
Update Discourse installation support in China (pnpm) (#867)
This commit updates 2 things.
1. Updates the yarn hook to replace the npm mirror before `pnpm install`.
2. Removes the `yarn.lock` patch as pnpm is now used.
After applying these modifications, I successfully installed Discourse on the Tencent Cloud China server. No more network problems.
David Taylor [Fri, 6 Sep 2024 09:28:15 +0000 (10:28 +0100)]
Suppress pnpm upgrade notices in logs (#866)
Alan Guo Xiang Tan [Fri, 6 Sep 2024 07:09:59 +0000 (15:09 +0800)]
Clean up nginx folder after installation. (#865)
Jeff Wong [Thu, 5 Sep 2024 00:08:17 +0000 (17:08 -0700)]
DEV: update golang versions (#863)
update golang versions and bump dependencies
Jeff Wong [Wed, 4 Sep 2024 13:42:02 +0000 (06:42 -0700)]
FEATURE: add an option for custom namespaces (#862)
Add an option to select a targeted namespace, env var DISCOURSE_NAMESPACE
Configure:
Add `source-tag` to select which tag to configure from.
Rename old `tag` option to `target-tag` to differentiate from `source-tag` option
Migrate:
Add `tag` to select which tag to migrate with
Alan Guo Xiang Tan [Wed, 4 Sep 2024 03:35:26 +0000 (11:35 +0800)]
Reduce min docker version to 20.10.0 (#861)
Follow up to
31931deae8fc05b4d4c0ab8489596179f4ae3421
Docker 20.10.0 works for now so be less aggressive in forcing people to
upgrade.
Alan Guo Xiang Tan [Wed, 4 Sep 2024 02:47:58 +0000 (10:47 +0800)]
DEV: Bump minimal Docker version to 24.0.7 (#860)
When running the newer Debian bookworm based images, we are seeing
`(ThreadError) can't create Thread: Operation not permitted` errors when
trying to spawn a thread in Ruby.
A similar issue was reported in https://github.com/docker-library/ruby/issues/429#issuecomment-
1708908819
and the fix here is to upgrade Docker. Either way, we should probably
update because Docker 17 has been EOF for many many years.
Jeff Wong [Tue, 3 Sep 2024 04:12:34 +0000 (21:12 -0700)]
add tmp directory to gitignore (#859)
Jeff Wong [Tue, 3 Sep 2024 01:54:14 +0000 (18:54 -0700)]
FEATURE: add autocomplete (#857)
Jeff Wong [Mon, 2 Sep 2024 22:09:38 +0000 (15:09 -0700)]
FEATURE: add runtime features (#849)
adds commands for: start, run, stop, cleanup, destroy, logs, enter, restart, rebuild -- carrying over existing run commands from launcher1.
Rebuild will also do its best to minimize downtime with the following steps:
* Detect if Discourse is running as a single container or external DB
* Detect if db:migrate is configured to run on container boot
* Build initial container (keeping existing one online)
* Exit running containers if it's a single container (otherwise keeps existing online)
* Run migrations
* Defer migrations if db:migrate is configured to run on container boot
* Run migrations with SKIP_POST_DEPLOYMENT_MIGRATIONS=1 if it's a 2 container setup
* Otherwise, run all migrations
* Destroy the old container (finally stopping the current, if it's still up here)
* Start the new container
* Run post-deploy migrations
* Run migrations with SKIP_POST_DEPLOYMENT_MIGRATIONS=0 if it's a 2 container setup
Jeff Wong [Mon, 2 Sep 2024 20:19:43 +0000 (13:19 -0700)]
DEV: install redis data folder if none exists (#804)
David Taylor [Mon, 2 Sep 2024 19:55:57 +0000 (20:55 +0100)]
Make compatible with pnpm (#854)
Switches behavior based on the presence of `yarn.lock`
See https://github.com/discourse/discourse/pull/28671
Alan Guo Xiang Tan [Mon, 2 Sep 2024 03:49:43 +0000 (11:49 +0800)]
Switch to `discourse/ruby:3.3.4-bookworm-slim` (#853)
Jeff Wong [Sat, 31 Aug 2024 01:05:34 +0000 (18:05 -0700)]
DEV: remove bundle cache (#852)
On the current image this removes ~78MB from the layer
Uncompressed image sizes:
before: 3.3GB
after: 3.23GB
Alan Guo Xiang Tan [Fri, 30 Aug 2024 02:03:17 +0000 (10:03 +0800)]
Remove use of `discourse/base:aarch64` in launcher2 (#851)
Since
fc61b8a850e0a7f8c1ef0852a13d735121b4d862, we started shipping
manifests for the `discourse/base` images so we don't have to
specifically pull the tag for arm64.
Alan Guo Xiang Tan [Fri, 30 Aug 2024 00:39:27 +0000 (08:39 +0800)]
Drop `mac-os` tests for launcher_go (#850)
The runners cost 10 times more and there are no macOS specific tests
which we are running.
Jeff Wong [Thu, 29 Aug 2024 07:59:12 +0000 (00:59 -0700)]
FEATURE: Add workflow for `launcher_go` (#848)
Jeff Wong [Thu, 29 Aug 2024 03:01:28 +0000 (20:01 -0700)]
FEATURE: add migrate and bootstrap commands (#842)
Adds command for migrate only. Adds batch commands for bootstrap (build+migrate+configure)
Jeff Wong [Thu, 29 Aug 2024 02:34:24 +0000 (19:34 -0700)]
DEV: remove oxipng archive in layer (#846)
* DEV: remove oxipng archive in layer
Saves ~52MB for the layer
* DEV: Remove nginx archives
Remove another 1.2MB from image
Alan Guo Xiang Tan [Wed, 28 Aug 2024 17:02:49 +0000 (01:02 +0800)]
DEV: Improve assertions of `cli_build_test.go` (#844)
This commit improves the assertions by testing against the entire
command string and env so that we can be sure of the full command we are
running.
David Taylor [Wed, 28 Aug 2024 09:19:59 +0000 (10:19 +0100)]
Increase timeout for scheduled build job (#845)
Now that base & dev images are built in the same job, we need a little more time
Alan Guo Xiang Tan [Wed, 28 Aug 2024 06:20:17 +0000 (14:20 +0800)]
DEV: Minor readability improvements to launcher2 (#843)
Jeff Wong [Wed, 28 Aug 2024 05:13:39 +0000 (22:13 -0700)]
FEATURE: add configure command (#841)
Add 'configure' command - If run after the "build" command, this is equivalent to today's 'bootstrap' command.
Note that unlike build command, a docker run+commit pattern needs to be used here as this requires a running database + mounted volumes.
Jeff Wong [Mon, 26 Aug 2024 19:36:41 +0000 (12:36 -0700)]
[WIP] Launcher2 (#791)
Partial merge of Launcher2's CLI
* FEATURE: merge launcher2 - build command
merge launcher2, only build commands
Alan Guo Xiang Tan [Mon, 26 Aug 2024 07:05:20 +0000 (15:05 +0800)]
Fix timeout for arm64 builds not correctly set (#839)
Alan Guo Xiang Tan [Mon, 26 Aug 2024 05:22:33 +0000 (13:22 +0800)]
Base image in launcher (#838)
This pulls in the Nginx 1.26.1 update, Ruby 3.3.4 update and Debian
bookworm update.
David Taylor [Mon, 26 Aug 2024 05:10:28 +0000 (06:10 +0100)]
DEV: Introduce arm64 dev image and multi-arch manifests (#829)
- Combines dev image build into the `base` job
- Calculates a single timestamp for all builds
- Pushes timestamped per-arch images to Dockerhub for base, base-slim and dev images
- If both arch build jobs are successful, multiarch manifests are generated & pushed
David Taylor [Thu, 22 Aug 2024 10:09:50 +0000 (11:09 +0100)]
Update GitHub actions runners to ubuntu-22.04 (#837)
Alan Guo Xiang Tan [Thu, 22 Aug 2024 04:25:15 +0000 (12:25 +0800)]
Bump Ruby to 3.3.4 (#836)
Ruby 3.3.4 has fixes for some regressions in 3.3.3. I don't think it
affects us but still good to upgrade.
Alan Guo Xiang Tan [Thu, 22 Aug 2024 02:57:56 +0000 (10:57 +0800)]
Switch to debian:bookworm-slim image (#831)
Debian Bullseye is EOL.
Alan Guo Xiang Tan [Thu, 22 Aug 2024 02:57:29 +0000 (10:57 +0800)]
Ensure uid, gid for postgres, redis and discourse stays consistent (#835)
When updating to `debian/base:bookworm` from `debian/base:bullseye`, we
noticed that the uid of the `postgres` and `redis` user changed leading
to permission issues when trying to access directories of mounted volumn
which was previously created with the old uid. The change is because the
`_apt` user is assigned a uid of `42` in Debian bookworm instead of `100`
in Debian bullseye. As a result, the `postgres` user created by the `postgres`
package is automatically assigned a uid of `100` in Debian bookworm instead of `101` in Debian
bullseye.
This commit updates the `slim.Dockefile` to manually add the `postgres`
user and group assigning it a gid of `104` and uid of `101`. The `redis`
user and group is assigned a uid of `103` and a gid of `106`. The
`discourse` user and group is assigned a uid of `1000` and gid of
`1000`.
David Taylor [Tue, 20 Aug 2024 13:51:32 +0000 (14:51 +0100)]
Warmup yarn and bundle caches in dev image (#832)
Uses a multi-stage build with bind mount to avoid adding the discourse repo itself to the layers
David Taylor [Tue, 20 Aug 2024 13:51:14 +0000 (14:51 +0100)]
dev: add user-installed gems to PATH (#833)
This is important for usability of things like discourse_theme, and editor tooling (e.g. ruby-lsp)
David Taylor [Tue, 20 Aug 2024 12:44:25 +0000 (13:44 +0100)]
Use flaky-test-retry system (#834)
We use this on the main core repository, so it makes sense to use it here as well. It should reduce the overall flakiness of the discourse_docker build.
David Taylor [Mon, 19 Aug 2024 15:44:23 +0000 (16:44 +0100)]
DEV: Simplify discourse_dev postgres setup (#830)
- Remove manual database creation, and instead promote discourse user to postgres SUPERUSER. This means that `db:drop` and `db:create` commands can be run in the dev image, just like in other local development environments. As well as simplifying things, it fixes turbo_rspec, which was previously impossible in the docker dev environment (because `discourse` didn't have permissions to create the parallel databases)
- Stop pre-migrating test database in dev image. It adds additional build time & image size, and doesn't actually help because core's `bin/docker/boot_dev` script overwrites the container's postgres directory with a volume mount
Alan Guo Xiang Tan [Mon, 19 Aug 2024 01:19:54 +0000 (09:19 +0800)]
Upgrade nginx to 1.26.1 since it is the new stable version (#827)
Since 1.26.x has been marked stable, 1.25.x is automatically EOL as
nginx only maintains one mainline version and one stable version.
Pablo Ganuza Vidal [Sun, 18 Aug 2024 22:39:29 +0000 (00:39 +0200)]
Fix verification of ports (#818)
nc needs -p to publish verification code correctly, at least in Debian 12
Derek J. Lambert [Sun, 18 Aug 2024 22:35:56 +0000 (17:35 -0500)]
FIX: Broken config and variable handling in setup script (#693)
* FIX: Variable isn't being set
* DEV: Goodbye tabs, they're probably feeling lonely anyway
* FIX: Variable is never used. No need for command substitution
* FIX: The likelihood of knowing the PID for the script before execution is exceptionally low
Jay Pfaffman [Sun, 18 Aug 2024 22:31:55 +0000 (15:31 -0700)]
bash tab completion for launcher + discourse-setup (#676)
add tab completion for launcher and discourse-setup.
For launcher, offers command (e.g., rebuild, start) and then offers yml files from containers directory. After that switches (e.g., --run-image) are offered. (Will not offer switches except in final position, sorry.)
discourse-setup offers switches (e.g., --two-container).
discourse-docter has no command line arguments.
Jeff Wong [Mon, 12 Aug 2024 14:43:26 +0000 (07:43 -0700)]
DEV: allow multiple configure runs (#828)
when we have already run an initial setup, fall back to just checking for
socket, rather than outright failing if the init script has already been run.
This allows 'configure' steps to be re-run in standalone cases.
eg: `launcher2 configure app && launcher2 configure app`
current version: fails as it's missing the install_postgres file
with PR: checks for psql socket, and builds.
doing something like `launcher2 start app && launcher2 configure app` would also
print out a more correct error message, "postgres already running stop container"
Rafael dos Santos Silva [Fri, 9 Aug 2024 14:16:38 +0000 (11:16 -0300)]
Update pgvector to 0.7 (#825)
* Update pgvector to 0.7
* escape
* drop version
Alan Guo Xiang Tan [Fri, 9 Aug 2024 03:05:25 +0000 (11:05 +0800)]
Revert "Switch to Chrome for Testing and drop support for Chromium (#824)" (#826)
This reverts commit
bdfcc8ad23d9c8a6754de083e9930caa8837d106.
Broke the test build
Alan Guo Xiang Tan [Fri, 9 Aug 2024 01:55:50 +0000 (09:55 +0800)]
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.
Alan Guo Xiang Tan [Thu, 8 Aug 2024 08:29:53 +0000 (16:29 +0800)]
Build `discourse/base` and `discourse/discourse_test` image for bookworm (#823)
We need to upgrade to bookworm because bullseye is EOL. This commit when merged into branch will push the following images to Docker hub:
1. `discourse/base:slim-bookworm`
2. `discourse/base:release-bookworm`
3. `discourse/discourse_test:slim-bookworm`
4. `discourse/discourse_test:slim-browsers-bookworm`
5. `discourse/discourse_test:release-bookworm`
Alan Guo Xiang Tan [Thu, 8 Aug 2024 03:23:54 +0000 (11:23 +0800)]
FIX: Remove `bundle config jobs` (#821)
This fixes a regression introduced in
bbefa1e5f387bcad0fac79fea00b39f15f6dee4e. 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.
David Taylor [Wed, 7 Aug 2024 13:13:50 +0000 (14:13 +0100)]
Increase `yarn` network-timeout from 30s to 60s (#820)
A number of people have reported hitting yarn timeouts on low-spec DO droplets, which causes the build to fail. This should provide a little more leeway
Alan Guo Xiang Tan [Wed, 31 Jul 2024 04:04:14 +0000 (12:04 +0800)]
FIX: Use `sharedscripts` in `/etc/logrotate.d/rails` (#819)
This commit adds `sharedscripts` which will ensure that our `postrotate`
script is only ran once even if multiple log files in the `/shared/log/rails/`
are rotated. If `sharedscripts` is not specified, we are sending `sv 1
unicorn` once per log file rotated and this has resulted in weird
behaviours like our Sidekiq process hanging indefinitely.
Note the following from the manpage for logrotate:
```
sharedscripts
Normally, prerotate and postrotate scripts are run for each log which is rotated and the absolute path to the log file is passed as first argument to the script. That means a single script may be run multiple times for log file entries which match multiple files (such as the /var/log/news/* example). If sharedscripts is specified, the scripts are only run once, no matter how many logs match the wildcarded pattern, and whole pattern is passed to them.
```
Juan David Martínez Cubillos [Tue, 30 Jul 2024 15:11:11 +0000 (17:11 +0200)]
DEV: Updated vanilla.template.yml (#817)
* DEV: Updated vanilla.template.yml
* updated vanilla.template.yml to make the migration process more straight forward
* removed branch pull
* implemented suggested changes
* added suggested chantes
* added before_code hook to set remote fork
* updated with suggested changes
Alan Guo Xiang Tan [Wed, 10 Jul 2024 23:28:47 +0000 (07:28 +0800)]
DEV: Remove useless lines from `web.template.yml` (#816)
The lines are not necessary because those config has already been set in
when we are building the image.
Alan Guo Xiang Tan [Wed, 10 Jul 2024 02:46:30 +0000 (10:46 +0800)]
Bump timeout for arm64 scheduled builds to 60 mins. (#815)
We are hitting timeouts at 45mins.
Alan Guo Xiang Tan [Tue, 9 Jul 2024 02:06:19 +0000 (10:06 +0800)]
Bump base image used by launcher to pull in Ruby 3.3.3 (#813)
Kelv [Mon, 8 Jul 2024 09:34:01 +0000 (17:34 +0800)]
DEV: update to use IM7 syntax magick in validation command (#814)
Rafael dos Santos Silva [Tue, 25 Jun 2024 14:41:23 +0000 (11:41 -0300)]
DEV: Add poppler-utils for PDF -> text handling (#812)
Rafael dos Santos Silva [Mon, 24 Jun 2024 16:24:15 +0000 (13:24 -0300)]
DEV: Allow ImageMagick to handle PDFs. (#811)
Alan Guo Xiang Tan [Fri, 14 Jun 2024 00:19:55 +0000 (08:19 +0800)]
DEV: Bump Ruby to 3.3.3 (#807)
Pulls in some bugfixes which may or may not be affecting us.
Alan Guo Xiang Tan [Mon, 3 Jun 2024 02:33:29 +0000 (10:33 +0800)]
FEATURE: Bump base image used by launcher to pull in Ruby 3.3.x take 2 (#805)
First attempt in
01ce8cf8f935bf8aeb3d96a7b124ba33a612c07d was reverted
because our new base image was not compatible with the stable branch of
discourse/discourse.
Alan Guo Xiang Tan [Thu, 30 May 2024 22:31:15 +0000 (06:31 +0800)]
Bump Ruby to 3.3.2 (#806)
Pulls in lots of bug fixes: https://github.com/ruby/ruby/releases/tag/v3_3_2
David Taylor [Mon, 20 May 2024 11:10:53 +0000 (12:10 +0100)]
Revert "FEATURE: Bump base image used by launcher to pull in Ruby 3.3.1 (#802)" (#803)
This reverts commit
01ce8cf8f935bf8aeb3d96a7b124ba33a612c07d.
We are investigating incompatibilities with Discourse stable.
Alan Guo Xiang Tan [Mon, 20 May 2024 02:52:34 +0000 (10:52 +0800)]
FEATURE: Bump base image used by launcher to pull in Ruby 3.3.1 (#802)
Alan Guo Xiang Tan [Mon, 20 May 2024 01:09:12 +0000 (09:09 +0800)]
FEATURE: Bump Ruby to 3.3.1 (#801)
Bumping Ruby to 3.3.1 to pull in latest performance and memory
improvements made to YJIT. On Discourse hosting services with Ruby 3.3.1
+ YJIT, we saw an
estimate 10-20% improvement in time spent executing Ruby code over Ruby
3.2.3 + YJIT.
Alan Guo Xiang Tan [Thu, 9 May 2024 07:40:01 +0000 (15:40 +0800)]
FEATURE: Update `discourse-setup` to prompt for MaxMind account ID (#796)
In order to download the free MaxMind GeoLite2 databases, an account ID
and license key is required going forward. This commit updates
`discourse-setup` to start prompting the user to provide the MaxMind
Account ID first before asking for the MaxMind license key. If the user
does not provide the Account ID, the script will not prompt for the
license key as we assume the user has opted out.
We are aware that we don't have a reliable way to test for changes to
the `discourse-setup` script but it is what it is at this point in time.
We intend to invest resources in improving things in the future but now
is not the time.
Jay Pfaffman [Thu, 9 May 2024 07:19:54 +0000 (02:19 -0500)]
Update discourse-setup (#799)
DEV: `./launcher stop` needs to be skipped when in debug mode
Alan Guo Xiang Tan [Tue, 7 May 2024 05:29:45 +0000 (13:29 +0800)]
DEV: Build/release `discourse/base:release-ruby-3.3.1` for testing (#800)
This commit adds a `ruby_3_3` job to our Github workflow which releases
a `discourse/base:release-ruby-3.3.1` Docker image to allow us to test
Ruby 3.3.1 before eventually changing to that version as the default.
耗子 [Mon, 6 May 2024 05:47:35 +0000 (13:47 +0800)]
FEATURE: Fix Discourse installation support in China (#793)
This commit does 2 things:
1. Added a new yarn hook to replace the npm mirror before `yarn install`.
2. Modified `web.china.template.yml` to add more mirror sources.
Below is an explanation of these modifications:
- The GitHub proxy added in `web.china.template.yml` has existed in China for many years, and its repository https://github.com/hunshcn/gh-proxy has 6k+ stars, which can ensure its security and stability.
- The NPM mirror site added in `web.china.template.yml` is maintained by Alibaba Group, one of the largest Internet companies in China.
- Modified the Gem mirror in `web.china.template.yml` to the mirror provided by Tsinghua University, one of the top universities in China.
- The reason why sed is used to replace the `yarn.lock` file is because `yarn install --frozen-lockfile` is used for installation below. If the url is not replaced, the NPM mirror will not take effect.
After applying these modifications, I successfully installed Discourse on the Tencent Cloud China server. No more network problems.
Alan Guo Xiang Tan [Thu, 2 May 2024 01:46:00 +0000 (09:46 +0800)]
DEV: Bump default base image for launcher to `discourse/base:2.0.
20240502-0021` (#795)
This is necessary to pull in
303b646c3c48fc3179af954433d9fa797e70a3b9