From bed7a620a8a03eccbbe926d4371b2cc7d0fd8561 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 1 Nov 2023 15:39:49 +0000 Subject: [PATCH] Use prebuilt synapse image for now --- .github/workflows/tests.yaml | 68 ++++++++++++++++++++---------------- deploy/deploy.go | 2 +- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4125ef2..54e58e7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -43,40 +43,46 @@ jobs: (cd js-sdk && yarn install --frozen-lockfile && yarn build) cp -r ./js-sdk/dist/. ./tests/dist - # Build homeserver image, honouring branch names - - name: "Checkout corresponding Synapse branch" + # Temporary: as it takes 3m to build the complement synapse image >:( + - name: Pull synapse service v1.94.0 shell: bash run: | - mkdir -p homeserver - - # Attempt to use the version of the homeserver which best matches the - # current build. - # - # 1. If we are not on complement's default branch, check if there's a - # similarly named branch (GITHUB_HEAD_REF for pull requests, - # otherwise GITHUB_REF). - # 2. otherwise, use the default homeserver branch ("HEAD") + docker pull ghcr.io/matrix-org/synapse-service:v1.94.0 + docker tag ghcr.io/matrix-org/synapse-service:v1.94.0 homeserver:latest - for BRANCH_NAME in "$GITHUB_HEAD_REF" "${GITHUB_REF#refs/heads/}" "HEAD"; do - # Skip empty branch names, merge commits, and our default branch. - # (If we are on complement's default branch, we want to fall through to the HS's default branch - # rather than using the HS's 'master'/'main'). - case "$BRANCH_NAME" in - "" | refs/pull/* | main | master) - continue - ;; - esac - (wget -O - "https://github.com/matrix-org/synapse/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C homeserver) && break - done - - # Build the base Synapse dockerfile and then build a Complement-specific image from that base. - - run: | - docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile . - docker build -t matrixdotorg/synapse-workers:latest -f docker/Dockerfile-workers . - docker build -t homeserver -f docker/complement/Dockerfile docker/complement - working-directory: homeserver - env: - DOCKER_BUILDKIT: 1 + # Build homeserver image, honouring branch names + #- name: "Checkout corresponding Synapse branch" + #shell: bash + #run: | + #mkdir -p homeserver +# + ## Attempt to use the version of the homeserver which best matches the + ## current build. + ## + ## 1. If we are not on complement's default branch, check if there's a + ## similarly named branch (GITHUB_HEAD_REF for pull requests, + ## otherwise GITHUB_REF). + ## 2. otherwise, use the default homeserver branch ("HEAD") +# + #for BRANCH_NAME in "$GITHUB_HEAD_REF" "${GITHUB_REF#refs/heads/}" "HEAD"; do + ## Skip empty branch names, merge commits, and our default branch. + ## (If we are on complement's default branch, we want to fall through to the HS's default branch + ## rather than using the HS's 'master'/'main'). + #case "$BRANCH_NAME" in + #"" | refs/pull/* | main | master) + #continue + #;; + #esac + #(wget -O - "https://github.com/matrix-org/synapse/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C homeserver) && break + #done + ## Build the base Synapse dockerfile and then build a Complement-specific image from that base. + #- run: | + #docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile . + #docker build -t matrixdotorg/synapse-workers:latest -f docker/Dockerfile-workers . + #docker build -t homeserver -f docker/complement/Dockerfile docker/complement + #working-directory: homeserver + #env: + #DOCKER_BUILDKIT: 1 - run: | set -o pipefail && diff --git a/deploy/deploy.go b/deploy/deploy.go index c2613b4..26da491 100644 --- a/deploy/deploy.go +++ b/deploy/deploy.go @@ -45,7 +45,7 @@ func (d *SlidingSyncDeployment) Teardown() { func RunNewDeployment(t *testing.T) *SlidingSyncDeployment { // allow 30s for everything to deploy - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() // Deploy the homeserver using Complement