mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
5da8045bb2ed954f4df652be2f2c38ae22c19150
18
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a0741e5011 |
fix(emr-serverless): keep an application with runs going from stopping (#8038)
StopApplication stopped an application whose runs had not finished, where the API reference says "All scheduled and running jobs must be completed or cancelled before stopping an application." A run that has not finished, a STREAMING or CANCELLING one included, now refuses the stop with ValidationException, the one error the model declares for it, carrying that sentence, as AWS's own message is not recorded. The check holds the job runs' lock, as StartJobRun's admission does, so no run starts between it and the stop. Step Functions' stopApplication goes the same way. |
||
|
|
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.
|
||
|
|
cfd7e83776 |
fix(glue): let the Glue catalog client read back tables and partitions (#7329)
The Glue Data Catalog client, which Spark's Glue catalog and Hive's Glue metastore use on EMR, could not read back a table it had just created on Floci: "NullPointerException: Cannot invoke java.lang.Integer.intValue() because the return value of Table.retention() is null". Floci's Table had no Retention, and its StorageDescriptor no StoredAsSubDirectories, SortColumns, BucketColumns, SkewedInfo or AdditionalLocations, so what the client wrote was dropped, and the client unboxes Retention, Compressed, NumberOfBuckets, StoredAsSubDirectories and an Order's SortOrder without a null check. Past that, a partitioned table came back with each partition, and so each row, five times: the client reads a table's partitions in five GetPartitions segments by default, and Floci answered every segment with all of them. Now: - Table keeps Retention and IsRegisteredWithLakeFormation, and StorageDescriptor keeps AdditionalLocations, BucketColumns, SortColumns, SkewedInfo and StoredAsSubDirectories, and the table and descriptor copies carry them. - every table and partition a catalog action returns (GetTable, GetTables, SearchTables, GetTableVersion, GetTableVersions, GetPartition, GetPartitions, BatchGetPartition) reads Retention as 0, IsRegisteredWithLakeFormation as false, and a storage descriptor's Compressed, NumberOfBuckets, SortColumns and StoredAsSubDirectories as false, 0, an empty list and false when they were written without them, as the CLI reference's get-tables output shows Glue doing. The stored records keep their nulls: Spectrum reads a partition's missing Compressed as its table's. - GetPartitions honours Segment, "a non-overlapping region of a table's partitions": a partition is in the one segment its values hash to, a SegmentNumber past the last holds none, and TotalSegments outside 1 to 10, a negative SegmentNumber or a missing member is a ValidationException, and a member that is not an integer a SerializationException. - a SortColumns entry that is null, lacks Column or SortOrder, or has a SortOrder other than 0 or 1 fails the whole CreateTable, UpdateTable, CreatePartition, UpdatePartition, BatchCreatePartition or BatchUpdatePartition with a ValidationException before anything is stored, as the client unboxes SortOrder on read. - the EMR runner gives the client the job's account as its hive.metastore.glue.catalogid, on a cluster and in an EMR Serverless run. Given none, the client in emr-7.10.0 asks STS GetCallerIdentity for it through an STS client no setting points at Floci, so a step reached real AWS STS and failed. The job's own account is what an unset one means, and a cluster's spark-hive-site or a run's spark-defaults one, for a Data Catalog in another account, still wins. IsRegisteredWithLakeFormation is always false, as Floci does not tie a table to a location registered with Lake Formation. |
||
|
|
2b6a8b4e66 |
feat(emr-serverless): give a job run's driver its driverEnv and S3 archives (#7107)
In the docker runner mode the user guide's way of giving an EMR
Serverless job run its Python libraries did nothing. "Building a Python
virtual environment" packs a virtualenv into an archive in S3 and
submits the job with:
--conf spark.archives=s3://.../pyspark_venv.tar.gz#environment
--conf spark.emr-serverless.driverEnv.PYSPARK_DRIVER_PYTHON=./environment/bin/python
--conf spark.emr-serverless.driverEnv.PYSPARK_PYTHON=./environment/bin/python
--conf spark.executorEnv.PYSPARK_PYTHON=./environment/bin/python
Floci set no driverEnv variable on the driver's container, and Spark in
local mode unpacks spark.archives into a temporary files folder of its
own once the driver's Python has started, not into the working
directory. With the variables set, the driver could not start: "Cannot
run program "./environment/bin/python"".
Now:
- a spark.emr-serverless.driverEnv.<KEY> property ("Option that adds
environment variables to the Spark driver"), from the run's
spark-defaults or a --conf in its sparkSubmitParameters, which wins,
is an environment variable of the driver's container, replacing one
of Floci's own of that name;
- each archive of spark.archives (which spark-submit's own --archives
sets, winning over a --conf, as in Spark) in Floci's S3 is read as the
run's account, streamed into the created container and unpacked into
its working directory before spark-submit starts, under the name after
its # or else its file's name, as Spark's Utils.unpack does it (.jar
and .zip unzipped, .tar.gz, .tgz and .tar untarred, anything else
copied). The guide's venv-pack example puts the environment in
/home/hadoop/environment, and /home/hadoop is the image's working
directory. An archive that cannot be read fails the run before its
driver starts, naming it; a cancel, a reset or a shutdown while they
are put in ends the copy and puts in no other.
SparkJobRunner.Job carries the archives, which classic EMR's steps
leave empty. Spark still unpacks each archive into its own files folder
too, where SparkFiles.get finds it, and gives spark.executorEnv
variables to the Python workers it starts, so those need nothing more.
|
||
|
|
931b2d26a7 |
feat(emr-serverless): run a job run in its application's custom image (#6975)
In the docker runner mode an application's imageConfiguration, and a
worker type's, was stored and returned, but every run started from the
release's public image. So a job whose libraries are baked into its own
image, the user guide's "Customizing an EMR Serverless image", could not
run. Now a run starts from the application's custom image:
- the Driver worker type's imageConfiguration, else the application's,
which "EMR Serverless applies ... to all worker types". Local mode
runs the executors in the driver's container, so an Executor image is
not used;
- an <account>.dkr.ecr.<region>.amazonaws.com URI leads to Floci's ECR,
as a Lambda function's or an ECS task's image does, and the
repositoryUri Floci's ECR hands out works too;
- the image is pulled for every run, as an ECS task's is, so a tag
pushed again is what the next run gets ("New workloads submitted after
the update automatically will use the new image"), and the driver
starts from the image id that pull resolved. When the pull fails, the
image the Docker daemon has runs; without one the run is FAILED.
SparkJobRunner.Job carries the custom image beside the template, which
classic EMR's steps leave null.
The image configurations, the application's and each worker type's,
are checked as the user guide and the model describe them, in Floci's
own wording as no source gives AWS's:
- CreateApplication refuses one without imageUri, "This field is
required when you create a new application";
- CreateApplication and UpdateApplication refuse an image whose ECR
repository, AWS-shaped or a repositoryUri from Floci's ECR, is in
another Region: "The Amazon ECR repository must be in the same AWS
Region that you use to launch EMR Serverless applications";
- UpdateApplication with one that leaves imageUri out removes it: "If
you leave this field blank in an update, Amazon EMR will remove the
image configuration."
EcrRegistryManager.imageRegion reads the Region from either URI form.
Floci does not check imageUri against the model's pattern, which would
refuse the repository URIs its own ECR hands out, nor the image's
release or size, and reports no resolvedImageDigest; the service doc
lists these.
|
||
|
|
c9bc1e7cb8 |
feat(emr): have the JVMs in EMR containers trust Floci's CA (#6926)
With TLS on, every container Floci launches gets the CA bundle and the SSL_CERT_FILE family of variables, but the JVM reads none of them. So in the docker runner mode a Spark job's own SDK clients that ignore AWS_ENDPOINT_URL, the AWS SDK for Java 1.x's or an older 2.x's, failed with "PKIX path building failed" against Floci's HTTPS, even with FLOCI_DNS_SPOOF_AWS_ENDPOINTS sending AWS's endpoint names to Floci. A job could only reach Floci over its HTTP endpoint. Floci now also writes the bundle's certificates as a PKCS12 trust store at boot, floci-ca-bundle.p12 beside the bundle. A launcher whose workload is Java can copy it into a container before the container starts (ContainerLifecycleManager.copyJavaTrustStore) and point the container's JVMs at it through JAVA_TOOL_OPTIONS, with a shell line that does so only when the file is there. The store has no password and the line gives only its path, so a trust store a job or an image names itself replaces Floci's, with that store's own type and password. EMR Serverless job runs and EMR steps copy it into the driver's container ahead of spark-submit or the step's command, and the bootstrap actions' container gets it for its actions, then drops it before the image is kept. Other services' containers are unchanged. JAVA_TOOL_OPTIONS rather than spark.driver.extraJavaOptions, since setting that key would replace what the image's spark-defaults.conf gives it, and a job's own value would drop Floci's. Each JVM prints "Picked up JAVA_TOOL_OPTIONS: ..." on its standard error, as the docs now say. |
||
|
|
66a5c05037 |
feat(emr-serverless): retry a failed job run as its retry policy allows (#6894)
In the docker runner mode a job run's retryPolicy was stored and
returned, but a run whose driver failed was never tried again: every
run was its one attempt. Now, on release 7.1.0 or later, "EMR
Serverless releases 7.1.0 and higher include support for job
resiliency", a run whose driver fails is tried again as the user
guide's "Job resiliency" gives it:
- a BATCH run until it has made maxAttempts attempts, "The default is
1, which means to not rerun the job";
- a STREAMING run, which "EMR Serverless indefinitely retries", until
it has failed maxFailedAttemptsPerHour times within an hour, "The
default is five".
The failed attempt ends FAILED with its stateDetails, and the next is
SCHEDULED again and runs its driver from the beginning, "its own set
of logs" under attempts/<n>/ in S3 and CloudWatch Logs. A cancelled
run, one past its timeout ("Cancelling: ... or the job run has timed
out"), one Floci's own shutdown stopped and one whose application is
gone are not tried again; a retry is admitted while its application
cannot be deleted, as the first attempt is.
GetJobRun without attempt returns "the latest attempt", and with one
an earlier attempt as it ended; ListJobRunAttempts lists them all,
oldest first, each with its own createdAt and updatedAt. No source says
whether a run's timeout spans its attempts; Floci applies it to each.
Floci sends no EMR Serverless events, so the job run retry event is
not sent.
StartJobRun holds retryPolicy to "Accepted values are 1 to 10,
inclusive" for both members: outside that range is a
ValidationException in the model's constraint form, and a member that
is not an integer a SerializationException, as Smithy's restJson1
malformed-request tests have it.
|
||
|
|
5c9eb3eb30 |
feat(emr-serverless): send Spark driver output to CloudWatch Logs (#6703)
With CloudWatch logging enabled on a job run in the docker runner mode, its Spark driver's standard output and error now go line by line, while it runs, to Floci's CloudWatch Logs, as well as to Floci's log. - Which configuration: the run's cloudWatchLoggingConfiguration, or else the application's; the user guide merges them by configuration type, and "enabled": false at the run removes it. - Where: the log group logGroupName, /aws/emr-serverless by default, and the log streams <logStreamNamePrefix>/applications/<applicationId> /jobs/<jobRunId>/SPARK_DRIVER/stdout and .../stderr, with attempts/1/ before SPARK_DRIVER for a retried run on 7.1.0 or later, as for S3. The guide gives the default group and the stream up to its worker type; the stdout and stderr streams under it are as Dagster's EMR Serverless client reads them, and Airflow's operator builds the same prefix. Group and streams are created as needed, in the run's account and Region. - What: the driver's stdout and stderr, "By default, EMR Serverless publishes only the driver stdout and stderr logs". A logTypes that names some types sends only the driver's it names, so none of them when it names only SPARK_EXECUTOR: the API reference's logTypes is "The types of logs that you want to publish to CloudWatch". ContainerLogStreamer gets attachByStreamForAccount, which sends a container's standard output and error to log streams of their own; its reassembly callback now keeps the stream each line came from. The shared Spark runner uses it when a job carries a CloudWatch destination. |
||
|
|
0a47ddd5e4 |
feat(emr,emr-serverless): write Spark driver logs to S3 (#6620)
In the docker runner mode a Spark driver's output went only to Floci's log. Once a driver ends, the shared runner now reads its standard output and error from Docker and puts them, gzipped, into Floci's S3 as stdout.gz and stderr.gz in the run's log folder, while the container is still the run's. A driver a cancel or its timeout ended is stopped first, through a new ContainerLifecycleManager.stop that leaves the container in place, so it changes nothing more while its output is read and the logs hold all it wrote; a driver Floci's teardown took writes nothing. Logs that cannot be written leave the run as it ended. - EMR steps: under the cluster's LogUri, at <LogUri>/<cluster-id>/steps/<step-id>/ (Management Guide, "Log locations"); without a LogUri "logs are not created". An s3n:// or s3a:// LogUri names the same bucket. - EMR Serverless job runs: under the run's s3MonitoringConfiguration logUri, or else the application's (the user guide merges them by configuration type, and an empty one at the run removes it), at applications/<applicationId>/jobs/<jobRunId>/SPARK_DRIVER/, with attempts/1/ before SPARK_DRIVER/ for a STREAMING run or a BATCH run whose retry policy allows more than one attempt, on 7.1.0 or later. FailureDetails gets no LogFile: the Management Guide ties it to a root cause EMR identifies, and Floci's Reason is always "Unknown Error". core.common.S3Uri splits the folder's s3:// URI into bucket and key. |
||
|
|
b66ee9ecf0 |
feat(core): make the image pull timeout configurable (#6521)
ImageCacheService gave each attempt at pulling an image a hard-coded five minutes, and a pull three attempts. An EMR Serverless runtime is 3.5 to 4.3 GB, so on an ordinary connection the first run of a release Docker did not have yet failed with "Could not pull image" before the pull could finish. floci.docker.image-pull-timeout-seconds, or FLOCI_DOCKER_IMAGE_PULL_TIMEOUT_SECONDS, now sets the limit for each attempt. Its default, 300, keeps today's five minutes, and it must be at least 1, checked with the other Docker timeouts in DockerClientProducer. Follow-up to #6469. |
||
|
|
edbcac33c7 |
feat(emr-serverless): run Spark job runs in a container (#6469)
A new runner mode, floci.services.emrserverless.runner-mode=docker,
runs each Spark job run. Floci starts one container per run from the
release's EMR Serverless base image on Amazon ECR Public, and starts
spark-submit in local mode in it itself, since the image's own
entrypoint hands over to a script only EMR Serverless supplies. The
default, immediate, keeps today's behaviour.
A docker run is SCHEDULED while its image is pulled and its container
starts, RUNNING once the Spark driver runs, then SUCCESS when it exits
0 and FAILED otherwise, with the exit code in stateDetails, as the
user guide's job run states describe. CancelJobRun, or a BATCH run
passing its executionTimeoutMinutes, makes it CANCELLING until the
driver is stopped, then CANCELLED. A run left by a Floci restart is
FAILED once read.
Floci's shutdown and a state reset stop every driver, one whose image
is still being pulled as soon as its container is up, and a reset
raises a generation the runs' threads check, so none writes its run
back after the storage wipe. A driver a hard stop left running is
removed before this process starts one: driver containers carry the
deployment's owner label, as EC2's and ECS's do, and
reconcile-containers-on-startup turns the removal off, as theirs does,
for two Flocis sharing a daemon. A stop that comes after its run has
ended is dropped, and a cancel before a run starts is read from the
run's state. A driver is watched with a look at its container every
250 ms, as Batch's runner watches its jobs, so a run holds no Docker
connection while its driver runs; a run past its timeout is
CANCELLING while its driver is stopped.
spark-submit gets the entry point, its arguments and the
sparkSubmitParameters (split as a POSIX shell would), after the
spark-defaults of the application's runtimeConfiguration, or the
run's own in its applicationConfiguration, which replace the
application's whole classification ("Only the properties included in
StartJobRun is considered for this classification"); from
emr-spark-8.1.0 the two merge by property, the run's winning, as its
release notes say. S3A takes s3:// and s3a:// paths to Floci's S3 on
every release, with in-memory commit tracking, without which EMR's
committer loses every write; the Glue Data Catalog client goes to
Floci's Glue. The container gets a session for the run's execution
role and AWS_ENDPOINT_URL, as the other containers Floci launches do.
The image is public.ecr.aws/emr-serverless/spark/<release>:latest, or
spark4/ in place of spark/ for an emr-spark-* release, where ECR
Public keeps the AWS runtime for Apache Spark images. image-template
names another image, and docker-network the network.
Docker answers a stop of a container that has already exited with
HTTP 304, which ContainerLifecycleManager logged as a failed stop
after every run that ended by itself. It now counts as stopped, as a
304 on start already counts as started, and so does the runner's stop
for a cancel that finds the driver already exited.
A Hive run fails without running. Log destinations, retries and the
cancellation grace period are not emulated; the driver's output goes
to Floci's log.
Part of #6046 (REAL-2).
|
||
|
|
15de90c3ff |
feat(stepfunctions): add the emr-serverless optimized integrations (#6386)
A Task can now use the six optimized EMR Serverless integrations the
Step Functions guide lists: createApplication, startApplication,
stopApplication, deleteApplication, startJobRun and cancelJobRun, each
request-response and .sync. Each calls Floci's EMR Serverless in the
state machine's Region. They failed with "Unsupported resource" before.
A Task names the API's members in PascalCase where the API writes them
in camelCase, so a request and a response are mapped against botocore's
EMR Serverless model, now vendored as aws/emr-serverless-shapes.json by
tools/aws/regen_emr_serverless_shapes.py: a structure's members are
renamed, a map keeps the keys the state machine wrote (tags,
InitialCapacity's DRIVER, a configuration's Properties such as
spark.executor.memory), and a member the model does not have is
dropped. A member, ApplicationId and JobRunId included, may be written
in either case. One the model has and Floci's request class lacks is
refused rather than dropped, and a test holds the classes to the model.
request_shapes.py can now keep output shapes for it. A request
without ClientToken gets a random one, as the SDK fills an idempotency
token in; the guide's examples leave it out.
The result is the API's response in PascalCase, or {"ApplicationId"}
where the API answers nothing, as the guide's table says. The guide
finds no difference between a .sync response and the API's, so a .sync
result is the starting call's own: state machines read a
createApplication.sync result's ApplicationId and a startJobRun.sync
result's JobRunId. A .sync Task records TaskSubmitted and polls
GetApplication or GetJobRun until the state the guide names, as the
elasticmapreduce ones do; a run that ends FAILED or CANCELLED, or an
application that can no longer get there, fails the Task with
States.TaskFailed and the describe response as the cause. A wait that
ends early cancels the run of a startJobRun.sync, stops the application
of a startApplication.sync and deletes the one a createApplication.sync
made, the call each integration's IAM policy grants beyond its own and
its read. EMR Serverless answering that the application or run is gone
or past undoing is logged and leaves the Task ending as it was; any
other failure is raised.
An EMR Serverless error keeps its code under EmrServerless., the
exception prefix the guide gives the service; no record shows the
optimized integration's. A Task without the ApplicationId, or a
cancelJobRun without the JobRunId, it acts on fails with
States.TaskFailed before EMR Serverless sees it.
CreateApplication now stores the configurations UpdateApplication
already did (runtime, monitoring, scheduler, disk encryption,
interactive, Identity Center and job-level cost allocation), and
ImageConfiguration keeps applicationLevelDigestResolution. Both were
dropped, from a Task and from the API alike. A runtime configuration
kept only its properties, lifted out of their member: Jackson bound the
properties member to the field of that name holding every member read.
It keeps its classification and properties now, on update as well.
GetApplication no longer returns the application's clientToken, which
its Application has no member for and which the .sync waits read. The
token stays with the stored application, which CreateApplication's
retries are matched on.
The .sync wait loop the elasticmapreduce integrations had is now shared
by both, as are their request and failure helpers, and the two EMR
Step Functions tests share their state machine helpers.
Part of #6046 (part 11).
|
||
|
|
63d577a245 |
feat(emr-serverless): tag job runs and report their attempts (#6297)
TagResource, UntagResource and ListTagsForResource now take job run ARNs
(.../applications/<id>/jobruns/<id>), which the model's ResourceArn
allows ("the supported resources are Amazon EMR Serverless applications
and job runs"). They work on the tags StartJobRun stores, so GetJobRun
reports the current set, under the same rules as an application's: at
most 50 tags, no "aws:" prefix. An ARN must be the run's own, so one of
another application or account names nothing, and once an application
is deleted its runs' ARNs name nothing, as its own ARN already does. A
session ARN, which the pattern also allows, now answers
ResourceNotFoundException rather than ValidationException, as sessions
are not emulated.
ListJobRunAttempts (GET .../jobruns/{jobRunId}/attempts) and GetJobRun's
attempt parameter report attempts. Nothing runs, so no run fails and
none is retried: every run is one attempt, number 1, created and updated
with the run. GetJobRun, ListJobRuns and ListJobRunAttempts carry it.
GetJobRun with attempt 1 or none returns the run; another attempt
answers ResourceNotFoundException, in Floci's words, as no source shows
AWS's answer for an attempt a run never made, and leaves the run as it
was.
Also from the #6202 review:
- From release emr-7.11.0 a BATCH run's executionTimeoutMinutes must be
1 to 10080. The model: "the maximum value is 10080 minutes (7 days)
starting with Amazon EMR release 7.11. Setting a value of 0 to disable
the timeout is no longer supported for BATCH mode job runs." Earlier
releases and STREAMING runs keep 0 to 1,000,000. No source gives the
error; ValidationException, in Floci's words. The check runs before
auto-start, under the application's lock, so a refused run leaves the
application as it was.
- ListJobRuns refuses a state or mode that does not exist and more than
8 states, and ListApplications a state that does not exist and more
than 7, with the framework ValidationException. A typo listed nothing
before. ListApplications' maxResults outside 1 to 50 now answers the
same framework message, joined with any states violation.
- EmrServerlessRegionIntegrationTest uses EmrServerlessRequests, which
gains tagsPath, and pins a job run ARN across Regions;
EmrServerlessTagIntegrationTest moves onto the same helpers.
The enum and range violations are now SmithyValidationErrors.notInEnum,
notAllInEnum and outOfRange, which EMR Serverless uses.
Part of #6046 (part 9).
|
||
|
|
1f1e5db1bc |
feat(emr-serverless): start, get, list and cancel job runs (#6202)
Adds StartJobRun, GetJobRun, ListJobRuns and CancelJobRun under
/applications/{applicationId}/jobruns. Job runs are metadata only, like
Glue's: a run is RUNNING from submission and settles when read. With the
new floci.services.emrserverless.job-run-duration-seconds at its default
of 0, a BATCH run is SUCCESS as soon as it starts; a positive duration
keeps it RUNNING that long, and a run that would outlast its
executionTimeoutMinutes (720 when not given) is CANCELLED at the
timeout. A STREAMING run stays RUNNING until it is cancelled.
A run on a CREATED or STOPPED application starts it, as auto-start
defaults to on; with auto-start off the run is refused. clientToken is
the idempotency token: a retry returns the original run, and the same
token with another request answers ConflictException "Request did not
match the original". CancelJobRun on a finished run answers
ValidationException "Job run is not in a cancellable state". ListJobRuns
returns the newest runs first, filtered by states, creation time and
mode, and its nextToken resumes only the listing it came from. A run
needs a jobDriver that sets exactly one of sparkSubmit and hive, as
GetJobRun's JobRun always carries one, and tags are checked before
auto-start, so a refused run leaves the application as it was.
createdBy is the caller's ARN.
Application createdAt and updatedAt now go out as epoch seconds, the
restJson1 default for the model's Date shape, as job runs do. They were
epoch milliseconds, which the Java SDK reads as the year 58774 and
botocore refuses as out of range. Auto-start rewrites updatedAt, so a
run's own submission reached the bug. Applications persisted with
millisecond timestamps read back at the same instant.
Part of #6046 (part 8).
|
||
|
|
03f87285a0 |
fix(emr-serverless): retain deleted applications for waiters (#6103)
* fix(emr-serverless): retain deleted applications for waiters * fix(emr-serverless): reject tag access after application deletion |
||
|
|
e14e5433ab | fix(emr-serverless): isolate applications by request region (#6078) | ||
|
|
5aad012e78 |
feat(emr-serverless): tag, untag and list tags for applications (#4667)
EMR Serverless had no tagging API: no TagHandler was registered for the emr-serverless ARN service, so TagResource, UntagResource and ListTagsForResource could not be routed, and a tagged aws_emrserverless_application could not be planned. Register an emr-serverless handler with the shared /tags dispatcher, answering 200 as the model does, over the tags already stored on the application. Validate keys and values, the user guide's 50 tag limit and its reserved aws: prefix, refuse job run ARNs as not found, and synchronize the application mutators so a tag write cannot lose a concurrent update. Closes #4662 |
||
|
|
8a673fc580 |
feat(emrserverless): support EMR Serverless applications (#2403)
* feat(emrserverless): add EMR Serverless application management emulator This adds a full emulator for the EMR Serverless Application management plane, allowing tools like Terraform to provision and manage EmrServerless applications. Includes full CRUD operations, route collision handling, and integration tests. * fix(emrserverless): disambiguate local endpoint routing using SigV4 auth header * fix(emrserverless): resolve bot feedback on ARNs, idempotency, updates, and list controls * fix(emrserverless): resolve bot feedback on idempotency races and dropped update fields * fix(emrserverless): add jobLevelCostAllocationConfiguration to updates * fix(emrserverless): retain nested configuration fields using dynamic properties * fix(emrserverless): add required field validation and correct 404 status code * docs(emrserverless): document unsupported tagging APIs * fix(emrserverless): increase ListApplications maxResults limit to 100 * test(emrserverless): fix integration test assertions to align with required field validations and correct 404 status code * fix(emrserverless): revert ListApplications maxResults limit to 50 to match AWS limits * test(emrserverless): add validation tests for CreateApplication required fields |