Skip to content

breaking: Upgrade min Compose version to 2.23.2 #3535

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

Merged
merged 6 commits into from
Jan 16, 2025
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
16 changes: 7 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Get Compose
uses: ./get-compose-action

- name: Unit Tests
run: ./unit-test.sh

Expand All @@ -42,20 +45,15 @@ jobs:
LATEST_TAG=$(curl -s https://api.github.com/repos/getsentry/self-hosted/releases/latest | jq -r '.tag_name')
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV

- name: Get Compose
# TODO: Replace this with `@master` after landing
uses: getsentry/self-hosted/get-compose-action@byk/ref/upgrade-compose

- name: Checkout latest release
uses: actions/checkout@v4
with:
ref: ${{ env.LATEST_TAG }}

- name: Get Compose
run: |
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo mkdir -p "/usr/local/lib/docker/cli-plugins"
sudo curl -L https://github.com/docker/compose/releases/download/v2.26.0/docker-compose-`uname -s`-`uname -m` -o "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo chmod +x "/usr/local/lib/docker/cli-plugins/docker-compose"

- name: Restore DB Volumes Cache
id: restore_cache
uses: BYK/docker-volume-cache-action/restore@be89365902126f508dcae387a32ec3712df6b1cd
Expand Down
7 changes: 4 additions & 3 deletions _unit-test/js-sdk-assets-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
source _unit-test/_test_setup.sh
source install/dc-detect-version.sh
$dcb --force-rm web
$dc pull nginx

export SETUP_JS_SDK_ASSETS=1

source install/setup-js-sdk-assets.sh

sdk_files=$(docker compose run --no-deps --rm -v "sentry-nginx-www:/var/www" nginx ls -lah /var/www/js-sdk/)
sdk_tree=$(docker compose run --no-deps --rm -v "sentry-nginx-www:/var/www" nginx tree /var/www/js-sdk/ | tail -n 1)
non_empty_file_count=$(docker compose run --no-deps --rm -v "sentry-nginx-www:/var/www" nginx find /var/www/js-sdk/ -type f -size +1k | wc -l)
sdk_files=$($dcr --no-deps -v "sentry-nginx-www:/var/www" nginx ls -lah /var/www/js-sdk/)
sdk_tree=$($dcr --no-deps -v "sentry-nginx-www:/var/www" nginx tree /var/www/js-sdk/ | tail -n 1)
non_empty_file_count=$($dcr --no-deps -v "sentry-nginx-www:/var/www" nginx find /var/www/js-sdk/ -type f -size +1k | wc -l)

# `sdk_files` should contains 5 lines, '4.*', '5.*', '6.*', `7.*` and `8.*`
echo $sdk_files
Expand Down
17 changes: 2 additions & 15 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,13 @@ runs:
fi

- name: Get Compose
env:
COMPOSE_PATH: /usr/local/lib/docker/cli-plugins
COMPOSE_VERSION: "v2.26.0"
shell: bash
run: |
# Always remove `docker compose` support as that's the newer version
# and comes installed by default nowadays.
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "${{ env.COMPOSE_PATH }}/docker-compose"
sudo mkdir -p "${{ env.COMPOSE_PATH }}"
sudo curl -L https://github.com/docker/compose/releases/download/${{ env.COMPOSE_VERSION }}/docker-compose-`uname -s`-`uname -m` -o "${{ env.COMPOSE_PATH }}/docker-compose"
sudo chmod +x "${{ env.COMPOSE_PATH }}/docker-compose"
uses: ./get-compose-action

- name: Compute Docker Volume Cache Keys
id: cache_key
shell: bash
run: |
source ${{ github.action_path }}/.env
source ${{ github.action_path }}.env
# See https://explainshell.com/explain?cmd=ls%20-Rv1rpq
# for that long `ls` command
SENTRY_MIGRATIONS_MD5=$(docker run --rm --entrypoint bash $SENTRY_IMAGE -c '{ ls -Rv1rpq src/sentry/migrations/; sed -n "/KAFKA_TOPIC_TO_CLUSTER/,/}/p" src/sentry/conf/server.py; }' | md5sum | cut -d ' ' -f 1)
Expand Down
19 changes: 19 additions & 0 deletions get-compose-action/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Get Docker Compose"
inputs:
version:
required: false
default: 2.32.3
description: "Docker Compose version"

runs:
using: "composite"
steps:
- name: Get Compose
shell: bash
run: |
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo mkdir -p "/usr/local/lib/docker/cli-plugins"
sudo curl -L https://github.com/docker/compose/releases/download/v${{ inputs.version }}/docker-compose-`uname -s`-`uname -m` -o "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo chmod +x "/usr/local/lib/docker/cli-plugins/docker-compose"
2 changes: 1 addition & 1 deletion install/_min-requirements.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Don't forget to update the README and other docs when you change these!
MIN_DOCKER_VERSION='19.03.6'
MIN_COMPOSE_VERSION='2.19.0'
MIN_COMPOSE_VERSION='2.32.2'

# 16 GB minimum host RAM, but there'll be some overhead outside of what
# can be allotted to docker
Expand Down
2 changes: 1 addition & 1 deletion install/dc-detect-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ else
dc="$dc_base --ansi never"
fi
proxy_args="--build-arg http_proxy=${http_proxy:-} --build-arg https_proxy=${https_proxy:-} --build-arg no_proxy=${no_proxy:-}"
dcr="$dc run --rm"
dcr="$dc run --pull=never --rm"
dcb="$dc build $proxy_args"
dbuild="docker build $proxy_args"

Expand Down
2 changes: 1 addition & 1 deletion sentry-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on the host filesystem. Commands that write files should write them to the '/sen
# Actual invocation that runs the command in the container.
invocation() {
$dc up postgres --wait
$dcr --no-deps --quiet-pull -v "$VOLUME_MAPPING" -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1
$dcr --no-deps -v "$VOLUME_MAPPING" -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1
}

# Function to modify lines starting with `Usage: sentry` to say `Usage: ./sentry-admin.sh` instead.
Expand Down
Loading