Area: Deployment Issues
Sub-Area: Remote Executor / AWS Fargate Ephemeral Storage
Applies to: Cloud
Issue
Ingestion runs on a Remote Executor deployed on AWS Fargate fail because the task runs out of ephemeral disk. The Remote Executor is a DataHub Cloud feature that you deploy and run in your own environment.
You Might Be Asking
- How do I increase the ephemeral storage for my Fargate Remote Executor?
- What is the default Fargate ephemeral storage?
- How do I see how much disk a run used?
- How do I make runs use less disk?
Cause
If you don't set ephemeral_storage in the Terraform module, the Fargate task gets the Fargate default of 20 GiB.
The executor uses that disk for three things:
- Dynamic venvs. The executor builds one per run under
/tmp/datahub/ingest/<execution-id>/and deletes it when the run ends. - The uv package cache.
- Per-execution logs under
/tmp/datahub/logs/. These stay after the run until the log garbage collector prunes them (14 days or a 10000 MB cap by default).
If the largest venv, the cache and the retained logs together exceed the disk, runs fail.
Solution
-
Check free disk. Each ingestion run's CLI report has a
disk_infoentry with the keystotal,used,used_initally(spelled this way in the code) andfree. They are measured on the container root filesystem/only.used_initallyis the usage at the first measurement. A lowfreevalue means the root filesystem was nearly full while the run ran, which fits a task that is out of disk. -
Set
ephemeral_storagein the Terraform module. The input takes{ size_in_gib = N }. Size it for the largest single venv, plus the uv cache, plus the retained-log budget. Pin the module with?ref=<tag>. Module tags and image tags are versioned independently. See Deploy on Amazon ECS for the module inputs.
module "datahub_remote_executor" {
source = "git::https://github.com/acryldata/datahub-terraform-modules.git//remote-ingestion-executor?ref=<tag>"
datahub = {
url = "https://<company>.acryl.io/gms"
executor_pool_id = "remote"
}
# Store the Remote Executor token in Secrets Manager yourself.
secrets = [
{ name = "DATAHUB_GMS_TOKEN", valueFrom = "<secret-arn>" }
]
task_exec_secret_arns = ["<secret-arn>"]
create_task_exec_iam_role = true
subnet_ids = ["<subnet-id>"]
ephemeral_storage = {
size_in_gib = <size>
}
}
create_task_exec_iam_role defaults to false. Without it the task can't pull the image, write logs or read the token, so it doesn't launch. Never pass the token through environment.
-
Run
terraform apply. -
Reduce disk use (optional).
- Set the source's CLI Version (under Advanced in the source settings) to
bundled. The run then uses a pre-built, read-only venv under/opt/datahub/venvs/<plugin>-bundled. It installs nothing at runtime and adds no ephemeral-storage growth. An empty value,latestor a specific version builds a dynamic venv instead. If the plugin isn't bundled in the image, the run also falls back to a dynamic venv. See Bundled and dynamic ingestion venvs. - Lower the log retention.
DATAHUB_EXECUTOR_LOG_GC_RETENTION_DAYSdefaults to 14 andDATAHUB_EXECUTOR_LOG_GC_MAX_DIR_SIZE_MBdefaults to 10000. On Terraform, add them to the module'senvironmentinput as[{ name = "...", value = "..." }]. On CloudFormation, use the Environment Variables parameter, in the formENV_VAR_NAME=ENV_VAR_VALUE. - The Terraform module and CloudFormation template default to
UV_LINK_MODE=hardlink. Hardlinks only work if the uv cache and/tmp/datahub/ingestare on the same filesystem. Otherwise uv copies, and every venv costs its full size. - Reclaim cache space with
uv cache prune.
- Set the source's CLI Version (under Advanced in the source settings) to
-
Verify. Re-run the failing source and check
disk_infoin the run report for free space.
CloudFormation users: You update the stack yourself, in place. In the CloudFormation console, select the stack, choose Update, Replace current template, upload the latest template, change parameters, acknowledge the IAM capabilities and choose Update stack. Unchanged parameters keep their values, and the ECS service rolls the task.
The documented template parameters are ExecutorPoolId, VPCID, SubnetID, DataHubBaseUrl and DataHubAccessToken, plus the optional executor version, Source Secrets and Environment Variables. None of them sets ephemeral storage or disk size. The Terraform module documents the ephemeral_storage input, and it builds the same ECS/Fargate stack. To get more disk than the template gives you, deploy with the Terraform module. To use the step 4 options on CloudFormation, set the Environment Variables parameter.