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

[Task][prism] Have java wrapper check and download released prism binary if available. #31402

Closed
Tracked by #28187 ...
lostluck opened this issue May 24, 2024 · 2 comments · Fixed by #31796
Closed
Tracked by #28187 ...
Assignees

Comments

@lostluck
Copy link
Contributor

lostluck commented May 24, 2024

The binary zips we're putting up in GitHub release artifacts will be at URLs with the following pattern.

http://github.com/apache/beam/releases/download/RELEASE/apache_beam-RELEASE-prism-OS-ARCH.zip

This issue is the sibling to #31403.

This is with the full release version that matches the release tag. That is for version 2.57.0, the tag is v2.57.0.

Since we're building with Go os and architecture tags, we may need to translate however we detect those to match the Go build terms.

OS: windows linux darwin
ARCH: amd64 arm64

darwin is the Mac/OSX version.


Detecting these in Java is pretty straight forward.

OS:

https://stackoverflow.com/questions/228477/how-do-i-programmatically-determine-operating-system-in-java

It boils down to System.getProperty("os.name") and do some processing to convert to the values we need.

Architecture would be with the os.arch property, and similar processing: with the important values being "AArch64" and "x86" for our immeadiate purposes.


We can write the file out as a zip file, and then read it in with https://docs.oracle.com/javase/8/docs/api/java/util/zip/ZipFile.html. Though there's probably a way to use the input stream directly so we only need to save the unpacked binary.


Making a http request in Java without extra library's appears to be https://stackoverflow.com/questions/1359689/how-to-send-http-request-in-java

@lostluck lostluck changed the title Have java wrapper check and download released prism binary if available. [Task][prism] Have java wrapper check and download released prism binary if available. May 24, 2024
@damondouglas
Copy link
Contributor

@lostluck Is the intent for when a release becomes available, the untagged-<commit> will convert to <release-tag>? For example, https://github.com/apache/beam/releases/download/v2.57.0/apache_beam-v2.57.0-prism-linux-amd64.zip resulted in a 404 while https://github.com/apache/beam/releases/download/untagged-dadf35fc62aedc91ebcb/apache_beam-v2.57.0-prism-linux-amd64.zip worked.

@damondouglas
Copy link
Contributor

Nevermind. I realized that it is a draft release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants