-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OC-926: Make ECS task run incremental ARI import #747
base: main
Are you sure you want to change the base?
Changes from all commits
dd5835a
474ae3e
ae25503
b7bf8fc
ff75aa3
c37b4de
5e26263
b3a7a52
cf383e0
36251fe
9132fd6
98be6c6
4848bce
60f9355
c440002
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,7 @@ coverage | |
# VSC settings | ||
.vscode | ||
.env | ||
*.code-workspace | ||
*.code-workspace | ||
|
||
# Docker | ||
volume |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Alternative way of doing it, removes the mkdir command, WORKDIR does this for you. Splits things into multiple steps so you don't have to redo |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# syntax=docker/dockerfile:1.7-labs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haven't seen this before, what does it do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was needed to use the --exclude flag with COPY. |
||
FROM public.ecr.aws/docker/library/node:20-alpine | ||
RUN apk add \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg \ | ||
git \ | ||
openssl \ | ||
openssl-dev \ | ||
libc6-compat | ||
RUN mkdir /app | ||
# Build context is project root | ||
COPY --exclude=**/node_modules . /app | ||
WORKDIR /app/api | ||
RUN npm i | ||
CMD ["npm", "run", "ariImport", "--", "dryRun=false", "reportFormat=email"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# For testing the ARI import runner docker image locally. | ||
services: | ||
ari-import-runner: | ||
build: | ||
context: ../../.. | ||
dockerfile: infra/docker/ariImportRunner/Dockerfile | ||
command: | ||
["/bin/sh", "-c", "/app/infra/docker/ariImportRunner/local-ari-import.sh"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Override the container's command locally - only difference is to change the report format to a file because the container can't send an email. |
||
env_file: ../../../api/.env | ||
# So it can access the DB and opensearch that are exposed on host ports. | ||
network_mode: host |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
cd /app/api | ||
npm run ariImport -- dryRun=false reportFormat=file | ||
cat ari-import-report.txt |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ resource "aws_codebuild_project" "deploy-docker-image" { | |
|
||
environment { | ||
compute_type = "BUILD_GENERAL1_SMALL" | ||
image = "aws/codebuild/standard:5.0" | ||
type = "LINUX_CONTAINER" | ||
image = "aws/codebuild/amazonlinux-aarch64-standard:3.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The codepipeline to build the image wasn't working until I changed this to build with an ARM based environment. |
||
type = "ARM_CONTAINER" | ||
privileged_mode = true | ||
|
||
environment_variable { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
output "task_security_group_id" { | ||
value = aws_security_group.hello-world-task-sg.id | ||
value = aws_security_group.ari-import-task-sg.id | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were actually always setting the property to true, so I changed the way they're set.