fix(emr): list every emr-7.x and emr-spark release, as AWS names and orders them (#9114)

ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes
knew five releases, the newest emr-7.5.0, so they refused emr-7.13.0
and the emr-spark-8.x releases Floci runs clusters on. The catalogue
now holds every emr-7.x release, emr-7.0.0 to emr-7.14.0, and the AWS
runtime for Apache Spark's emr-spark-8.0.0, 8.1.0 and 8.2.0, beside
emr-6.15.0, emr-6.14.0 and emr-5.36.2. Each release's applications,
versions and Amazon Linux releases come from its Release Guide page,
as before; the emr-7.14.0, emr-spark-8.1.0 and emr-spark-8.2.0 pages
list no Amazon Linux release, so those report none.

Application names are spelled as AWS answers them, Spark, HBase,
ZooKeeper and JupyterHub, where they were lowercased; each page lists
them that way too, with Trino for "Trino (PrestoSQL)". The Application
filter of ListReleaseLabels still matches without regard to case.

ListReleaseLabels lists the numbered releases newest first, and the
emr-spark ones after them oldest first, the order AWS answered for
that family. DescribeReleaseLabel without a label describes the first
release listed, now emr-7.14.0.

An unknown release label gets AWS's recorded answers, which differ by
operation: DescribeReleaseLabel "The release label isn't valid." with
ErrorCode InvalidInputParameter, and ListSupportedInstanceTypes "The
supplied release label is invalid: <label>." with ErrorCode
INVALID_RELEASE_LABEL, a missing label reading null. A blank label is
refused there too, and a blank default-release-label setting no
longer adds an empty release to the list.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-20 18:08:32 -04:00
1 parent 30c37a129c
commit 89e0242167
10 files changed
+397 -196

No files matched your search

@@ -5,12 +5,14 @@ import java.util.List;
import java.util.Optional;
/**
* The EMR releases ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes report: a
* curated set of recent releases, not AWS's full list. Each release's applications and versions come
* from its page in the Amazon EMR Release Guide (application names lowercased and versions without
* AWS's {@code -amzn-N} build suffix, as the API reports them), with the two most recent Amazon Linux
* releases that page lists. The instance types are common EMR families with their EC2 sizes, all of
* which these releases support.
* The EMR releases ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes report: every emr-7.x
* release and every release of the AWS runtime for Apache Spark (emr-spark-*), with emr-6.15.0, emr-6.14.0 and
* emr-5.36.2, not AWS's full list. Each release's applications and versions come from its page in the Amazon EMR
* Release Guide. The names are spelled as that page's list of applications spells them, which is how AWS answers
* them (Spark, HBase, ZooKeeper), with Trino for "Trino (PrestoSQL)". The versions drop AWS's build suffix
* ({@code -amzn-N}), the API giving "the concise version of the application". Each release also has the two most
* recent Amazon Linux releases its page lists, or none where the page lists none. The instance types are common
* EMR families with their EC2 sizes, all of which these releases support.
*/
final class EmrReleaseCatalog {
@@ -21,138 +23,197 @@ final class EmrReleaseCatalog {
record InstanceType(String type, int vcpu, float memoryGb, int storageGb, int numberOfDisks,
boolean ebsStorageOnly, String instanceFamilyId, String architecture) {}
/** Newest first, as ListReleaseLabels returns them. */
// The two most recent Amazon Linux 2023 and Amazon Linux 2 releases, the same on every page that lists them.
private static final List<String> AMAZON_LINUX_2023 = List.of("2023.12.20260803.3", "2023.12.20260727.0");
private static final List<String> AMAZON_LINUX_2 = List.of("2.0.20260803.1", "2.0.20260727.0");
/**
* In ListReleaseLabels' order (see {@link #LISTING_ORDER}): every emr-7.x release, emr-6.15.0, emr-6.14.0 and
* emr-5.36.2, then the AWS runtime for Apache Spark's releases.
*/
static final List<Release> RELEASES = List.of(
new Release("emr-7.14.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.3.2"), app("Flink", "1.20.0"),
app("HBase", "2.6.4"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.2"), app("Hive", "3.1.3"),
app("Hudi", "1.0.2"), app("Hue", "4.11.0"), app("Iceberg", "1.10.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.3.0"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.8"), app("TensorFlow", "2.19.0"),
app("Tez", "0.10.2"), app("Trino", "479"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.3")),
List.of()),
new Release("emr-7.13.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.3.2"), app("Flink", "1.20.0"),
app("HBase", "2.6.4"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.2"), app("Hive", "3.1.3"),
app("Hudi", "1.0.2"), app("Hue", "4.11.0"), app("Iceberg", "1.10.0"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.3.0"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.6"), app("TensorFlow", "2.19.0"),
app("Tez", "0.10.2"), app("Trino", "479"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.3")),
AMAZON_LINUX_2023),
new Release("emr-7.12.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.3.2"), app("Flink", "1.20.0"),
app("HBase", "2.6.2"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.1"), app("Hive", "3.1.3"),
app("Hudi", "1.0.2"), app("Hue", "4.11.0"), app("Iceberg", "1.10.0"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.1"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.6"), app("TensorFlow", "2.19.0"),
app("Tez", "0.10.2"), app("Trino", "476"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.3")),
AMAZON_LINUX_2023),
new Release("emr-7.11.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.3.2"), app("Flink", "1.20.0"),
app("HBase", "2.6.2"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.1"), app("Hive", "3.1.3"),
app("Hudi", "1.0.2"), app("Hue", "4.11.0"), app("Iceberg", "1.9.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.1"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.6"), app("TensorFlow", "2.19.0"),
app("Tez", "0.10.2"), app("Trino", "475"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.3")),
AMAZON_LINUX_2023),
new Release("emr-7.10.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.3.0"), app("Flink", "1.20.0"),
app("HBase", "2.6.2"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.1"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.8.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.1"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.5"), app("TensorFlow", "2.18.0"),
app("Tez", "0.10.2"), app("Trino", "470"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.3")),
AMAZON_LINUX_2023),
new Release("emr-7.9.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.3.0"), app("Flink", "1.20.0"),
app("HBase", "2.6.2"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.1"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.7.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.1"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.5"), app("TensorFlow", "2.16.1"),
app("Tez", "0.10.2"), app("Trino", "467"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.3")),
AMAZON_LINUX_2023),
new Release("emr-7.8.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.3.0"), app("Flink", "1.20.0"),
app("HBase", "2.6.1"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.1"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.7.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.1"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.4"), app("TensorFlow", "2.16.1"),
app("Tez", "0.10.2"), app("Trino", "467"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.3")),
AMAZON_LINUX_2023),
new Release("emr-7.7.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.2.1"), app("Flink", "1.20.0"),
app("HBase", "2.6.1"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.0"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.7.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.1"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.3"), app("TensorFlow", "2.16.1"),
app("Tez", "0.10.2"), app("Trino", "467"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.2")),
AMAZON_LINUX_2023),
new Release("emr-7.6.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.2.1"), app("Flink", "1.20.0"),
app("HBase", "2.6.1"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.0"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.6.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.0"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.3"), app("TensorFlow", "2.16.1"),
app("Tez", "0.10.2"), app("Trino", "457"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.2")),
AMAZON_LINUX_2023),
new Release("emr-7.5.0", List.of(
app("amazoncloudwatchagent", "1.300032.2"),
app("delta", "3.2.1"),
app("flink", "1.19.1"),
app("hadoop", "3.4.0"),
app("hbase", "2.5.10"),
app("hcatalog", "3.1.3"),
app("hive", "3.1.3"),
app("hudi", "0.15.0"),
app("hue", "4.11.0"),
app("iceberg", "1.6.1"),
app("jupyterenterprisegateway", "2.6.0"),
app("jupyterhub", "1.5.0"),
app("livy", "0.8.0-incubating"),
app("oozie", "5.2.1"),
app("phoenix", "5.2.0"),
app("pig", "0.17.0"),
app("presto", "0.287"),
app("spark", "3.5.2"),
app("tensorflow", "2.16.1"),
app("tez", "0.10.2"),
app("trino", "446"),
app("zeppelin", "0.11.1"),
app("zookeeper", "3.9.2")),
List.of("2023.12.20260803.3", "2023.12.20260727.0")),
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.2.1"), app("Flink", "1.19.1"),
app("HBase", "2.5.10"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.0"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.6.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.0"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.2"), app("TensorFlow", "2.16.1"),
app("Tez", "0.10.2"), app("Trino", "446"), app("Zeppelin", "0.11.1"), app("ZooKeeper", "3.9.2")),
AMAZON_LINUX_2023),
new Release("emr-7.4.0", List.of(
app("amazoncloudwatchagent", "1.300032.2"),
app("delta", "3.2.0"),
app("flink", "1.19.1"),
app("hadoop", "3.4.0"),
app("hbase", "2.5.5"),
app("hcatalog", "3.1.3"),
app("hive", "3.1.3"),
app("hudi", "0.15.0"),
app("hue", "4.11.0"),
app("iceberg", "1.6.1"),
app("jupyterenterprisegateway", "2.6.0"),
app("jupyterhub", "1.5.0"),
app("livy", "0.8.0-incubating"),
app("oozie", "5.2.1"),
app("phoenix", "5.2.0"),
app("pig", "0.17.0"),
app("presto", "0.287"),
app("spark", "3.5.2"),
app("sqoop", "1.4.7"),
app("tensorflow", "2.16.1"),
app("tez", "0.10.2"),
app("trino", "446"),
app("zeppelin", "0.11.1"),
app("zookeeper", "3.9.2")),
List.of("2023.12.20260803.3", "2023.12.20260727.0")),
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.2.0"), app("Flink", "1.19.1"),
app("HBase", "2.5.5"), app("HCatalog", "3.1.3"), app("Hadoop", "3.4.0"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.6.1"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.2.0"),
app("Pig", "0.17.0"), app("Presto", "0.287"), app("Spark", "3.5.2"), app("Sqoop", "1.4.7"),
app("TensorFlow", "2.16.1"), app("Tez", "0.10.2"), app("Trino", "446"), app("Zeppelin", "0.11.1"),
app("ZooKeeper", "3.9.2")),
AMAZON_LINUX_2023),
new Release("emr-7.3.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.2.0"), app("Flink", "1.18.1"),
app("HBase", "2.4.17"), app("HCatalog", "3.1.3"), app("Hadoop", "3.3.6"), app("Hive", "3.1.3"),
app("Hudi", "0.15.0"), app("Hue", "4.11.0"), app("Iceberg", "1.5.2"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("Oozie", "5.2.1"), app("Phoenix", "5.1.3"),
app("Pig", "0.17.0"), app("Presto", "0.285"), app("Spark", "3.5.1"), app("Sqoop", "1.4.7"),
app("TensorFlow", "2.16.1"), app("Tez", "0.10.2"), app("Trino", "442"), app("Zeppelin", "0.11.1"),
app("ZooKeeper", "3.9.1")),
AMAZON_LINUX_2023),
new Release("emr-7.2.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.1.0"), app("Flink", "1.18.1"),
app("HBase", "2.4.17"), app("HCatalog", "3.1.3"), app("Hadoop", "3.3.6"), app("Hive", "3.1.3"),
app("Hudi", "0.14.1"), app("Hue", "4.11.0"), app("Iceberg", "1.5.0"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("MXNet", "1.9.1"), app("Oozie", "5.2.1"),
app("Phoenix", "5.1.3"), app("Pig", "0.17.0"), app("Presto", "0.285"), app("Spark", "3.5.1"),
app("Sqoop", "1.4.7"), app("TensorFlow", "2.11.0"), app("Tez", "0.10.2"), app("Trino", "436"),
app("Zeppelin", "0.10.1"), app("ZooKeeper", "3.9.1")),
AMAZON_LINUX_2023),
new Release("emr-7.1.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "3.0.0"), app("Flink", "1.18.1"),
app("HBase", "2.4.17"), app("HCatalog", "3.1.3"), app("Hadoop", "3.3.6"), app("Hive", "3.1.3"),
app("Hudi", "0.14.1"), app("Hue", "4.11.0"), app("Iceberg", "1.4.3"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.8.0-incubating"), app("MXNet", "1.9.1"), app("Oozie", "5.2.1"),
app("Phoenix", "5.1.3"), app("Pig", "0.17.0"), app("Presto", "0.284"), app("Spark", "3.5.0"),
app("Sqoop", "1.4.7"), app("TensorFlow", "2.11.0"), app("Tez", "0.10.2"), app("Trino", "435"),
app("Zeppelin", "0.10.1"), app("ZooKeeper", "3.9.1")),
AMAZON_LINUX_2023),
new Release("emr-7.0.0", List.of(
app("AmazonCloudWatchAgent", "1.300031.1"), app("Delta", "3.0.0"), app("Flink", "1.18.0"),
app("HBase", "2.4.17"), app("HCatalog", "3.1.3"), app("Hadoop", "3.3.6"), app("Hive", "3.1.3"),
app("Hudi", "0.14.0"), app("Hue", "4.11.0"), app("Iceberg", "1.4.2"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.5.0"),
app("Livy", "0.7.1-incubating"), app("MXNet", "1.9.1"), app("Oozie", "5.2.1"),
app("Phoenix", "5.1.3"), app("Pig", "0.17.0"), app("Presto", "0.283"), app("Spark", "3.5.0"),
app("Sqoop", "1.4.7"), app("TensorFlow", "2.11.0"), app("Tez", "0.10.2"), app("Trino", "426"),
app("Zeppelin", "0.10.1"), app("ZooKeeper", "3.5.10")),
AMAZON_LINUX_2023),
new Release("emr-6.15.0", List.of(
app("delta", "2.4.0"),
app("flink", "1.17.1"),
app("ganglia", "3.7.2"),
app("hadoop", "3.3.6"),
app("hbase", "2.4.17"),
app("hcatalog", "3.1.3"),
app("hive", "3.1.3"),
app("hudi", "0.14.0"),
app("hue", "4.11.0"),
app("iceberg", "1.4.0"),
app("jupyterenterprisegateway", "2.6.0"),
app("jupyterhub", "1.5.0"),
app("livy", "0.7.1-incubating"),
app("mxnet", "1.9.1"),
app("oozie", "5.2.1"),
app("phoenix", "5.1.3"),
app("pig", "0.17.0"),
app("presto", "0.283"),
app("spark", "3.4.1"),
app("sqoop", "1.4.7"),
app("tensorflow", "2.11.0"),
app("tez", "0.10.2"),
app("trino", "426"),
app("zeppelin", "0.10.1"),
app("zookeeper", "3.5.10")),
List.of("2.0.20260803.1", "2.0.20260727.0")),
app("Delta", "2.4.0"), app("Flink", "1.17.1"), app("Ganglia", "3.7.2"), app("HBase", "2.4.17"),
app("HCatalog", "3.1.3"), app("Hadoop", "3.3.6"), app("Hive", "3.1.3"), app("Hudi", "0.14.0"),
app("Hue", "4.11.0"), app("Iceberg", "1.4.0"), app("JupyterEnterpriseGateway", "2.6.0"),
app("JupyterHub", "1.5.0"), app("Livy", "0.7.1-incubating"), app("MXNet", "1.9.1"),
app("Oozie", "5.2.1"), app("Phoenix", "5.1.3"), app("Pig", "0.17.0"), app("Presto", "0.283"),
app("Spark", "3.4.1"), app("Sqoop", "1.4.7"), app("TensorFlow", "2.11.0"), app("Tez", "0.10.2"),
app("Trino", "426"), app("Zeppelin", "0.10.1"), app("ZooKeeper", "3.5.10")),
AMAZON_LINUX_2),
new Release("emr-6.14.0", List.of(
app("delta", "2.4.0"),
app("flink", "1.17.1"),
app("ganglia", "3.7.2"),
app("hadoop", "3.3.3"),
app("hbase", "2.4.17"),
app("hcatalog", "3.1.3"),
app("hive", "3.1.3"),
app("hudi", "0.13.1"),
app("hue", "4.11.0"),
app("iceberg", "1.3.1"),
app("jupyterenterprisegateway", "2.6.0"),
app("jupyterhub", "1.5.0"),
app("livy", "0.7.1-incubating"),
app("mxnet", "1.9.1"),
app("oozie", "5.2.1"),
app("phoenix", "5.1.3"),
app("pig", "0.17.0"),
app("presto", "0.281"),
app("spark", "3.4.1"),
app("sqoop", "1.4.7"),
app("tensorflow", "2.11.0"),
app("tez", "0.10.2"),
app("trino", "422"),
app("zeppelin", "0.10.1"),
app("zookeeper", "3.5.10")),
List.of("2.0.20260803.1", "2.0.20260727.0")),
app("Delta", "2.4.0"), app("Flink", "1.17.1"), app("Ganglia", "3.7.2"), app("HBase", "2.4.17"),
app("HCatalog", "3.1.3"), app("Hadoop", "3.3.3"), app("Hive", "3.1.3"), app("Hudi", "0.13.1"),
app("Hue", "4.11.0"), app("Iceberg", "1.3.1"), app("JupyterEnterpriseGateway", "2.6.0"),
app("JupyterHub", "1.5.0"), app("Livy", "0.7.1-incubating"), app("MXNet", "1.9.1"),
app("Oozie", "5.2.1"), app("Phoenix", "5.1.3"), app("Pig", "0.17.0"), app("Presto", "0.281"),
app("Spark", "3.4.1"), app("Sqoop", "1.4.7"), app("TensorFlow", "2.11.0"), app("Tez", "0.10.2"),
app("Trino", "422"), app("Zeppelin", "0.10.1"), app("ZooKeeper", "3.5.10")),
AMAZON_LINUX_2),
new Release("emr-5.36.2", List.of(
app("flink", "1.14.2"),
app("ganglia", "3.7.2"),
app("hadoop", "2.10.1"),
app("hbase", "1.4.13"),
app("hcatalog", "2.3.9"),
app("hive", "2.3.9"),
app("hudi", "0.10.1"),
app("hue", "4.10.0"),
app("jupyterenterprisegateway", "2.6.0"),
app("jupyterhub", "1.4.1"),
app("livy", "0.7.1-incubating"),
app("mahout", "0.13.0"),
app("mxnet", "1.8.0"),
app("oozie", "5.2.1"),
app("phoenix", "4.14.3-HBase-1.4"),
app("pig", "0.17.0"),
app("presto", "0.267"),
app("spark", "2.4.8"),
app("sqoop", "1.4.7"),
app("tensorflow", "2.4.1"),
app("tez", "0.9.2"),
app("zeppelin", "0.10.0"),
app("zookeeper", "3.4.14")),
List.of("2.0.20260803.1", "2.0.20260727.0")));
app("Flink", "1.14.2"), app("Ganglia", "3.7.2"), app("HBase", "1.4.13"), app("HCatalog", "2.3.9"),
app("Hadoop", "2.10.1"), app("Hive", "2.3.9"), app("Hudi", "0.10.1"), app("Hue", "4.10.0"),
app("JupyterEnterpriseGateway", "2.6.0"), app("JupyterHub", "1.4.1"),
app("Livy", "0.7.1-incubating"), app("MXNet", "1.8.0"), app("Mahout", "0.13.0"),
app("Oozie", "5.2.1"), app("Phoenix", "4.14.3-HBase-1.4"), app("Pig", "0.17.0"),
app("Presto", "0.267"), app("Spark", "2.4.8"), app("Sqoop", "1.4.7"), app("TensorFlow", "2.4.1"),
app("Tez", "0.9.2"), app("Zeppelin", "0.10.0"), app("ZooKeeper", "3.4.14")),
AMAZON_LINUX_2),
new Release("emr-spark-8.0.0", List.of(
app("AmazonCloudWatchAgent", "1.300032.2"), app("Delta", "4.0.0"), app("Hudi", "1.1.0"),
app("Iceberg", "1.10.1"), app("JupyterEnterpriseGateway", "2.6.0"), app("Livy", "0.8.0-incubating"),
app("Spark", "4.0.2")),
AMAZON_LINUX_2023),
new Release("emr-spark-8.1.0", List.of(
app("AmazonCloudWatchAgent", "1.300034.0"), app("Delta", "4.2.0"), app("Hudi", "1.1.1"),
app("Iceberg", "1.11.0"), app("JupyterEnterpriseGateway", "2.6.0"), app("Livy", "0.9.0-incubating"),
app("Spark", "4.1.1")),
List.of()),
new Release("emr-spark-8.2.0", List.of(
app("AmazonCloudWatchAgent", "1.300034.0"), app("Delta", "4.2.0"), app("Hudi", "1.1.1"),
app("Iceberg", "1.11.0"), app("JupyterEnterpriseGateway", "2.6.0"), app("Livy", "0.9.0-incubating"),
app("Spark", "4.1.3")),
List.of()));
static final List<InstanceType> INSTANCE_TYPES = List.of(
new InstanceType("c5.xlarge", 4, 8f, 0, 0, true, "c5", "X86_64"),
@@ -179,21 +240,35 @@ final class EmrReleaseCatalog {
return RELEASES.stream().filter(r -> r.label().equals(label)).findFirst();
}
/** Numeric release order, so emr-6.15.0 sorts after emr-6.9.0. */
static final Comparator<String> NEWEST_FIRST = Comparator.comparing(EmrReleaseCatalog::versionKey,
(a, b) -> {
for (int i = 0; i < Math.max(a.length, b.length); i++) {
int x = i < a.length ? a[i] : 0;
int y = i < b.length ? b[i] : 0;
if (x != y) {
return Integer.compare(y, x);
}
}
return 0;
});
// The AWS runtime for Apache Spark's releases, numbered from 8.0.0 on.
private static final String SPARK_RUNTIME_PREFIX = "emr-spark-";
/**
* ListReleaseLabels' order. The numbered releases come newest first by number, emr-6.15.0 before emr-6.9.0, as
* AWS lists them. AWS answered a recorded ListReleaseLabels for the AWS runtime for Apache Spark's releases with
* emr-spark-8.0.0, then emr-spark-8.1.0, so those come oldest first; where AWS puts them among the numbered
* releases is not recorded, and Floci lists them last.
*/
static final Comparator<String> LISTING_ORDER = Comparator
.comparing((String label) -> label.startsWith(SPARK_RUNTIME_PREFIX))
.thenComparing((a, b) -> a.startsWith(SPARK_RUNTIME_PREFIX) ? byNumber(a, b) : byNumber(b, a));
/** Two labels by their release numbers, lowest first. */
private static int byNumber(String a, String b) {
int[] x = versionKey(a);
int[] y = versionKey(b);
for (int i = 0; i < Math.max(x.length, y.length); i++) {
int left = i < x.length ? x[i] : 0;
int right = i < y.length ? y[i] : 0;
if (left != right) {
return Integer.compare(left, right);
}
}
return 0;
}
private static int[] versionKey(String label) {
String[] parts = label.replaceFirst("^emr-", "").split("\\.");
String[] parts = label.replaceFirst("^emr-(spark-)?", "").split("\\.");
int[] key = new int[parts.length];
for (int i = 0; i < parts.length; i++) {
try {
@@ -1717,22 +1717,23 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
private static final int INSTANCE_TYPE_PAGE = 50;
/**
* The catalogue's releases, newest first. Floci's configured default release label is always
* The catalogue's releases, in ListReleaseLabels' order. Floci's configured default release label is always
* among them, with no applications when the catalogue does not describe it, so a non-default
* setting never makes Floci's own default unknown.
* setting never makes Floci's own default unknown. A blank setting names no release, so it adds none.
*/
List<EmrReleaseCatalog.Release> releases() {
if (EmrReleaseCatalog.release(defaultReleaseLabel).isPresent()) {
if (defaultReleaseLabel == null || defaultReleaseLabel.isBlank()
|| EmrReleaseCatalog.release(defaultReleaseLabel).isPresent()) {
return EmrReleaseCatalog.RELEASES;
}
List<EmrReleaseCatalog.Release> all = new ArrayList<>(EmrReleaseCatalog.RELEASES);
all.add(new EmrReleaseCatalog.Release(defaultReleaseLabel, List.of(), List.of()));
all.sort((a, b) -> EmrReleaseCatalog.NEWEST_FIRST.compare(a.label(), b.label()));
all.sort((a, b) -> EmrReleaseCatalog.LISTING_ORDER.compare(a.label(), b.label()));
return all;
}
/**
* Release labels, newest first, narrowed by {@code prefix} (such as {@code emr-6}) and by
* Release labels, in the catalogue's order, narrowed by {@code prefix} (such as {@code emr-6}) and by
* {@code application}, a name or {@code name@version} (such as {@code spark@3.5.2}) matched
* without regard to case. A token belongs to the filters it was issued for, so one replayed
* with other filters, or altered, is refused.
@@ -1763,32 +1764,35 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
nextToken, namespace, EmrService::invalidToken);
}
/** A release's applications and OS releases; no label means the latest release. */
/** A release's applications and OS releases; no label means the newest numbered release, the first listed. */
public EmrReleaseCatalog.Release describeReleaseLabel(String label) {
return label == null || label.isBlank() ? releases().get(0) : requireRelease(label);
if (label == null || label.isBlank()) {
return releases().get(0);
}
// AWS's recorded answer: InvalidRequestException with this ErrorCode and a message naming no label.
return findRelease(label).orElseThrow(() -> new AwsException("InvalidRequestException",
"The release label isn't valid.", 400, Map.of("ErrorCode", "InvalidInputParameter")));
}
public PaginatedResult<EmrReleaseCatalog.InstanceType> listSupportedInstanceTypes(String label, String marker) {
if (label == null || label.isBlank()) {
throw new AwsException("InvalidRequestException", "ReleaseLabel is required.", 400);
// AWS's recorded answer, a missing label reading "null"; its ErrorCode and wording differ from
// DescribeReleaseLabel's.
if (label == null || label.isBlank() || findRelease(label).isEmpty()) {
throw new AwsException("InvalidRequestException", "The supplied release label is invalid: " + label + ".",
400, Map.of("ErrorCode", "INVALID_RELEASE_LABEL"));
}
requireRelease(label);
List<EmrReleaseCatalog.InstanceType> types = EmrReleaseCatalog.INSTANCE_TYPES;
return Pagination.paginate(types, positionIn(types), INSTANCE_TYPE_PAGE, marker,
"ListSupportedInstanceTypes|" + label, EmrService::invalidToken);
}
private EmrReleaseCatalog.Release requireRelease(String label) {
return releases().stream()
.filter(r -> r.label().equals(label))
.findFirst()
.orElseThrow(() -> new AwsException("InvalidRequestException",
"The specified release label " + label + " is not valid.", 400));
private Optional<EmrReleaseCatalog.Release> findRelease(String label) {
return releases().stream().filter(r -> r.label().equals(label)).findFirst();
}
/**
* A cursor that keeps the catalogue's own order: {@link Pagination} sorts by cursor, and the
* catalogue is newest first rather than alphabetical.
* catalogue is in ListReleaseLabels' order rather than alphabetical.
*/
private static <T> Function<T, String> positionIn(List<T> items) {
Map<T, String> positions = new HashMap<>();