The "Vendored AWS data in sync" job now takes six to nine minutes, nearly
all of it the IAM request-resources check, which grows with each namespace
the generated table reads, so runs on a slower runner reach the job's
ten-minute limit and are cancelled inside that check. Raise the limit to
thirty minutes; nothing else changes.
Toree finds its built-in magics (%AddJar, %AddDeps, %LsMagic, %%sql,
%%dataframe and the rest) by scanning its own jar for plugin classes,
and its class finder reads each entry's name through a reflective call
to JarFile$JarFileEntry.getName(). The notebook image's Java 17 refuses
that call unless java.util.jar is open to the caller, so the scan
failed ("PluginSearcher: Failed to load class info from classpath",
an InaccessibleObjectException) and the kernel started with no magics.
- The Scala kernel spec exports JDK_JAVA_OPTIONS with
--add-opens=java.base/java.util.jar=ALL-UNNAMED, after any value
already set, before it runs spark-submit. Java reads the variable
itself, so the image's spark.driver.extraJavaOptions stay as they
are, where --driver-java-options would replace them. The option
comes from EmrServerlessSparkRunner.javaBaseOpens, which now builds
YARN's options from their package list too.
- The nightly check's Scala kernel adds a jar with %AddJar, then
compiles a cell against a class in it. Its method's timeout grows by
the two cells' four minutes, and the docker-runner group's with it.
An endpoint's jupyter-kernel-overrides gives a kernel its own
container-image ("Custom kernel image with interactive endpoint"), and
on EMR on EKS each kernel is a pod of its image. A Floci endpoint ran
every kernel in its gateway's container, whatever image the overrides
named.
- The gateway job tells the gateway program which kernels the
overrides give an image (python3 and spark-python-kubernetes, the
kernels the guide's example names, as "You can't add new kernel image
types"), where it asks Floci for their containers, and a secret Floci
gives that gateway alone.
- EmrContainersKernelContainersRoute takes the gateway's POST and
DELETE on /_aws/emr-containers/kernel-containers/<endpoint>/<kernel>.
The service checks the secret, that the endpoint is ACTIVE and its
overrides give the kernel an image, and the kernel id, response
address and public key, then EmrContainersKernelContainers runs the
kernel's container: the override image, with the gateway's settings
and environment and the kernel's KERNEL_ variables, running the
image's Jupyter Enterprise Gateway launcher (launch_ipykernel.py),
under spark-submit with the %%configure magic for a PySpark kernel.
A launch is admitted under the lock the gateway's end takes, so an
endpoint's kernel containers all stop with its gateway, and a reset
or Floci's shutdown stops every one.
- The gateway program gives such a kernel a jupyter_client provisioner
that speaks the launcher's protocol: it asks Floci for the container
with an RSA public key and a response address, decrypts the
connection the launcher sends back (an AES key, under RSA, over
AES-GCM), and polls, signals and stops the kernel through the
launcher's comm port and Floci. It waits KERNEL_LAUNCH_TIMEOUT
seconds, at most the guide's 400, or 400, and a launch that fails
once the container was asked for stops it.
- Such a kernel's %%configure magic posts to its ENDPOINT_IP, the
gateway, on port 9547 over TLS, with a certificate the image's openssl
makes; the program checks it with the launcher's AES key, which each
launch refreshes. Every restart, the kernels API's, the
auto-restarter's or %%configure's, gives the kernel a new container
with new ports and a new key, and the program moves the kernel's
clients and its activity watch onto them.
- The nightly check gains a method: an endpoint that overrides both
kernels with the release's own image runs each in its own container,
the PySpark one counting an S3 file's lines and taking %%configure.
The docker-runner group's budget grows by its eighteen minutes.
Interactive endpoints "support the following kernels: Python 3, PySpark
on Kubernetes, Apache Spark with Scala" (EMR on EKS Development Guide,
"Overview of interactive endpoints"). A Floci endpoint's gateway had no
Scala kernel.
- The gateway program writes a spark-scala-kubernetes kernel spec,
"Apache Spark with Scala", a name of Floci's beside the guide's
spark-python-kubernetes, as the guide gives the Scala kernel none. It
runs the image's Apache Toree, beside Jupyter Enterprise Gateway's
Scala launcher, under spark-submit as Toree's own kernel spec does:
org.apache.toree.Main with the connection file as its profile, after
KERNEL_EXTRA_SPARK_OPTS. Its spark is a Spark session in Spark's
local mode on Floci's S3, as the PySpark kernel's is.
- The docs move the Scala kernel out of "Not emulated yet", and the
endpoint role every kernel runs with out of it too: "All kernels and
users that connect to the interactive endpoint utilize the role that
you specified when you created the endpoint".
- The nightly check lists the new kernel spec and counts an S3 file's
lines in the Scala kernel. Kernel start, connection and deletion
become helpers. The method's timeout and the docker-runner group's
budget grow by its four minutes.
An endpoint's configurationOverrides take "the additional
classification jeg-config", whose allow-listed settings are
RemoteMappingKernelManager.cull_idle_timeout and
RemoteMappingKernelManager.cull_interval (EMR on EKS Development
Guide, "Jupyter Enterprise Gateway (JEG) configuration options"). A
Floci endpoint's gateway read neither.
- The gateway job passes those two properties of the endpoint's
jeg-config classification to the program as its arguments
(--RemoteMappingKernelManager.cull_idle_timeout=<value>), a later
classification's winning; other jeg-config properties go nowhere.
- The program's kernel manager is now named RemoteMappingKernelManager,
as Jupyter Enterprise Gateway's is, so the settings reach it under the
names the guide gives them, and jupyter_server's culler shuts down a
kernel idle that long, checking every interval.
- EmrContainersSparkJobs.properties reads any classification of a
configurationOverrides, sparkDefaults now through it.
- The nightly check gains a method: an endpoint whose jeg-config sets a
10-second idle timeout culls a python3 kernel left idle within a
minute. The docker-runner group's budget grows by its seven minutes.
EMR Studio's "Modifying PySpark session parameters" has a PySpark
kernel's %%configure "adjust the Spark configuration associated with a
PySpark session"; the endpoint's operations count it as ConfigureKernel
("Monitoring interactive endpoints"). A Floci endpoint's PySpark kernel
had no such magic.
- The PySpark kernel loads the image's own magic, configure_magic.py,
beside Jupyter Enterprise Gateway's kernel launchers. It turns its
cell's settings into KERNEL_EXTRA_SPARK_OPTS, refusing reserved ones,
and posts them with the replies that end the cell to
localhost:18888/api/kernels/configure/<kernel id>, signed with the
AES key in its ADDITIONAL_INFO.
- The gateway program's kernel manager gives each kernel its KERNEL_ID
and an AES key of its own, as the image's launcher does, keeps its
launch environment, and drops an ENDPOINT_IP the endpoint's Spark
defaults would pass on, which would send the magic elsewhere.
- The program serves port 18888 on the container's loopback alone: for
a post signed with the kernel's key, it restarts the kernel, keeping
its id, with the new KERNEL_EXTRA_SPARK_OPTS in place of the old, and
once the restarted kernel answers, sends the prepared replies to the
clients connected to it, as the restart takes the kernel down before
it can. A kernel that dies first, or does not answer in
jupyter_server's restart time, ends the cell with an error instead.
A kernel's posts take their turn.
- The nightly check runs a %%configure cell, then reads the restarted
kernel's Spark settings. Its timeout and the docker-runner group's
budget grow by its four minutes.
An EMR on EKS managed endpoint ran nothing: it was ACTIVE at once with no
serverUrl, so no Jupyter client could start a kernel on it, and its
session tokens opened nothing.
- With runner-mode docker, an endpoint runs a Jupyter Enterprise Gateway,
which "provides the remote kernel lifecycle management capability that
interactive clients need", in a container of its release's
notebook-spark image on Amazon ECR Public, the base image of
interactive endpoints. That image holds jupyter_server and ipykernel but
no Enterprise Gateway, so a program of Floci's own serves the gateway's
kernels API on jupyter_server, passing a kernel the KERNEL_ variables
of its start request's env, as Jupyter Enterprise Gateway does.
- Its kernels are the image's python3, and spark-python-kubernetes, whose
spark and sc are a Spark session in Spark's local mode on Floci's S3,
with the endpoint's execution role, KERNEL_EXTRA_SPARK_OPTS going to
its spark-submit.
- The endpoint is CREATING until the gateway answers, then ACTIVE with
its serverUrl and the guide's "Endpoint created successfully. It took
m Minutes s Seconds". DeleteManagedEndpoint makes it TERMINATING until
the gateway has stopped. A gateway that fails, and one a restart left,
end it TERMINATED_WITH_ERRORS with INTERNAL_ERROR.
- serverUrl is a path of the endpoint's own on Floci's port. A request
there goes on to the gateway, its kernels' WebSocket tunnelled, when it
carries a live token GetManagedEndpointSessionCredentials gave for that
endpoint, as a token parameter or an Authorization: token header, as
Jupyter Enterprise Gateway 2.6.0 takes one; any other gets that
gateway's 401 {"reason": "Unauthorized", "message": ""}.
- SessionServers, which runs EMR Serverless's and EMR's Spark Connect
servers and keeps their tokens, runs the gateways too, a token given
for one endpoint reaching no other. CloudFront's WebSocket splice moves
to WebSocketUpgrades, which the gateway's tunnel shares.
- gateway-image-template replaces the notebook image's registry.
An EMR on EKS job run ran nothing: it was COMPLETED at once, or RUNNING
on a timer and then COMPLETED, whatever its Spark job would have done.
- With floci.services.emrcontainers.runner-mode set to docker, a run
runs its Spark job in a container of its release's EMR on EKS base
image on Amazon ECR Public, or of its custom image: a
sparkSubmitJobDriver's spark-submit, or a sparkSqlJobDriver's
spark-sql with its entry point as the file it runs, with the
spark-defaults of its configurationOverrides and its execution role's
credentials, on Floci's S3.
- The release label names the image's repository and tag, as the
development guide's release notes give each release's "Container
image tag": emr-7.2.0-20240610 runs emr-7.2.0:20240610. The base
image's spark-defaults.conf runs a driver in Kubernetes' cluster
mode, so the driver runs in client mode, its executors with it.
- A run is SUBMITTED while its container starts, RUNNING once its
driver runs, and COMPLETED or FAILED as the driver exits, a failed
driver with AWS's USER_ERROR and "Jobrun failed. Main Spark container
terminated with errors. ...". A container that cannot start, a job
driver without an entry point, and a run a restart left running fail
with the development guide's INTERNAL_ERROR and VALIDATION_ERROR
answers.
- CancelJobRun makes a running run CANCEL_PENDING until its driver is
stopped, then CANCELLED.
- A run holds its virtual cluster's running slot from its submission
until its driver ends, counting as concurrent, not queued, and the
slot then goes to the queue. A run that cannot be handed to a thread
fails and frees its slot, and a leftover driver of a run found failed
is removed.
- The immediate runner mode, the default, is unchanged.
Use the existing HTTP host and port environment settings for the container
probe. Map wildcard hosts to loopback and keep TLS probes on the public
multiplexed port. Preserve readiness and startup-grace handling.
Honor the LocalStack listener aliases the way LocalStackParity does:
USE_SSL, EDGE_PORT and the first GATEWAY_LISTEN entry, with a nonempty
Floci setting winning and LOCALSTACK_PARITY=false turning them off.
Add socket-level coverage for listener selection and failure responses,
run in the existing Docker runner job.
Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <jxnprice@amazon.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
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.
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.
* 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>
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
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>
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.
One shard was cut by the 25-minute job limit twice on 2026-11-02, at 25m15s
and 25m26s, and no test had failed in it either time: the reports it uploaded
before the cut carried 13459 tests with no failures and no errors. The suite
has grown into the budget rather than anything having broken, and a fifth
shard is what gives it room.
The partitioner needs no change. It takes the shard total as an argument and
balances by class count with each @TestProfile group kept whole, and the
completeness gate checks the shards it is handed against the commit's own
class list rather than a count. So this is the matrix, the total beside it,
and the comments that named four.
Measured over the 3223 test classes on main today, with each class's time
taken from the surefire reports of one four-shard run:
four shards 13.8 13.3 17.1 13.8 minutes of tests
five shards 12.6 12.1 12.4 10.7 10.2
The slowest shard loses 27 percent of its test time, 17.1 minutes down to
12.6, and the spread across shards narrows from 3.8 to 2.4. A shard pays
about 2m15s before its first test, 1m52s of that the compile, so the fifth
job costs that much runner time while the critical path drops by about four
and a half minutes.
What this does not do is balance by duration. The partitioner weighs classes
and profile groups rather than seconds, which is how one shard of four came
to carry 17.1 minutes against another's 13.3. Five shards leave more headroom
over that imbalance; they do not remove it.