AdoptOpenJDK/openjdk-api

The API for the "Latest" build does not return info for all arches

dinogun opened this issue · 5 comments

Eg. when we query for the latest nightly for hotspot, we get the following JSON object.

{
  "release_name": "jdk8u181-b13-201813081646",
  "timestamp": "2018-08-13T17:02:00Z",
  "release": false,
  "binaries": [
    {
      "os": "linux",
      "architecture": "aarch64",
      "binary_type": "jdk",
      "openjdk_impl": "hotspot",
      "binary_name": "OpenJDK8_aarch64_Linux_201813081646.tar.gz",
      "binary_link": "https://github.com/AdoptOpenJDK/openjdk8-nightly/releases/download/jdk8u181-b13-201813081646/OpenJDK8_aarch64_Linux_201813081646.tar.gz",
      "binary_size": 79440911,
      "checksum_link": "https://github.com/AdoptOpenJDK/openjdk8-nightly/releases/download/jdk8u181-b13-201813081646/OpenJDK8_aarch64_Linux_201813081646.sha256.txt",
      "version": "8"
    }
  ]
}

This has only an entry for aarch64. However if we specifically query for nightly hotspot for x64 arch, we get this.

{
  "release_name": "jdk8u181-b13-201808131800",
  "timestamp": "2018-08-13T16:29:23Z",
  "release": false,
  "binaries": [
    {
      "os": "linux",
      "architecture": "x64",
      "binary_type": "jdk",
      "openjdk_impl": "hotspot",
      "binary_name": "OpenJDK8_x64_Linux_201808131800.tar.gz",
      "binary_link": "https://github.com/AdoptOpenJDK/openjdk8-nightly/releases/download/jdk8u181-b13-201808131800/OpenJDK8_x64_Linux_201808131800.tar.gz",
      "binary_size": 78344689,
      "checksum_link": "https://github.com/AdoptOpenJDK/openjdk8-nightly/releases/download/jdk8u181-b13-201808131800/OpenJDK8_x64_Linux_201808131800.sha256.txt",
      "version": "8"
    }
  ]
}

dino [Today at 09:55]
Question on the v2 API: If the "latest" version is different for different arches, how do you determine the generic latest ? (edited)

17 replies
dino [3 hours ago]
Eg. https://api.adoptopenjdk.net/v2/info/nightly/openjdk8?openjdk_impl=hotspot&os=linux&type=jdk&release=latest
vs
https://api.adoptopenjdk.net/v2/info/nightly/openjdk8?openjdk_impl=hotspot&os=linux&type=jdk&release=latest&arch=x64

dino [3 hours ago]
Also ideally, the first one should return content for all supported arches right ? Currently it only has data for aarch64

dino [3 hours ago]
Similarly for openj9 as well

dino [3 hours ago]
https://api.adoptopenjdk.net/v2/info/nightly/openjdk8?openjdk_impl=openj9&os=linux&type=jdk&release=latest
and
https://api.adoptopenjdk.net/v2/info/nightly/openjdk8?openjdk_impl=openj9&os=linux&type=jdk&release=latest&arch=x64

martijnverburg [3 hours ago]
Probably best to raise an issue on this on the api project and @johno and I will take a look

dino [3 hours ago]
ok thx

johno [3 hours ago]
@dino That is because the latest release only contained an arch binary https://github.com/AdoptOpenJDK/openjdk8-nightly/releases/tag/jdk8u181-b13-201813081646
GitHub
AdoptOpenJDK/openjdk8-nightly
openjdk8-nightly - AdoptOpenJDK nightly binary releases for OpenJDK 8 with HotSpot

johno [3 hours ago]
yeah, that is potentially a bug and we should look back to find the latest for every possible matching config

dino [3 hours ago]
yeah, I guess the issue is we have nightly builds with some arches failing / not available on specific nights. This means, for a given nightly tag, we cannot expect it to have builds for all arches

johno [3 hours ago]
yeah, it will be the odd behaviour that if you are more specific on the query it will work though

johno [3 hours ago]
so if you add an arch it should find it

dino [3 hours ago]
right

martijnverburg [3 hours ago]
I think that’s reasonable expected behaviour…

dino [3 hours ago]
I guess the question is on what the API returns for latest. Every arch has a latest, but the nightly version might not match

johno [3 hours ago]
yeah it will become quite complex in that if you dont provide an impl, type and arch for instance. The api will now have to search back to find the last for every possible ++ that could exist

dino [3 hours ago]
Maybe we can disallow latest without all the specifiers then ?

johno [3 hours ago]
hmm, could do

Some background history
dino [3 hours ago]
yeah, I guess the issue is we have nightly builds with some arches failing / not available on specific nights. This means, for a given nightly tag, we cannot expect it to have builds for all arches

-- @dinogun correct, that is updated nightly publish story. Set nightly builds deployment per platform

johno [3 hours ago]
yeah, it will be the odd behaviour that if you are more specific on the query it will work though

-- @johnoliver When we updated the nightly publish story we hit the issue Get latest sdk per platfom doesn't work all times fixed by force latest to always fetch the latest build . Guess this can explain this behavior.

Could be set latest always be the latest one with all specifiers?

I think its not impossible to return the latest build for every combination that matches the filters. Its just a question of how complex will it be to do, will have to take a look.

Should be resolved, if you want this info use the https://api.adoptopenjdk.net/v2/latestAssets/nightly/openjdk8 endpoint