Commit Graph

19 Commits

Author SHA1 Message Date
Daniel Sanche c4d86703c5
Add licenses (#367) 2020-07-15 11:56:37 -07:00
dependabot[bot] fccaff8885
Bump httplib2 from 0.12.1 to 0.18.0 in /src/emailservice (#349)
Bumps [httplib2](https://github.com/httplib2/httplib2) from 0.12.1 to 0.18.0.
- [Release notes](https://github.com/httplib2/httplib2/releases)
- [Changelog](https://github.com/httplib2/httplib2/blob/master/CHANGELOG)
- [Commits](https://github.com/httplib2/httplib2/compare/v0.12.1...v0.18.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-18 10:47:44 -07:00
Daniel Sanche 1cf78ea7d8
Fix local clusters (#318) 2020-04-08 20:29:21 -07:00
dependabot[bot] 12f06ab19d
Bump urllib3 from 1.24.1 to 1.24.2 in /src/emailservice (#314) 2020-04-08 15:36:07 -07:00
Megan O'Keefe 90f9287f3a
Adds option to disable Stackdriver Export (#293) 2020-02-20 15:26:44 -05:00
Morgan McLean 595bd21d38
Set environment variable to enable Profiler (#239) 2020-02-14 16:49:24 -08:00
Megan O'Keefe 04b2084779
[WIP] Fixes emailservice CrashLoop when Workload Identity is enabled (#280)
* Adds explicit PROJECT_ID for stackdriver exporter

* save work

* cleanup
2019-12-17 13:41:59 -05:00
Joseph Sirianni 24ca9eecef use python 3.7, as python:3-slim is now using python 3.8. (#254) 2019-10-16 10:11:05 -07:00
Daniel Sanche 4681320f80 got rid of errors in Stackdriver Logging (#245) 2019-09-20 15:11:49 -04:00
Kalyana Chadalavada 86fb1662a3 Add Stackdriver Profiler Python agent (#176)
* Add Stackdriver Profiler Python agent to EmailService and
RecommendationService

* Update recommendation_server.py

* Moved Profiler init to a function

* Moved Profiler init to a function

* Delete key.json

* Delete key.json

* Delete key.json
2019-05-03 10:29:34 -07:00
Dustin Ingram aaf2f8717d Simplify package management for python services (#120)
This PR does a few things:

1. **Removes unnecessary Python dependencies currently being installed for `emailservice`**

    There are quite a few packages being installed that aren't actual dependencies.

2. **Removes a number of related, also unnecessary system-level dependencies for `emailservice`**

    These were a result of the Python dependencies that are unnecessary.

3. **Pins all of the sub-dependencies for `loadgenerator`**

    This is good practice to ensure that things don't break one day in the future when a newer version of an unpinned sub-dependenency is released.

4. **Compile all Python dependencies from `requirements.in` files**

    This is mostly bookkeeping. It allows us to only specify the top-level dependencies we care about in the requirements.in files, which are then compiled to frozen dependencies in the requirements.txt files. This ensures that we only install the dependencies we need, and that we're not missing any unpinned sub-dependencies. It also makes it more clear where our sub-dependencies are coming from.

5. **Switch to -slim images from -alpine**

    Python's built distribution format (wheel) is incompatible with alpine-based images, causing dependencies like `grpcio` to be compiled from scratch, rather than from a pre-built wheel.

    This should improve or possibly fi​x #58, while keeping the image size roughly the same:

    ```
    emailservice          latest           d1b818eabe05        6 seconds ago       286MB
    loadgenerator         latest           4d9b5acbfbbb        6 seconds ago       125MB
    ```
2019-01-11 14:59:27 -08:00
Chris Kleinknecht 5272a4d821 Re-enable opencensus python (#103)
Enables tracing in the email and recommendation services, which was disabled in 316db88 because of a memory leak in the stackdriver exporter.

We fixed the leak in https://github.com/googleapis/google-cloud-python/pull/6856. The fix is included in the [0.1.10 release of opencensus-python](https://github.com/census-instrumentation/opencensus-python/releases/tag/v0.1.10).

With this diff, traces show up as expected in stackdriver while running the demo on GKE. Using an `opencensus-python` package version before `0.1.10` causes the email and recommendation services to leak memory until they OOM. Memory use is back to normal (i.e. roughly constant) using the new package version.
2018-12-11 16:15:51 -08:00
davidstanke 9b055cabfb update requests package (#92) 2018-10-29 20:39:44 -07:00
Ahmet Alp Balkan 3b6d3864a0
grpc: bump health-probe to v0.2.0 (#71)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-10-09 15:54:55 -07:00
Yoshi Yamaguchi 7f40378ecc log: change log format to JSON payload for better log in Stackdriver (#66)
change the log format in Python and Node.js services.

Effected services are currencyservice, emailservice, paymentservice,
and recommendationservice. Loadgenerator is left as is because of
the diffculty to change the log format and log target in locust.

ref. #47
2018-10-05 11:23:45 -07:00
Colin Nelson 2924250449 emailservice Image Optimization (#51)
Reduce docker image for emailservice to ~240 MB (down from ~ 1.31 GB)

Main application (`email_server.py`) now runs as python 2.7. Before we had both Python 2.7 and Python 3 installed in the image.

Switched to using `python:2.7-alpine3.8` as the base image, and used multi-stage dockerfiles to keep dependencies minimal.

Fixes #49 

From my shell:
```
$ docker build -t emailservice:dev . && docker run -it emailservice:dev
Sending build context to Docker daemon  97.28kB
Step 1/17 : FROM python:2.7-alpine3.8 as base
 ---> b2bc7255b42c
Step 2/17 : FROM base as builder
 ---> b2bc7255b42c
Step 3/17 : RUN apk add --update --no-cache     gcc     linux-headers     make     musl-dev     python-dev     g++     cairo-dev     cairo     openssl-dev     gobject-introspection-dev
 ---> Using cache
 ---> 6daf3d9fe49a
Step 4/17 : ENV GRPC_PYTHON_VERSION 1.15.0
 ---> Using cache
 ---> 3e33d97d9580
Step 5/17 : RUN python -m pip install --upgrade pip
 ---> Using cache
 ---> e8fa3879c282
Step 6/17 : RUN pip install grpcio==${GRPC_PYTHON_VERSION} grpcio-tools==${GRPC_PYTHON_VERSION}
 ---> Using cache
 ---> c6fba7743eed
Step 7/17 : COPY requirements.txt .
 ---> Using cache
 ---> 1f6b0a444980
Step 8/17 : RUN pip install -r requirements.txt
 ---> Using cache
 ---> 8cc0a7af6aa8
Step 9/17 : FROM base as final
 ---> b2bc7255b42c
Step 10/17 : RUN GRPC_HEALTH_PROBE_VERSION=v0.1.0-alpha.1 &&     wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 &&     chmod +x /bin/grpc_health_probe
 ---> Using cache
 ---> e954a0384081
Step 11/17 : ENV PYTHONUNBUFFERED=0
 ---> Using cache
 ---> 64ece3d72a66
Step 12/17 : WORKDIR /email_server
 ---> Using cache
 ---> 27b34dc14492
Step 13/17 : COPY --from=builder /usr/local/lib/python2.7/ /usr/local/lib/python2.7/
 ---> Using cache
 ---> 60035ec8dfd4
Step 14/17 : RUN apk add --no-cache libstdc++
 ---> Using cache
 ---> 920be90c126e
Step 15/17 : COPY . .
 ---> Using cache
 ---> 9541bed2d7a0
Step 16/17 : EXPOSE 8080
 ---> Using cache
 ---> 48fbeaa852b9
Step 17/17 : ENTRYPOINT [ "python", "email_server.py" ]
 ---> Using cache
 ---> ff317770992d
Successfully built ff317770992d
Successfully tagged emailservice:dev
starting the email service in dummy mode.
listening on port: 8080
```
2018-09-25 16:43:39 -07:00
Ahmet Alp Balkan 880ee16be2
grpc: add health checks to python services (#28)
also converted line endings for recommendationservice/requirements.txt from
dos to unix.
2018-09-19 12:34:56 -07:00
Ahmet Alp Balkan d0128060e4
Add LICENSE headers to source files
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-25 09:54:28 -07:00
michaelawyu 05381b3626 Add emailservice
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-07-24 21:08:29 -07:00