mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
ab7fc6f81f2ea04dc73ccff59ffeefdf6335d5cd
56
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
030ba3d72b |
chore(ci): run the EMR Docker runner test nightly, beside the cluster shrink check (#8957)
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. |
||
|
|
b9ebbe0a42 |
feat(docker): count open Docker streams per service and add a saturation harness (#8953)
* 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 |
||
|
|
fb59000838 |
test(emr): move the cluster shrink scenario to nightly checks (#8903)
* test(emr): move the cluster shrink scenario to nightly checks |
||
|
|
3ffec01a76 |
feat(emr-serverless): open the live Spark UI from dashboard links (#8890)
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. |
||
|
|
4b342dad3f |
feat(emr): open a cluster's on-cluster application UIs for real in the docker runner mode (#8773)
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. |
||
|
|
6a5a464ca8 |
test(emr): move Hive and Spark steps to nightly checks (#8738)
* test(emr): move Hive steps to nightly checks alongside session checks * test(emr): declare nightly Hive and Spark timeout |
||
|
|
9821a919b6 |
feat(emr): run a notebook execution's notebook on its cluster in the docker runner mode (#8764)
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. |
||
|
|
2517edb471 |
feat(emr): run a session's Spark Connect server on its cluster in the docker runner mode (#8751)
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. |
||
|
|
50276fa533 |
feat(emr-serverless): run a session's Spark Connect server in the docker runner mode (#8731)
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. |
||
|
|
30f8a9985e |
feat(emr): run Pig steps on Apache Pig, an opt-in download added to the cluster's image (#8636)
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. |
||
|
|
975632df5c |
test(emr): run an EMR cluster from Floci in a container nightly (#8591)
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. |
||
|
|
9ee8417f6c |
test(emr-serverless): run a custom image from Floci's ECR nightly (#8584)
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. |
||
|
|
2d3fa5cd86 |
ci: run the checks too heavy for a pull request nightly (#8574)
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. |
||
|
|
065d7194b0 | fix(ci): distribute slow classes sharing a test profile (#8511) | ||
|
|
5d40c565d4 | fix(ci): prepare Cargo sidecar images before HTTP requests (#8512) | ||
|
|
54ea160aa6 |
feat(emr): run a step's MapReduce and Hive's Tez on the cluster's YARN (#8151)
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.
|
||
|
|
9eb3ba38ed |
ci: weigh the two slow EMR Docker classes when partitioning test shards (#7901)
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. |
||
|
|
fcb2421ee4 |
fix(ci): prefetch bind-directory Docker test images (#7651)
* 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. |
||
|
|
a5b3fab110 |
fix(ci): derive Neptune prefetch images from configuration (#7834)
* 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> |
||
|
|
99be149382 |
chore: add regression coverage for CI sharding (#7245)
Cover the two balancing rules with deterministic partition CLI regressions. Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
aef59b9aaf |
ci: prefetch the PostGIS snapshot restore fixture image (#7647)
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> |
||
|
|
7cf443fcee |
chore: rename the package to io.floci.aws (#7689)
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> |
||
|
|
a389299b67 |
chore(ci): prefetch missing container fixture images (#7474)
* 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> |
||
|
|
3a64d2b761 |
feat(emr): give each docker cluster a real HDFS on its primary node (#7496)
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.
|
||
|
|
5a4632229e |
feat(emr): run Hive steps in the docker runner mode (#7459)
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.
|
||
|
|
710b2488bf |
feat(emrserverless): run Hive job runs in the docker runner mode (#7407)
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.
|
||
|
|
b63e4a5bb9 |
test(emr): run steps and job runs through the Docker runner (#7349)
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. |
||
|
|
2d17978bf7 |
ci: run the test suite in five shards (#7303)
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. |
||
|
|
488a3197f1 |
chore(compat): close the SES races and report pre-pull and class timings (#7221)
Review of #7212 left three gaps in the parallel sdk-test-java setup. The classes that create SES contact lists share a one-list-per-account limit and three of them delete every list, and SesAccountAttributesTest turns account sending off while other classes send. All of them now hold ses-account, which costs about 8 s of serial time. The pre-pull step discarded its output, so a failed pull only showed as a slower run. Each pull now records its result and duration, and a step puts them in the job summary with a warning when one failed. Under JUnit parallel execution Surefire writes some test cases into another class's XML file, so the timing report credited them to the wrong class. It now sums per test case classname, which also splits sdk-test-python's single "pytest" row into its classes. Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
743bede481 |
feat(core): have the JVMs in Lambda, ECS, Batch and Flink containers trust Floci's CA (#6945)
With TLS on, Floci writes its CA bundle as a Java trust store too, but only EMR's containers got it: a launcher had to copy it in with ContainerLifecycleManager.copyJavaTrustStore and point its JVMs at it with a shell line. So a Java Lambda function, ECS task, Batch job or Flink application calling Floci over HTTPS still failed with "PKIX path building failed" unless it brought a trust store of its own. ContainerBuilder now has withJavaTrustStore(). For a container whose spec asks for it, the lifecycle manager copies the trust store in beside the CA bundle as it creates the container, and sets JAVA_TOOL_OPTIONS to Floci's -Djavax.net.ssl.trustStore ahead of the value the spec gives it, or the image's own when the spec sets none, so a trust store the workload names itself still replaces Floci's. A copy that fails creates the container again without any of the trust variables, as a failed bundle copy already did, so JAVA_TOOL_OPTIONS never names a file that is not there. Lambda functions on a Java runtime or from a container image, ECS task containers, Batch jobs, and Flink's JobManager and TaskManager ask for it, and so do EMR steps and EMR Serverless job runs, whose spark-submit starts directly again. The bootstrap actions' container keeps the separate copy and the shell line, since it is kept as the steps' image, which would keep a JAVA_TOOL_OPTIONS set at its creation. Other containers are unchanged. |
||
|
|
e8ef0b147e |
chore(ci): name the Java package in one place for tools and CI (#6596)
The docs tools, the partition gate and their registries each spelled out src/main/java/io/github/hectorvent/floci/. tools/java_sources.py now holds the package path, the tools import it, and services.yaml and service_matrix.yaml list sources relative to the package root, so the move to io.floci.aws changes one line here. A registry entry still in the repo-relative form fails with a message naming the new form. prefetch-images.sh finds TestImages.java by name. Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
afb4afd2f1 |
test(compat): build partition-aware ARNs in the partition nightly's failing tests (#6451)
The partition nightly has failed every night since 2026-10-20. Every failure is on the test side: - ApiGatewayV2WebSocketDataPlaneTest hard-coded arn:aws:lambda:us-east-1 integration and authorizer URIs. Since #6001 Floci invokes the function in the region the ARN names, so $connect answered 500 in any other region. - RedshiftOperationsTest tagged a us-east-1 literal ARN, which #6026 rejects. - EmrServerlessJobRunTest expected createdBy to start with arn:aws:. - Ec2TagRegionTest failed in a partition with one region; it now skips there. ResourceGroupsTest#capacityPoolLifecycle is allowlisted for eusc-de-east-1: the Resource Groups model's GroupStringV2 and ResourceArn patterns cannot match any eusc-de-east-1 ARN, and Floci enforces the model as published. Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
b58947c70a |
fix(rdsdata): refresh backend endpoints before JDBC connect (#6148)
* refactor(rdsdata): carry backend runtime identity * fix(rdsdata): resolve runtime endpoint before JDBC connect * test(rdsdata): cover backend endpoint refresh * refactor(rds): make backend gates runtime-only * test(rds): enforce proxy runtime identity * test(rdsdata): reuse proxy endpoint refresh backends * docs(rds): fix backend gate Javadoc link |
||
|
|
6e01216f88 |
feat(lambdaweb): serve endpoint domains from a Node.js environment per revision (#5760)
* feat(lambdaweb): serve endpoint domains from a Node.js environment per revision A request whose Host is an endpoint's domainName goes over HTTP/1.1 to a container that Floci starts from the revision's S3 code on the first request: public.ecr.aws/lambda/nodejs:24 with the code in /var/task, index.js or AWS_LAMBDA_NODEJS_ENTRYPOINT as the entry file, the node flags and the environment variables AWS sets, ten seconds to listen, SIGTERM and one second when idle, and a fresh environment after the process exits between requests. The forwarded request carries the headers AWS adds and loses the ones AWS drops. The response carries lambda-web-request-id and lambda-web-logstream and streams as the app writes it. Two revisions in revisionWeights split the traffic by weight. The platform pages for an unsupported method, an unknown domain, HTTP/1.0, a server that does not listen, a timeout, a crash and a disabled endpoint are the AWS pages. Part of #5699 * fix(lambdaweb): index endpoint domains and claim only the minted host shapes A request looked its domain up by scanning every stored function across accounts and iterating live endpoint maps outside the function lock. The service now keeps a domain index, filled from storage at start and kept by the create and delete paths, and copies the function under its lock. The data plane claims only hosts shaped like the domains Floci mints, in any case and with any port, so a dotted S3 bucket with a lambda-web label still reaches S3. * fix(lambdaweb): reserve environments against the idle reaper and track exits acquire now reserves the environment under the same lock the idle reaper takes, so a request cannot start on a container the reaper is about to stop. Docker faults in the reaper and in discard are contained so one error does not end the periodic run or skip the removal. The exit watcher records the exit time and arms itself again when its stream drops, and a request that found a dead process is replayed only when that recorded exit came first, never because the container is gone. The unpacked code directory is removed on every path. The container gets the execution role's session credentials when the role exists, and the function account's credentials otherwise, as the Lambda launcher does. * fix(lambdaweb): bound the whole exchange by timeoutSeconds and forward chunked bodies timeoutSeconds is a deadline on the whole request, as recorded against AWS: a response that has not started by then is the 504 page, one that is still streaming is cut, and a slow upload gets its 504 once the body is in, since the edge takes the body before it answers. A body without a Content-Length is sent chunked instead of carrying the client's Transfer-Encoding header. A failure of the upload stream ends the exchange and releases the environment once. * test(compat): probe the unknown Lambda Web domain in the shape Floci mints The data plane claims only hosts shaped like the domains it mints, so the unknown-domain check needs a 16 character id to reach it. |
||
|
|
d3999ad416 |
chore(compat): run the partition nightly in GovCloud and EUSC too (#5616)
The partition compatibility nightly ran the Java SDK suite in cn-north-1
only. GovCloud (IAM signs us-gov-west-1, no CloudFront) and EUSC (no
global endpoints) take their own code paths and had no end-to-end check.
The job is now a matrix of cn-north-1, us-gov-west-1 and eusc-de-east-1;
a dispatch that names a region runs that region alone.
Measured locally on main
|
||
|
|
fde5170335 |
test(compat): take the partition and region from TestFixtures in the last 33 suites (#5052)
Third and last batch of the cn-north-1 allowlist burn-down (#4272). The 41 remaining entries all pinned commercial values: ARNs built as arn:aws:<svc>:us-east-1:..., arn:aws: prefix assertions, us-east-1 zones, hosts and filter strings, and clients or signers created for us-east-1 next to the cn-north-1 fixture clients. Among them, the RDS IAM-token tests signed their tokens for us-east-1, OrganizationsTest built its invited account's client for us-east-1, Route53Test associated VPCs as us-east-1 that live in the fixture region, and SesEventPublishingTest failed in setup on a us-east-1 event bus ARN. All 33 classes now derive those values from TestFixtures, so the allowlist is empty: any failure in the China nightly fails the run. |
||
|
|
6deb0d4d2b |
test(compat): run the China-absent tests per partition instead of allowlisting them (#5027)
* test(compat): run the China-absent tests per partition instead of allowlisting them Third batch of the cn-north-1 allowlist burn-down (#4272): the 13 tests that exercised something AWS does not offer in China. Seven keep running there with the China shape: - S3Test: only the us-east-1 endpoint creates a bucket in another region, so elsewhere the location-constraint round trip names the client's own region. - StsTest: the SAML assertion's Recipient is the partition's console sign-on URL (the CDK region facts), signin.amazonaws.cn in China. - Ec2Tests: China names its interface endpoint services cn.com.amazonaws, so the S3 gateway and interface offerings are two services there. - IamTest: GetAccountSummary reports GlobalEndpointTokenVersion only in the commercial partition, the one with a global STS endpoint. Six skip where the service has no endpoint: the five Marketplace tests (the regions botocore publishes for each) and Lightsail (commercial only). The allowlist's China-absent section is gone, 13 entries, 73 to 60. * test(compat): derive VPC endpoint names from the DNS suffix and keep Marketplace guards to us-east-1 The ECR interface service is named under the partition's DNS suffix reversed in every China, EUSC and ISO region (eu.amazonaws, gov.ic.c2s, ...), not only in China, so describeVpcEndpointServices now takes that prefix from the SDK's partition metadata. S3 keeps the China-only split, the only regions where AWS lists it. Floci serves Marketplace Agreement and Entitlement only in us-east-1, so their guards no longer admit the other regions AWS runs them in; widening both is a separate change. |
||
|
|
dfe2117fed |
test(compat): take the partition and region from TestFixtures in five more suites (#5025)
Second batch of the cn-north-1 allowlist burn-down (#4272). These tests pinned the commercial partition, so they failed against a China deployment for the test's own reasons, not Floci's: - AppSyncTest asserted the arn:aws:appsync: prefix on four ARNs. - Ec2DescribeSpotPriceHistoryTest filtered on us-east-1a and us-east-1b. - PipesTest built its role, SQS and Kinesis ARNs in arn:aws and us-east-1. - IamTest looked its user up by an arn:aws ARN; its AWS managed-policy prefix and the SimulatePrincipalPolicy source now follow the partition too. - CloudWatchLogsMetricFilterTest replaced the recorded @aws.region dimension with us-east-1, and MetricFilterQueryAssertions signed its Query request for us-east-1, so it read another region's metrics. All now derive the partition and region from TestFixtures. The allowlist drops 19 entries, from 73 to 54. |
||
|
|
fa30cd7834 |
test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests (#5017)
* test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests The cn-north-1 nightly allowlists 25 cases in SesTagResourceTest, SsoAdminAccountAssignmentTest and SesConfigurationSetEventDestinationTest that fail only because the tests pin commercial values: ARNs built as arn:aws:<svc>:us-east-1:..., the arn:aws: AWS-owned SSO application provider and managed policies, and a us-east-1 primaryRegion. Floci answers correctly in China. TestFixtures gains region(), partition() (from the SDK's region metadata) and arn()/globalArn() builders, and the three classes use them. The rejected-bus cases move from @CsvSource, which only takes constants, to a @MethodSource whose mismatched-region bus is another region of the fixture partition. The 25 entries leave the allowlist (98 to 73). Part of BL-020. * test(compat): keep the SES bus rejection cases running in a single-region partition Greptile on #5017: the method source threw when the fixture partition has no second region (aws-eusc and aws-iso-e list one), so the custom-bus and mismatched-account cases, which need no second region, never ran there. The other region is now optional: the two cases always run, and only the mismatched-region case is left out of a single-region partition. |
||
|
|
c800cc375e |
test(compat): keep the China nightly allowlist free of an order-dependent entry (#4891)
The first Partition Compatibility run (36963820252) went red on one stale entry: SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passed. It only fails when OrganizationsTest#testFullLifecycle leaves its organization behind, which made the caller the management account for every later test, and that happened because the organization's own assertions, including the arn:aws: one that fails in cn-north-1, ran before the try whose finally deletes it. The assertions now run inside the try, so the organization is deleted however they end, and the stale entry is gone from the cn-north-1 allowlist. Part of #4272. |
||
|
|
d72923ab33 |
fix(core): compare ARN partitions with the resource's region, not the literal aws (#4791)
* fix(core): compare ARN partitions with the resource's region, not the literal aws Part of #4272 (P10b). Running the Java SDK suite against a Floci deployed in cn-north-1 (#4790) found five checks comparing a parsed ARN with "aws" and a seeded ARN fixed to the commercial partition: - RdsService.hasRdsResourceIdentity required partition aws, so DB instances, clusters, DB and cluster snapshots and subnet groups created outside aws failed their own ownership check and were not found right after creation. The proxy target group check had the same comparison, and CopyDBSnapshot refused any source ARN outside aws; it now requires the target region's partition, since a snapshot copies within its partition. - ElastiCache ListTagsForResource rejected every arn:aws-cn: ARN; it now expects the request region's partition and names it in the message. - RAM ignored organization principals outside aws; any published partition is accepted, the organization id ties the principal to the caller's. - The seeded IAM Identity Center instance was arn:aws:sso:::instance/... in every deployment, so China permission sets never found it. It now takes the partition of the deployment's home region, and AddRegion compares against the instance's own primary region instead of a fixed us-east-1. * fix(sso): move a persisted bootstrap instance to its partition, and drop the fixed China allowlist entries Greptile on #4791: a deployment persisted before the seeded instance took its partition keeps it as arn:aws:sso:::instance/..., while its permission sets were already minted in the instance's own partition, so the fix would not reach it. ensureBootstrapInstance now rewrites a stored bootstrap instance whose ARN is not in its primary region's partition. pgermosen on #4791: with #4790 on main, the cn-north-1 allowlist entries this fixes would turn stale and fail the nightly. Measured against this branch in cn-north-1: CloudFormationRdsDynamicReferenceTest, the ten RdsControlPlaneTest entries, RdsJdbcCompatTest#createDbInstanceAndConnectWithPassword and SsoPortalTest now pass and are deleted. The four IAM-token connection tests still fail because they sign their tokens for a pinned us-east-1, which a cn-north-1 database rightly refuses; they move to the group of tests that pin commercial values. * fix(ram): answer the listing operations for the request's region only Greptile on #4791: with organization principals accepted in every partition, a commercial GetResourceShares from a member of the organization returned a China share. The cause predates this PR: GetResourceShares, ListResources, ListPrincipals and GetResourceShareInvitations walked every stored share, so a share created in eu-west-1 was listed through us-east-1 too, while a resource share is a regional resource. RamController now passes the request region and the four operations keep only shares (and invitations to shares) in it, which also keeps a share out of another partition. * fix(ram): resolve a share or invitation to mutate in the request's region only pgermosen on #4791: after the listings were scoped to the request's region, findOwnedShare still walked every stored share, so a share invisible to GetResourceShares in one region could still be deleted, updated, associated, disassociated or retagged from there; AssociateResourceShare would add a resource the same endpoint's ListResources does not report. Accept and RejectResourceShareInvitation had the same gap. The six share mutations and the two invitation responses now take the request region from RamController and resolve only a share or invitation in it: one from another region gets UnknownResourceException or ResourceShareInvitationArnNotFoundException, like an ARN that does not exist. |
||
|
|
ea06896984 |
test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures (#4790)
* test(compat): run the Java SDK suite nightly in cn-north-1 against an allowlist of known failures Part of #4272 (P11). The partition work is covered by unit and integration tests over all eight partitions, but nothing ran a real SDK whose own partition logic (arn:aws-cn: ARNs, China signing scopes, the LocationConstraint S3 CreateBucket sends) has to round-trip. The Partition Compatibility workflow runs after each Nightly against the image it published, or on dispatch with an image and region: Floci starts with FLOCI_DEFAULT_REGION=cn-north-1 and sdk-test-java runs with AWS_REGION set, which TestFixtures now reads (default us-east-1, so the per-PR legs are unchanged). It runs once a night rather than per PR, to keep the shared runner pools free. compat-allowlist-check.py compares the JUnit results with compat-partition-allowlist-<region>.txt and fails on a failure the list does not name, on an entry that no longer fails, or on missing results, so the list only shrinks. The cn-north-1 list holds the 112 failures measured locally on main plus #4787: 96 tests that pin commercial ARNs, regions or zones, 13 that exercise commercial-only behaviour, and 3 still to explain. * test(compat): pin the nightly China run to its image's commit and catch an aborted suite Greptile on #4790: the workflow checked out the Nightly run's head_sha but pulled the mutable floci/floci:nightly tag, so the image and the tests could come from different commits; it now pulls the image first and checks out the commit in its org.opencontainers.image.revision label. And Maven exits non-zero for allowlisted failures too, so a suite that stopped partway could pass; the checker now takes --test-sources and requires a report for every test class in that tree. The cn-north-1 allowlist groups its entries by the verified cause: the RDS and SSO portal entries are Floci bugs (an RdsService ownership check against the literal partition "aws", and an arn:aws: seeded Identity Center instance), and SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passes alone and fails only after OrganizationsTest leaves an organization behind. |
||
|
|
d73e33fe4b |
fix(ecs): pull task images at launch so a moved tag reaches the next task (#4583)
* fix(ecs): pull task images at launch so a moved tag reaches the next task Floci resolved an image reference to an image id the first time it saw it and reused that id for the life of the process, so a rebuilt :latest pushed to the registry never reached a new task, even through a new task definition revision and a forced deployment, and nothing reported the mismatch. ECS now pulls every container image when a task starts, before creating any of its containers, following the agent's ECS_IMAGE_PULL_BEHAVIOR (configurable as floci.services.ecs.image-pull-behavior, default "default": pull, and fall back to the cached image when the pull fails). The cached image is whatever the local tag names at launch rather than a remembered id. Each container reports the manifest digest it runs as containers[].imageDigest. * fix(ecs): create task containers from the image id their pull resolved to An overlapping RunTask could pull the same moved tag between this task's pull and its container creation, so the container was created from whatever the shared tag cache named by then while reporting the digest this task pulled. resolveForLaunch now returns the resolved image id with its digest, and ECS builds each container from that id, so the image a task runs and the digest it reports always come from the same pull. The pull also now uses the reference the container is created from, including floci.docker.image-registry-base, instead of the unprefixed name. * fix(ecs): launch image ids without a pull and report the digest the pull resolved A bare sha256 image id under always, or on the first once launch, went to the registry as if it were a repository reference and failed the task although the image was local. resolveForLaunch now runs an image id as it is, like ensureImageExists. The reported digest took the first RepoDigests entry for the repository, which is not necessarily the manifest the tag resolved to when the image holds more than one (an index and a platform manifest). It now comes from the Digest line the daemon streams for the pull, kept while the tag still names that image; a cached image falls back to its repo digest only when there is exactly one. The shared test config uses prefer-cached so the other ECS Docker suites stop adding a registry round trip per launch; the image pull integration test pins default in its own profile. ContainerBuilder imports are back in order. * fix(ecs): report a pull's digest only for the launch that pulled The digest a pull reported was kept per reference and reused while the tag still named the same image id, but on the classic image store an id is the config digest and several manifests can share it, so an outside pull could move the tag to another manifest and leave the reused digest stale. Only the launch that pulled now uses the streamed digest. A cached launch uses the image's repo digest for the repository when there is one, or the one equal to the id (the containerd store names an image by its manifest), and otherwise none. Also sorts the ContainerLifecycleManager imports. * fix(ecs): pull the image-pull test's busybox and registry from Docker Hub EcsImagePullDockerIntegrationTest pulled both images through the public.ecr.aws/docker/library mirror, whose anonymous quota is shared per runner IP; shard 3 failed on toomanyrequests: Data limit exceeded. Take them from TestImages like the other Docker-backed tests, pinning the registry image there, and prefetch both for the shard that runs the class. * test(ecs): name the registry readiness probe's tolerated exception expected |
||
|
|
5aae37a3ef |
ci: prefetch busybox for the ECS leftover-container test (#4647)
EcsLeftoverContainersDockerIntegrationTest starts busybox but was not listed among the classes that key the busybox prefetch, so its shard pulled the image during the test instead of before it. List it with the other busybox users. |
||
|
|
ac706264a3 |
ci: pull the Firelens router from Docker Hub and correct why (#4622)
* ci: pull the Firelens router from Docker Hub and correct why A post-merge run showed the ECR Public quota is per runner IP and per byte, not specific to the docker/library mirror: the Firelens router failed with "toomanyrequests: Data limit exceeded" right after the same job had pulled two Lambda runtimes from ECR Public. The router is the same image AWS publishes on Docker Hub (same manifest, config and layer digests on both architectures), so the Firelens test now names it there, through a TestImages pin the prefetch reads. The Lambda runtimes stay on ECR Public: their Docker Hub copies lag by more than a year and some tags are missing. The TestImages Javadoc now gives the corrected reason. * ci: annotate a stale, unreadable or misrouted prefetch The prefetch already writes a line when a key names a class that no longer exists or when a TestImages pin cannot be read, but only into a log nobody reads unless a shard fails. The results step now turns those lines into workflow warning annotations, and adds one more: an image prefetched from ECR Public that is not a Lambda runtime, since everything else the tests start is carried by Docker Hub and belongs there. The prefetch stays best-effort, so these are annotations, not failures. * ci: warn on a misrouted prefetch whether or not its pull succeeded The routing warning matched only "prefetched" lines, so an image on the wrong registry whose pull failed on the quota, the very case the warning is for, produced only the raw failure line. It now matches "prefetch failed" lines too. |
||
|
|
903efdf58e |
ci: key the ECR Public prefetch on the classes that start each image (#4600)
* ci: key the ECR Public prefetch on the classes that start each image prefetch-images.sh keyed the four Lambda runtimes on any /lambda/ path in shard.txt, and partition.sh spreads the Lambda tests over every shard, so each of the four shards pulled all four runtimes (674 MiB) plus the Firelens router (105 MiB) from ECR Public anonymously before its tests started. ECR Public counts that transfer per runner IP, and once the quota is spent every later anonymous pull fails with "toomanyrequests: Data limit exceeded", which is how a 2 MiB busybox pull took a shard down on main twice on 2026-09-27. Measured from a full four-shard run by pairing each ImageCacheService "Pulling image" / "Image already present locally" line with the class that logged it: nodejs:20 is reached from every shard, python:3.14 and python:3.12 each have one Docker-backed class, nodejs:18 was pulled by every shard and started by none, and the Firelens router has one class. Each entry now keys on those classes, which cuts a shard's ECR Public prefetch from about 800 MiB to between 120 and 330 MiB. A class the list misses pulls inline, as before. The tests also used three busybox tags (latest, 1.36, stable) for the same 2 MiB image. They now share one pin, TestImages.BUSYBOX (busybox:stable, the tag application.yml and the compatibility suites already use), and the prefetch script reads that pin from the class the way it reads the sidecar pins from application.yml, so one prefetch serves every test and the two cannot drift apart. The one test that pulls the other architecture keeps a tag of its own: a foreign-platform pull replaces what the local tag points at on a daemon without the containerd image store, and the docker build in the VolumesFrom test resolves its base from that local tag. Each key that names a class is checked against src/test/java, and a stale name is written to the log, so a rename cannot silently turn a prefetch off. The prefetch also set off ECR Public's per-second limit on its own: every pull started in the background at once, so the shard's ECR Public pulls landed in the same second. They are now queued and pulled one after another, a second apart, small images first because core/common/docker sorts near the top of every shard, while the Docker Hub pulls stay parallel. And each pull now writes one result line to prefetch-images.log, printed by a step after the tests, so a failed or still-running prefetch can be told apart from a test pulling the image itself. * ci: pull the Docker library test images from Docker Hub The first run of the prefetch results log showed where the quota actually runs out. On the two shards that failed, the very first pull of the job, docker/library/busybox or docker/library/python from the ECR Public mirror, came back with "toomanyrequests: Data limit exceeded" before the job had transferred anything, so the shard's own volume was not what spent it. The same runner then pulled busybox from Docker Hub seven seconds later and a 116 MiB lambda/ image from ECR Public half a minute after that, both fine. The mirror at public.ecr.aws/docker/library has an anonymous quota of its own, shared by runner IP and often already spent when a job starts, while GitHub-hosted runners pull Docker Hub without a limit: the fourteen Docker Hub images each shard prefetches have never failed. TestImages now names busybox and python-alpine the Docker Hub way, with the reason in its Javadoc, and the prefetch pulls them with the other Docker Hub images instead of queuing them behind the ECR Public runtimes. The three python-alpine literals share one pin. The pin is read with a regex that tolerates spacing, and a pin the script cannot read writes a "prefetch skipped" line instead of silently pulling nothing. An image two entries name is pulled once. The results step also lists any docker pull still running, so an early exit does not make an unfinished pull look like one that never ran. * test(compat): pull the SageMaker and CodeBuild images from Docker Hub The SageMaker compatibility tests (Java and Python) and the CodeBuild one named busybox through the public.ecr.aws/docker/library mirror, the same namespace whose anonymous quota fails the Build and Test shards, and the native Python jobs of another PR failed on it the same way. They now name the image the Docker Hub way. The CodeBuild digest is the same on both registries, so that reference only changes its host. |
||
|
|
5fbaab1cca |
fix(ci): compute shard.txt before Compile so the image prefetch overlaps compilation (#4026)
The first prefetch-images.sh call ran before shard.txt existed, so it always hit the readability guard and exited silently; only the second call, right before the tests, did any work. Derive the shard include list from src/test/java instead of target/test-classes, so shard.txt is available before Compile. Every test is a top-level class in src/test/java, so the source file name equals the class name and the resulting shard.txt is byte-identical for all four shards. Prefetch once, right after the shard is computed, and drop the second call. Make the script log when it exits at the readability guard so a no-op call shows up in the job log instead of being silent. Closes #3995 |
||
|
|
3c23fff607 |
ci: prefetch the Postgres, k3s, InfluxDB and Firelens images the shards pull inline (#4181)
Every shard pulled these images inline during the test run. Prefetch them in the step that already warms the lambda and docdb images, matched on the shard's own test list so a shard only pulls what it runs: postgres:15-alpine for redshift and cloudformation, postgres:16.3-alpine for rds, influxdb:2.7, rancher/k3s and the fluent-bit and busybox pair for ecs. The rds tag is hardcoded on purpose, since imageForEngine adapts the configured default to the requested EngineVersion and there is no single config line to read. |
||
|
|
27633bf94d |
feat(appsync): execute APPSYNC_JS resolvers via a Node sidecar (#3422)
* feat(appsync): execute APPSYNC_JS resolvers via a Node sidecar A field with a resolver resolved to null: no data fetchers were registered, so graphql-java fell through to its property fetcher on an empty root. This runs the resolver instead, for UNIT and PIPELINE alike, over NONE, AWS_LAMBDA, RELATIONAL_DATABASE and AMAZON_DYNAMODB data sources. Resolver JavaScript runs in a Node sidecar container rather than in process. Floci's published image is a Mandrel native executable, which carries no Truffle languages, so there is no in-process JavaScript to embed; running real Node also means a bundle executes as written, ES modules and all. @aws-appsync/utils is a shim the sidecar writes at boot rather than the published package, so a resolver call never depends on npm being reachable. The pipeline follows AppSync's: ctx.stash threads through every stage, each stage sees the last as ctx.prev.result, runtime.earlyReturn stops everything, util.error fails the field with the type the resolver chose, and util.appendError returns its errors beside the data. A data source failure does not fail the field on its own: the stage's response() handler is called with ctx.error set and decides whether to re-raise or suppress, which is why resolvers carry an explicit if (ctx.error) branch. VTL mapping templates are not executed. A VTL stage fails its field saying so rather than resolving to null, since a null that means "not implemented" is indistinguishable from a null that means "no rows". Carries model/FunctionConfiguration and AppSyncService so it builds and tests standalone; both are identical to the copies in the AppSync CloudFormation change and collapse on merge. * feat(appsync): enforce the APPSYNC_JS subset before evaluating resolver code The sidecar is real Node, so it accepted JavaScript AWS rejects: async functions, promises, classes, try/catch, while loops, this, and imports of Node builtins. For an emulator that is the worst failure available, since a local run green-lights resolver code that cannot deploy. Imports are restricted by a module resolve hook rather than a source scan, so a dynamic import of a builtin cannot slip past either. An async handler is caught before it runs and a handler returning a promise after. The remaining constructs are found by scanning the source with comments, strings and template text blanked first, so the same keywords inside them are not flagged. A rejected resolver fails its field with errorType UnsupportedFeature and the line. Enforcement is on by default and can be turned off with floci.services.appsync.js-runtime.enforce-appsync-subset, which exists only so a false positive cannot block someone whose code AWS does accept. Checking real resolvers against it found a gap of the same kind in the other direction: @aws-appsync/utils/dynamodb is a real module the shim did not provide, so valid code was being rejected. It now implements get, put and remove; the helpers that compile a condition or update expression throw by name rather than returning something the data source would mishandle. Also from review: cap the /evaluate request body, keep integer precision in the DynamoDB NS branch as the N branch already did, reject two SQL parameters bound to the same name instead of letting the Data API report it, drop the container id and close the log follower in reset(), and bound the docker probe in the integration test so an unresponsive daemon cannot hang CI. * feat(appsync): add the js-runtime url knob and stop the sidecar through ContainerTeardown Follows the sidecar contract the other managed containers use. floci.services.appsync. js-runtime.url points the runtime at a Node server that is already running, in which case ensureStarted skips container management entirely: nothing is created, adopted or stopped, and the URL is probed with the short adopt budget so a wrong one says so instead of holding the first resolver for the full start timeout. Same shape and meaning as floci.services.duck.url. NodeAppSyncJsRuntime now implements ContainerTeardown, so EmulatorLifecycle stops the sidecar with the other process-bound containers at a deterministic point rather than only through @PreDestroy, which the interface documents as running too late for the final storage flush. Teardown is a no-op for a pre-configured URL, since that server is not ours to stop. * fix(appsync): serialize reset() and stop the sidecar it gives up on reset() touched started, baseUrl, containerId and logStream without holding the monitor that ensureStarted() and stopManagedContainers() both take. A failed evaluation could therefore clear those fields in the window after a container had been created and its id recorded but before started was set, dropping the only handle to a live container: teardown then saw a null id, treated the sidecar as never started, and the container was leaked rather than stopped. reset() is now synchronized on the same monitor, and reentrant so the callers already holding it are unaffected. The failure path in post() goes through discardSidecar(), which stops and removes the container before clearing the fields instead of forgetting it, since forgetting is what leaks: nothing else holds the id. A pre-configured url owns no container, so teardown there stays a no-op. The regression races eight failing evaluations against startup and asserts every container the runtime created was also stopped. It needs a transport-level failure to reach the path: a 500 is rethrown as an AwsException before it, so the stub drops the connection instead. Against the previous reset() it fails with expected <[container-1]> but was <[]>. * refactor(appsync): run resolvers through the GraphQL sidecar callback out of Floci, which left this branch building DataFetchers for a schema that no longer has any. Resolver execution moves onto the sidecar's batched resolver callback instead, so the engine stays in the sidecar and the resolvers, the data sources and the Node runtime stay here. /v1/execute now carries a resolve block naming every planned coordinate that has a resolver, with a callback URL and a token minted for that one operation. The sidecar batches each execution level into one POST /appsync-resolve, which runs the field's resolver and answers with a value or an error. denyFields still win, so a denied coordinate is never listed and never reaches a resolver, and the token stops working as soon as the operation returns. AppSyncResolverExecutor takes a ResolverInvocation record instead of a DataFetchingEnvironment. Every value it read off the environment is on the record, so the pipeline, the data source invokers and the JS runtime are unchanged. ResolverDataFetcher is gone: fields with no resolver are the sidecar's own property fetcher again, and a resolver that disappears mid-operation falls back to the source property rather than failing. One AppSync behaviour does not fit the callback response, which carries a value or an error per field and never both. util.appendError means report this and keep the data, so those errors come back on the operation's session and are merged into the response envelope, which keeps data and appended errors together as AppSync returns them. Also gives the sidecar container host.docker.internal on Linux, since it now has to reach Floci back, moves the JS runtime image pin into application.yml so CI prefetches it the way it does the sidecar pins, and puts the Docker integration test on the shared AppSyncGraphqlSidecarProfile so it is namespaced and gated like the other AppSync integration tests. * ci(appsync): prefetch the Node image only on the shard that starts it The js-runtime prefetch matched /appsync/, so all four shards pulled node:22-alpine although only the shard carrying AppSyncJsResolverDockerIntegrationTest starts that container. Every other test in the package is a unit test. Matching the class name instead is three fewer Docker Hub pulls per run, which is what this script exists to avoid. * fix(appsync): keep null arguments and move the resolver callback under _floci Two review points from #3422. ResolverInvocation copied arguments and variables with Map.copyOf, which rejects a null value, so getMessages(nextToken: null) threw out of the callback and answered 500. That failed every field in the batch, not only the field carrying the null. Both copies are now null tolerant, and an explicit null stays distinguishable from an absent argument: it is present in ctx.args and null, where an absent one is not there at all. The callback moves from /appsync-resolve to /_floci/appsync/resolve, with the EKS webhooks. A bare path is reachable as a path-style S3 request for a bucket of that name, and an S3 bucket name cannot begin with an underscore, so the prefix cannot be shadowed. The null case is covered both ways: a unit test in ResolverCallbackResourceTest that fails with a NullPointerException against the previous code, and three queries in the Docker round trip covering an explicit null, its value reaching ctx.args, and an absent argument for contrast. |
||
|
|
b1e0751764 | ci: prefetch the SQL Server image for the shard that runs RdsAwsIntegrationTest (#3970) |