Area: Remote Executor Sub-Area: Deployment
Applies to: Cloud
Issue
You want to deploy the DataHub Remote Executor on Amazon ECS with the AWS CLI. You may be a DevOps engineer who doesn't know DataHub, or a DataHub admin who can't deploy AWS resources yourself.
You Might Be Asking
- What do I need before I run
create-stack? - Why does my ECS task never start or never pull the image?
- Why does the pool not show as Active in DataHub?
Cause
The Remote Executor runs in your own AWS account. The image is in a private DataHub Cloud registry, so the deployment needs more than the CloudFormation command. You need registry access from DataHub, a Remote Executor token, a pool, and a network that allows outbound HTTPS.
Solution
This walkthrough follows the Deploy on Amazon ECS section of the setup guide.
Who does what
- Step 1 (registry access): Whoever has the AWS account ID and the DataHub relationship does this.
- DataHub user: Do step 2. You need the Manage Metadata Ingestion platform privilege to create the pool. To create the Remote Executor token, you also need the Generate Personal Access Tokens privilege. Without it, the Generate new token menu on Settings > Access Tokens is disabled. If you don't have AWS access, send this article to your DevOps or cloud infrastructure team, and give them the DataHub URL, the token and the pool identifier.
-
AWS admin: Do steps 3, 4, 5 and 6. The template creates an ECS cluster with one remote ingestion task and an IAM role. The command passes
CAPABILITY_NAMED_IAM, so the AWS identity that runscreate-stackmust be allowed to create IAM roles and ECS resources. DataHub doesn't publish an exact IAM action list.
Step 1: Give DataHub your AWS account ID
Send your AWS account ID to your DataHub representative, or share it through a secure sharing service such as One Time Secret. This lets your account pull the executor image from the private DataHub Cloud ECR. Without it, the ECS task can't pull the container and never starts.
Step 2: Get your DataHub connection details
-
DataHub URL: Copy your DataHub Cloud URL and add
/gmsto the end, for examplehttps://mycompany.acryl.io/gms. The/gmssuffix is mandatory. - Access token: In DataHub, go to Settings > Access Tokens > Generate new token. Set the type to Remote Executor and copy the token. Don't use a personal access token.
-
Pool: Go to Data Sources (left sidebar) > Executors tab > Create. Enter a Pool Identifier (for example
remote) and an optional Description. Default Pool is optional. Click Create. You pass the identifier to the stack asExecutorPoolId.
See Configuration Prerequisites.
Step 3: Choose your AWS network
You need an existing VPC and one or more subnets with outbound HTTPS (port 443) egress. A private subnet needs a NAT gateway. Pick a subnet that meets this. Don't take the first subnet of the default VPC without checking.
The executor needs outbound access only, with no inbound access. It must reach:
https://<company>.acryl.io/*https://sqs.*.amazonaws.com/*- a Python package index
- the container registry that hosts the image
Note the AWS region, the VPC ID and the subnet ID.
Step 4: Download the template
curl -O https://raw.githubusercontent.com/acryldata/datahub-cloudformation/master/remote-executor/datahub-executor.ecs.template.yaml
Run the next step from the folder that holds this file.
Step 5: Deploy the stack
Replace the values and run the command. It deploys the downloaded file with --template-body file://.
aws --region <region> cloudformation create-stack \
--stack-name datahub-remote-executor \
--template-body file://datahub-executor.ecs.template.yaml \
--capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_NAMED_IAM \
--parameters \
ParameterKey=ExecutorPoolId,ParameterValue="remote" \
ParameterKey=VPCID,ParameterValue="<vpc>" \
ParameterKey=SubnetID,ParameterValue="<subnet>" \
ParameterKey=DataHubBaseUrl,ParameterValue="https://<company>.acryl.io/gms" \
ParameterKey=DataHubAccessToken,ParameterValue="<token>"
You can also deploy the same template from the CloudFormation console.
The executor version parameter is optional and defaults to latest. To pin a version, set it to a Remote Executor image listed under "Recommended Versions" in the release notes for your DataHub Cloud version. Image tags look like v2.4.4-cloud.
Step 6: Verify it worked
- In DataHub, go to Data Sources (left sidebar) > Executors. Your pool shows its executors with a status of Active or Stale, the last reported time and the running tasks.
- In the AWS console, go to ECS > Cluster > your stack > Services > Logs. Look for
Starting datahub executor worker.
Troubleshooting
GMS returned no executor configs
The worker logs GMS returned no executor configs, unable to proceed. when GMS returns no pool that is serving and not embedded. The worker retries until it gets a config. Check Data Sources > Executors to confirm your pool exists, and check the settings from Step 2 and the checklists below.
Connection failed
Check network connectivity, the DataHub URL, the Executor Pool ID and the access token.
Secret access failed
Check the secret ARNs or names, the permissions and the secret format.
Container failed to start
Check resource limits, registry access (Step 1) and the container logs.