Skip to content

Commit d63b8cd

Browse files
devops72-sreEvolveArtgraniet
authored
Deployment setup (#31)
* Deployment setup * fixed error * fixed port & config * fix: add brokers to env.example * feat: unique index hypertable * feat: continuous aggregates * update compose, upgrade version rdkafka * undo hypertables * feat: query from realtime view * feat: adapt route to use new views * fix: schema * added kafka brokers * fix: sql types * fix: optional .env file in ingestor --------- Co-authored-by: devops72-sre <> Co-authored-by: 0xevolve <Artevolve@yahoo.com> Co-authored-by: graniet <graniet75@gmail.com>
1 parent 72b9868 commit d63b8cd

File tree

6 files changed

+49
-8
lines changed

6 files changed

+49
-8
lines changed

infra/pragma-ingestor/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ USER ingestor:pragma
2525
WORKDIR /home/pragma-ingestor
2626

2727
COPY --from=builder --chown=ingestor:pragma /home/pragma-ingestor/bin/pragma-ingestor /usr/local/bin/pragma-ingestor
28-
COPY infra/pragma-ingestor/config/.env.example .env
28+
# COPY infra/pragma-ingestor/config/.env.example .env
2929

3030
CMD ["pragma-ingestor"]

infra/pragma-ingestor/buildspec.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 0.2
2+
phases:
3+
pre_build:
4+
commands:
5+
- echo Logging in to Amazon ECR...
6+
- aws --version
7+
- aws ecr get-login-password --region $ECR_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com
8+
- REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$ECR_REGION.amazonaws.com/$ECR_REPOSITORY_NAME
9+
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
10+
- IMAGE_TAG=${COMMIT_HASH:=latest}
11+
build:
12+
commands:
13+
- echo Build started on `date`
14+
- echo Building the Docker image...
15+
- ls -ltr
16+
- docker build -f infra/pragma-ingestor/Dockerfile -t $REPOSITORY_URI:latest .
17+
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
18+
post_build:
19+
commands:
20+
- echo Build completed on `date`
21+
- echo Pushing the Docker images...
22+
- docker push $REPOSITORY_URI:latest
23+
- docker push $REPOSITORY_URI:$IMAGE_TAG
24+
- echo Writing image definitions file...
25+
- printf '[{"name":"%s","imageUri":"%s"}]' $ECS_CONTAINER_NAME $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
26+
artifacts:
27+
files:
28+
- imagedefinitions.json
29+
- infra/pragma-ingestor/config.yml
30+
discard-paths: yes

infra/pragma-ingestor/config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
path: "/"
2+
container_port: 8080
3+
health_check_path: "/"
4+
container_environment:
5+
- region: "eu-west-3"
6+
- prefix: "/conf/{{ SERVICE_NAME }}/{{ RUN_ENV }}"
7+
- keys:
8+
- DATABASE_URL
9+
- BROKERS
10+
- TOPIC
11+
- GROUP_ID

infra/pragma-node/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ USER node:pragma
2626
WORKDIR /home/pragma-node
2727

2828
COPY --from=builder --chown=node:pragma /home/pragma-node/bin/pragma-node /usr/local/bin/pragma-node
29-
COPY infra/pragma-node/config/.env.example .env
29+
# COPY infra/pragma-node/config/.env.example .env
3030

3131
EXPOSE 3000
3232

buildspec.yml infra/pragma-node/buildspec.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
version: 0.2
22
phases:
3-
install:
4-
runtime-versions:
5-
nodejs: 18
63
pre_build:
74
commands:
85
- echo Logging in to Amazon ECR...
@@ -16,7 +13,7 @@ phases:
1613
- echo Build started on `date`
1714
- echo Building the Docker image...
1815
- ls -ltr
19-
- docker build -t $REPOSITORY_URI:latest .
16+
- docker build -f infra/pragma-node/Dockerfile -t $REPOSITORY_URI:latest .
2017
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
2118
post_build:
2219
commands:
@@ -29,4 +26,5 @@ phases:
2926
artifacts:
3027
files:
3128
- imagedefinitions.json
32-
- config.yml
29+
- infra/pragma-node/config.yml
30+
discard-paths: yes
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
path: "/"
22
container_port: 8080
3-
alb_scheme: internal
43
health_check_path: "/node"
54
container_environment:
65
- region: "eu-west-3"
76
- prefix: "/conf/{{ SERVICE_NAME }}/{{ RUN_ENV }}"
87
- keys:
98
- DATABASE_URL
9+
- DATABASE_MAX_CONN
10+
- TOPIC
1011
- HOST
1112
- PORT
13+
- KAFKA_BROKERS

0 commit comments

Comments
 (0)