Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Switch to using Azul's REST API to fetch Java #15

@srdo

Description

@srdo

When performing a customer upgrade we had the following issues:

  • By not specifying a java_version, they risked installing different versions between their testing and production environments.
  • When specifying a java_version, they had trouble telling which versions were available in the Apt repository, which will make it difficult for them when they next want to bump the Java version.

I've sent a few emails to Azul support asking for advice on the second point. As far as I can tell, the usual apt tools (e.g. apt policy) don't list which OpenJDK versions are available in the Azul Apt repository. The version strings used in the repository don't seem to be listed anywhere on Azul's page. How did we guess the string "13.33.25-2"?

Azul's support guy recommended we instead script installs around their REST API. I will include parts of his email here:

Use the Azul OpenJDK Discovery API ( https://www.azul.com/downloads/zulu-community/api/ )

As example, to get the list of Zulu DEB builds for Ubuntu, you can use this command:
$ curl -H "Accept: application/json" "https://api.azul.com/zulu/download/community/v1.0/bundles/?jdk_version=13&ext=deb&os=linux&arch=x86&hw_bitness=64"

{"id":10844,"url":"https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-linux_amd64.deb","name":"zulu13.27.9-ca-jdk13.0.0-linux_amd64.deb","zulu_version":[13,27,9,0],"jdk_version":[13,0,0,33]},{"id":10877,"url":"https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-linux_amd64.deb","name":"zulu13.28.11-ca-jdk13.0.1-linux_amd64.deb","zulu_version":[13,28,11,0],"jdk_version":[13,0,1,10]},{"id":10878,"url":"https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jre13.0.1-linux_amd64.deb","name":"zulu13.28.11-ca-jre13.0.1-linux_amd64.deb","zulu_version":[13,28,11,0],"jdk_version":[13,0,1,10]},{"id":11055,"url":"https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jre13.0.2-linux_amd64.deb","name":"zulu13.29.9-ca-jre13.0.2-linux_amd64.deb","zulu_version":[13,29,9,0],"jdk_version":[13,0,2,6]},{"id":11064,"url":"https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-linux_amd64.deb","name":"zulu13.29.9-ca-jdk13.0.2-linux_amd64.deb","zulu_version":[13,29,9,0],"jdk_version":[13,0,2,6]},{"id":11259,"url":"https://cdn.azul.com/zulu/bin/zulu13.31.11-ca-jdk13.0.3-linux_amd64.deb","name":"zulu13.31.11-ca-jdk13.0.3-linux_amd64.deb","zulu_version":[13,31,11,0],"jdk_version":[13,0,3,3]},{"id":11261,"url":"https://cdn.azul.com/zulu/bin/zulu13.31.11-ca-jre13.0.3-linux_amd64.deb","name":"zulu13.31.11-ca-jre13.0.3-linux_amd64.deb","zulu_version":[13,31,11,0],"jdk_version":[13,0,3,3]},{"id":11494,"url":"https://cdn.azul.com/zulu/bin/zulu13.33.25-ca-jdk13.0.4-linux_amd64.deb","name":"zulu13.33.25-ca-jdk13.0.4-linux_amd64.deb","zulu_version":[13,33,25,0],"jdk_version":[13,0,4,8]},{"id":11502,"url":"https://cdn.azul.com/zulu/bin/zulu13.33.25-ca-jre13.0.4-linux_amd64.deb","name":"zulu13.33.25-ca-jre13.0.4-linux_amd64.deb","zulu_version":[13,33,25,0],"jdk_version":[13,0,4,8]},{"id":12121,"url":"https://cdn.azul.com/zulu/bin/zulu13.35.51-ca-jdk13.0.5.1-linux_amd64.deb","name":"zulu13.35.51-ca-jdk13.0.5.1-linux_amd64.deb","zulu_version":[13,35,51,0],"jdk_version":[13,0,5,1]},{"id":12134,"url":"https://cdn.azul.com/zulu/bin/zulu13.35.51-ca-jre13.0.5.1-linux_amd64.deb","name":"zulu13.35.51-ca-jre13.0.5.1-linux_amd64.deb","zulu_version":[13,35,51,0],"jdk_version":[13,0,5,1]},{"id":12180,"url":"https://cdn.azul.com/zulu/bin/zulu13.35.51-ca-fx-jdk13.0.5.1-linux_amd64.deb","name":"zulu13.35.51-ca-fx-jdk13.0.5.1-linux_amd64.deb","zulu_version":[13,35,51,0],"jdk_version":[13,0,5,1]},{"id":11875,"url":"https://cdn.azul.com/zulu/bin/zulu13.35.17-ca-jdk13.0.5-linux_amd64.deb","name":"zulu13.35.17-ca-jdk13.0.5-linux_amd64.deb","zulu_version":[13,35,17,0],"jdk_version":[13,0,5,3]},{"id":11884,"url":"https://cdn.azul.com/zulu/bin/zulu13.35.17-ca-jre13.0.5-linux_amd64.deb","name":"zulu13.35.17-ca-jre13.0.5-linux_amd64.deb","zulu_version":[13,35,17,0],"jdk_version":[13,0,5,3]},{"id":12018,"url":"https://cdn.azul.com/zulu/bin/zulu13.35.17-ca-fx-jdk13.0.5-linux_amd64.deb","name":"zulu13.35.17-ca-fx-jdk13.0.5-linux_amd64.deb","zulu_version":[13,35,17,0],"jdk_version":[13,0,5,3]},{"id":12333,"url":"https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-linux_amd64.deb","name":"zulu13.37.21-ca-jdk13.0.6-linux_amd64.deb","zulu_version":[13,37,21,0],"jdk_version":[13,0,6,5]},{"id":12343,"url":"https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jre13.0.6-linux_amd64.deb","name":"zulu13.37.21-ca-jre13.0.6-linux_amd64.deb","zulu_version":[13,37,21,0],"jdk_version":[13,0,6,5]},{"id":12517,"url":"https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-fx-jdk13.0.6-linux_amd64.deb","name":"zulu13.37.21-ca-fx-jdk13.0.6-linux_amd64.deb","zulu_version":[13,37,21,0],"jdk_version":[13,0,6,5]}

As examples, I successfully downloaded these two builds by running the following commands:
a) $ curl -L -o zulu13.31.11-ca-jdk13.0.3-linux_amd64.deb "https://api.azul.com/zulu/download/community/v1.0/bundles/11259/binary/"
(snip)

I think we should consider fetching installers via the URLs given by this API instead of fetching from their Apt repo.

I think there would be these benefits:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions