diff --git a/.circleci/config.yml b/.circleci/config.yml
index 51d0e13b..68f940b0 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -8,15 +8,15 @@ commands:
steps:
- restore_cache:
keys:
- - v7-pip-dependencies-{{ checksum "requirements/test/test.txt" }}-{{ checksum "requirements/base/base.txt" }}
+ - v10-pip-dependencies-{{ checksum "requirements/test/test.txt" }}-{{ checksum "requirements/base/base.txt" }}
# fallback to using the latest cache if no exact match is found
- - v7-pip-dependencies-
+ - v10-pip-dependencies-
save_cache_cmd:
steps:
- save_cache:
paths:
- "env"
- key: v7-pip-dependencies-{{ checksum "requirements/test/test.txt" }}-{{ checksum "requirements/base/base.txt" }}
+ key: v10-pip-dependencies-{{ checksum "requirements/test/test.txt" }}-{{ checksum "requirements/base/base.txt" }}
orbs:
slack: circleci/slack@3.4.2
diff --git a/.gitignore b/.gitignore
index 719d7d18..5c6dec07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,6 +43,7 @@ npm-debug.log
.python-version
env-local.sh
*.dump
+*.pgdump
.envrc
.direnv
.vscode
diff --git a/Dockerfile b/Dockerfile
index 1e9f8748..fbd86ae3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,7 +7,7 @@ RUN npm install --silent
COPY frontend/ /code/
RUN npm run build
-FROM python:3.8-slim as base
+FROM python:3.8-slim-bullseye as base
# Create a group and user to run our app
ARG APP_USER=appuser
@@ -43,6 +43,7 @@ RUN set -ex \
build-essential \
libpcre3-dev \
libpq-dev \
+ git-core \
" \
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
&& pip install -U -q pip-tools \
diff --git a/README.rst b/README.rst
index 621c9afe..46b938a5 100644
--- a/README.rst
+++ b/README.rst
@@ -1,18 +1,10 @@
-NC Traffic Stops
+NC CopWatch
================
-.. image:: https://badge.waffle.io/OpenDataPolicingNC/Traffic-Stops.svg?label=ready&title=Ready
- :target: https://waffle.io/OpenDataPolicingNC/Traffic-Stops
- :alt: 'Stories in Ready'
+.. image:: https://circleci.com/gh/caktus/Traffic-Stops.svg?style=svg
+ :target: https://circleci.com/gh/caktus/Traffic-Stops
-.. image:: https://readthedocs.org/projects/nc-traffic-stops/badge/?version=latest
- :target: http://nc-traffic-stops.readthedocs.org/en/latest/
- :alt: Documentation Status
-
-.. image:: https://travis-ci.org/OpenDataPolicingNC/Traffic-Stops.svg?branch=master
- :target: https://travis-ci.org/OpenDataPolicingNC/Traffic-Stops
-
-NC Traffic Stops is a website to monitor and identify racial profiling
+NC CopWatch is a website to monitor and identify racial profiling
practices by North Carolina law enforcement agencies. This project is lead by
`Forward Justice`_, a nonpartisan law, policy, and strategy center dedicated to advancing racial,
social, and economic justice in the U.S. South.
@@ -20,6 +12,4 @@ social, and economic justice in the U.S. South.
Please see the `production documentation`_ and `development documentation`_
for more information.
-.. _production documentation: http://nc-traffic-stops.readthedocs.org/en/latest/
-.. _development documentation: http://nc-traffic-stops.readthedocs.org/en/dev/
.. _Forward Justice: https://forwardjustice.org/
diff --git a/deploy/deploy-hosting-services.yml b/deploy/deploy-hosting-services.yml
index 9c1008f0..574946d4 100644
--- a/deploy/deploy-hosting-services.yml
+++ b/deploy/deploy-hosting-services.yml
@@ -6,3 +6,7 @@
gather_facts: false
roles:
- role: caktus.k8s-hosting-services
+ tasks:
+ - import_role:
+ name: caktus.k8s-hosting-services
+ tasks_from: monitoring
diff --git a/deploy/group_vars/all.yml b/deploy/group_vars/all.yml
index 2c458a62..4a5cc886 100644
--- a/deploy/group_vars/all.yml
+++ b/deploy/group_vars/all.yml
@@ -42,6 +42,7 @@ cloudformation_stack:
UseAES256Encryption: "true"
CustomerManagedCmkArn: ""
ContainerInstanceType: t3a.medium
+ ContainerVolumeSize: 40
DatabaseAllocatedStorage: 100
DatabaseClass: db.t3.large
DatabaseEngineVersion: "12"
@@ -71,17 +72,33 @@ k8s_ci_repository_arn: arn:aws:ecr:us-east-2:606178775542:repository/traff-appli
k8s_ci_vault_password_arn: arn:aws:secretsmanager:us-east-2:606178775542:secret:trafficstops-ansible-vault-password-XKpR8f
k8s_letsencrypt_email: admin@caktusgroup.com
-# New Relic Infrastructure: Caktus Paid Account
-k8s_newrelic_license_key: !vault |
- $ANSIBLE_VAULT;1.1;AES256
- 31623963653434303137323231656263643235616539316537346331646133313732316465623865
- 3438623336353035323437653033313434646366383236390a656531636336663530373462323331
- 32643434333833363433663932316534373565663035383334336231313366373763303263393836
- 3035363662323335630a306331303761303434633235616564386362353766336462656535663033
- 31333537343865616436623063386539303339653165636664633736666365623337326363646437
- 6565393035313438666364363231353562613334376135663031
+k8s_iam_users: [copelco]
+
+# Pin ingress-nginx and cert-manager to current versions so future upgrades of this
+# role will not upgrade these charts without your intervention:
+# https://github.com/kubernetes/ingress-nginx/releases
+k8s_ingress_nginx_chart_version: "3.39.0"
+# https://github.com/jetstack/cert-manager/releases
+k8s_cert_manager_chart_version: "v1.6.1"
+# AWS only:
+# Use the newer load balancer type (NLB). DO NOT edit k8s_aws_load_balancer_type after
+# creating your Service.
+k8s_aws_load_balancer_type: nlb
+
+# ----------------------------------------------------------------------------
+# caktus.k8s-hosting-services: Logging and monitoring configuration
+# ----------------------------------------------------------------------------
k8s_papertrail_logspout_destination: "syslog+tls://logs2.papertrailapp.com:20851"
k8s_papertrail_logspout_memory_limit: 128Mi
-k8s_iam_users: [copelco]
+# New Relic Infrastructure: admin+newrelic@caktusgroup.com
+k8s_newrelic_chart_version: "3.2.4"
+k8s_newrelic_license_key: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 37656631623333346263383231386165666531333961373931383661366338343634333362356430
+ 3963613833663637313632373465613730383365626461630a383432346335386632303935356532
+ 61643737636132336339336332396262623362333663333130393031376338363266363430326136
+ 6131396135646236360a323766623330313365306539316263393533623063346166653433316631
+ 39356263623363653934333064376364363562303236646238666234356136663539343064383463
+ 3161356339656137373935623562366134393765346466643365
diff --git a/deploy/requirements.yml b/deploy/requirements.yml
index fdd60ed0..9cf8e56b 100644
--- a/deploy/requirements.yml
+++ b/deploy/requirements.yml
@@ -2,7 +2,7 @@
- src: https://github.com/caktus/ansible-role-django-k8s
name: caktus.django-k8s
- version: v0.0.11
+ version: v1.3.0
- src: https://github.com/caktus/ansible-role-aws-web-stacks
name: caktus.aws-web-stacks
@@ -10,8 +10,8 @@
- src: https://github.com/caktus/ansible-role-k8s-web-cluster
name: caktus.k8s-web-cluster
- version: v0.0.7
+ version: v1.1.0
- src: https://github.com/caktus/ansible-role-k8s-hosting-services
name: caktus.k8s-hosting-services
- version: v0.0.1
+ version: v0.3.0
diff --git a/docs/deploy.rst b/docs/deploy.rst
index 4cc32e89..41d86ac5 100644
--- a/docs/deploy.rst
+++ b/docs/deploy.rst
@@ -14,7 +14,7 @@ Caktus AWS Access
.. code-block::
[trafficstops]
- role_arn = arn:aws:iam::000000000000:role/CaktusAccessRole
+ role_arn = arn:aws:iam::000000000000:role/CaktusAccountAccessRole-Admins
source_profile = caktus
See LastPass entry *Traffic Stops AWS Profile role_arn* for the AWS account
@@ -111,4 +111,3 @@ Deploy application
4. Deploy::
inv staging deploy --tag=...
-=======
diff --git a/docs/hosting-services.md b/docs/hosting-services.md
new file mode 100644
index 00000000..32bfe2ec
--- /dev/null
+++ b/docs/hosting-services.md
@@ -0,0 +1,34 @@
+# Hosting Services
+
+The services configured for this project are:
+* PostgreSQL database backups to S3 (within Caktus AWS account)
+ * Currently, this is only `traffic_stops`, which contains users, census data, etc.
+ * `traffic_stops_nc` is not backed up since the entire dataset is re-imported daily.
+* Papertrail logging (to Caktus account)
+* New Relic Infrastructure monitoring (Account: `admin+newrelic@caktusgroup.com`)
+
+
+## Production database disaster recovery
+
+In the event a restore from a historical backup is needed, access to the [Caktus
+AssumeRole is
+required](https://github.com/caktus/caktus-hosting-services/blob/main/docs/aws-assumerole.md#aws-accounts).
+Once you have that access, you can use invoke tools to pull historical backups.
+
+To download the latest `daily` backup:
+
+```sh
+inv utils.get-db-backup
+```
+
+
+## Production backup configuration
+
+[caktus.k8s-hosting-services](https://github.com/caktus/ansible-role-k8s-hosting-services)
+manages database backups.
+
+Run this command to set up database backups and monitoring services:
+
+```sh
+inv deploy.playbook -n deploy-hosting-services.yml
+```
diff --git a/frontend/src/Components/Charts/ChartPrimitives/Bar.js b/frontend/src/Components/Charts/ChartPrimitives/Bar.js
index 947581b7..be1bed30 100644
--- a/frontend/src/Components/Charts/ChartPrimitives/Bar.js
+++ b/frontend/src/Components/Charts/ChartPrimitives/Bar.js
@@ -2,10 +2,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import { VictoryAxis, VictoryBar, VictoryChart, VictoryContainer } from 'victory';
import { AXIS_STYLE } from './chartConstants';
+import ChartLoading from 'Components/Charts/ChartPrimitives/ChartLoading';
import BarSkeleton from 'Components/Elements/Skeletons/BarSkeleton';
function Bar({ data, chartProps, xAxisProps, yAxisProps, barProps }) {
- if (!data) return ;
+ if (!data) return ;
return (
{hasError && some chart error message
}
- {isLoading && }
+ {isLoading && }
{chartTitle}
{!hideLegend && (