-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/align-csv-sms-counting
- Loading branch information
Showing
15 changed files
with
146 additions
and
85 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker run --rm -v "$PWD:/mnt" koalaman/shellcheck:v0.9.0 -P ./bin/ -x ./scripts/*.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Shellcheck | ||
on: | ||
push: | ||
paths: | ||
- "**/*.sh" | ||
|
||
jobs: | ||
shellcheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Shellcheck | ||
run: | | ||
.github/workflows/scripts/run-shellcheck.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
#!/bin/sh | ||
|
||
# runs celery with all celery queues except the throtted sms queue | ||
|
||
set -e | ||
|
||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [[ ! -z "${STATSD_HOST}" ]]; then | ||
# Runs celery with all celery queues except the throtted sms queue. | ||
|
||
echo "Initializing... Waiting for CWAgent to become ready." | ||
while : | ||
do | ||
if nc -vz $STATSD_HOST 25888; then | ||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [ -n "${STATSD_HOST}" ]; then | ||
echo "Initializing... Waiting for CWAgent to become ready within the next 30 seconds." | ||
timeout=30 | ||
while [ $timeout -gt 0 ]; do | ||
if nc -vz "$STATSD_HOST" 25888; then | ||
echo "CWAgent is Ready." | ||
break; | ||
break | ||
else | ||
echo "Waiting for CWAgent to become ready." | ||
sleep 1 | ||
timeout=$((timeout - 1)) | ||
fi | ||
done | ||
|
||
if [ $timeout -eq 0 ]; then | ||
echo "Timeout reached. CWAgent did not become ready in 30 seconds." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}" | ||
|
||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=${CELERY_CONCURRENCY-4} -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-sms-tasks,send-sms-high,send-sms-medium,send-sms-low,send-email-tasks,service-callbacks,delivery-receipts | ||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency="${CELERY_CONCURRENCY-4}" -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-sms-tasks,send-sms-high,send-sms-medium,send-sms-low,send-email-tasks,service-callbacks,delivery-receipts |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# runs the celery beat process. This runs the periodic tasks | ||
|
||
set -e | ||
|
||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [[ ! -z "${STATSD_HOST}" ]]; then | ||
# Runs the celery beat process, i.e the Celery periodic tasks. | ||
|
||
echo "Initializing... Waiting for CWAgent to become ready." | ||
while : | ||
do | ||
if nc -vz $STATSD_HOST 25888; then | ||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [ -n "${STATSD_HOST}" ]; then | ||
echo "Initializing... Waiting for CWAgent to become ready within the next 30 seconds." | ||
timeout=30 | ||
while [ $timeout -gt 0 ]; do | ||
if nc -vz "$STATSD_HOST" 25888; then | ||
echo "CWAgent is Ready." | ||
break; | ||
break | ||
else | ||
echo "Waiting for CWAgent to become ready." | ||
sleep 1 | ||
timeout=$((timeout - 1)) | ||
fi | ||
done | ||
|
||
if [ $timeout -eq 0 ]; then | ||
echo "Timeout reached. CWAgent did not become ready in 30 seconds." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
celery -A run_celery.notify_celery beat --loglevel=INFO |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# runs celery with all celery queues except send-throttled-sms-tasks, send-sms-* and send-email-* | ||
|
||
set -e | ||
|
||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [[ ! -z "${STATSD_HOST}" ]]; then | ||
# Runs celery with all celery queues except send-throttled-sms-tasks, | ||
# send-sms-* and send-email-*. | ||
|
||
echo "Initializing... Waiting for CWAgent to become ready." | ||
while : | ||
do | ||
if nc -vz $STATSD_HOST 25888; then | ||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [ -n "${STATSD_HOST}" ]; then | ||
echo "Initializing... Waiting for CWAgent to become ready within the next 30 seconds." | ||
timeout=30 | ||
while [ $timeout -gt 0 ]; do | ||
if nc -vz "$STATSD_HOST" 25888; then | ||
echo "CWAgent is Ready." | ||
break; | ||
break | ||
else | ||
echo "Waiting for CWAgent to become ready." | ||
sleep 1 | ||
timeout=$((timeout - 1)) | ||
fi | ||
done | ||
|
||
if [ $timeout -eq 0 ]; then | ||
echo "Timeout reached. CWAgent did not become ready in 30 seconds." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}" | ||
|
||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=${CELERY_CONCURRENCY-4} -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,service-callbacks,delivery-receipts | ||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency="${CELERY_CONCURRENCY-4}" -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,service-callbacks,delivery-receipts |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# runs celery with only the throttled sms sending queue | ||
|
||
# runs celery with all celery queues except send-throttled-sms-tasks, send-sms-tasks, send-sms-high, send-sms-medium, or send-sms-low | ||
|
||
set -e | ||
|
||
# Runs celery with all celery queues except send-throttled-sms-tasks, | ||
# send-sms-tasks, send-sms-high, send-sms-medium, or send-sms-low. | ||
|
||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [[ ! -z "${STATSD_HOST}" ]]; then | ||
echo "Initializing... Waiting for CWAgent to become ready." | ||
while : | ||
do | ||
if nc -vz $STATSD_HOST 25888; then | ||
if [ -n "${STATSD_HOST}" ]; then | ||
echo "Initializing... Waiting for CWAgent to become ready within the next 30 seconds." | ||
timeout=30 | ||
while [ $timeout -gt 0 ]; do | ||
if nc -vz "$STATSD_HOST" 25888; then | ||
echo "CWAgent is Ready." | ||
break; | ||
break | ||
else | ||
echo "Waiting for CWAgent to become ready." | ||
sleep 1 | ||
timeout=$((timeout - 1)) | ||
fi | ||
done | ||
|
||
if [ $timeout -eq 0 ]; then | ||
echo "Timeout reached. CWAgent did not become ready in 30 seconds." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}" | ||
|
||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=${CELERY_CONCURRENCY-4} -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-email-tasks,send-email-high,send-email-medium,send-email-low,service-callbacks,delivery-receipts | ||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency="${CELERY_CONCURRENCY-4}" -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-email-tasks,send-email-high,send-email-medium,send-email-low,service-callbacks,delivery-receipts |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# runs celery with only the send-email-* queues | ||
|
||
set -e | ||
|
||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [[ ! -z "${STATSD_HOST}" ]]; then | ||
# Runs celery with only the send-email-* queues. | ||
|
||
echo "Initializing... Waiting for CWAgent to become ready." | ||
while : | ||
do | ||
if nc -vz $STATSD_HOST 25888; then | ||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [ -n "${STATSD_HOST}" ]; then | ||
echo "Initializing... Waiting for CWAgent to become ready within the next 30 seconds." | ||
timeout=30 | ||
while [ $timeout -gt 0 ]; do | ||
if nc -vz "$STATSD_HOST" 25888; then | ||
echo "CWAgent is Ready." | ||
break; | ||
break | ||
else | ||
echo "Waiting for CWAgent to become ready." | ||
sleep 1 | ||
timeout=$((timeout - 1)) | ||
fi | ||
done | ||
|
||
if [ $timeout -eq 0 ]; then | ||
echo "Timeout reached. CWAgent did not become ready in 30 seconds." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}" | ||
|
||
# TODO: we shouldn't be using the send-email-tasks queue anymore - once we verify this we can remove it | ||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=${CELERY_CONCURRENCY-4} -Q send-email-tasks,send-email-high,send-email-medium,send-email-low | ||
# TODO: we shouldn't be using the send-email-tasks queue anymore, once we verify this we can remove it | ||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency="${CELERY_CONCURRENCY-4}" -Q send-email-tasks,send-email-high,send-email-medium,send-email-low |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# runs celery with only the send-sms-* queues | ||
set -e | ||
|
||
if [[ ! -z "${STATSD_HOST}" ]]; then | ||
echo "Initializing... Waiting for CWAgent to become ready." | ||
while : | ||
do | ||
if nc -vz $STATSD_HOST 25888; then | ||
# Runs celery with only the send-sms-* queues. | ||
|
||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [ -n "${STATSD_HOST}" ]; then | ||
echo "Initializing... Waiting for CWAgent to become ready within the next 30 seconds." | ||
timeout=30 | ||
while [ $timeout -gt 0 ]; do | ||
if nc -vz "$STATSD_HOST" 25888; then | ||
echo "CWAgent is Ready." | ||
break; | ||
break | ||
else | ||
echo "Waiting for CWAgent to become ready." | ||
sleep 1 | ||
timeout=$((timeout - 1)) | ||
fi | ||
done | ||
|
||
if [ $timeout -eq 0 ]; then | ||
echo "Timeout reached. CWAgent did not become ready in 30 seconds." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}" | ||
|
||
# TODO: we shouldn't be using the send-sms-tasks queue anymore - once we verify this we can remove it | ||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=${CELERY_CONCURRENCY-4} -Q send-sms-tasks,send-sms-high,send-sms-medium,send-sms-low | ||
celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency="${CELERY_CONCURRENCY-4}" -Q send-sms-tasks,send-sms-high,send-sms-medium,send-sms-low |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# runs celery with only the throttled sms sending queue | ||
|
||
set -e | ||
|
||
# Runs celery with only the throttled sms sending queue. | ||
|
||
if [[ ! -z "${STATSD_HOST}" ]]; then | ||
echo "Initializing... Waiting for CWAgent to become ready." | ||
while : | ||
do | ||
if nc -vz $STATSD_HOST 25888; then | ||
# Check and see if this is running in K8s and if so, wait for cloudwatch agent | ||
if [ -n "${STATSD_HOST}" ]; then | ||
echo "Initializing... Waiting for CWAgent to become ready within the next 30 seconds." | ||
timeout=30 | ||
while [ $timeout -gt 0 ]; do | ||
if nc -vz "$STATSD_HOST" 25888; then | ||
echo "CWAgent is Ready." | ||
break; | ||
break | ||
else | ||
echo "Waiting for CWAgent to become ready." | ||
sleep 1 | ||
timeout=$((timeout - 1)) | ||
fi | ||
done | ||
|
||
if [ $timeout -eq 0 ]; then | ||
echo "Timeout reached. CWAgent did not become ready in 30 seconds." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
celery -A run_celery.notify_celery worker --loglevel=INFO --concurrency=1 -Q send-throttled-sms-tasks |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
# run a single unit test, pass in the unit test name for example: tests/app/service/test_rest.py::test_get_template_list | ||
source environment_test.sh | ||
py.test $@ | ||
# shellcheck source=/dev/null # Not finding this file in code base | ||
. environment_test.sh | ||
py.test "$@" |
This file contains 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
This file contains 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