Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build discourse/base and discourse/discourse_test image for bookworm #823

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,51 @@ jobs:
run: |
docker tag discourse/base:release${{ steps.arch-helper.outputs.arch_postfix_dash }} discourse/base:aarch64
docker push discourse/base:aarch64
base_bookworm:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a simplified version of the base job.

runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
timeout-minutes: ${{ github.event_name != 'schedule' && 30 }}
steps:
- uses: actions/checkout@v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, the latest version of checkout is v4. we could add a dependabot config to this repo to bump this stuff for us

with:
fetch-depth: 1
- name: build slim image
run: |
cd image && ruby auto_build.rb base_slim_bookworm
- name: tag slim images
id: tag-images
run: |
TAG=`date +%Y%m%d-%H%M`
echo "tag=$(echo $TAG)" >> $GITHUB_OUTPUT
docker tag discourse/base:build_slim_bookworm discourse/base:2.0.$TAG-slim-bookworm
docker tag discourse/base:build_slim_bookworm discourse/base:slim-bookworm
- name: build release image
run: |
cd image && ruby auto_build.rb base_bookworm
- name: tag release images
run: |
TAG=${{ steps.tag-images.outputs.tag }}
docker tag discourse/base:build_bookworm discourse/base:2.0.$TAG-bookworm
docker tag discourse/base:build_bookworm discourse/base:release-bookworm
- name: build test_build image
run: |
cd image && ruby auto_build.rb discourse_test_build_bookworm
- name: run specs
run: |
docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build_bookworm
- name: Print summary
run: |
docker images discourse/base
- name: push to dockerhub
if: success() && (github.ref == 'refs/heads/main')
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
TAG=${{ steps.tag-images.outputs.tag }}
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
docker push discourse/base:2.0.$TAG-slim-bookworm
docker push discourse/base:slim-bookworm
docker push discourse/base:2.0.$TAG-bookworm
docker push discourse/base:release-bookworm
test:
runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
timeout-minutes: 30
Expand Down Expand Up @@ -145,6 +190,47 @@ jobs:
docker push discourse/discourse_test:slim
docker push discourse/discourse_test:slim-browsers
docker push discourse/discourse_test:release
test_bookworm:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only work on the main branch since the image has not been pushed to Dockerhub

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a simplified version of the test job.

runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
timeout-minutes: 30
needs: base_bookworm
defaults:
run:
working-directory: image/discourse_test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: build discourse_test:slim-bookworm
run: |
docker buildx build . --load \
--build-arg from_tag=slim-bookworm \
--target base \
--tag discourse/discourse_test:slim-bookworm
- name: build discourse_test:slim-browsers-bookworm
run: |
docker buildx build . --load \
--build-arg from_tag=slim-bookworm \
--target with_browsers \
--tag discourse/discourse_test:slim-browsers-bookworm
- name: build discourse_test:release-bookworm
run: |
docker buildx build . --load \
--build-arg from_tag=release-bookworm \
--target release \
--tag discourse/discourse_test:release-bookworm
- name: Print summary
run: |
docker images discourse/discourse_test
- name: push to dockerhub
if: success() && (github.ref == 'refs/heads/main')
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
docker push discourse/discourse_test:slim-bookworm
docker push discourse/discourse_test:slim-browsers-bookworm
docker push discourse/discourse_test:release-bookworm
dev:
runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
timeout-minutes: 30
Expand Down
15 changes: 15 additions & 0 deletions image/auto_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
tag: "discourse/base:build_slim",
extra_args: "-f slim.Dockerfile",
},
base_slim_bookworm: {
name: "base",
tag: "discourse/base:build_slim_bookworm",
extra_args: "-f slim.Dockerfile --build-arg=\"DEBIAN_RELEASE=bookworm\"",
},
base_slim_arm64: {
name: "base",
tag: "discourse/base:build_slim_arm64",
Expand All @@ -19,6 +24,11 @@
tag: "discourse/base:build",
extra_args: "-f release.Dockerfile",
},
base_bookworm: {
name: "base",
tag: "discourse/base:build_bookworm",
extra_args: "-f release.Dockerfile --build-arg=\"tag=build_slim_bookworm\"",
},
base_arm64: {
name: "base",
tag: "discourse/base:build_arm64",
Expand All @@ -28,6 +38,11 @@
name: "discourse_test",
tag: "discourse/discourse_test:build",
},
discourse_test_build_bookworm: {
name: "discourse_test",
tag: "discourse/discourse_test:build_bookworm",
extra_args: "--build-arg=\"from_tag=build_bookworm\"",
},
discourse_test_build_arm64: {
name: "discourse_test",
tag: "discourse/discourse_test:build_arm64",
Expand Down
16 changes: 8 additions & 8 deletions image/base/install-imagemagick
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ IMAGE_MAGICK_HASH="d282117bc6d0e91ad1ad685d096623b96ed8e229f911c891d83277b350ef8
LIBJPEGTURBO=$(cat /etc/issue | grep -qi Debian && echo 'libjpeg62-turbo libjpeg62-turbo-dev' || echo 'libjpeg-turbo8 libjpeg-turbo8-dev')

# Ubuntu 22.04/22.10 doesn't have libwebp6
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')
LIBWEBP=$(cat /etc/issue | grep -qiE 'Debian GNU/Linux 12|Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')

PREFIX=/usr/local
WDIR=/tmp/imagemagick

# Install build deps
apt -y -q remove imagemagick
apt -y -q install git make gcc pkg-config autoconf curl g++ yasm cmake \
libde265-0 libde265-dev ${LIBJPEGTURBO} x265 libx265-dev libtool \
libpng16-16 libpng-dev ${LIBJPEGTURBO} ${LIBWEBP} libwebp-dev libgomp1 \
libde265-0 libde265-dev ${LIBJPEGTURBO} ${LIBWEBP} x265 libx265-dev libtool \
libpng16-16 libpng-dev libwebp-dev libgomp1 \
libwebpmux3 libwebpdemux2 ghostscript libxml2-dev libxml2-utils librsvg2-dev \
libltdl7-dev libbz2-dev gsfonts libtiff-dev libfreetype6-dev libjpeg-dev
libltdl7-dev libbz2-dev gsfonts libtiff-dev libfreetype6-dev libjpeg-dev libheif1 libheif-dev

# Ubuntu doesn't like `bullseye-backports`
if cat /etc/issue | grep -qi 'Ubuntu 22'; then
apt -y install libheif1 libaom-dev libheif-dev
# Ubuntu doesn't like backports
if cat /etc/issue | grep -qiE 'Debian GNU/Linux 12|Ubuntu 22'; then
apt -y install libaom-dev
else
# Use backports instead of compiling it
apt -y -q install -t bullseye-backports libheif1 libaom-dev libheif-dev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libheif1 libheif-dev are not part of bullseye-backport

apt -y -q install -t bullseye-backports libaom-dev
fi

mkdir -p $WDIR
Expand Down
9 changes: 5 additions & 4 deletions image/base/slim.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ENV PG_MAJOR=13 \

RUN echo 2.0.`date +%Y%m%d` > /VERSION

RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/bullseye-backports.list
RUN echo "deb http://deb.debian.org/debian ${DEBIAN_RELEASE}-backports main" > "/etc/apt/sources.list.d/${DEBIAN_RELEASE}-backports.list"
RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install gnupg sudo curl fping
RUN sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://proxy:3128\";}; };' > /etc/apt/apt.conf.d/40proxy && apt-get update || true"
Expand All @@ -31,9 +31,10 @@ ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

RUN curl https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | \
tee /etc/apt/sources.list.d/postgres.list
RUN install -d /usr/share/postgresql-common/pgdg &&\
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc &&\
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt ${DEBIAN_RELEASE}-pgdg main" > /etc/apt/sources.list.d/pgdg.list

Comment on lines +34 to +37
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUN curl --silent --location https://deb.nodesource.com/setup_18.x | sudo bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
Expand Down
Loading