Skip to content

Commit

Permalink
ci: Remove debian and preview images (#33728)
Browse files Browse the repository at this point in the history
Co-authored-by: Debdut Chakraborty <debdutdeb@outlook.com>
  • Loading branch information
ggazzo and debdutdeb authored Oct 30, 2024
1 parent 6dca2b0 commit c2a48e3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 160 deletions.
91 changes: 0 additions & 91 deletions .github/actions/build-docker-image/action.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/actions/build-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
platform:
required: false
description: 'Platform'
type: string
default: 'alpine'
build-containers:
required: false
description: 'Containers to build along with Rocket.Chat'
Expand Down Expand Up @@ -84,7 +84,7 @@ runs:
- run: yarn build
if: inputs.setup == 'true'
shell: bash
- if: ${{ inputs.platform == 'official' }}
- if: ${{ inputs.platform == 'alpine' }}
uses: actions/cache@v3
with:
path: /tmp/build/matrix-sdk-crypto.linux-x64-musl.node
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ on:
rc-docker-tag:
required: true
type: string
rc-dockerfile-debian:
required: true
type: string
rc-docker-tag-debian:
required: true
type: string
gh-docker-tag:
required: true
type: string
Expand Down Expand Up @@ -83,16 +77,16 @@ jobs:
test:
runs-on: ubuntu-20.04
env:
RC_DOCKERFILE: ${{ matrix.mongodb-version == '7.0' && inputs.rc-dockerfile-debian || inputs.rc-dockerfile }}
RC_DOCKER_TAG: ${{ matrix.mongodb-version == '7.0' && inputs.rc-docker-tag-debian || inputs.rc-docker-tag }}
RC_DOCKERFILE: ${{ inputs.rc-dockerfile }}.${{ (matrix.mongodb-version == '7.0' && 'debian' && false) || 'alpine' }}
RC_DOCKER_TAG: ${{ inputs.rc-docker-tag }}-${{ (matrix.mongodb-version == '7.0' && 'debian' && false) || 'alpine' }}

strategy:
fail-fast: false
matrix:
mongodb-version: ${{ fromJSON(inputs.mongodb-version) }}
shard: ${{ fromJSON(inputs.shard) }}

name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'true' && ' [no watchers]' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }}) - ${{ matrix.mongodb-version == '7.0' && 'Debian' || 'Alpine (Official)' }}
name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'true' && ' [no watchers]' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }}) - ${{ (matrix.mongodb-version == '7.0' && 'Debian' && false) || 'Alpine (Official)' }}

steps:
- name: Collect Workflow Telemetry
Expand Down
77 changes: 19 additions & 58 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ jobs:
gh-docker-tag: ${{ steps.docker.outputs.gh-docker-tag }}
lowercase-repo: ${{ steps.var.outputs.lowercase-repo }}
rc-dockerfile: '${{ github.workspace }}/apps/meteor/.docker/Dockerfile'
rc-docker-tag: '${{ steps.docker.outputs.gh-docker-tag }}.official'
rc-dockerfile-debian: '${{ github.workspace }}/apps/meteor/.docker/Dockerfile.debian'
rc-docker-tag-debian: '${{ steps.docker.outputs.gh-docker-tag }}.debian'
rc-docker-tag: '${{ steps.docker.outputs.gh-docker-tag }}'
node-version: ${{ steps.var.outputs.node-version }}
deno-version: ${{ steps.var.outputs.deno-version }}
official-platform: 'alpine'
# this is 100% intentional, secrets are not available for forks, so ee-tests will always fail
# to avoid this, we are using a dummy license, expiring at 2025-06-31
enterprise-license: X/XumwIkgwQuld0alWKt37lVA90XjKOrfiMvMZ0/RtqsMtrdL9GoAk+4jXnaY1b2ePoG7XSzGhuxEDxFKIWJK3hIKGNTvrd980LgH5sM5+1T4P42ivSpd8UZi0bwjJkCFLIu9RozzYwslGG0IehMxe0S6VjcO0UYlUJtbMCBHuR2WmTAmO6YVU3ln+pZCbrPFaTPSS1RovhKaNCNkZwIx/CLWW8UTXUuFV/ML4PbKKVoa5nvvJwPeatgL7UCnlSD90lfCiiuikpzj/Y/JLkIL6velFbwNxsrxg9iRJ2k0sKheMMSmlTiGzSvZUm+na5WQq91aKGncih+DmaEZA7QGrjp4eoA0dqTk6OmItsy0fHmQhvZIOKNMeO7vNQiLbaSV6rqibrzu7WPpeIvsvL57T1h37USoCSB6+jDqkzdfoqIpz8BxTiJDj1d8xGPJFVrgxoqQqkj9qIP/gCaEz5DF39QFv5sovk4yK2O8fEQYod2d14V9yECYl4szZPMk1IBfCAC2w7czWGHHFonhL+CQGT403y5wmDmnsnjlCqMKF72odqfTPTI8XnCvJDriPMWohnQEAGtTTyciAhNokx/mjAVJ4NeZPcsbm4BjhvJvnjxx/BhYhBBTNWPaCSZzocfrGUj9Z+ZA7BEz+xAFQyGDx3xRzqIXfT0G7w8fvgYJMU=
Expand Down Expand Up @@ -307,7 +306,7 @@ jobs:
- if: steps.matrix-rust-sdk-crypto-nodejs.outputs.cache-hit != 'true'
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '20.18.0'

- if: steps.matrix-rust-sdk-crypto-nodejs.outputs.cache-hit != 'true'
uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -335,15 +334,15 @@ jobs:
runs-on: ubuntu-20.04

env:
RC_DOCKERFILE: ${{ matrix.platform == 'debian' && needs.release-versions.outputs.rc-dockerfile-debian || needs.release-versions.outputs.rc-dockerfile }}
RC_DOCKER_TAG: ${{ matrix.platform == 'debian' && needs.release-versions.outputs.rc-docker-tag-debian || needs.release-versions.outputs.rc-docker-tag }}
RC_DOCKERFILE: ${{ needs.release-versions.outputs.rc-dockerfile }}.${{ matrix.platform }}
RC_DOCKER_TAG: ${{ needs.release-versions.outputs.rc-docker-tag }}-${{ matrix.platform }}
DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }}
LOWERCASE_REPOSITORY: ${{ needs.release-versions.outputs.lowercase-repo }}

strategy:
fail-fast: false
matrix:
platform: ['official', 'debian']
platform: ['alpine']

steps:
- uses: actions/checkout@v4
Expand All @@ -357,7 +356,7 @@ jobs:
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
platform: ${{ matrix.platform }}
build-containers: ${{ matrix.platform == 'debian' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }}
build-containers: ${{ matrix.platform == needs.release-versions.outputs.official-platform && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Make sure matrix bindings load
Expand All @@ -371,15 +370,15 @@ jobs:
runs-on: ubuntu-20.04

env:
RC_DOCKERFILE: ${{ matrix.platform == 'debian' && needs.release-versions.outputs.rc-dockerfile-debian || needs.release-versions.outputs.rc-dockerfile }}
RC_DOCKER_TAG: ${{ matrix.platform == 'debian' && needs.release-versions.outputs.rc-docker-tag-debian || needs.release-versions.outputs.rc-docker-tag }}
RC_DOCKERFILE: ${{ needs.release-versions.outputs.rc-dockerfile }}.${{ matrix.platform }}
RC_DOCKER_TAG: ${{ needs.release-versions.outputs.rc-docker-tag }}-${{ matrix.platform }}
DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }}
LOWERCASE_REPOSITORY: ${{ needs.release-versions.outputs.lowercase-repo }}

strategy:
fail-fast: false
matrix:
platform: ['official', 'debian']
platform: ['alpine']

steps:
- uses: actions/checkout@v4
Expand All @@ -391,18 +390,22 @@ jobs:
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
platform: ${{ matrix.platform }}
build-containers: ${{ matrix.platform == 'debian' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }}
build-containers: ${{ matrix.platform == needs.release-versions.outputs.official-platform && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Rename official Docker tag to GitHub Container Registry
if: matrix.platform == 'official'
if: matrix.platform == needs.release-versions.outputs.official-platform
run: |
IMAGE_NAME_BASE="ghcr.io/${LOWERCASE_REPOSITORY}/rocket.chat:${DOCKER_TAG}"
echo "Push Docker image: ${IMAGE_NAME_BASE}"
docker tag ${IMAGE_NAME_BASE}.official $IMAGE_NAME_BASE
docker tag ${IMAGE_NAME_BASE}.${{matrix.platform}} $IMAGE_NAME_BASE
docker push $IMAGE_NAME_BASE
echo "Push Docker image: ${IMAGE_NAME_BASE}.official"
docker tag ${IMAGE_NAME_BASE}.${{matrix.platform}} ${IMAGE_NAME_BASE}.official
docker push ${IMAGE_NAME_BASE}.official
checks:
needs: [release-versions, packages-build]

Expand Down Expand Up @@ -437,8 +440,6 @@ jobs:
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
rc-docker-tag: ${{ needs.release-versions.outputs.rc-docker-tag }}
rc-dockerfile-debian: ${{ needs.release-versions.outputs.rc-dockerfile-debian }}
rc-docker-tag-debian: ${{ needs.release-versions.outputs.rc-docker-tag-debian }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
secrets:
CR_USER: ${{ secrets.CR_USER }}
Expand All @@ -461,8 +462,6 @@ jobs:
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
rc-docker-tag: ${{ needs.release-versions.outputs.rc-docker-tag }}
rc-dockerfile-debian: ${{ needs.release-versions.outputs.rc-dockerfile-debian }}
rc-docker-tag-debian: ${{ needs.release-versions.outputs.rc-docker-tag-debian }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
secrets:
Expand All @@ -489,8 +488,6 @@ jobs:
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
rc-docker-tag: ${{ needs.release-versions.outputs.rc-docker-tag }}
rc-dockerfile-debian: ${{ needs.release-versions.outputs.rc-dockerfile-debian }}
rc-docker-tag-debian: ${{ needs.release-versions.outputs.rc-docker-tag-debian }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
secrets:
CR_USER: ${{ secrets.CR_USER }}
Expand All @@ -514,8 +511,6 @@ jobs:
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
rc-docker-tag: ${{ needs.release-versions.outputs.rc-docker-tag }}
rc-dockerfile-debian: ${{ needs.release-versions.outputs.rc-dockerfile-debian }}
rc-docker-tag-debian: ${{ needs.release-versions.outputs.rc-docker-tag-debian }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
secrets:
Expand Down Expand Up @@ -545,8 +540,6 @@ jobs:
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
rc-docker-tag: ${{ needs.release-versions.outputs.rc-docker-tag }}
rc-dockerfile-debian: ${{ needs.release-versions.outputs.rc-dockerfile-debian }}
rc-docker-tag-debian: ${{ needs.release-versions.outputs.rc-docker-tag-debian }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
db-watcher-disabled: 'true'
Expand Down Expand Up @@ -651,47 +644,15 @@ jobs:
aws s3 cp $ROCKET_DEPLOY_DIR/ s3://download.rocket.chat/build/ --recursive
build-docker-preview:
name: 🚢 Build Docker Image (preview)
runs-on: ubuntu-20.04
needs: [build, checks, release-versions]
if: github.event_name == 'release' || github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v4

- name: Restore build
uses: actions/download-artifact@v4
with:
name: build
path: /tmp/build

- name: Unpack build
run: |
cd /tmp/build
tar xzf Rocket.Chat.tar.gz
rm Rocket.Chat.tar.gz
- name: Build Docker image
id: build-docker-image-preview
uses: ./.github/actions/build-docker-image
with:
root-dir: /tmp/build
docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
release: preview
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}

docker-image-publish:
name: 🚀 Publish Docker Image (main)
runs-on: ubuntu-20.04
needs: [deploy, build-docker-preview, release-versions]
needs: [deploy, release-versions]

strategy:
matrix:
# this is currently a mix of variants and different images
release: ['official', 'preview', 'debian']
release: ['alpine', 'preview', 'debian']

env:
IMAGE_NAME: 'rocketchat/rocket.chat'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ RUN set -x \
&& rm -rf npm/node_modules/sharp \
&& npm install sharp@0.32.6 \
&& mv node_modules/sharp npm/node_modules/sharp \
&& cd /app/bundle/programs/server/npm/node_modules/@vector-im/matrix-bot-sdk \
&& npm install \
# End hack for sharp
# # Start hack for isolated-vm...
# && rm -rf npm/node_modules/isolated-vm \
Expand All @@ -36,6 +38,10 @@ RUN set -x \
&& npm cache clear --force \
&& apk del .fetch-deps

# TODO: remove hack once upstream builds are fixed
COPY matrix-sdk-crypto.linux-x64-musl.node /app/bundle/programs/server/npm/node_modules/@matrix-org/matrix-sdk-crypto-nodejs
COPY matrix-sdk-crypto.linux-x64-musl.node /app/bundle/programs/server/npm/node_modules/@vector-im/matrix-bot-sdk/node_modules/@matrix-org/matrix-sdk-crypto-nodejs

VOLUME /app/uploads

WORKDIR /app/bundle
Expand Down

0 comments on commit c2a48e3

Please sign in to comment.