Skip to content

Commit ba28e1e

Browse files
authored
Merge branch 'latest_release' into master
2 parents 23d73b8 + eb995e4 commit ba28e1e

File tree

192 files changed

+9518
-887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+9518
-887
lines changed

.env

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ENVIRONMENT=PRODUCTION
2+
API_URL=http://cueo-backend:8000
3+
ALERT_API_URL=http://cueo-alerts:8100
4+
REDIS_BROKER_URL=redis://cueo-redis:6379/0
5+
CELERY_RESULT_BACKEND=redis://cueo-redis:6379/1
6+
7+
NGINX_API_URL=http://cueo-backend:8000
8+
NGINX_ALERT_API_URL=http://cueo-alerts:8100
9+
NGINX_UI_URL=http://cueo-frontend:3030
10+
11+
## Central DB SETTINGS
12+
#POSTGRES_DB_HOST=cueo-postgresql
13+
#POSTGRES_DB_USERNAME=postgres
14+
#POSTGRES_DB_PASSWORD=postgres
15+
#POSTGRES_DB_SCHEMA=cue_observe
16+
#POSTGRES_DB_PORT=5432
17+
18+
## SUPERUSER'S VARIABLE
19+
DJANGO_SUPERUSER_USERNAME=User
20+
DJANGO_SUPERUSER_PASSWORD=admin
21+
DJANGO_SUPERUSER_EMAIL=[email protected]
22+
23+
## AUTHENTICATION
24+
IS_AUTHENTICATION_REQUIRED=False
25+
26+
## EMAIL
27+
EMAIL_HOST="" ### ex smtp.gmail.com
28+
EMAIL_HOST_USER=""
29+
EMAIL_HOST_PASSWORD=""

.env.dev

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
ENVIRONMENT=dev
2+
API_URL=http://cueo-backend:8000
3+
ALERT_API_URL=http://cueo-alerts:8100
4+
REDIS_BROKER_URL=redis://cueo-redis:6379/0
5+
6+
NGINX_API_URL=http://cueo-backend:8000
7+
NGINX_ALERT_API_URL=http://cueo-alerts:8100
8+
NGINX_UI_URL=http://cueo-frontend:3030
9+
10+
## Central DB SETTINGS
11+
#POSTGRES_DB_HOST=localhost
12+
#POSTGRES_DB_USERNAME=postgres
13+
#POSTGRES_DB_PASSWORD=postgres
14+
#POSTGRES_DB_SCHEMA=cue_observe
15+
#POSTGRES_DB_PORT=5432
16+
17+
## SUPERUSER'S VARIABLE
18+
DJANGO_SUPERUSER_USERNAME=User
19+
DJANGO_SUPERUSER_PASSWORD=admin
20+
DJANGO_SUPERUSER_EMAIL=[email protected]
21+
22+
## AUTHENTICATION
23+
IS_AUTHENTICATION_REQUIRED=False
24+
25+
## EMAIL
26+
EMAIL_HOST="" ### ex smtp.gmail.com
27+
EMAIL_HOST_USER=""
28+
EMAIL_HOST_PASSWORD=""

.github/ISSUE_TEMPLATE/bug_report.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Additional context**
27+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
on:
2+
push:
3+
branches:
4+
- latest_release
5+
workflow_dispatch:
6+
inputs:
7+
tagName:
8+
description: 'Tag Name'
9+
required: true
10+
default: 'latest'
11+
12+
name: Deploy to Docker
13+
14+
jobs:
15+
build-and-push-frontend:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Build, tag, and push image to Docker Hub
23+
id: build-image
24+
env:
25+
REGISTRY: cuebook
26+
REPOSITORY: cue-observe-frontend
27+
IMAGE_TAG: ${{ github.sha }}
28+
run: |
29+
cd ui
30+
# Build a docker container and
31+
# push it to ECR so that it can
32+
# be deployed to ECS.
33+
docker login -u vincue -p ${{ secrets.DOCKER_TOKEN }}
34+
TAGNAME=latest
35+
if [[ ${{ github.event_name == 'workflow_dispatch' }} ]]; then TAGNAME=${{ github.event.inputs.tagName }}; fi
36+
docker build -t $REGISTRY/$REPOSITORY:$TAGNAME .
37+
docker push $REGISTRY/$REPOSITORY --all-tags
38+
echo "::set-output name=image::$REGISTRY/$REPOSITORY:$IMAGE_TAG"
39+
40+
build-and-push-backend:
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v2
46+
47+
- name: Build, tag, and push image to Docker Hub
48+
id: build-image
49+
env:
50+
REGISTRY: cuebook
51+
REPOSITORY: cue-observe-backend
52+
IMAGE_TAG: ${{ github.sha }}
53+
run: |
54+
cd api
55+
# Build a docker container and
56+
# push it to ECR so that it can
57+
# be deployed to ECS.
58+
docker login -u vincue -p ${{ secrets.DOCKER_TOKEN }}
59+
TAGNAME=latest
60+
if [[ ${{ github.event_name == 'workflow_dispatch' }} ]]; then TAGNAME=${{ github.event.inputs.tagName }}; fi
61+
docker build -t $REGISTRY/$REPOSITORY:$TAGNAME .
62+
docker push $REGISTRY/$REPOSITORY --all-tags
63+
echo "::set-output name=image::$REGISTRY/$REPOSITORY:$IMAGE_TAG"
64+
65+
build-and-push-alerts:
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@v2
71+
72+
- name: Build, tag, and push image to Docker Hub
73+
id: build-image
74+
env:
75+
REGISTRY: cuebook
76+
REPOSITORY: cue-observe-alerts
77+
IMAGE_TAG: ${{ github.sha }}
78+
run: |
79+
cd alerts-api
80+
# Build a docker container and
81+
# push it to ECR so that it can
82+
# be deployed to ECS.
83+
docker login -u vincue -p ${{ secrets.DOCKER_TOKEN }}
84+
echo ${{ github.event_name }}
85+
TAGNAME=latest
86+
if [[ ${{ github.event_name == 'workflow_dispatch' }} ]]; then TAGNAME=${{ github.event.inputs.tagName }}; fi
87+
docker build -t $REGISTRY/$REPOSITORY:$TAGNAME .
88+
docker push $REGISTRY/$REPOSITORY --all-tags
89+
echo "::set-output name=image::$REGISTRY/$REPOSITORY:$IMAGE_TAG"
90+

.github/workflows/deploy_v2.yaml

+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
7+
name: Deploy all on eks
8+
9+
jobs:
10+
build-and-push-frontend:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Configure AWS credentials
18+
uses: aws-actions/configure-aws-credentials@v1
19+
with:
20+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
21+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
22+
aws-region: ap-south-1
23+
24+
- name: Login to Amazon ECR
25+
id: login-ecr
26+
uses: aws-actions/amazon-ecr-login@v1
27+
28+
- name: Build, tag, and push image to Amazon ECR
29+
id: build-image
30+
env:
31+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
32+
ECR_REPOSITORY: cue-observe-frontend
33+
IMAGE_TAG: ${{ github.sha }}
34+
run: |
35+
cd ui
36+
# Build a docker container and
37+
# push it to ECR so that it can
38+
# be deployed to ECS.
39+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
40+
docker push $ECR_REGISTRY/$ECR_REPOSITORY
41+
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
42+
43+
build-and-push-backend:
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v2
49+
50+
- name: Configure AWS credentials
51+
uses: aws-actions/configure-aws-credentials@v1
52+
with:
53+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
54+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
55+
aws-region: ap-south-1
56+
57+
- name: Login to Amazon ECR
58+
id: login-ecr
59+
uses: aws-actions/amazon-ecr-login@v1
60+
61+
- name: Build, tag, and push image to Amazon ECR
62+
id: build-image
63+
env:
64+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
65+
ECR_REPOSITORY: cue-observe-backend
66+
IMAGE_TAG: ${{ github.sha }}
67+
run: |
68+
cd api
69+
# Build a docker container and
70+
# push it to ECR so that it can
71+
# be deployed to ECS.
72+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
73+
docker push $ECR_REGISTRY/$ECR_REPOSITORY
74+
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
75+
76+
build-and-push-alerts:
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v2
82+
83+
- name: Configure AWS credentials
84+
uses: aws-actions/configure-aws-credentials@v1
85+
with:
86+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
87+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
88+
aws-region: ap-south-1
89+
90+
- name: Login to Amazon ECR
91+
id: login-ecr
92+
uses: aws-actions/amazon-ecr-login@v1
93+
94+
- name: Build, tag, and push image to Amazon ECR
95+
id: build-image
96+
env:
97+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
98+
ECR_REPOSITORY: cue-observe-alerts
99+
IMAGE_TAG: ${{ github.sha }}
100+
run: |
101+
cd alerts-api
102+
# Build a docker container and
103+
# push it to ECR so that it can
104+
# be deployed to ECS.
105+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
106+
docker push $ECR_REGISTRY/$ECR_REPOSITORY
107+
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
108+
109+
build-and-push-search:
110+
runs-on: ubuntu-latest
111+
112+
steps:
113+
- name: Checkout
114+
uses: actions/checkout@v2
115+
116+
- name: Configure AWS credentials
117+
uses: aws-actions/configure-aws-credentials@v1
118+
with:
119+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
120+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
121+
aws-region: ap-south-1
122+
123+
- name: Login to Amazon ECR
124+
id: login-ecr
125+
uses: aws-actions/amazon-ecr-login@v1
126+
127+
- name: Build, tag, and push image to Amazon ECR
128+
id: build-image
129+
env:
130+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
131+
ECR_REPOSITORY: cue-observe-search
132+
IMAGE_TAG: ${{ github.sha }}
133+
run: |
134+
cd search-api
135+
# Build a docker container and
136+
# push it to ECR so that it can
137+
# be deployed to ECS.
138+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
139+
docker push $ECR_REGISTRY/$ECR_REPOSITORY
140+
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
141+
142+
143+
deploy-all:
144+
runs-on: ubuntu-latest
145+
needs: [build-and-push-frontend, build-and-push-backend, build-and-push-alerts, build-and-push-search]
146+
147+
steps:
148+
- name: Deploy to cluster
149+
uses: ianbelcher/eks-kubectl-action@master
150+
with:
151+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
152+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
153+
aws_region: ${{ secrets.AWS_DEPLOY_REGION }}
154+
cluster_name: ${{ secrets.AWS_CLUSTER_NAME }}
155+
args: rollout restart deployment cueo-frontend cueo-backend cueo-alerts cueo-search -n cue-observe

0 commit comments

Comments
 (0)