This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mypy] | |
python_version = 3.7 | |
warn_return_any = True | |
warn_unused_configs = True | |
[mypy-apache_beam.*] | |
ignore_missing_imports = True | |
[mypy-google.cloud.*] | |
ignore_missing_imports = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- id: 'tests' | |
name: 'python:3.7-slim-buster' | |
args: ['bash', './scripts/tests.sh'] | |
- id: 'docker_build' | |
name: 'gcr.io/cloud-builders/docker' | |
args: ['build', '-t', '${_IMAGE_NAME}:${_IMAGE_TAG}', '.'] | |
images: ['${_IMAGE_NAME}:${_IMAGE_TAG}'] | |
substitutions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7 | |
WORKDIR /app | |
EXPOSE 80 | |
COPY app app | |
COPY *.py ./ | |
COPY *.ini ./ | |
RUN python --version \ | |
&& python -m pip install --upgrade pip setuptools wheel \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x #echo on | |
# entrypoint requires the following variables to be set | |
case $ENVIRONMENT in | |
"prod") | |
export CLOUDSDK_COMPUTE_ZONE="prod" | |
export CLOUDSDK_CONTAINER_CLUSTER="prod" | |
export GCLOUD_PROJECT="prod" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- id: 'tests' | |
name: 'python:3.7-slim-buster' | |
args: ['bash', './scripts/tests.sh'] | |
- id: 'build' | |
name: 'gcr.io/cloud-builders/docker' | |
args: ['build', '-t', '${_IMAGE_NAME}:${BRANCH_NAME}', '.'] | |
- id: 'push' | |
name: 'gcr.io/cloud-builders/docker' | |
args: ['push', '${_IMAGE_NAME}:${BRANCH_NAME}'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults: | |
envs: &envs_defaults | |
ENVIRONMENT: prod | |
DATE: "{{ ds }}" | |
task: &task_defaults | |
type: my_type | |
envs: *envs_defaults | |
tasks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
histogram_quantile(0.50, sum(rate(istio_request_duration_seconds_bucket{reporter="source",destination_service=~"$service"}[1m])) by (le)) | |
round(sum(rate(istio_requests_total{reporter="source",destination_service=~"$service"}[1m])), 0.1) | |
-- success rate should be replaced with error rate | |
sum(rate(istio_requests_total{reporter="source",destination_service=~"$service",response_code!~"5.*"}[1m])) / sum(rate(istio_requests_total{reporter="source",destination_service=~"$service"}[1m])) | |
-- alerts P99 | |
histogram_quantile(0.99, sum(rate(istio_request_duration_seconds_bucket{reporter="source",destination_service="my_service"}[60m])) by (le)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# stopwords.txt | |
# | |
# Freely available stopword list, balancing coverage and size. | |
# | |
# From http://www.lextek.com/manuals/onix/stopwords1.html | |
a | |
about | |
above | |
across |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i | |
me | |
my | |
myself | |
we | |
our | |
ours | |
ourselves | |
you | |
your |