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

#221 🚀 improve build performance; #230 🔧 use ghcr.io as snapshot repo #229

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

d-ryan-ashcraft
Copy link
Collaborator

@d-ryan-ashcraft d-ryan-ashcraft commented Jul 24, 2024

This also cover #230

<images>
<image>
<build>
<buildx>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I (Informational): configure the docker-maven-plugin to use the buildx docker-container driver at deploy time and to/from caching to improve build speed.

<DOCKER_BASELINE_REPO_ID>${docker.baseline.repo.id}/</DOCKER_BASELINE_REPO_ID>
<VERSION_AISSEMBLE>${version.aissemble}</VERSION_AISSEMBLE>
<SPARK_VERSION>${version.spark}</SPARK_VERSION>
</args>
<buildx>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: For normal builds, use the default (local) buildx driver, which results in faster execution than the docker-container driver due to less I/O.

<goals>
<goal>build</goal>
</goals>
<configuration>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: When the ci profile is activated, do NOT build. We can improve performance by running both the arm64 and amd64 platform builds simultaneously.

@@ -39,10 +39,13 @@
</execution>
</executions>
</plugin>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: we were configuring the fabric8 build incorrectly within the extensions-docker module (including an active run there). These changes correct this issue so that we can use the updated configuration above.

@@ -15,7 +15,7 @@
<packaging>docker-build</packaging>

<properties>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: this was ultimately resolving as target/dockerbuild/jars//* - so I cleaned it up

LABEL org.opencontainers.image.source="https://github.com/boozallen/aissemble"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: moved the python configuration to the agent container, where it belongs. This also improved the speed in which it was installing overall a bit.

@@ -5,11 +5,11 @@ LABEL org.opencontainers.image.source="https://github.com/boozallen/aissemble"
USER root
USER jenkins

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: The changes in versions represent IA issues flagged during the docker build of this container.

@@ -88,6 +88,21 @@
</execution>
</executions>
</plugin>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: This block was oddly in the parent pom but was only ever used here. This change aligns the declaration and use more effectively.

@@ -56,11 +58,9 @@

<modules>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I: bye bye bye

<buildx>
<!-- use default cache, passed to docker via config flag.-->
<builderName>default</builderName>
<dockerStateDir>~/.docker</dockerStateDir>
<platforms>
<platform>${docker.platforms}</platform>
Copy link
Contributor

Choose a reason for hiding this comment

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

Q/A: Can we exclude this for this configuration? Seems like it wouldn't be used, since you can only build the same platform as the host machine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sadly, if this is not present, the build will trigger as a non-buildx build. To avoid suggesting a more invasive change to fabric8 (and keep it simple), this is the trigger for buildx with the default buildx driver.

Docker does provide lovely, informative error messages if you try to use it out of place.

@d-ryan-ashcraft d-ryan-ashcraft changed the title #221 🚀 improve build performance #221 🚀 improve build performance; #230 🔧 use ghcr.io as snapshot repo Jul 24, 2024
@d-ryan-ashcraft d-ryan-ashcraft merged commit 3a9bacb into dev Jul 25, 2024
@d-ryan-ashcraft d-ryan-ashcraft deleted the fabric8-updates branch July 25, 2024 00:18
@ewilkins-csi ewilkins-csi linked an issue Feb 4, 2025 that may be closed by this pull request
4 tasks
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.

Feature: Improve Docker Module Build Speed
3 participants