Skip to content

Conversation

@yanksyoon
Copy link
Member

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint && make test?

Currently blocked by:

@tigarmo
Copy link
Collaborator

tigarmo commented Apr 22, 2025

@yanksyoon can you merge in main? It has fixes to the spread tests that will make them faster

@tigarmo
Copy link
Collaborator

tigarmo commented Apr 22, 2025

Related spread failure:

2025-04-22T15:28:19.5633242Z 2025-04-22 15:28:19 Error executing google:ubuntu-22.04-64:tests/spread/rockcraft/extension-spring-boot:base_2404 (apr221349-432801) : 
2025-04-22T15:28:19.5634366Z -----
2025-04-22T15:28:19.5635036Z + NAME=spring-boot-ubuntu-24.04-gradle
2025-04-22T15:28:19.5635674Z + NAME=spring-boot-ubuntu-24-04-gradle
2025-04-22T15:28:19.5636263Z + ROCK_FILE=spring-boot-ubuntu-24-04-gradle_0.1_amd64.rock
2025-04-22T15:28:19.5636903Z + IMAGE=spring-boot-ubuntu-24-04-gradle:0.1
2025-04-22T15:28:19.5637450Z + JAVA_VERSION=21
2025-04-22T15:28:19.5637994Z + sudo snap install devpack-for-spring --edge --classic
2025-04-22T15:28:19.5638835Z snap "devpack-for-spring" is already installed, see 'snap help refresh'
2025-04-22T15:28:19.5640670Z + devpack-for-spring boot start --path gradle-app --project gradle-project --language java --boot-version 3.4.4 --version 0.0.1 --group com.example --artifact demo --name demo --description 'Demo project for Spring Boot' --package-name com.example.demo --dependencies web --packaging jar --java-version 21
2025-04-22T15:28:19.5642477Z Can't create path /rockcraft/tests/spread/rockcraft/extension-spring-boot/gradle-app

@yanksyoon yanksyoon requested review from tigarmo and vpa1977 April 29, 2025 02:44
Copy link
Contributor

@vpa1977 vpa1977 left a comment

Choose a reason for hiding this comment

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

Looks, great! I have added some minor comments.

The PR also needs rebasing.

Copy link
Collaborator

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

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

almost there ;)

]
override_build_cmds += [
"cp ${CRAFT_STAGE}/*init.gradle* ${CRAFT_PART_BUILD}/.gradle/",
"rm -f ${CRAFT_STAGE}/*init.gradle*",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@vpa1977 is right; if the intent is that the gradle-init-script part will provide an init-script that is available during the other part's build but not primed then that part should have its own prime: key (we can document this).
As it is this override-build snippet is wrong: a build script must not remove files from stage/prime.


build_packages = [*self.DEFAULT_BUILD_PACKAGES]
if not self.gradlew_path.exists():
build_packages += ["gradle"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes I believe our extensions should default to using archive things. We can discuss how to 'detect' user-provided gradle declarations in the future as an improvement.

@tigarmo
Copy link
Collaborator

tigarmo commented May 7, 2025

almost there ;)

Well, there are many related spread failures. This one happened multiple times:

2025-05-06T09:50:12.7538538Z + docker run --name spring-boot-bare-maven-container -d -p 8080:8080 spring-boot-bare-maven:0.1
2025-05-06T09:50:12.7539527Z a6eed2aab633ac1018fc8279374498376e8bfda9f58eeb0642cb649b20f3d487
2025-05-06T09:50:12.7540239Z + retry -n 5 --wait 2 curl localhost:8080
2025-05-06T09:50:12.7540873Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2025-05-06T09:50:12.7541698Z                                  Dload  Upload   Total   Spent    Left  Speed
2025-05-06T09:50:12.7542121Z 
2025-05-06T09:50:12.7542349Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7543834Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7544527Z curl: (56) Recv failure: Connection reset by peer
2025-05-06T09:50:12.7545176Z retry: command curl localhost:8080 failed with code 56
2025-05-06T09:50:12.7545839Z retry: next attempt in 2.0 second(s) (attempt 1 of 5)
2025-05-06T09:50:12.7546577Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2025-05-06T09:50:12.7547572Z                                  Dload  Upload   Total   Spent    Left  Speed
2025-05-06T09:50:12.7547992Z 
2025-05-06T09:50:12.7548228Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7548832Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7549392Z curl: (52) Empty reply from server
2025-05-06T09:50:12.7549999Z retry: command curl localhost:8080 failed with code 52
2025-05-06T09:50:12.7550753Z retry: next attempt in 2.0 second(s) (attempt 2 of 5)
2025-05-06T09:50:12.7551557Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2025-05-06T09:50:12.7552369Z                                  Dload  Upload   Total   Spent    Left  Speed
2025-05-06T09:50:12.7552775Z 
2025-05-06T09:50:12.7553017Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7553614Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7554232Z curl: (56) Recv failure: Connection reset by peer
2025-05-06T09:50:12.7554891Z retry: command curl localhost:8080 failed with code 56
2025-05-06T09:50:12.7555539Z retry: next attempt in 2.0 second(s) (attempt 3 of 5)
2025-05-06T09:50:12.7556653Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2025-05-06T09:50:12.7557385Z                                  Dload  Upload   Total   Spent    Left  Speed
2025-05-06T09:50:12.7557805Z 
2025-05-06T09:50:12.7558022Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7558656Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7559220Z curl: (52) Empty reply from server
2025-05-06T09:50:12.7559820Z retry: command curl localhost:8080 failed with code 52
2025-05-06T09:50:12.7560857Z retry: next attempt in 2.0 second(s) (attempt 4 of 5)
2025-05-06T09:50:12.7561596Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2025-05-06T09:50:12.7562343Z                                  Dload  Upload   Total   Spent    Left  Speed
2025-05-06T09:50:12.7562751Z 
2025-05-06T09:50:12.7562968Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7563656Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2025-05-06T09:50:12.7564263Z curl: (52) Empty reply from server
2025-05-06T09:50:12.7564814Z retry: command curl localhost:8080 failed with code 52
2025-05-06T09:50:12.7565571Z retry: command curl localhost:8080 keeps failing after 5 attempts

Project requirements
====================

To use the ``spring-boot-framework`` extension, there must be either:
Copy link
Contributor

Choose a reason for hiding this comment

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

spring-boot-framework

Except for when we're referring to its name in code, let's please use the plain English name of the extension. :)

Comment on lines 32 to 33
The ``spring-boot-framework`` extension dynamically determines the plugin to be
used to bulid the rock. Depending on the presence of ``pom.xml`` or
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The ``spring-boot-framework`` extension dynamically determines the plugin to be
used to bulid the rock. Depending on the presence of ``pom.xml`` or
The ``spring-boot-framework`` extension dynamically determines the plugin to use
use to bulid the rock. Depending on the presence of ``pom.xml`` or

or `gradle
<https://documentation.ubuntu.com/rockcraft/en/latest/common/craft-parts/
reference/plugins/gradle_plugin/>`_
plugin respectively.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
plugin respectively.
plugin, respectively.

Comment on lines 85 to 89
To provide an efficient runtime for Java, the `Jlink
<https://documentation.ubuntu.com/rockcraft/en/latest/common/craft-parts/
reference/plugins/jlink_plugin/>`_
plugin is used to trim out any unused parts of the JDK. This reduces the size
of the rock and improves the performance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To provide an efficient runtime for Java, the `Jlink
<https://documentation.ubuntu.com/rockcraft/en/latest/common/craft-parts/
reference/plugins/jlink_plugin/>`_
plugin is used to trim out any unused parts of the JDK. This reduces the size
of the rock and improves the performance.
To provide an efficient runtime for Java, the extension calls the `Jlink
<https://documentation.ubuntu.com/rockcraft/en/latest/common/craft-parts/
reference/plugins/jlink_plugin/>`_
plugin to trim out any unused parts of the JDK. This reduces the size
of the rock and improves performance.

parts:
spring-boot-framework/install-app:
build-packages:
- openjdk-17-jdk # specify the Java package to use
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- openjdk-17-jdk # specify the Java package to use
- openjdk-17-jdk # specify the Java package to use

Comment on lines 101 to 106
- default-jdk
stage-packages: # these packages are required for bare base rocks.
- bash_bins
- ca-certificates_data
- coreutils_bins
- base-files_tmp
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- default-jdk
stage-packages: # these packages are required for bare base rocks.
- bash_bins
- ca-certificates_data
- coreutils_bins
- base-files_tmp
- default-jdk
stage-packages: # these packages are required for bare base rocks.
- bash_bins
- ca-certificates_data
- coreutils_bins
- base-files_tmp

@tigarmo
Copy link
Collaborator

tigarmo commented May 15, 2025

@yanksyoon in addition to the unit test failures, here are the spread errors that I can see:

2025-05-14T15:01:28.8858832Z + rockcraft.skopeo copy oci-archive:spring-boot-hello-world_0.1_amd64.rock docker-daemon:spring-boot-hello-world:0.1
2025-05-14T15:01:28.8859265Z time="2025-05-14T15:01:28Z" level=fatal msg="Error loading trust policy: open /etc/containers/policy.json: no such file or directory"
2025-05-14T15:34:59.9684832Z curl: (52) Empty reply from server
2025-05-14T15:34:59.9684979Z retry: command curl localhost:8080 failed with code 52
2025-05-14T15:34:59.9685382Z retry: command curl localhost:8080 keeps failing after 5 attempts

@tigarmo
Copy link
Collaborator

tigarmo commented May 16, 2025

Still this one left:

2025-05-15T09:28:06.8223823Z + rockcraft.skopeo copy oci-archive:spring-boot-hello-world_0.1_amd64.rock docker-daemon:spring-boot-hello-world:0.1
2025-05-15T09:28:06.8224247Z time="2025-05-15T09:28:06Z" level=fatal msg="Error loading trust policy: open /etc/containers/policy.json: no such file or directory"

@tigarmo tigarmo merged commit 60481b9 into canonical:main May 18, 2025
18 checks passed
@tigarmo
Copy link
Collaborator

tigarmo commented May 18, 2025

@medubelko @yanksyoon I merged with some open comments/suggestions from Michael so we can finally get this feature in; we should do a smaller follow-up PR addressing the open comments. Thanks!

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.

4 participants