Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 538044a

Browse files
authored
Collapse Docker build commands in Complement CI runs to make the logs easier to read. (#13058)
1 parent 941dc3d commit 538044a

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ jobs:
371371
372372
- name: "Install Complement Dependencies"
373373
run: |
374-
sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev
374+
sudo apt-get -qq update && sudo apt-get install -qqy libolm3 libolm-dev
375375
go get -v github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt@latest
376376
377377
- name: Run actions/checkout@v2 for synapse

changelog.d/13058.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make Complement CI logs easier to read.

docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as requirements
4040
RUN \
4141
--mount=type=cache,target=/var/cache/apt,sharing=locked \
4242
--mount=type=cache,target=/var/lib/apt,sharing=locked \
43-
apt-get update && apt-get install -y git \
43+
apt-get update -qq && apt-get install -yqq git \
4444
&& rm -rf /var/lib/apt/lists/*
4545

4646
# We install poetry in its own build stage to avoid its dependencies conflicting with
@@ -73,7 +73,7 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as builder
7373
RUN \
7474
--mount=type=cache,target=/var/cache/apt,sharing=locked \
7575
--mount=type=cache,target=/var/lib/apt,sharing=locked \
76-
apt-get update && apt-get install -y \
76+
apt-get update -qq && apt-get install -yqq \
7777
build-essential \
7878
libffi-dev \
7979
libjpeg-dev \
@@ -118,7 +118,7 @@ LABEL org.opencontainers.image.licenses='Apache-2.0'
118118
RUN \
119119
--mount=type=cache,target=/var/cache/apt,sharing=locked \
120120
--mount=type=cache,target=/var/lib/apt,sharing=locked \
121-
apt-get update && apt-get install -y \
121+
apt-get update -qq && apt-get install -yqq \
122122
curl \
123123
gosu \
124124
libjpeg62-turbo \

docker/Dockerfile-workers

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ FROM matrixdotorg/synapse:$SYNAPSE_VERSION
66
RUN \
77
--mount=type=cache,target=/var/cache/apt,sharing=locked \
88
--mount=type=cache,target=/var/lib/apt,sharing=locked \
9-
apt-get update && \
10-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9+
apt-get update -qq && \
10+
DEBIAN_FRONTEND=noninteractive apt-get install -yqq --no-install-recommends \
1111
redis-server nginx-light
1212

1313
# Install supervisord with pip instead of apt, to avoid installing a second

docker/complement/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FROM matrixdotorg/synapse-workers:$SYNAPSE_VERSION
99

1010
# Install postgresql
1111
RUN apt-get update && \
12-
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y postgresql-13
12+
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -yqq postgresql-13
1313

1414
# Configure a user and create a database for Synapse
1515
RUN pg_ctlcluster 13 main start && su postgres -c "echo \

scripts-dev/complement.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
# Exit if a line returns a non-zero exit code
2525
set -e
2626

27+
28+
# Helper to emit annotations that collapse portions of the log in GitHub Actions
29+
echo_if_github() {
30+
if [[ -n "$GITHUB_WORKFLOW" ]]; then
31+
echo $*
32+
fi
33+
}
34+
35+
2736
# enable buildkit for the docker builds
2837
export DOCKER_BUILDKIT=1
2938

@@ -41,14 +50,20 @@ if [[ -z "$COMPLEMENT_DIR" ]]; then
4150
fi
4251

4352
# Build the base Synapse image from the local checkout
53+
echo_if_github "::group::Build Docker image: matrixdotorg/synapse"
4454
docker build -t matrixdotorg/synapse -f "docker/Dockerfile" .
55+
echo_if_github "::endgroup::"
4556

4657
# Build the workers docker image (from the base Synapse image we just built).
58+
echo_if_github "::group::Build Docker image: matrixdotorg/synapse-workers"
4759
docker build -t matrixdotorg/synapse-workers -f "docker/Dockerfile-workers" .
60+
echo_if_github "::endgroup::"
4861

4962
# Build the unified Complement image (from the worker Synapse image we just built).
63+
echo_if_github "::group::Build Docker image: complement/Dockerfile"
5064
docker build -t complement-synapse \
5165
-f "docker/complement/Dockerfile" "docker/complement"
66+
echo_if_github "::endgroup::"
5267

5368
export COMPLEMENT_BASE_IMAGE=complement-synapse
5469

0 commit comments

Comments
 (0)