Skip to content
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

Better building and testing of deployable zipfile artifacts #8706

Merged
merged 5 commits into from
Jan 8, 2025

Conversation

chosak
Copy link
Member

@chosak chosak commented Jan 6, 2025

This PR modifies the way that we build the "deployable zipfile" artifact that gets installed on EC2 servers running cf.gov.
Currently we don't have any automated testing around the built artifact. The only way we know it works properly is when we test its deployment onto a real EC2 instance. This PR adds automated testing of the image by deploying it to a CentOS 7-based container (to mimic our current RHEL7 EC2 instances). These changes are intended to provide a framework for pending changes to our EC2 workflows around both Apache and upgrading to RHEL9.

These changes don't modify the deployable zipfile at all but only modify how it gets built. There are now two Docker images - cfgov-artifact-builder and cfgov-artifact-tester - that are used to build and test the artifact, respectively.

Note that this PR includes some manual surgery of migration files that will be unnecessary once the migration squash process started in #8701 is completed; this surgery was necessary to remove incompatibilities with SQLite which is used when testing the deployable zipfile.

Screenshots

New documentation about the modified process:

Build Test
image image

docker/centos7/Dockerfile Outdated Show resolved Hide resolved
@wpears
Copy link
Member

wpears commented Jan 7, 2025

This is very cool, all the additions seem sensible and pointed in the right direction. Do you plan on getting the whole migration squash process in to main before merging this?

@chosak
Copy link
Member Author

chosak commented Jan 7, 2025

@wpears thanks for the review, yes, I'm planning on opening part 2 of #8701 today.

@chosak chosak force-pushed the feature/deployable-zipfile-images branch from eec1667 to c08cf7f Compare January 7, 2025 16:25
Copy link
Member

@wpears wpears left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Sonarcloud is complaining about the container running as root which imo is less important for this specific image, but could probably be fixed with adding a USER and chown/chmoding some things.

@chosak
Copy link
Member Author

chosak commented Jan 8, 2025

Thanks @wpears. I took a quick look at implementing a non-root user but it gets complicated because of necessary permissions on the mounted volume used for the cf.gov artifact. I'm going to merge this to try it out and we can add in future if desired.

@chosak chosak added this pull request to the merge queue Jan 8, 2025
Merged via the queue into main with commit 181307b Jan 8, 2025
10 of 11 checks passed
@chosak chosak deleted the feature/deployable-zipfile-images branch January 8, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants