-
Notifications
You must be signed in to change notification settings - Fork 2
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
WIP -[AB2D-5870] Update postgres container version to 15 #1300
Conversation
b1678ed
to
3854174
Compare
7bfa908
to
7586339
Compare
.run("echo \"pg_ctl restart\"\n >> /docker-entrypoint-initdb.d/init_pg_cron.sh") | ||
.run("chmod +x /docker-entrypoint-initdb.d/init_pg_cron.sh") | ||
.run("apt-get install -y curl") | ||
.run("apt-get install -y postgresql-15-cron") |
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.
Can these lines be moved to the postgres Dockerfile, then that file be referenced with withFileFromPath?
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.
I am not sure. I originally attempted to have init_pg_cron.sh already exist inside the repo, and then just copy it to the container with a:
.copy("<path_to_init_pg_cron.sh>", "/docker-entrypoint-initdb.d/");
The problem I ran into was a null pointer exception with reference to the init_pg_cron.sh path. I tried both a relative path and an absolute path but neither worked. I am probably missing something, but for testing purposes I gave up and just created the script inside the container on the fly using the commands above.
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.
Coming back to this, I worry this will have a big impact on tests -- will this result in dozens of image builds during testing? Could the postgres image instead be built and uploaded to ECR, then referenced there?
I think it already does spin up dozens of images during testing. At least locally, when we run testcontainers it spins up a LOT of containers for all of the tests that run. In that regard, this PR doesn't change that so it should have the same impact that it currently does. That said, I am not sure what is meant by building the image and uploading it to ECR (I don't know what ECR is so I would need to research this). If that would eliminate the current behavior of spinning up a lot of dummy test-containers that would be a great benefit in my opinion. |
🎫 Ticket
https://jira.cms.gov/browse/AB2D-5870
🛠 Changes
Updates testcontainers and docker image to use postgres 15.
Installs pg_cron inside of the docker images and testcontainers.
ℹ️ Context for reviewers
(Background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers.)
✅ Acceptance Validation
(How were the changes verified? Did you fully test the acceptance criteria in the ticket? Provide reproducible testing instructions and screenshots if applicable.)
🔒 Security Implications
If any security implications apply, add Jason Ashbaugh (GitHub username: StewGoin) as a reviewer and do not merge this PR without his approval.