Skip to content
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

WIP - ref(build): Support building Arm64 Docker image #38180

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7a41eb5
feat(build): Install libxmlsec1-dev with heroku-buildpack-apt
armenzg Aug 23, 2022
02af4dc
Requirements for uwsgi
armenzg Aug 23, 2022
06038a0
Temporarily use runtime.txt and later use setup.py
armenzg Aug 23, 2022
c7b533a
feat(build): Switch back to containers rather than buildpacks
armenzg Aug 23, 2022
ad08efb
feat(build): Allow building Sentry Docker image from local checkout
armenzg Aug 23, 2022
c38b5b0
Simplify local Docker build
armenzg Aug 23, 2022
8674e21
Skip two steps
armenzg Aug 23, 2022
00a359d
Try again
armenzg Aug 23, 2022
b14330a
Start from blank slate
armenzg Aug 23, 2022
bb58363
A bit more Docker
armenzg Aug 23, 2022
974cf37
Add a bunch more
armenzg Aug 23, 2022
3b70c0a
Add missing parts
armenzg Aug 23, 2022
c6a8a94
Remove
armenzg Aug 23, 2022
37f5c9f
Minor fix
armenzg Aug 23, 2022
6d3122a
Build deps for psycopg2-binary
armenzg Aug 23, 2022
692c001
Create image that uses for Heroku
armenzg Aug 24, 2022
31a3108
Use 0.0.0.0
armenzg Aug 24, 2022
c6d5681
Try non-root user
armenzg Aug 24, 2022
6ff21c9
Try using gunicorn
armenzg Aug 24, 2022
5cb4537
Go away from gunicorn
armenzg Aug 24, 2022
6621020
Try using a worker
armenzg Aug 25, 2022
30ec37e
Less layers
armenzg Aug 25, 2022
f6aafc7
Try again
armenzg Aug 25, 2022
7ee1dcb
Remove Docker ignore for now
armenzg Aug 25, 2022
163b2c5
It has something to do with the Docker build context
armenzg Aug 25, 2022
c31fbf3
Make it similar and remove labels
armenzg Aug 25, 2022
5da94f1
Lower the number of layers
armenzg Aug 25, 2022
7065b68
Sorted
armenzg Aug 26, 2022
3280c16
Only dependencies for web runner
armenzg Aug 26, 2022
bb890dd
Fix Docker build
armenzg Aug 26, 2022
edd5889
Lower hiredis version
armenzg Aug 26, 2022
14eda83
Add zstandard
armenzg Aug 26, 2022
911baa5
Tweak
armenzg Aug 26, 2022
c03880d
Try exec form
armenzg Aug 26, 2022
5aee651
Try this
armenzg Aug 26, 2022
2b55eb1
Try again
armenzg Aug 26, 2022
9b6925b
Add a release step
armenzg Aug 26, 2022
b2ac94b
confluent-kafka
armenzg Aug 26, 2022
ad2719c
Use our own built packages
armenzg Aug 26, 2022
8229116
Restore
armenzg Aug 26, 2022
39f135b
Ignore frozen
armenzg Aug 26, 2022
0eb5fba
Merge branch 'master' into armenzg/build/arm64-docker
armenzg Aug 26, 2022
d5ab4c2
Restore Dockerfile
armenzg Aug 26, 2022
285b9bb
Restore file
armenzg Aug 26, 2022
d3ea70d
Restore more
armenzg Aug 26, 2022
24f48f2
Move
armenzg Aug 26, 2022
febe0e3
Reducing differences
armenzg Aug 26, 2022
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
!/yarn.lock
!/dist/requirements-frozen.txt
!/dist/*.whl
# To allow local builds
!/requirements-frozen.txt
13 changes: 10 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM python:3.8.13-slim-bullseye
# The Cloud build uses /dist as a place to cache wheels and others
ARG DIST_DIR=.

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title="Sentry"
Expand Down Expand Up @@ -48,7 +50,7 @@ ENV \
GRPC_POLL_STRATEGY=epoll1

# Install dependencies first to leverage Docker layer caching.
COPY /dist/requirements-frozen.txt /tmp/requirements-frozen.txt
COPY ${DIST_DIR}/requirements-frozen.txt /tmp/requirements-frozen.txt
RUN set -x \
&& buildDeps="" \
# uwsgi
Expand All @@ -67,7 +69,11 @@ RUN set -x \
" \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
# HACK: Using our own builds of these
&& pip install --index-url https://pypi.devinfra.sentry.io/simple confluent-kafka==1.9.2 psycopg2-binary==2.8.6 \
&& pip install -r /tmp/requirements-frozen.txt \
# HACK: Installing Sentry here since we don't have access to wheels in /dist
&& pip install sentry \
&& mkdir /tmp/uwsgi-dogstatsd \
&& wget -O - https://github.com/eventbrite/uwsgi-dogstatsd/archive/filters-and-tags.tar.gz | \
tar -xzf - -C /tmp/uwsgi-dogstatsd --strip-components=1 \
Expand Down Expand Up @@ -103,8 +109,9 @@ RUN set -x \
&& python -c 'import maxminddb.extension; maxminddb.extension.Reader' \
&& mkdir -p $SENTRY_CONF

COPY /dist/*.whl /tmp/dist/
RUN pip install /tmp/dist/*.whl --no-deps && pip check && rm -rf /tmp/dist
# HACK: We do not have access to /dist; doing pip install sentry up above
# COPY /dist/*.whl /tmp/dist/
# RUN pip install /tmp/dist/*.whl --no-deps && pip check && rm -rf /tmp/dist
RUN sentry help | sed '1,/Commands:/d' | awk '{print $1}' > /sentry-commands.txt

COPY ./docker/sentry.conf.py ./docker/config.yml $SENTRY_CONF/
Expand Down
2 changes: 2 additions & 0 deletions docker/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ steps:
'--use-new-run',
'--build-arg',
'SOURCE_COMMIT=$COMMIT_SHA',
'--build-arg',
'DIST_DIR=/dist',
'--destination=us.gcr.io/$PROJECT_ID/sentry-builder:$COMMIT_SHA',
'-f',
'./docker/builder.dockerfile',
Expand Down