-
Notifications
You must be signed in to change notification settings - Fork 13
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
How to download GraalVM faster? #74
Comments
Hi. The file it's downloading here is about 450M. It can certainly take some time depending on your Internet connection speed. For example, to download the 450M file on a 100Mbit connection, it could take 36s in perfect conditions. You can use a calculator like this to determine what it should roughly take to download the file. If it is pausing for about that amount of time, then that is about what you can expect with your Internet speed. A couple more notes here:
Hope that helps! |
@dmikusa-pivotal |
OK, so the third process can be a little confusing. Let me walk you through it.
Then you want to create a file where the name of the file (i.e. the binding key) is the sha256 hash of the dependency you want to change. The contents of the file (i.e. the binding value) should be the new URL to use. If you are hosting the files on your local machine, you can use Then do the same thing for the substrate VM download (there are two downloads for GraalVM).
See how in the screenshot the URLs have changed to my custom URLs. You should also see the It's a little bit of setup, but you only need to do steps 1-4 when there are new binaries. Otherwise, just make sure the HTTP server is running & that you've mapped in the volume with the bindings. Hope that helps! |
@dmikusa-pivotal 1.
|
1.) Correct. The sha256 should match the dependency you want to replace in buildpack.toml. 2.) At the moment, you need to be using Spring Boot 2.5RC to do this. It is functionality added to the 2.5 branch. 2.4 does not have that capability. See https://docs.spring.io/spring-boot/docs/2.5.0-RC1/maven-plugin/reference/htmlsingle/#build-image-customization. If you're using 2.4, you need to use Other.) You can use Hope that helps! |
Thanks for your kind help~ |
I think there are still issues here, and we're hoping to have further improvements, but we did add a new feature to the buildpacks that allows you to use dependency-mapping and point to This allows you to map a volume into your containers with the It's similar to hosting mapped dependencies on a local HTTP server, as is mentioned above, but even easier because it doesn't require the local HTTP server anymore. |
Using Local File Path will be more user-friendly. And i'll try it later. But I think the most easy way is that add the file path or url in <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder:tiny</builder>
<env>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
<!-- Using Http Url -->
<JDK_URI>https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.0.0.2/graalvm-ce-java8-linux-amd64-21.0.0.2.tar.gz</JDK_URI>
<!-- File Path on Linux -->
<JDK_URI>/root/jdk/graalvm-ce-java8-linux-amd64-21.0.0.2.tar.gz</JDK_URI>
<!-- File Path on Windows -->
<JDK_URI>C:\\Users\\Administrator\\Downloads\\graalvm-ce-java8-linux-amd64-21.0.0.2.tar.gz</JDK_URI>
</env>
</image>
</configuration>
</plugin> |
It does not presently work that way. There is no link between env variables and what is downloaded. You need to use the dependency mapping binding. That said, you can add bindings into your Spring Boot 2.5+ maven tools configuration, so you should be able to achieve something very similar. |
I did this and it amounts to the following:
You then need two folders locally:
This works by adding the dependency mapping & pointing to a location on disk that has been volume mounted with your local You can fetch both the sha256 hash & the download URL from buildpack.toml for the buildpack. |
Oh...Got it.
|
@cuiziboczb - Could you include the output of building? It would help to clarify what is happening. The setup looks OK to me. The only thing I see is that your GraalVM deps are one version ago. We bumped to 21.3.0 recently. If you're using the latest buildpack, it's going to expect 21.3.0 dependencies, so that could explain why it's not using your local deps. If you're using the latest buildpack, you'll need to download the latest set of dependencies, and add binding entries for them. |
Description
When start build
spring-native
image byMaven
, the process will wait for downloadingGrallVM
for a very long time.Maybe it's a network problem, but i want to know is there any other ways to speedup this step.
Maven Config
Build Cmd
Docker Builder Container Logs
The text was updated successfully, but these errors were encountered: