Skip to content

Commit

Permalink
ref(py3): Make PY3 the default*, add SENTRY_PYTHON (getsentry#763)
Browse files Browse the repository at this point in the history
This is in preparation to make the PY3 version the default* for Docker images and self-hosted. It is part **2/5**:

1. ~~Add `-py2` variants for the Python 2 build tags and introduce the `SENTRY_PYTHON2` env variable usage~~ (getsentry/sentry#22460)
2. __Switch getsentry/onpremise to Python 3 by default*, introducing the `SENTRY_PYTHON2` env var for Py2 builds via the `-py2` suffix__
3. Move the unsuffixed version of the builds to Python 3
4. Remove the `SENTRY_PYTHON3` env var support and `-py3` prefix usage from getsentry/onpremise
5. Remove tagging of `-py3` builds from here

_* this will only happen when item 3 above gets landed_
  • Loading branch information
BYK authored Dec 4, 2020
1 parent 41e7d86 commit 06fb0d7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
test:
strategy:
matrix:
py3: ['', '1']
py2: ['', '1']
runs-on: ubuntu-18.04
name: "test${{ matrix.py3 == '1' && ' PY3' || ''}}"
name: "test${{ matrix.py2 == '1' && ' PY2' || ''}}"
steps:
- name: Pin docker-compose
run: |
Expand All @@ -31,7 +31,8 @@ jobs:
- name: Install and test
env:
COMPOSE_PARALLEL_LIMIT: 10
SENTRY_PYTHON3: ${{ matrix.py3 }}
SENTRY_PYTHON2: ${{ matrix.py2 == '1' || '' }}
SENTRY_PYTHON3: ${{ matrix.py2 != '1' || ''}}
run: |
./install.sh
./test.sh
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ Official bootstrap for running your own [Sentry](https://sentry.io/) with [Docke

## Setup

To get started with all the defaults, simply clone the repo and run `./install.sh` in your local check-out.

_If you like trying out new things, you can run `SENTRY_PYTHON3=1 ./install.sh` instead to use our brand new Python 3 images. **Keep in mind that Python 3 support is experimental at this point**_
To get started with all the defaults, simply clone the repo and run `./install.sh` in your local check-out. Sentry uses Python 3 by default since December 4th, 2020. If you want/need to stick with the Python 2 versions of the images, you can run `SENTRY_PYTHON2=1 ./install.sh` instead. Note that we are planning to end our Python 2 support completely by January 2021.

During the install, a prompt will ask if you want to create a user account. If you require that the install not be blocked by the prompt, run `./install.sh --no-user-prompt`.

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ x-sentry-defaults: &sentry_defaults
context: ./sentry
args:
- SENTRY_IMAGE
- SENTRY_PYTHON2
- SENTRY_PYTHON3
image: sentry-onpremise-local
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MIN_COMPOSE_VERSION='1.24.1'
MIN_RAM=2400 # MB

# Increase the default 10 second SIGTERM timeout
# to ensure celery queues are properly drained
# to ensure celery queues are properly drained
# between upgrades as task signatures may change across
# versions
STOP_TIMEOUT=60 # seconds
Expand Down Expand Up @@ -217,7 +217,7 @@ echo ""
$dc pull -q --ignore-pull-failures 2>&1 | grep -v -- -onpremise-local || true

# We may not have the set image on the repo (local images) so allow fails
docker pull ${SENTRY_IMAGE}${SENTRY_PYTHON3:+-py3} || true;
docker pull ${SENTRY_IMAGE}${SENTRY_PYTHON2:+-py2}${SENTRY_PYTHON3:+-py3} || true;

echo ""
echo "Building and tagging Docker images..."
Expand Down
3 changes: 2 additions & 1 deletion sentry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG SENTRY_IMAGE
ARG SENTRY_PYTHON2
ARG SENTRY_PYTHON3
FROM ${SENTRY_IMAGE}${SENTRY_PYTHON3:+-py3}
FROM ${SENTRY_IMAGE}${SENTRY_PYTHON2:+-py2}${SENTRY_PYTHON3:+-py3}

COPY . /usr/src/sentry

Expand Down

0 comments on commit 06fb0d7

Please sign in to comment.