Commit Graph

1589 Commits

Author SHA1 Message Date
mwaniki-wairungu ad89eb3b10
FIX: install pgvector package for old PG versions during update (#932) 2025-01-29 18:32:39 +03:00
mwaniki-wairungu 7b4839c5ea
Bump default base image to discourse/base:2.0.20250129-0720 (#931)
Follow-up to d9c837c783
2025-01-29 11:53:40 +03:00
mwaniki-wairungu d9c837c783
FEATURE: Update base image and set default to postgresql 15 (#909)
This updates the default PostgreSQL version to 15.

  * image/base: update default postgres version to 15
  * launcher: bump base image to include postgres 15
  * postgres.template.yml: update default version to 15
  * postgres.15.template.yml: current version template

Legacy version templates:

  * postgres.13.template.yml
  * postgres.12.template.yml
  * postgres.10.template.yml
  * postgres.9.5.template.yml
2025-01-29 10:20:49 +03:00
Jarek Radosz 92ac6cbc9b
DEV: Update ImageMagick to 7.1.1-43 (#929)
We could use a bump, after two years since the last one.
2025-01-28 12:07:56 +01:00
Jarek Radosz c41284d0d1
DEV: Update nginx to 1.26.1 (#930) 2025-01-28 12:07:44 +01:00
nta~ 79724e9e28
Fix TLS in socketed template (#925)
After 7d548ad4ae, the replacement pattern in web.socketed.template.yml no longer matches, making nginx.https.sock not exist.

As such, remove the `http2` field from the `listen` directive to match aforementioned commit.
2025-01-28 08:59:53 +08:00
Jarek Radosz 79ccbcc532
DEV: Update the workflow to Ubuntu 24.04 (#928)
The current LTS
2025-01-28 08:58:35 +08:00
Mwaniki Wairungu 90a1b46e98
FIX: use appropriate manifest for pg-15 image from 8a956d4bb
Follow-up to ab957b2f64
2025-01-27 12:40:00 +03:00
Alan Guo Xiang Tan 8a956d4bb1
Push docker manifest for `discourse/base:2.0.${{ env.TIMESTAMP }}-15` (#926)
Follow-up to ab957b2f64
2025-01-27 16:41:30 +08:00
Michael Fitz-Payne 8057b695b7
DEV: bump timeout for non-scheduled builds (#924)
The most recent build timed out at 30 minutes. Bump timeout temporarily
to get a gauge on how long self-hosted builds take (push to Dockerhub
looks to be slower than Github-hosted runners).
2025-01-24 09:21:00 +08:00
Michael Fitz-Payne e72554ed7f
DEV: switch amd64 builds to debian-12 runners
We can use our self-hosted action/runner machines to build the amd64
Docker images, falling back to the Github action/runner machines for the
arm64 builds.

Additionally, simplify the expression for how arm runners are selected.
The cost savings from switching to self-hosted runners dwarfs the
increase in 8core vs 2core arm runners.
2025-01-24 08:32:50 +10:00
Bianca Nenciu e44bc08778
Revert "Add new Nginx config to base image (#918)" (#923)
We have decided to go another route and keep the Nginx config in the
Discourse repository, but add the outlets there.

This reverts commit 32dc866c85.
2025-01-23 15:46:29 +08:00
Bianca Nenciu 32dc866c85
Add new Nginx config to base image (#918)
This commit moves the Nginx config from discourse/discourse repository
and updates it with several 'include' statements that serve as extension
outlets.

This change was made to place the config closer to where it is used and
implements an alternative to the "find & replace" hacks.

It is unused at this moment, but all templates and samples will be
updated in a future commit.
2025-01-22 20:13:17 +02:00
Alan Guo Xiang Tan 0c7d085b38
DEV: Correct manifest name for images with PG 15 installed (#919)
Follow-up to ab957b2f64
2025-01-21 16:01:07 +08:00
Alan Guo Xiang Tan ab957b2f64
Build images with PG 15 installed (#917)
This commit updates the build workflow to build and push an extra base Docker
image with PG 15 installed. The tag is not meant to be permanent and is
just meant to help us update our postgres templates to support PG 15
within the same commit.

The tag will be removed once our `discourse/base:release` ships with PG
15 by default.
2025-01-21 09:59:32 +08:00
Alan Guo Xiang Tan 136c638906
DEV: Remove invalid comment (#916)
This script is used by the build workflow which invalidates the comment
2025-01-16 08:48:16 +08:00
Jarek Radosz 6c5e2d1412
DEV: Remove unused docker images (#915)
1. `monitor` uses a 9 year old base image
2. `discourse_fast_switch` uses a 6 year old base image and references ruby 2.4 and 2.5
3. `discourse_bench` uses an 8 year old base image and references postgres 9.5
2025-01-16 07:52:39 +08:00
Jarek Radosz aeb28ff600
DEV: Minor cleanup of the workflow (#914) 2025-01-15 21:46:02 +01:00
Jeff Wong fa85268554
Separate nginx build step (#908)
* Revert "Revert "Move nginx installation into another build step (#897)" (#899)"

This reverts commit 0e767585d6.

* add nginx runtime dependencies
2025-01-14 13:29:19 -08:00
David Taylor 107ffb40fe
Revert "Add nginx config file and support for outlets (#871)" (#912)
This reverts commit 01cbf07622.
2025-01-14 16:44:52 +00:00
Bianca Nenciu 01cbf07622
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.
2025-01-14 17:56:45 +02:00
Jarek Radosz 4f56ee9f72 Bump default base image to discourse/base:2.0.20250114-0014 2025-01-14 15:46:23 +01:00
Jarek Radosz b345430a82
FEATURE: Update node to version 22.x (#910) 2025-01-13 14:01:08 +01:00
Alan Guo Xiang Tan d4ebd314de
DEV: Periodic bump of launcher (#906) 2025-01-07 14:18:56 +08:00
Alan Guo Xiang Tan ae194861f8
Bump Redis to 7.0.15 (#907)
Pulls in bug and security fixes since 7.0.7
2025-01-07 13:46:53 +08: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
Alan Guo Xiang Tan 7cd3dce007
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
```
2024-12-23 16:52:19 +08:00
Alan Guo Xiang Tan 2fb389f61d
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.
2024-12-23 16:38:59 +08:00
Michael Brown 033eaadbbc Revert "FIX: Set the Host header in the nginx.conf upstream block"
This reverts commit d8a363b60e.

Support for this was removed in nginx - I was unintentionally testing on an old version
2024-12-19 15:56:22 -05:00
Michael Brown d8a363b60e 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.
2024-12-19 15:29:49 -05:00
Alan Guo Xiang Tan 0e767585d6
Revert "Move nginx installation into another build step (#897)" (#899)
This reverts commit d963389430.

This broke certain assumptions like the `/etc/nginx` directory
exists.
2024-12-19 10:19:13 +08:00
Alan Guo Xiang Tan 12153f737e
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.
2024-12-18 09:09:50 +08:00
Alan Guo Xiang Tan d963389430
Move nginx installation into another build step (#897)
Avoids polluting the main image with nginx's build dependencies
2024-12-18 07:07:26 +08:00
Alan Guo Xiang Tan b375a7113f
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
2024-12-17 14:54:12 +08:00
Gullumluvl 0b74eeb842
Only parse a single line from lscpu to get the Cpu(s) count. Avoid localization. (#879) 2024-12-17 14:02:21 +08:00
Jeff Wong 5ed07ecc93
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.
2024-12-17 13:28:54 +08:00
Alan Guo Xiang Tan e70c3596b8
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
```
2024-12-17 07:57:38 +08:00
Alan Guo Xiang Tan dfaf203e16
DEV: Periodic bump of launcher base image (#893)
Pulls in various fixes and updates
2024-12-10 10:39:20 +08:00
Alan Guo Xiang Tan a0be7c92ce
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.
2024-12-03 10:51:15 +08:00
Jeff Wong 69d7558c98
Move source for launcher2 to its own repository. (#890) 2024-11-18 20:37:27 -08:00
Jeff Wong b8f9edab75
jemalloc build with install_lib_shared libraries (#888)
Only output shared lib libraries, we should not need static libraries
2024-11-12 17:54:29 -08:00
Alan Guo Xiang Tan 58e0dce1a8
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/
2024-11-13 08:49:34 +08:00
Jeff Wong c77b53047b
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
2024-11-10 23:10:49 -08:00
Jeff Wong 3792f7155c
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
2024-11-07 19:41:21 -08:00
Alan Guo Xiang Tan 1ae67ef87e
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.
2024-11-08 07:27:55 +08:00
Jeff Wong 785fda38c2
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
2024-11-04 10:49:58 -08:00
Tealk 7d548ad4ae
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>
2024-10-16 10:17:43 +08:00
Jeff Wong a1d8d0bbcb
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`.
2024-10-14 23:19:13 -07:00
Jeff Wong 20e33fbfd9
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.
2024-09-30 05:46:23 -07:00
Alan Guo Xiang Tan 9835070940
Fix the broken build (#870)
Follow-up to b47bd562cc

`Error response from daemon: No such image:
discourse/base:2.0.20240909-1149-arm6`
2024-09-09 20:47:50 +08:00