A large pull request diff could fail the IAM data gate before any check
ran, because the workflow passed every changed path in one make argument
("Argument list too long"). The workflow now writes the paths to a file
and iam-data-verify reads it through CHANGED_FILE, keeping affected-check
selection, the CHANGED interface, full verification for an empty diff or
the weekly run, and the report of every failed check. A Python test runs
the target with stubbed checks for each of those cases.
The prune job added in #8956 listed maven-Linux- caches across every ref, so a cache another ref saved under the current pom's key could pass its guard and let it delete main's older entries while main's own current one was missing. It now lists and checks only refs/heads/main. No other ref saves that key today, since the save runs only on a push to main, but the guard no longer depends on it.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* chore(ci): check the amd64 native image after each Nightly, not on every pull request
compatibility.yml built the amd64 native image on every pull request (7 to 9 minutes in the last five green runs) to run one 2-minute suite, sdk-test-python, whose Firehose compression delivery test needs the x86_64 snappy JNI library. Pull requests now build and test arm64 only. compat-partitions.yml, which already runs after each Nightly against the published floci/floci:nightly image, gains an amd64 sdk-test-python job in the commercial partition, so the amd64 half of the multi-arch image is still checked once a day, against the image users pull.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* chore(ci): keep the amd64 job's test results, and skip it on a single-region dispatch
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
EmrDockerRunnerDockerIntegrationTest pulls a 3.5 GB image and took about 640 s of a passing pull request shard, so after #8903 moved its cluster shrink scenario to the nightly checks, the rest of the class follows as EmrDockerRunnerNightlyIntegrationTest. partition.sh no longer weighs it: SLOW_CLASSES comes from PARTITION_SLOW_CLASSES, empty by default, and test_partition.py passes its own. The standard nightly group has no room for it (339 of its 359 minutes), so the cluster-shrink group becomes docker-runner, with both classes in 42 minutes of bounds in a 62-minute job. On a pull request, the nightly checks now run only the nightly classes it adds or changes, or all of them when it changes the workflow.
* feat(docker): count open Docker streams per service and add a saturation harness
* fix(docker): match container routes at the start of the path, and tidy the harness
* test(docker): drop the saturation harness's quiet-stream sleep
With runner-mode docker, GetDashboardForJobRun's link for a Spark run's
attempt that has not ended now opens its driver's Spark UI for real, and
GetResourceDashboard's link does the same for a session's Spark Connect
server, as "For jobs in a running state, the application UI is a live
user interface such as the Spark or Tez web UI" and "While a session is
active, the URL opens the live Apache Spark UI".
Each link opens on a host of its own,
<secret>-4040.emr-serverless-ui.<Floci's host>, through the application
UI proxy EMR's on-cluster UIs use. That proxy moves to core.common
(AppUiProxy, AppUiRoutes, AppUiRoute, AppUiHost), and each service
registers the label its hosts are under. The runner turns the driver's
UI on for every EMR Serverless Spark run, as the release's image turns
it off, publishes port 4040 on the Docker host's loopback interface, and
keeps where Floci reaches it while the container runs.
A run whose logs are not kept in managed storage gets no live UI, as
with logs in S3 alone the application UI is "Not supported". A Hive
run, a run or session that has ended, and every link in the immediate
mode still open Floci's own page, which now says whether the attempt's
logs are in managed storage.
A nightly check skips unless -Dnightly.checks.enabled=true, but Quarkus builds
the application of every profile a run's classes use while JUnit discovers the
tests, before any class is skipped, and keeps it for the rest of the JVM. Six
profiles are used only by nightly checks, so every routine run built and held
six applications for classes that never run.
Surefire now excludes **/*NightlyIntegrationTest.java by default, and a
nightly-checks profile, active when nightly.checks.enabled is true, takes the
exclusion away again. The nightly workflow already passes that flag, so it runs
the checks as before; a CI shard and a local ./mvnw test no longer discover
them. The default **/*$* exclude stays, since a configured list replaces it.
With runner-mode docker, GetOnClusterAppUIPresignedURL now opens the
interfaces that run on the cluster's primary node for real: its
ResourceManager, an application master through the ResourceManager's
web proxy, its MapReduce JobHistory server, and the NodeManager of a
primary node that works.
Each opens on a host of its own, as AWS's application UIs do under
emrappui-prod.<region>.amazonaws.com, which are on the Public Suffix
List: http://<secret>-<port>.emrappui.<Floci's host and port>/, the
secret 26 random base32 characters only the link holds, so the host is
the link's authority, as the interface takes no AWS credentials.
EmrAppUiProxy, a Vert.x route ahead of the REST layer, sends a request
to that host on to the node's port, which the primary node publishes on
the host's loopback interface (Floci in a container joins the cluster's
network instead). It asks the interface under the browser's host, so
the links the interface writes itself are the browser's, and makes each
link the node's daemons write to one another by the node's name a link
to that interface's own host under the same secret, in text answers and
Location headers; an answer too large to hold goes on unchanged. A
request's body streams on as it arrives, an interface that sends nothing
for a minute has the request given up, and a link of a cluster that has
ended opens nothing, the node's port it found asked for again every ten
seconds while the cluster runs.
A link asked for before the primary node runs, as on a cluster no step
has run on yet, starts the node as a step would, through runOnCluster,
running nothing, and is not PresignedURLReady until the node is; its
host answers 503 meanwhile. With an ApplicationId each interface lands
on the application's page. The link lasts an hour, as Floci's page
links do. An interface Floci does not run (the Spark History Server,
the YARN timeline server, the Tez UI), and any link in the immediate
mode, still opens Floci's own page.
Floci's TLS certificate names *.emrappui.localhost and
*.emrappui.localhost.floci.io.
Lambda's CreateFunction and UpdateFunctionCode now refuse a direct
ZipFile upload over 50 MB from its Base64 length, before decoding it,
so a request already over the limit takes no more memory than it came
in; its RequestEntityTooLargeException is as before, and the test of it
builds its oversized upload without the bytes behind it.
EmrAppUiNightlyIntegrationTest runs it for real on an emr-7.5.0
cluster: the ResourceManager's link starts the primary node and opens
the ResourceManager, and after a MapReduce step its REST answer's links
open the application master's logs on the NodeManager's host and,
through the web proxy's redirect, the job on the JobHistory server's
host, as the JobHistory server's own link does. The nightly job's
timeout and image prefetch take the new check.
With runner-mode docker, StartNotebookExecution now runs the notebook on
its cluster as a step's command runs: a spark-submit there, a YARN
application with the cluster's Spark settings, as the execution's
ExecutionRoleArn, else the cluster's instance profile, with its
EnvironmentVariables (KERNEL_EXTRA_SPARK_OPTS, as AWS's example passes,
going to spark-submit as its options).
No source names AWS's kernel, so a program of Floci's own runs it,
needing only Python and PySpark, which every release's image has, not
Jupyter: it reads the notebook through the cluster's S3A, puts
NotebookParams in papermill's way (a cell tagged injected-parameters
after the one tagged parameters, else first, in place of any an earlier
run left; a name that is not a Python variable's fails the run), clears
every earlier output, runs the code cells in one namespace holding spark
and sc, keeping each one's output, its last expression's value and any
error, stops at the first cell that raises, and writes the notebook as
run as <name>.ipynb and <name>.html, then exits 3. A %%sql cell runs its
body with spark.sql, a %%local or %%spark one as Python, and other cell
magics are not run; % and ! lines are dropped only from a cell that is
not Python as it stands.
The notebook is the execution's NotebookS3Location; Floci keeps no EMR
Notebook's own S3 location, so an execution named by EditorId alone
fails at once. No source gives where AWS writes the notebook as run, so
Floci writes it under the OutputNotebookS3Location prefix, else beside
the notebook, in a folder named for the execution, and reports the one
OutputNotebookFormat names, the HTML one, else the notebook, as
OutputNotebookURI. The execution is START_PENDING until its container
runs, then RUNNING, and FINISHED, FAILED at the first raising cell (any
other failure giving the run's exit code), or STOPPED,
StopNotebookExecution going through STOPPING; its cluster's end stops
it, and one a restart left behind fails as interrupted.
EmrService.runOnCluster runs such a command on a cluster through the
cluster preparation steps and sessions share, its cluster's storage held
while it runs and its end stopping it. As a step's, its thread starts
nothing once its cluster has shut down or a reset's or a shutdown's
teardown has begun; one that cannot be handed to its thread ends at
once.
EmrNotebookExecutionNightlyIntegrationTest runs it for real on an
emr-7.5.0 cluster: a parameterized notebook's run, an earlier run's
parameters in it, written to S3 with its outputs, its %%sql cell's among
them, and HTML; a failing notebook's FAILED with its error kept and an
earlier run's later outputs gone; and a misnamed parameter's run failed
with its exit code.
The nightly job's timeout and image prefetch take the new check.
With runner-mode docker, StartSession now runs the session's Spark
Connect server on its cluster, as "Amazon EMR launches a Spark Connect
Server as a YARN application on your cluster": a container on the
cluster as a step's is, in the image its steps run in, its HDFS and
YARN started first where they are not running, the server's driver in
that container and its executors on the cluster's YARN. Its
spark-defaults are the cluster's, then the session's
EngineConfigurations, with the server's port; it runs as the session's
ExecutionRoleArn, else the cluster's instance profile.
A client reaches it through Floci as an EMR Serverless session's server
is reached (#8731): GetSessionEndpoint answers Floci's address and a
token, and a client connects with
sc://<host>:<port>/;x-aws-proxy-auth=<token>;authorization=<session id>,
AWS's string with Floci's port. The proxy drops the authorization
parameter, which AWS's own proxy reads, before the call reaches the
server.
The session is SUBMITTED until its container runs, STARTING until the
server answers, then IDLE, BUSY while a call runs on its server and
IDLE again once none does. TerminateSession goes through TERMINATING
until the server has stopped; the idle timeout stops it too, and the
cluster's end ends its sessions and stops their servers on its own,
its storage released only once the last of them has gone. A server that exits on its own, or does not answer within
10 minutes, fails the session; one a restart left behind fails as
interrupted, its container removed.
What EMR Serverless's sessions and these share moves into
emrserverless.SparkConnectServers: running each server, asking it
whether it answers, the tokens, the calls a session takes, and one
check for its next deadline; and SparkConnectSessionOwner, the states a
session goes through as its server starts, answers, takes calls and
stops, each service giving only how it stores, ends and checks its
sessions (both models implement SparkConnectSession). A server being stopped takes no new call, a call's
busy and idle reach the owner in order under the server's own lock, and
a server's entry goes even where its owner fails to hear it stopped. A step's setup on its cluster (its image, storage,
metadata address, added nodes and HDFS) moves into a preparation that
steps and sessions' servers share.
EmrSessionServerNightlyIntegrationTest runs it for real on an
emr-spark-8.1.0 cluster with Spark 4's JVM client from that image: a
wrong token refused, queries run, a missing table's Spark error back,
TerminateSession removing the server. The nightly job's timeout and
image prefetch take the new check.
With runner-mode docker, StartSession now runs the session's driver, a
Spark Connect server, in a container, as a job run's driver runs: in the
release's image or the application's custom image, on the same network,
with the execution role's credentials and the application's executors.
Its spark-defaults are the application's runtime configuration, then the
session's runtimeConfiguration; Floci sets the server's port and drops a
spark.connect.grpc.binding.address, which "is reserved by EMR Serverless
and cannot be overridden by users".
A client reaches the server through Floci. GetSessionEndpoint answers
Floci's own address, and the client puts the token in the
x-aws-proxy-auth parameter, as AWS's connection string does
(sc://<host>:443/;use_ssl=true;x-aws-proxy-auth=<token>). The new
core.common.SparkConnectProxy takes gRPC calls to
spark.connect.SparkConnectService on Floci's port, checks the token, and
forwards each call over HTTP/2, trailers included, to the server, whose
port is published on the Docker host's loopback interface only; a
Trailers-Only answer, Spark's error before any message, goes back as
one. A call
with no token, an unknown one or an expired one fails with gRPC's
UNAUTHENTICATED; one to a session that is not ready, or in the immediate
mode, with UNAVAILABLE.
The session is SUBMITTED until its container runs, STARTING until the
server answers, then IDLE. No source says when a session is BUSY: Floci
makes it BUSY while a call runs on its server and IDLE again once none
does, its idle timeout counting from then. TerminateSession goes through
TERMINATING until the container has stopped; the idle timeout, the 24
hours (counted from when the server answers) and StopApplication stop it
too, each session keeping one check for its next deadline. A server that
exits on its own, or does not answer within 10 minutes, fails the
session with the reason; one a restart left behind fails as interrupted,
and its container, if the startup's cleanup left it, is removed.
The runner's Job gains a listening port, published on loopback and
reported through Progress.listening once the container runs.
EmrServerlessSparkConnectNightlyIntegrationTest runs it for real: the
server in the emr-7.13.0 image and Spark's own JVM Spark Connect client
from that image, which runs a query through Floci with the token and is
refused with a wrong one. The nightly job's timeout and image prefetch
take the new check.
EmrServerlessCustomImageNightlyIntegrationTest's waits are bounded
already, the base image's pull at 20 minutes, its two pushes at 30 each
and its five job runs at 5 each, but it ran under the pom's 2-minute
default for every test and lifecycle method: a pull or a push that ran
long was cut short before its own bound. The class now allows the sum
of its test's waits, 85 minutes, and its setUp, which a class-level
@Timeout does not reach, 21.
The Nightly checks job, which runs the checks one after another, was
capped at 90 minutes, less than this check's bounds alone, so a slow
pull or push would have cancelled the job with no message. It now
allows the sum of every check's bounds, 160 minutes, and 20 for the
build: 180.
No AWS image carries Pig, so a Pig step failed without running. With
floci.services.emr.pig.enabled on (off by default), a docker cluster
whose Applications name Pig gets Apache Pig 0.18.0 in its image:
downloaded to a temporary file from the first of
floci.services.emr.pig.urls that gives it whole with the checksum
floci.services.emr.pig.sha256 names (a URL that fails, stalls for a
minute or gives another checksum passes to the next), then streamed
into /usr/lib/pig as EmrReleaseImages makes the image, with Tez from
the release's Hive image and a /usr/bin/pig that EMR's own pig-script
runs.
Pig runs on the image's Tez, its bundled Tez and protobuf 3 left out,
on the cluster's YARN or in local mode, with exectype=tez, a working
directory without a scheme, which S3A takes, and no task reports and
one try for counters from the MapReduce JobHistory server the cluster
does not run, then the cluster's tez-site and pig-properties, in a
pig.properties of the step's own; pig-log4j and pig-env reach Pig too. A command step's new
tez-site.xml shares Hive's Tez-on-YARN settings.
Without the setting, a Pig step on a cluster that installs Pig still
fails without running, its message naming the setting; on one that
does not, EMR's pig-script says "Pig isn't installed." as on EMR.
Floci in a container of its own, with the Docker socket, is how many
users run it, and an EMR cluster's nodes are then its siblings on a
network of their own: Floci's container joins that network so the
cluster's metastore service reaches Floci's S3, and leaves it once the
cluster has ended. That path had unit tests and one manual run, as no
test ran Floci in a container for EMR.
EmrFlociContainerNightlyIntegrationTest starts the Floci image the
nightly workflow builds from the commit (docker/Dockerfile.jvm-package)
with the socket and the docker runner mode, runs a cluster with Hive and
Spark on it, and checks that a Hive step's tables over rows in S3 are
read by a Spark step through the metastore, that a later Hive step reads
the table the Spark step made, that Floci's container is on the
cluster's network meanwhile, and that it is off it once the cluster has
ended. A failing step's message carries its stderr and Floci's log.
The nightly workflow builds the image and names it to the checks; the
Spark and Hive images are prefetched for the class. The Hive and Spark
jobs EmrHiveStepsDockerIntegrationTest wrote inline are HiveCatalogJobs,
the step EMR tests added in two copies is EmrRequests.addStep, and the
Docker client two RDS tests built by hand is TestDockerClients.local.
An EMR Serverless application on a custom image in Floci's ECR had unit
tests for the digest it resolves (#8542) but no run that pushed an image
and pulled it back, as each run of it copies the whole 3.5 GB base image
into the registry. It is now a nightly check.
EmrServerlessCustomImageNightlyIntegrationTest builds the release's base
image with a FLOCI_IMAGE_BUILD marker, pushes it to a repository's tag in
Floci's ECR, removes the local copy, and runs a job that writes the marker
it sees. A second build pushed under the same tag is not seen by the
application that resolves its image as it starts until it starts again,
and is seen at once by one resolving it for each run. Floci listens on a
fixed port there, since the runner hands the Docker daemon
localhost:<floci.port> for an ECR image.
The class is enabled only by -Dnightly.checks.enabled=true, so the CI
shards skip it before Quarkus starts, and its base image is prefetched
only for the nightly checks. That property was -Dfloci.nightly=true, which
the first nightly run showed Floci's configuration refusing as a floci.*
name it does not know, so a Quarkus check never started; the workflow and
AGENTS.md name the new one. The part-file reader EmrDockerRunnerDockerIntegrationTest
kept to itself is S3TestClients.partFiles, shared by both.
Some checks need images of several gigabytes or long runs: an EMR
Serverless run on a custom image pushed to Floci's ECR copies the whole
3.5 GB base image into the registry on every run, and Floci running in a
container with an EMR cluster beside it needs the Floci image built
first. Every *Test class lands in one of the five CI shards, already
close to their time limit, so these have had no place to run.
The Nightly checks workflow runs the classes named
*NightlyIntegrationTest with -Dfloci.nightly=true: once a day on main, on
demand, and on a pull request that adds or changes one, so a check is
seen to pass before it merges. Each such class skips without the
property, which keeps the shards' cost at a skip. It frees the runner's
unused toolchains for the images, prefetches them through
prefetch-images.sh, and uploads the reports. GitHub-hosted runners only.
A nightly check keys its images in prefetch-images.sh on its own name, and
ci.yml hands the prefetch its shard's classes without the nightly ones, so
a shard never pulls an image for a check that skips there. AGENTS.md names
the convention.
documented-routes-verify runs inside iam-data-verify for a pull request
touching rest-routes.json, regen_rest_routes.py or its test, but
iam-data-drift.yml's pull_request.paths listed none of the three, so a
pull request changing only the routes skipped the online check until the
weekly run. rest-routes.json is also one of the authorized-action
check's paths, which went unchecked the same way.
- iam-data-drift.yml lists the three paths, and its header says it
checks the routes rest-routes.json takes from the AWS page documenting
an endpoint botocore does not model.
- DOCUMENTED_ROUTES_PATHS also covers regen_partitions.py and
regen_query_services.py, the modules regen_rest_routes.py imports, as
every other check's paths cover its generator's imports.
The release no longer holds back every standalone binary when a macOS or
Windows build fails or times out. publish-binaries now requires only the
three Linux native builds; a missing macOS or Windows binary gets a
warning and a job summary line, and every binary that did build is
staged, signed, attested and uploaded as before. 2.4.0 and 2.5.0
published none because both macOS builds timed out.
The macOS and Windows builds move unchanged into a reusable
standalone-binaries.yml, which release.yml calls for every tag. It can
also be run by hand from any branch with a subset of platforms, extra
native-image arguments, a macOS runner label and a timeout, and then
only uploads workflow artifacts.
The job's IAM request-resources check now takes about four and a half
minutes on its own, so the job as a whole runs right at its five-minute
limit and is cancelled whenever a runner is a little slow. Main's own
push run of it was cancelled that way on 2026-11-14, as were the PR runs
on several branches the same day, each of which passed on a re-run.
Every check that finished before the cut matched; nothing had drifted.
Where a docker cluster runs YARN its Spark ran on it, while MapReduce and
Hive's Tez stayed in local mode, in the step's container, and a job's own
-D mapreduce.framework.name=yarn failed.
- A step's mapred-site names YARN and the layout of the cluster's nodes,
which yarn.application.classpath's default does not, S3A's AWS SDK, and
the step's AWS environment for the application master and tasks, sized
for a NodeManager; the cluster's mapred-site replaces them.
- A step's hadoop, hadoop-streaming and hdfs dfs run from the nodes'
Hadoop, /usr/lib or an emr-spark-* release's /opt, set for that command
alone, so a spark-submit in the same step keeps the release's own.
- The images hold EMR Serverless's build of Tez, whose tez-site.xml names
its own plugins. On YARN a Hive step names the stock classes from the
same jars, real ports and bind addresses, ${env.NM_HOST} left for the
application master's node to fill in, Tez's jars from the node's own
disk, and one virtual core a task, as YARN's default scheduler grants
one and Tez gives back a container that does not match what it asked.
Intermediate compression is off, as the image's codec needs a native
library it lacks.
Where a cluster runs no YARN, MapReduce and Tez stay in local mode.
Two Docker cases check that a streaming job's tasks and a Hive query's
Tez tasks run in YARN's containers on the cluster's nodes. With them the
two EMR Docker classes take 651s and 402s on CI's runners, so the shard
partitioner weighs them at that, as at 280s and 260s their shard ran into
Surefire's 25 minutes.
With that split, PipesStreamEnrichmentDockerIntegrationTest ran in a JVM
where no class before it had told RestAssured how to send and read
DynamoDB's application/x-amz-json-1.0, which it relied on; it now does so
itself, as other tests do.
partition.sh balances shards by class count, which says nothing of how
long a class runs. EmrDockerRunnerDockerIntegrationTest and
EmrHiveStepsDockerIntegrationTest take about 540s between them, so the
shard holding them ran 1246s of Surefire's 1500s while the others ran
641s to 869s, and one run has already been cut at the limit.
- SLOW_CLASSES gives the seconds of those two, by class name, so a
package rename leaves them alone. A class counts for that many average
classes, and every other class counts as one, so with none listed the
assignment is what it was.
- Groups are packed heaviest first by that weight rather than by their
number of classes, and a slow class without a profile goes before the
others, so the rest are placed around them.
- A name that no longer matches a class is an annotation, not a failure,
as a stale key is for the image prefetch: the shards are only uneven.
Summing the 2026-11-09 run's class timings over the classes at this
commit, the slowest shard goes from 1136s to 989s. A profile of its own
for the EMR classes gave 1321s and a sixth shard 1117s, as neither tells
the partition that those classes are slow.
* fix(ci): prefetch bind-directory Docker test images
* fix(ci): locate OpenSearch catalog dynamically and log unreadable image
Find OpenSearchVersions.java dynamically instead of hardcoding its path, and log to PREFETCH_LOG when the default OpenSearch image cannot be parsed.
* fix(ci): drop stale REDSHIFT_PG18 prefetch block
RedshiftMaxErrorPostgres18IntegrationTest was renamed and no longer overrides the image, so the block only warned about a stale key on every shard. The renamed test runs on the default image already prefetched by the /redshift/ line.
* fix(ci): derive Neptune prefetch images from configuration
Read the Neptune pin for Java compatibility and shared shard prefetch from application.yml. Preserve best-effort pulls, shard selection and Node retry behavior.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ci): share configured Neptune image lookup
Reuse one keyed lookup for Node, Java and shard prefetch. Read the Neo4j pin from configuration and correct the pre-pull overlap comment.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(ci): share service image read and prefetch
Use one service/key config reader across Neptune and CodeArtifact. Share configured-image pull/skip logic, preserve Node/Java failure policies and remove the unused test file.
Signed-off-by: Andre Kurait <akurait@amazon.com>
* chore(ci): remove superseded Neptune image reader
Remove the old helper left by the preceding rename publication. All consumers use the qualified shared service/key reader.
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
Prepare the configured Gremlin image before the timed Node SDK suite on cold native runners. Preserve test assertions and deadlines.
Read the effective Neptune image pin after sparse checkout and retry registry pulls up to three times before Node compatibility execution. Preserve the existing test deadline and report exhausted pulls explicitly.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Read the restore fixture's PostgreSQL image override and prefetch it only
for the shard running that class, avoiding a cold pull during database
creation. Keep the existing best-effort pull behavior.
Source: AndreKurait/floci#487
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
Move the Java sources from io.github.hectorvent.floci to io.floci.aws, matching io.floci.gcp, io.floci.az and io.floci.oci. Generated by tools/rename/rename_package.py apply on the base commit, with no other edits.
Logger categories and the arn.fail-on-blank-region property move to the io.floci.aws prefix. The pom groupId becomes io.floci; the artifactId stays floci.
Refs #6589
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Under IAM enforcement, Redshift requests were checked on `*`, so a
grant scoped to a cluster, a snapshot or a database user was refused,
and a deny scoped to one never applied.
The redshift namespace moves from NOT_COVERED to NAMESPACES in the
request resources generator, with corrections where the generated rule
checks the wrong resource. GetClusterCredentials now also gives the
redshift:DbUser condition key, from a new generated table, to its own
check and to the CreateClusterUser check that AutoCreate adds.
Refs #5907
fix(redshift): act only on a snapshot of the cluster the request names
A snapshot request is checked on snapshot:<cluster>/<name> for the
cluster it names, but DeleteClusterSnapshot, RestoreFromClusterSnapshot
and DescribeClusterSnapshots found the snapshot by its name alone. A
caller allowed on one cluster's snapshots could act on a snapshot of
another cluster by naming the allowed one.
A snapshot taken from another cluster than the one the request names,
in SnapshotClusterIdentifier, the cluster of a SnapshotArn, or
DescribeClusterSnapshots' ClusterIdentifier, is now not found.
Refs #5907
chore(iam): generate the Lambda Web and Redshift condition keys into one table
chore(redshift): read a restore's snapshot ARN once
* chore(ci): prefetch missing container fixture images
Prefetch configured DSQL, PostgreSQL 18, CodeArtifact, MySQL and OpenSearch images only for consuming fixture shards. Preserve best-effort background pulls and current Hive selection.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
* fix(ci): skip unused mock OpenSearch image prefetch
The OpenSearch domain options fixture uses mock mode and never starts its engine container. Preserve prefetches for the actual consuming fixtures.
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
---------
Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Every EMR cluster runs HDFS: its primary node "also runs the HDFS
NameNode service". In the docker runner mode a cluster's HDFS was a
folder of its /mnt volume behind a view of the hdfs scheme, so an
hdfs:// path naming a host was not served, hadoop fs -ls / failed, and
Hive, which looks up the encryption zone of any hdfs:// path, reached it
under viewfs, where a table at an hdfs:// location failed. Each cluster
now runs a NameNode and a DataNode.
- EmrClusterStorage starts them in a container of their own, from the
release's EMR Serverless Hive image, which has HDFS's daemons where
the release's image has only the client. It runs as root only to add
the primary node's name to its hosts file and give its data volume to
the hadoop user, then runs both daemons as that user, with one copy of
each block and permissions off, and makes /tmp and /user/hadoop once
the DataNode has joined. The data is in a volume of its own, so the
first container to mount the cluster's /mnt volume is still a step's,
which fills it with what the bootstrap actions left there. It is on a
Docker network of the cluster's own, which only the cluster's steps
join besides theirs, as its HDFS serves its files to any client that
reaches it, so another cluster's steps, another account's too, do not.
- The AWS runtime for Apache Spark's releases, emr-spark-8.0.0 on,
publish no Hive image, so their clusters run HDFS from emr-7.5.0's.
Hadoop keeps its client-server protocols compatible across a major
version's minor releases, so their newer client reaches its NameNode.
- A step's thread starts it after the cluster's volumes, from the id
its image's pull, when it is missing, resolves, and waits up to two
minutes from then, the
NameNode on its port its own, the DataNode joined and the NameNode out
of safe mode, as the NameNode's JMX says; a step that comes while
it starts waits, and one that finds it running uses it. A failure
fails the step ("The step could not start: ..."), and one whose
container Docker cannot tell the state of leaves it as it is.
- The daemons log their warnings and errors to the container's output.
- When either daemon exits, the container ends and its readiness goes,
so the next step starts it again on the data its volume keeps; one
that finds it about to stop starts it again once.
- Steps reach it by the primary instance's PrivateDnsName, as
ListInstances gives it, on port 8020: their containers resolve that
name to the HDFS container's address, and fs.defaultFS names it, so
hdfs:// paths without a host and paths without a scheme lead there.
ListInstances numbers the MASTER group's instance first, so the name
holds while other groups resize.
In a namespace the steps share, the host's or another container's,
which the HDFS container joins too, they reach it on its loopback, and
its daemons listen there only, so no other interface serves its files,
which any client could change; one cluster's HDFS runs there at a
time, another's refused while it does. One a process with another
docker-network left running, in another namespace than the steps', is
started again in theirs on its data. With none, steps have no network,
so the cluster runs no HDFS.
- Hadoop's local job runner copies a job's -files to
/tmp/hadoop/mapred/staging on the local file system, then looks for
them at that path of the default file system, as JobResourceUploader
drops the folder's scheme. So in the hadoop command's configuration,
which a custom JAR's MapReduce in the driver reads too, the hdfs
scheme is a view of the cluster's HDFS in which that one folder is
the container's own. Spark and Hive keep HDFS's own client, as Hive
casts an hdfs:// file system to it to look up its encryption zone,
so a Spark step writes a Hive table in HDFS too.
- A reset or a shutdown removes the HDFS containers this process
started, found running or kept from an earlier process, after the
drivers that use them are stopped, and a step or a bootstrap handed to
its thread before it, however it then ends, starts no HDFS, driver or
successor after it but is left as one whose driver was stopped, and
none is handed to a thread until the reset is over; a container Docker
refuses to remove stays known for the next; a cluster's next step
starts its HDFS again on the data its volume keeps. The container and
its network go with the cluster's storage, and the startup sweep
removes those of clusters that are gone or have ended.
Every cluster now needs a Hive image, so the documentation of
image-template and hive-image-template says a mirror sets both.
The Docker-gated tests now cover a Hive table at an hdfs:// location, a
bootstrap action's file in /mnt, a structured streaming query keeping
its checkpoints in HDFS, a Spark step writing a Hive table there, hadoop
fs -ls /, and a DataNode that exits, after which the next step reads an
earlier step's file. The CI prefetch queues the Hive image for
EmrDockerRunnerDockerIntegrationTest's shard too.
In the docker runner mode a Hive step failed without running ("hive-script
and pig-script are not in the image steps run in"). On a cluster whose
Applications name Hive, a command-runner.jar step running hive-script, as
the AWS CLI writes a Type=Hive step ("hive-script --run-hive-script
--args" and the step's Args), or hive itself, now runs: the image's
hive-script runs hive with the arguments after --args, with Tez in local
mode, on the cluster's storage and Floci's S3.
- An EMR cluster's nodes hold every application it installs, so a
cluster with Hive bootstraps and runs every step in one image: the
release's EMR Serverless image with the Hive, Tez, HDFS, MapReduce and
YARN of its EMR Serverless Hive image (or the new hive-image-template).
EmrReleaseImages makes it the first time a release's cluster needs it:
a container of the EMR Serverless image, created and never started,
gets the Hive image's folders streamed in from a container of that
image, and is committed, as a bootstrap's container is, with no image
builder involved. The two images ship different builds of
emr-serverless-goodies-common under one name, so Tez keeps the Hive
image's in a folder of its own, its links rewritten to lead there, and
the Hive image's Hadoop configuration, which puts Tez on the class
path, goes to /etc/hadoop/conf.hive, which Hive runs with.
- The image is named after the release, the ids of the two images as a
container would run them (an image-registry-base included) and what
is copied, so a newer pull of either makes another; it is kept for the
release's next cluster, and made once at a time. The bootstrap and the
steps get its id, as they get a bootstrap image's, from their own
thread, which makes it first, unless the cluster has ended by then; a
failure to make it fails the step, or ends a bootstrapping cluster with
INTERNAL_ERROR.
- hive gets Floci's settings, then the cluster's core-site, tez-site and
hive-site properties as --hiveconf settings, then the step's own
arguments, so a step's --hiveconf wins as it does over hive-site.xml;
the cluster's hive-env exports are its environment.
- Its metastore is the cluster's own, as "Hive records metastore
information in a MySQL database on the primary node's file system": an
embedded Derby database in the cluster's /mnt, so a table one Hive step
makes is there for the next until the cluster ends. A hive-site naming
the Glue Data Catalog's client factory uses Floci's Glue instead.
- Hive reaches the cluster's HDFS through the same view of /mnt/hdfs
under the viewfs scheme: Hive looks up the HDFS encryption zone of any
hdfs:// path, which only an HDFS NameNode answers. A table without a
LOCATION is in /user/hive/warehouse there, which other steps read as
hdfs://.
- On a cluster without Hive, hive-script runs in the release's image, as
EMR's does without Hive ("Hive isn't installed."); NOT_RUN is
pig-script's alone.
The Docker-gated EmrHiveStepsDockerIntegrationTest runs the AWS CLI's
Hive steps on a cluster's metastore and HDFS, a hive-site for the Glue
Data Catalog, a cluster without Hive, and a bootstrapped cluster whose
installs a Hive step and a later step both find, in the emr-7.5.0
images, which the CI prefetch pulls for its shard.
EmrServerlessSparkRunner's hiveSettings now builds both services'
--hiveconf settings.
USER 1001 made the image start unprivileged, so the entrypoint skipped the branch that adds the socket's group and honours FLOCI_RUN_AS_ROOT. With a socket owned by a non-root group and mode 660, Docker-backed services could not launch containers, and FLOCI_RUN_AS_ROOT=true had no effect.
The image now starts as root like the standard one, and the entrypoint drops to uid 1001. HOME is set to /app because that drop keeps the environment: hooks would otherwise run with HOME=/root, which uid 1001 cannot write to, and pip install would fail.
docker exec now defaults to root on this image, as it does on the standard one.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
In the docker runner mode a Hive application's job run failed without
running ("Floci runs Spark job runs only"). It now runs: Floci starts
hive in a container of the release's EMR Serverless Hive image
(public.ecr.aws/emr-serverless/hive/<release>, or the new
hive-image-template), with Tez in local mode in Hive's JVM, S3A on
Floci's S3 and the Glue Data Catalog client, the image's metastore, on
Floci's Glue in the run's account.
- hive gets the core-site, tez-site and hive-site classifications as
--hiveconf settings, the application's then the run's, a run's
classification replacing the application's; then -i initQueryFile
and -f query; then the run's parameters, whose --hiveconf settings
take priority, as the user guide ranks them.
- The run's hive.exec.scratchdir and hive.metastore.warehouse.dir are
used as it sets them, in S3. Tez in local mode copies a session's
staging folder, which Hive puts under the scratch folder, to the same
path in the container, a copy that silently does nothing where the
image's hadoop user cannot create that path. The container starts as
root, makes that path hadoop's, sets the Tez addresses EMR
Serverless's runtime would set, then runs hive as hadoop in its home
folder, with the groups Docker gives it. The scratch folder is the
last hive.exec.scratchdir setting, in any form Hive's CLI reads:
--hiveconf name=value, --hiveconf=name=value, with one dash or two,
or the value as the next argument.
- A Hive application's custom image is its HiveDriver worker type's,
else the application's; Tez's tasks run in the driver's container, so
a TezTask image is not used.
- The driver's stdout.gz and stderr.gz go to the run's HIVE_DRIVER log
folder, and its CloudWatch log streams are under HIVE_DRIVER, the
entry of logTypes it reads; Hive's own log stays in the container.
- A run whose driver is not its application's type, hive on a Spark
application or sparkSubmit on a Hive one, fails without running.
spark-defaults go through the same classification merge. The
Docker-gated EmrServerlessHiveDockerIntegrationTest runs the user
guide's Hive job and a failing query in the emr-7.5.0 Hive image, which
the CI prefetch pulls for its shard. EmrServerlessRequests'
createApplication takes the application's type, and S3TestClients'
deleteBucket empties and deletes a test's bucket.
No EMR test ran a step or a job run through Floci's Docker runner: the
runner's wrappers and settings were unit tested and run by hand in the
images. EmrDockerRunnerDockerIntegrationTest, a Docker-gated
@QuarkusTest on ContainerDataPlaneProfile (which now sets both runner
modes to docker), runs them for real in the emr-7.5.0 image, reaching
Floci's S3 from the container:
- a hadoop-streaming word count step, its mapper and reducer from S3,
writing its counts to S3;
- the same word count as a custom JAR at EMR's streaming jar path;
- s3-dist-cp from S3 into the cluster's HDFS and back;
- a cluster's spark-env export, read by a Spark step's driver;
- an EMR Serverless run on the user guide's virtual environment recipe,
spark.archives with #environment and the driver's and executors'
Python in it, from an archive that needs no package index.
EmrRequests.awaitStep and EmrServerlessRequests' createSparkApplication,
startJobRun and awaitJobRun are shared helpers, each wait checking that
its call answered 200 before reading the state, and
RetryingTarCopier.putEntry, pulled out of singleFileTar, writes the
archive's entries. The CI prefetch queues the 3.5 GB image for the
shard that runs the class, last, behind the Lambda runtimes, and the
prefetch results step no longer warns about an EMR Serverless image on
ECR Public, the only place AWS publishes them.