Browse Source

google upgrade, take 2 (#23596)

josh 4 years ago
parent
commit
4d161535d6

+ 1 - 0
.github/workflows/development-environment.yml

@@ -91,6 +91,7 @@ jobs:
         run: |
           python -m venv .venv
           source .venv/bin/activate
+          pip install wheel  # GitHub Actions does not have `wheel` installed by default
           make install-py-dev
           make setup-git
           curl https://get.volta.sh | bash

+ 1 - 1
Makefile

@@ -68,7 +68,7 @@ ensure-venv:
 	@./scripts/ensure-venv.sh
 
 ensure-pinned-pip: ensure-venv
-	$(PIP) install --no-cache-dir --upgrade "pip>=20.0.2"
+	$(PIP) install --no-cache-dir --upgrade "pip>=20.0.2,<20.3"
 
 setup-git-config:
 	@git config --local branch.autosetuprebase always

+ 5 - 2
docker/Dockerfile

@@ -47,7 +47,8 @@ RUN set -x \
   && apt-get purge -y --auto-remove $buildDeps
 
 # Sane defaults for pip
-ENV PIP_NO_CACHE_DIR=off \
+ENV \
+  PIP_NO_CACHE_DIR=off \
   PIP_DISABLE_PIP_VERSION_CHECK=1 \
   # Sentry config params
   SENTRY_CONF=/etc/sentry \
@@ -55,7 +56,9 @@ ENV PIP_NO_CACHE_DIR=off \
   # Thank to https://stackoverflow.com/a/25260588/90297
   UWSGI_PROFILE_OVERRIDE=ssl=false;xml=false;routing=false \
   # UWSGI dogstatsd plugin
-  UWSGI_NEED_PLUGIN=/var/lib/uwsgi/dogstatsd
+  UWSGI_NEED_PLUGIN=/var/lib/uwsgi/dogstatsd \
+  # grpcio>1.30.0 requires this, see requirements.txt for more detail.
+  GRPC_POLL_STRATEGY=epoll1
 
 # Copy and install dependencies first to leverage Docker layer caching.
 COPY /dist/requirements.txt /tmp/dist/requirements.txt

+ 13 - 8
requirements-base.txt

@@ -12,13 +12,13 @@ django-sudo>=3.0.0,<4.0.0
 Django>=1.11,<1.12
 djangorestframework==3.6.4
 email-reply-parser>=0.5.0,<0.6.0
-google-api-core==1.14.3
-google-auth==1.6.3
-google-cloud-core==0.29.1
-google-cloud-bigtable==0.32.2
-google-cloud-pubsub==0.35.4
-google-cloud-storage==1.13.3
-googleapis-common-protos==1.6.0
+google-api-core==1.25.1
+google-auth==1.24.0
+google-cloud-bigtable==1.6.1
+google-cloud-core==1.5.0
+googleapis-common-protos==1.52.0
+google-cloud-pubsub==2.2.0
+google-cloud-storage==1.35.0
 jsonschema==3.2.0
 lxml>=4.6.1,<4.7.0
 maxminddb==1.5.4
@@ -50,7 +50,7 @@ rfc3986-validator==0.1.1
 sentry-relay>=0.8.1,<0.9.0
 sentry-sdk>=0.19.5,<0.20.0
 simplejson>=3.11.0,<3.12.0
-six>=1.11.0,<1.12.0
+six>=1.13.0
 sqlparse>=0.2.0,<0.3.0
 statsd>=3.1.0,<3.2.0
 structlog==17.1.0
@@ -67,6 +67,11 @@ msgpack>=1.0.0,<1.1.0
 billiard==3.6.3
 kombu==4.6.11
 
+# Note, grpcio>1.30.0 requires setting GRPC_POLL_STRATEGY=epoll1
+# See https://github.com/grpc/grpc/issues/23796 and
+# https://github.com/grpc/grpc/blob/v1.35.x/doc/core/grpc-polling-engines.md#polling-engine-implementations-in-grpc
+grpcio==1.35.0
+
 # not directly used, but provides a speedup for redis
 hiredis==0.3.1
 

+ 8 - 10
src/sentry/filestore/gcs.py

@@ -137,16 +137,14 @@ class FancyBlob(Blob):
         self.download_url = download_url
         super().__init__(*args, **kwargs)
 
-    def _get_download_url(self):
-        if self.media_link is None:
-            download_url = "{download_url}/download/storage/v1{path}?alt=media".format(
-                download_url=self.download_url, path=self.path
-            )
-            if self.generation is not None:
-                download_url += "&generation={:d}".format(self.generation)
-            return download_url
-        else:
-            return self.media_link
+    def _get_download_url(self, *args, **kwargs):
+        # media_link is for public objects; we completely ignore it.
+        download_url = "{download_url}/download/storage/v1{path}?alt=media".format(
+            download_url=self.download_url, path=self.path
+        )
+        if self.generation is not None:
+            download_url += "&generation={:d}".format(self.generation)
+        return download_url
 
 
 class GoogleCloudFile(File):

+ 0 - 1
src/sentry/utils/pytest/sentry.py

@@ -273,7 +273,6 @@ def pytest_collection_modifyitems(config, items):
 
         # In the case where we group by round robin (e.g. TEST_GROUP_STRATEGY is not `file`),
         # we want to only include items in `accepted` list
-
         item_to_group = (
             int(md5(str(item.location[0]).encode("utf-8")).hexdigest(), 16)
             if grouping_strategy == "file"