Browse Source

ref: use uwsgi-dogstatsd-plugin pip package (#38027)

anthony sottile 2 years ago
parent
commit
02bafce57e
4 changed files with 6 additions and 10 deletions
  1. 3 10
      docker/Dockerfile
  2. 1 0
      requirements-base.txt
  3. 1 0
      requirements-dev-frozen.txt
  4. 1 0
      requirements-frozen.txt

+ 3 - 10
docker/Dockerfile

@@ -43,7 +43,7 @@ ENV \
   # 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=/usr/local/lib/dogstatsd_plugin.so \
   # grpcio>1.30.0 requires this, see requirements.txt for more detail.
   GRPC_POLL_STRATEGY=epoll1
 
@@ -51,10 +51,9 @@ ENV \
 COPY /dist/requirements-frozen.txt /tmp/requirements-frozen.txt
 RUN set -x \
   && buildDeps="" \
-  # uwsgi
+  # c deps
   && buildDeps="$buildDeps \
   gcc \
-  wget \
   " \
   # maxminddb
   && buildDeps="$buildDeps \
@@ -68,13 +67,7 @@ RUN set -x \
   && apt-get update \
   && apt-get install -y --no-install-recommends $buildDeps \
   && pip install -r /tmp/requirements-frozen.txt \
-  && 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 \
-  && UWSGI_NEED_PLUGIN="" uwsgi --build-plugin /tmp/uwsgi-dogstatsd \
-  && mkdir -p /var/lib/uwsgi \
-  && mv dogstatsd_plugin.so /var/lib/uwsgi/ \
-  && rm -rf /tmp/requirements-frozen.txt /tmp/uwsgi-dogstatsd .uwsgi_plugins_builder \
+  && rm -f /tmp/requirements-frozen.txt \
   && apt-get purge -y --auto-remove $buildDeps \
   # We install run-time dependencies strictly after
   # build dependencies to prevent accidental collusion.

+ 1 - 0
requirements-base.txt

@@ -69,6 +69,7 @@ brotli>=1.0.9
 # See if we can remove LDFLAGS from lib.sh
 # https://github.com/getsentry/sentry/pull/30094
 uWSGI==2.0.20.0
+uwsgi-dogstatsd-plugin>=1.0.0
 zstandard>=0.18.0
 
 msgpack>=1.0.4

+ 1 - 0
requirements-dev-frozen.txt

@@ -175,6 +175,7 @@ unidiff==0.7.4
 uritemplate==4.1.1
 urllib3==1.26.11
 uwsgi==2.0.20.0
+uwsgi-dogstatsd-plugin==1.0.0
 vine==1.3.0
 virtualenv==20.14.1
 websocket-client==1.3.2

+ 1 - 0
requirements-frozen.txt

@@ -119,6 +119,7 @@ unidiff==0.7.4
 uritemplate==4.1.1
 urllib3==1.26.11
 uwsgi==2.0.20.0
+uwsgi-dogstatsd-plugin==1.0.0
 vine==1.3.0
 wsproto==1.1.0
 xmlsec==1.3.11