From db78485c0bb9738bdcfc023f307aff1684864ff2 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 14 Oct 2020 21:29:09 +0300 Subject: [PATCH 1/4] feat(py3): Add Python 3 support via SENTRY_PY3 env variable --- README.md | 2 ++ docker-compose.yml | 2 +- install.sh | 2 +- sentry/Dockerfile | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e7d929889e2..c0a927015b7 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Official bootstrap for running your own [Sentry](https://sentry.io/) with [Docke 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_PY3=1 ./install.sh` instead to use our brand new Python 3 images. **Keep in mind that Python 3 support is experimental at this point**_ + 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`. There may need to be modifications to the included example config files (`sentry/config.example.yml` and `sentry/sentry.conf.example.py`) to accommodate your needs or your environment (such as adding GitHub credentials). If you want to perform these, do them before you run the install script and copy them without the `.example` extensions in the name (such as `sentry/sentry.conf.py`) before running the `install.sh` script. diff --git a/docker-compose.yml b/docker-compose.yml index d0d5ce39f84..1fd12d82edb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ x-sentry-defaults: &sentry_defaults context: ./sentry args: - SENTRY_IMAGE + - SENTRY_PY3 image: sentry-onpremise-local depends_on: - redis @@ -60,7 +61,6 @@ services: nofile: soft: 10032 hard: 10032 - postgres: << : *restart_policy image: 'postgres:9.6' diff --git a/install.sh b/install.sh index 9f22a17ead4..62a55353e89 100755 --- a/install.sh +++ b/install.sh @@ -207,7 +207,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 || true; +docker pull ${SENTRY_IMAGE}${SENTRY_PY3:+-py3} || true; echo "" echo "Building and tagging Docker images..." diff --git a/sentry/Dockerfile b/sentry/Dockerfile index f9484f295b2..5037368d35f 100644 --- a/sentry/Dockerfile +++ b/sentry/Dockerfile @@ -1,5 +1,6 @@ ARG SENTRY_IMAGE -FROM ${SENTRY_IMAGE} +ARG SENTRY_PY3 +FROM ${SENTRY_IMAGE}${SENTRY_PY3:+-py3} COPY . /usr/src/sentry From 2d32c4b33e0dc3e7b12b29b063ee974b0cbaef14 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 14 Oct 2020 21:36:35 +0300 Subject: [PATCH 2/4] add py3 to tests too --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e53def0b6ee..eefb804f522 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,9 @@ env: DOCKER_COMPOSE_VERSION: 1.24.1 jobs: test: + strategy: + matrix: + py3: ['', '1'] runs-on: ubuntu-18.04 name: "test" steps: @@ -28,6 +31,7 @@ jobs: - name: Install and test env: COMPOSE_PARALLEL_LIMIT: 10 + SENTRY_PY3: ${{ matrix.py3 }} run: | ./install.sh ./test.sh From 9cd10864257d64ce102403305b8ab1d8cff46d6e Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 14 Oct 2020 21:38:57 +0300 Subject: [PATCH 3/4] <3 @joshuarli --- .github/workflows/test.yml | 2 +- README.md | 2 +- docker-compose.yml | 2 +- install.sh | 2 +- sentry/Dockerfile | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eefb804f522..da4578a6ec5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: - name: Install and test env: COMPOSE_PARALLEL_LIMIT: 10 - SENTRY_PY3: ${{ matrix.py3 }} + SENTRY_PYTHON3: ${{ matrix.py3 }} run: | ./install.sh ./test.sh diff --git a/README.md b/README.md index c0a927015b7..4d7fea2536d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Official bootstrap for running your own [Sentry](https://sentry.io/) with [Docke 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_PY3=1 ./install.sh` instead to use our brand new Python 3 images. **Keep in mind that Python 3 support is experimental at this point**_ +_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**_ 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`. diff --git a/docker-compose.yml b/docker-compose.yml index 1fd12d82edb..4a082d801a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ x-sentry-defaults: &sentry_defaults context: ./sentry args: - SENTRY_IMAGE - - SENTRY_PY3 + - SENTRY_PYTHON3 image: sentry-onpremise-local depends_on: - redis diff --git a/install.sh b/install.sh index 62a55353e89..d5fafc5bb06 100755 --- a/install.sh +++ b/install.sh @@ -207,7 +207,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_PY3:+-py3} || true; +docker pull ${SENTRY_IMAGE}${SENTRY_PYTHON3:+-py3} || true; echo "" echo "Building and tagging Docker images..." diff --git a/sentry/Dockerfile b/sentry/Dockerfile index 5037368d35f..7a5b3a8bf41 100644 --- a/sentry/Dockerfile +++ b/sentry/Dockerfile @@ -1,6 +1,6 @@ ARG SENTRY_IMAGE -ARG SENTRY_PY3 -FROM ${SENTRY_IMAGE}${SENTRY_PY3:+-py3} +ARG SENTRY_PYTHON3 +FROM ${SENTRY_IMAGE}${SENTRY_PYTHON3:+-py3} COPY . /usr/src/sentry From 90c91dd512d60cdf21c4d2186cfe388b4c368a07 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Wed, 14 Oct 2020 21:45:25 +0300 Subject: [PATCH 4/4] better workflow naming --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da4578a6ec5..f8165944362 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: matrix: py3: ['', '1'] runs-on: ubuntu-18.04 - name: "test" + name: "test${{ matrix.py3 == '1' && ' PY3' || ''}}" steps: - name: Pin docker-compose run: |