[go-migration] Compatibility issue with existing apps due to JRE relocation in the Go-based Java Buildpack
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với quy trình staging của buildpack và entry point /profile.d/0_java.sh được đề cập trong issue, sau đó truy vết nơi JAVA_HOME mới được thiết lập. Tái hiện staging với đường dẫn .java-buildpack/open_jdk_jre/bin/java được hard-code và xác minh rằng cả hai đường dẫn JRE legacy đều được phân giải đến vị trí canonical, trong khi JAVA_HOME mới vẫn khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
With the new Go-based Java Buildpack, the location of the JRE has changed:
for example, from /home/vcap/app/.java-buildpack/open_jdk_jre to the new location /home/vcap/deps/0/jre/jre-17.0.15/.
There are applications that invoke Java via a hardcoded relative path inside the droplet: .java-buildpack/open_jdk_jre/bin/java so those hardcoded paths no longer exist, which breaks apps and CF tasks that rely on that path. For example, an app used to execute CF Task to execute e.g. the DB schema (so the java is currently being invoked via the full path .java-buildpack/open_jdk_jre/bin/java). Or usages like JAVA_HOME=$PWD/.java-buildpack/open_jdk_jre JAVA_OPTS="-Djava.io.tmpdir=$TMPDIR
The new Go-based buildpack has a way to introduce $JAVA_HOME which will do the job but only for new apps (the existing apps pointing to /home/vcap/app/.java-buildpack/open_jdk_jre will fail).
Reproduction steps
- Use an app/script that calls Java using the relative path inside the droplet, e.g.:
.java-buildpack/open_jdk_jre/bin/java -Xms123M org.springframework.boot.loader.launch.JarLauncher - Stage the app using the current or the Go-migration branch of the buildpack.
- Run the app or run a CF task that invokes the hardcoded path.
- Observe that the app fails with
No such file or directory
Expected behavior
Existing apps/CF Tasks could continue to run without modification, even if the buildpack internal JRE layout changes.
Suggested solution
Introduce compatibility shims during staging:
export JAVA_HOME=<the-new-java-location> (available in /profile.d/0_java.sh)
mkdir -p /home/vcap/app/.java-buildpack
ln -s $JAVA_HOME /home/vcap/app/.java-buildpack/open_jdk_jre
ln -s $JAVA_HOME /home/vcap/app/.java-buildpack/sap_machine_jre
- This preserves
.java-buildpack/open_jdk_jreand.java-buildpack/sap_machine_jreas a symlink to the actual JRE location. $JAVA_HOMEpoints to the canonical new location.- Apps with hard-coded paths will continue working.
- Ngôn ngữ chính
- Go
- Star
- 452
- Fork
- 2.5k
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudfoundry/java-buildpack
-
v5.1.0 GA release planĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
cloudfoundry/java-buildpack#1423 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support configurable initial/minimum heap size relative to (/as a percentage of) calculated XmxĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
cloudfoundry/java-buildpack#1377 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
cloudfoundry/java-buildpack#1364 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
elastic-otel-java supportĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
cloudfoundry/java-buildpack#1342 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudfoundry/java-buildpack
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AOSSIE-Org/DebateAI#611 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MHSanaei/3x-ui#6737 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
terraform-provider
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
ClickHouse/terraform-provider-clickhousedbops#281 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
open-telemetry/opentelemetry-go-compile-instrumentation#1450 ·
Maintainer thường phản hồi trong vòng 2 ngày