Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0d6af5f
Merge pull request #145 from PurdueDualityLab/main
Dharun-Anand Oct 25, 2024
b4d7cc0
Merge pull request #148 from PurdueDualityLab/dharun
Dharun-Anand Oct 25, 2024
5a99faa
#deploy-to-prod
Dharun-Anand Oct 25, 2024
13a3d61
Updated the URL
Parth1811 Oct 25, 2024
c20ff86
#deploy-to-prod
Parth1811 Oct 25, 2024
b54dac1
Added Dynamic loading for EC2 IPs
Parth1811 Oct 26, 2024
2fa371b
#deploy-to-prod
Parth1811 Oct 26, 2024
307719c
Added CSRF Trusted host
Parth1811 Oct 29, 2024
13a1de4
#deploy-to-prod
Parth1811 Oct 29, 2024
9db0c34
Added CSRF Trusted host
Parth1811 Oct 29, 2024
0aec219
#deploy-to-prod
Parth1811 Oct 29, 2024
430f1f8
Merge pull request #149 from PurdueDualityLab/main
Tanmay182003 Oct 29, 2024
116aef0
adding logos and separating fixes and prevention
Tanmay182003 Oct 29, 2024
8239fee
Merge branch 'frontend' of https://github.com/PurdueDualityLab/ASE24-…
Tanmay182003 Oct 29, 2024
8b9e437
sseparating fixes and prevention
Tanmay182003 Oct 29, 2024
29194cb
Merge pull request #150 from PurdueDualityLab/frontend
Tanmay182003 Oct 29, 2024
77c02aa
#deploy-to-prod
Tanmay182003 Oct 29, 2024
ec18c04
Merge branch 'main' of https://github.com/PurdueDualityLab/ASE24-FAIL…
Tanmay182003 Oct 29, 2024
7a8cc3c
#deploy-to-prod
Tanmay182003 Oct 29, 2024
5fe4324
Changed the order in CD to stop the sdocker first
Parth1811 Oct 30, 2024
89ea6cb
#deploy-to-prod
Parth1811 Oct 30, 2024
33e300a
fixed the image clean in CD flow
Parth1811 Oct 30, 2024
5be105a
Corrected the typo in workflow
Parth1811 Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/deploy_to_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ jobs:
run: |
ssh -o StrictHostKeyChecking=no -i ec2-key.pem [email protected] << 'EOF'

# Stop and remove everything
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)

# Setup environment variables
export DJANGO_ALLOWED_HOSTS=softwarefailures.com,35.173.190.74
export DJANGO_ALLOWED_HOSTS="softwarefailures.com,$(ifconfig enX0 | grep 'inet ' | awk '{print $2}'),$(curl -s http://checkip.amazonaws.com)"
export REDIS_URL=redis://redis:6379/0
export $(aws secretsmanager get-secret-value --secret-id prod/failure/postgres --region us-east-1 --query SecretString --output text | jq -r '. as $secret | "POSTGRES_HOST=\($secret | .host)\nPOSTGRES_PORT=5432\nPOSTGRES_DB=\($secret | .dbname)\nPOSTGRES_USER=\($secret | .username)\nPOSTGRES_PASSWORD=\($secret | .password)\nDATABASE_URL=postgres://\($secret | .username):\($secret | .password)@\($secret | .host):5432/\($secret | .dbname)"')

# Pull the latest image
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${{ secrets.AWS_ECR_REPOSITORY_URL }}
docker pull ${{ secrets.AWS_ECR_REPOSITORY_URL }}:latest

# Stop and remove everything
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)

# Start the container with the new image
docker run -d --name redis -p 6379:6379 redis:alpine
docker run -d --name django-prod -p 80:80 -e POSTGRES_HOST -e POSTGRES_PORT -e POSTGRES_DB -e POSTGRES_USER -e POSTGRES_PASSWORD -e DATABASE_URL -e REDIS_URL -e DJANGO_ALLOWED_HOSTS ${{ secrets.AWS_ECR_REPOSITORY_URL }}:latest /start

# Clean up
docker rmi $(docker images -q)
docker image prune -f --all
docker volume prune -f
docker network prune -f

Expand Down
9 changes: 9 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Fix to Chroma requires sqlite3 >= 3.35.0
__import__('pysqlite3')
import sys

sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')


Expand Down Expand Up @@ -171,6 +172,14 @@

X_FRAME_OPTIONS = "DENY"

SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")

SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True)

SESSION_COOKIE_SECURE = True

CSRF_COOKIE_SECURE = True

# EMAIL
# ------------------------------------------------------------------------------
EMAIL_BACKEND = env(
Expand Down
2 changes: 2 additions & 0 deletions config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"]
ALLOWED_HOSTS += env.list("DJANGO_ALLOWED_HOSTS", default=[])

CSRF_TRUSTED_ORIGINS = ["https://softwarefailures.com"] + ALLOWED_HOSTS

# CACHES
# ------------------------------------------------------------------------------
CACHES = {
Expand Down
4 changes: 2 additions & 2 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
urlpatterns = [
# Django Admin, use {% url 'admin:index' %}
path(settings.ADMIN_URL, admin.site.urls),
path("failures/", include("failures.articles.urls", namespace="articles")),
path('health/', lambda request: JsonResponse({"status": "healthy"}, status=200), name='health_check'),
path("", public_admin.urls),
path("", include("failures.articles.urls", namespace="articles")),
# path("", public_admin.urls),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Expand Down
Binary file added failures/static/images/jamieWeb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions failures/templates/articles/incident_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ <h2>Incident: {{ incident.title }}</h2>
<td>{{ incident.impacts }}</td>
</tr>
<tr>
<td><strong>Preventions & Fixes</strong></td>
<td>{{ incident.preventions }} {{ incident.fixes }}</td>
<td><strong>Preventions</strong></td>
<td>{{ incident.preventions }}</td>
</tr>
<tr>
<td><strong>Fixes</strong></td>
<td>{{ incident.fixes }}</td>
</tr>
<td><strong>References</strong></td>
<td>{{ incident.references }}</td>
</tr>
Expand Down
31 changes: 25 additions & 6 deletions failures/templates/articles/public_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,38 @@
</head>
<body>

{% load static %}

<div class="container my-4">
<!-- Brief Description -->
<div class="alert alert-info" role="alert">
<h4 class="alert-heading">Failures Database</h4>
<p>This database contains reports analyzing software failures from the news. Currently, it contains failures from 2010 to 2022. This database was created through the FAIL (Failure Analysis Investigation with LLM) project. FAIL leverages Large Language Models (LLMs) to collect and analyze software failures reported in the news. Our work has been presented in the paper titled "<a href="https://dl.acm.org/doi/abs/10.1145/3691620.3695022" target="_blank">FAIL: Analyzing Software Failures from the News Using LLMs</a>." Contributing members include Dharun Anandayuvaraj, Matthew Campbell, Tanmay Singla, Parth Patil, Arav Tewari, and James C. Davis from Purdue University.</p>
<!-- Brief Description with Logos on the Right -->
<div class="alert alert-info d-flex justify-content-between align-items-center" role="alert">
<div>
<h4 class="alert-heading">Failures Database</h4>
<p>
This database contains reports analyzing software failures from the news. Currently, it contains failures from 2010 to 2022. This database was created through the FAIL (Failure Analysis Investigation with LLM) project. FAIL leverages Large Language Models (LLMs) to collect and analyze software failures reported in the news. Our work has been presented in the paper titled "<a href="https://dl.acm.org/doi/abs/10.1145/3691620.3695022" target="_blank">FAIL: Analyzing Software Failures from the News Using LLMs</a>." Contributing members include Dharun Anandayuvaraj, Matthew Campbell, Tanmay Singla, Parth Patil, Arav Tewari, and James C. Davis from Purdue University.
</p>
</div>

<!-- Logos aligned to the right -->
<div>
<!-- GitHub Icon Link -->
<a href="https://github.com/PurdueDualityLab/ASE24-FAIL-FailureAnalysisInvestigationWithLLM/tree/main" target="_blank" class="me-3">
<i class="bi bi-github" style="font-size: 1.8rem; color: black;"></i>
</a>

<!-- DavisJam Logo Link -->
<a href="https://davisjam.github.io/" target="_blank">
<img src="{% static 'images/jamieWeb.png' %}" alt="DavisJam Logo" width="40" height="40" style="vertical-align: middle;">
</a>
</div>
</div>

<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="/public/">
<a class="navbar-brand d-flex align-items-center" href="{% url 'articles:public_page' %}">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Purdue_Boilermakers_logo.svg/1200px-Purdue_Boilermakers_logo.svg.png"
alt="Purdue Logo" width="80" height="55">
Failures Database
<span class="ms-2">Failures Database</span>
</a>
</nav>

Expand Down