Skip to content

Commit

Permalink
Merge branch 'develop' into cicd-nightly-trigger-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-jameson authored Dec 2, 2022
2 parents 5a2761b + 014056a commit 8409ad3
Show file tree
Hide file tree
Showing 21 changed files with 1,628 additions and 53 deletions.
3 changes: 3 additions & 0 deletions tdrs-backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ AWS_REGION_NAME=us-gov-west-1
# Database startup script options
POSTGRES_CHECK_TIMEOUT=30
POSTGRES_CHECK_INTERVAL=1

# Elastic stack
ELASTIC_HOST=elastic:9200
5 changes: 3 additions & 2 deletions tdrs-backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG gid=1000
ENV DJANGO_SETTINGS_MODULE=tdpservice.settings.local
ENV DJANGO_CONFIGURATION=Local
# Allows docker to cache installed dependencies between builds
COPY Pipfile /tdpapp/
COPY Pipfile Pipfile.lock /tdpapp/
WORKDIR /tdpapp/
# Download latest listing of available packages:
RUN apt-get -y update
Expand All @@ -17,7 +17,8 @@ RUN apt-get -y upgrade
# Install a new package:
RUN apt-get install -y gcc && apt-get install -y graphviz && apt-get install -y graphviz-dev
# Install pipenv
RUN pip install --upgrade pip pipenv && pipenv install --dev --system --deploy --skip-lock
RUN pip install --upgrade pip pipenv
RUN pipenv install --dev --system --deploy

# Adds our application code to the image
COPY . /tdpapp
Expand Down
4 changes: 4 additions & 0 deletions tdrs-backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ flower = "==1.1.0"
django-celery-beat = "==2.2.1"
paramiko = "==2.11.0"
pytest_sftpserver = "==1.3.0"
elasticsearch = "==7.13.4" # REQUIRED - v7.14.0 introduces breaking changes
django-elasticsearch-dsl = "==7.1.1"
django-elasticsearch-dsl-drf = "==0.22.5"
requests-aws4auth = "==1.1.2"

[requires]
python_version = "3.10.8"
125 changes: 74 additions & 51 deletions tdrs-backend/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tdrs-backend/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ services:
# Copy in the Localstack setup script to configure any buckets needed
- ../scripts/localstack-setup.sh:/docker-entrypoint-initaws.d/localstack-setup.sh

elastic:
image: elasticsearch:7.17.6
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- logger.discovery.level=debug
ports:
- 9200:9200
- 9300:9300
volumes:
- elastic_data:/usr/share/elasticsearch/data

web:
restart: always
env_file:
Expand Down Expand Up @@ -88,3 +100,4 @@ services:
volumes:
localstack_data:
postgres_data:
elastic_data:
13 changes: 13 additions & 0 deletions tdrs-backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ services:
# Copy in the Localstack setup script to configure any buckets needed
- ../scripts/localstack-setup.sh:/docker-entrypoint-initaws.d/localstack-setup.sh

elastic:
image: elasticsearch:7.17.6
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- logger.discovery.level=debug
ports:
- 9200:9200
- 9300:9300
volumes:
- elastic_data:/usr/share/elasticsearch/data

web:
restart: always
environment:
Expand Down Expand Up @@ -100,3 +112,4 @@ services:
volumes:
localstack_data:
postgres_data:
elastic_data:
3 changes: 3 additions & 0 deletions tdrs-backend/gunicorn_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ sleep 5
# celery -A tdpservice.settings --broker=$REDIS_URI flower &
celery -A tdpservice.settings beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler &

# rebuild and repopulate elastic search indexes
python manage.py search_index --rebuild -f

echo "Starting Gunicorn"
if [[ "$DJANGO_CONFIGURATION" = "Development" || "$DJANGO_CONFIGURATION" = "Local" ]]; then
gunicorn_params="--bind 0.0.0.0:8080 --timeout 10 --workers 3 --reload --log-level $LOGGING_LEVEL"
Expand Down
Empty file.
Loading

0 comments on commit 8409ad3

Please sign in to comment.