Commit Graph

53 Commits

Author SHA1 Message Date
Jeff Wong cc9c36e59d
FEATURE: introduce web_only images
web_only images do not install postgres or redis, minimizing image sizes for
setups that do not require those components.

release and dev images still install postgres and redis, but do it later in the
process.

remove rm runs

rm no longer affects image sizes as we are no longer squashing images
2025-05-18 09:46:39 -07:00
Alan Guo Xiang Tan 64f31dbbe3
DEV: Update labels for our self hosted runners (#965)
We have 8 and 16 cores runner now but 16 core runners are not quite
ready for prime time yet.
2025-05-16 15:46:19 +08:00
David Taylor 3fba2aeee8
DEV: Move `RETRY_AND_LOG_FLAKY_TESTS` to correct location (#962)
We need to set the env inside the docker container, not in the github runner
2025-05-12 10:57:18 +01: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
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
Jarek Radosz aeb28ff600
DEV: Minor cleanup of the workflow (#914) 2025-01-15 21:46:02 +01: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
Jeff Wong 69d7558c98
Move source for launcher2 to its own repository. (#890) 2024-11-18 20:37:27 -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
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
Alan Guo Xiang Tan b47bd562cc
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>
2024-09-09 19:49:14 +08:00
Jeff Wong e84629a754
DEV: update golang versions (#863)
update golang versions and bump dependencies
2024-09-05 08:08:17 +08:00
Alan Guo Xiang Tan 9cd8186278
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.
2024-08-29 17:39:27 -07:00
Jeff Wong 85a6e38644
FEATURE: Add workflow for `launcher_go` (#848) 2024-08-29 15:59:12 +08:00
David Taylor 83c7e4e587
Increase timeout for scheduled build job (#845)
Now that base & dev images are built in the same job, we need a little more time
2024-08-28 17:19:59 +08:00
Alan Guo Xiang Tan ceb92647b4
Fix timeout for arm64 builds not correctly set (#839) 2024-08-26 15:05:20 +08:00
David Taylor fc61b8a850
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
2024-08-26 13:10:28 +08:00
David Taylor b110891382
Update GitHub actions runners to ubuntu-22.04 (#837) 2024-08-22 11:09:50 +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
David Taylor 8aff5b6588
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.
2024-08-20 13:44:25 +01:00
Alan Guo Xiang Tan 21a0351e30
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`
2024-08-08 16:29:53 +08:00
Alan Guo Xiang Tan dfd3fcee0e
Bump timeout for arm64 scheduled builds to 60 mins. (#815)
We are hitting timeouts at 45mins.
2024-07-10 10:46:30 +08:00
Alan Guo Xiang Tan 9f47034b0b
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.
2024-05-20 09:09:12 +08:00
Alan Guo Xiang Tan 6c890061e7
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.
2024-05-07 13:29:45 +08:00
Alan Guo Xiang Tan 5bbffa83bd
Increase build time for arm64 scheduled build (#785)
Scheduled build for arm64 running on 2cores is timing out at 30 minutes.
Let's give it some more time
2024-03-22 20:41:24 +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 bbefa1e5f3
Use Github hosted ARM runners to build arm64/aarch64 release image (#779)
Why this change?

We have been given access to Github's private beta of ARM hosted
runners. Switching to ARM runners should drastically speed up the time
required for us to build our ARM image.

What does this change do?

1. Switch to use Github's ARM hosted runners.
2. Build release image for arm64 as well. We previously only built the
   slim image because building the release image through emulation is
   way too slow so we skipped the release image.
3. Update `bundle` in `release.Dockerfile` to install gems in parallel
   based on the number of cores instead of hardcoding it to 4 jobs.
2024-03-19 10:29:56 +08:00
Alan Guo Xiang Tan c29cba70fc
DEV: Fix broken ARM64 build (#745)
Why this change?

The `docker tag discourse/base:aarch64-slim localhost:5000/discourse/base:aarch64-slim
` command broked in 0c93b2207d because
there is no `aarch64-slim` image being built. Instead, the `ruby
auto_build.rb base_slime_64` command builds an image with the
`discourse/base:build_slim_arm64` tag.

What does this change do?

This change removes the tagging command because it is pointless for us
to tag it.
2023-10-17 16:08:49 +08:00
Alan Guo Xiang Tan 0c93b2207d
DEV: Remove use of `--squash` flag and switch to buildx (#743)
Why this change?

In CI, we are seeing the following warning message:

```
WARNING: experimental flag squash is removed with BuildKit. You should squash inside build using a multi-stage Dockerfile for efficiency.
```

Basically, the `--squash` flag has not been working for quite some time
and is redundant.

What does this change do?

* This change removes the use of the `--squash` flag.

* This change uses the `buildx` tool in `auto_build.rb` as we prepare to
  build images for multiple platforms.
2023-10-16 10:41:05 +08: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
Jarek Radosz 97ebba2902
DEV: Use `plain` buildkit output (#730)
it's much more CI-friendly
2023-08-25 11:21:54 +02:00
Gerhard Schlager be563a4df5
FIX: Compiling oxipng didn't work on aarch64 (#694)
This uses the new sparse-registry feature from Rust 1.68 which lowers the memory usage. This avoids that cargo is killed due to an OOM issue (exit code 137) during "Updating crates.io index".
2023-03-13 10:55:15 +01:00
David Taylor 46ea141eef
Update deprecated `::set-output` in GitHub actions workflow (#664) 2023-01-03 17:29:46 +00:00
David Taylor d01e8ad13b
Use larger GitHub actions workers (#661)
Larger workers will be used for non-cron triggers to improve feedback-loop time when actively working on changes to the repository
2023-01-03 16:36:36 +00:00
David Taylor c71c9f2154 Fix tagging 2023-01-02 11:58:49 -03:00
David Taylor 76383a95e6 DEV: Allow booting app with slim image and make default for aarch46 2023-01-02 11:58:49 -03:00
Jarek Radosz 7254f7d13d
DEV: Fix workflow formatting (#623)
and update actions/checkout version
2022-04-29 12:18:02 +02:00
David Taylor 4cd6a5d96a
DEV: Fix aarch64 build (#592)
buildx can't build `FROM` a local image, so we need to set up a temporary local registry for the intermediate image
2021-12-15 00:09:46 +00: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 e5f0b0f5b8
DEV: Tag the correct images as 'slim' (#591) 2021-12-14 00:11:03 +00:00
David Taylor 3f8f4ce464
DEV: Pass `TAG` variable between workflow steps (#590) 2021-12-13 22:57:16 +00:00
David Taylor 9cd2de7b33
DEV: Correct GitHub actions build definition (#589) 2021-12-13 21:44:07 +00:00
David Taylor 3ef754f4ca
Introduce a discourse/base:slim image (#588)
The base-slim image doesn't run `yarn install` or `bundle install`, so it is much more lightweight. This is intended for use by systems which do their own dependency caching (e.g. GitHub Actions)

The image will be released under the `:slim` tag, and also `:v2.0.{timestamp}-slim`
2021-12-13 21:03:00 +00:00
Rafael dos Santos Silva cf296400aa add buildx and qemu setup 2021-12-02 17:19:43 -03:00
Rafael dos Santos Silva d0bb6d7e2f move aarch64 build to CI 2021-12-02 17:19:43 -03:00