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

Inline Containerfile generation #2119

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Inline Containerfile generation #2119

merged 1 commit into from
Oct 1, 2024

Conversation

rnc
Copy link
Collaborator

@rnc rnc commented Sep 30, 2024

This moves Containerfile generation from the operator to the Java request-processor (specifically the preprocessor step) so it can be reused outside of JBS.

docker build . -t quay.io/$(QUAY_USERNAME)/hacbs-jvm-controller:dev
docker push quay.io/$(QUAY_USERNAME)/hacbs-jvm-controller:dev
docker build . -t quay.io/$(QUAY_USERNAME)/hacbs-jvm-controller:"$${JBS_QUAY_IMAGE_TAG:-dev}"
docker push quay.io/$(QUAY_USERNAME)/hacbs-jvm-controller:"$${JBS_QUAY_IMAGE_TAG:-dev}"
Copy link
Collaborator Author

@rnc rnc Sep 30, 2024

Choose a reason for hiding this comment

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

Unless the JBS_QUAY_IMAGE_TAG is specified we default to dev. With Tekton pipelines, if tag is latest the it will use PullAlways. Hence for pipelines setting JBS_QUAY_IMAGE_TAG=latest is advised. We should consider whether to change the default to latest (perhaps in another iteration).

@@ -103,7 +106,7 @@ spec:
memory: 512Mi
script: |
$(params.BUILD_SCRIPT)
/opt/jboss/container/java/run/run-java.sh $(params.PREPROCESSOR_ARGS)
/opt/jboss/container/java/run/run-java.sh $(params.BUILD_TOOL)-prepare $(workspaces.source.path)/source --recipe-image=$(params.RECIPE_IMAGE) --request-processor-image=$(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE) --disabled-plugins=$(params.BUILD_PLUGINS)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This completely inlines the request processor arguments (which makes it easier for PNC to use)

} catch (IOException e) {
Log.errorf("Unable to write Containerfile", e);
throw new RuntimeException(e);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This inlines the Containerfile generation into the source directory for the next steps (the git archiving and image generation) in the task to use.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 70.90909% with 16 lines in your changes missing coverage. Please review.

Project coverage is 39.77%. Comparing base (5717743) to head (b03f84c).
Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
...ainer/build/preprocessor/AbstractPreprocessor.java 68.42% 5 Missing and 1 partial ⚠️
...iner/build/preprocessor/ant/AntPrepareCommand.java 0.00% 4 Missing ⚠️
...iner/build/preprocessor/sbt/SBTPrepareCommand.java 0.00% 4 Missing ⚠️
pkg/reconciler/dependencybuild/buildrecipeyaml.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2119      +/-   ##
============================================
+ Coverage     39.71%   39.77%   +0.05%     
- Complexity      812      813       +1     
============================================
  Files           301      301              
  Lines         14034    14028       -6     
  Branches       1468     1469       +1     
============================================
+ Hits           5573     5579       +6     
+ Misses         7823     7814       -9     
+ Partials        638      635       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vibe13
Copy link
Member

vibe13 commented Oct 1, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 1, 2024
@rnc rnc merged commit 1cd82ce into redhat-appstudio:main Oct 1, 2024
23 checks passed
@rnc rnc deleted the KJB11-2 branch October 1, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants