Running outside AWS
How to run temperwork's workers on GPUs outside AWS, such as a RunPod pod, while your queues and data stay in your AWS account. The same steps work for any machine that can't be given an AWS role: Kubernetes outside EKS, a machine in another cloud, a workstation.
Set up the AWS side first (Running on AWS), with the entries you'll run this way left at instances = 0.
What a worker needs
Wherever it runs, a worker only reaches four things, and every connection goes out from it:
Its queue, to take work.
The control bucket, to read the run records temperwork wrote and update them.
The data bucket, to read inputs and write outputs.
temperwork.com, to enroll once, then hold a lease for its certificate.
temperwork itself only talks to the queues and the control bucket, so it doesn't matter to temperwork where the worker runs.
Giving it AWS access
A machine outside AWS can't be given a role, so it gets the keys of an IAM user that may only assume a role with the workers' permissions. The worker uses the keys for that and nothing else, works with the role's short-lived credentials from then on, and removes the keys from its environment, so nothing it starts sees them.
The module's own workers' role trusts only EC2, so make one of your own:
A role with the workers' permissions. Attach the module's
worker_policy_jsonoutput to a new IAM role, and let your IAM user assume it in its trust policy.An IAM user that can only assume it. Give the user one policy and create an access key for it:
{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "<your workers' role ARN>"}]}
Starting it
Use the image's customer-prod-latest tag from ghcr.io/temperwork (public, no sign-in; ghcr.io/temperwork/qwen-image-edit-2511:customer-prod-latest for Qwen Image Edit 2511), and give it its settings as environment variables (on RunPod, the pod's or its template's). They are the module's worker_env output, the entry's own settings from its workers output, and the keys:
STUDIO_URL=https://temperwork.com
STUDIO_CONNECTION_ID=acme # the environment's id in temperwork
STUDIO_CONTROL_URI=s3://acme-control/.studio/
STUDIO_LORA_URI=s3://acme-data/temperwork/loras/
AWS_REGION=us-west-2
STUDIO_POD_MODEL=qwen-image-edit-2511 # this entry's settings (workers.edit.env)
STUDIO_POD_RUNS=inference
STUDIO_QUEUE_URL=https://sqs.us-west-2.amazonaws.com/123456789012/acme-edit.fifo
STUDIO_MODEL_QUEUE_URL=https://sqs.us-west-2.amazonaws.com/123456789012/acme-edit.fifo
STUDIO_QUEUE_ID=conn:acme:model:qwen-image-edit-2511
STUDIO_AWS_ROLE_ARN=arn:aws:iam::123456789012:role/acme-workers-outside-aws
AWS_ACCESS_KEY_ID=AKIA...
AWS_SECRET_ACCESS_KEY=...
STUDIO_ENROLL_TOKEN=twk1.... # the environment's card: Make an enrollment tokenA judge worker takes the module's judge_worker.env settings instead of an entry's, or runs as temperwork-worker judge-worker with the flags in judge_worker_args.
/opt/qwen/temperwork-worker check inside the pod enrolls if it needs to, takes one lease and prints what it found. The pod shows on the Workers page as runpod-<pod id> once it heartbeats.
Seeing the files
The same as on AWS: your browser opens files from signed links that work only through your S3 VPC endpoint, so it must be in your VPC or on a VPN into it. Where the workers run doesn't change that.
When the pod goes
A pod lasts as long as there is work. When its queue is empty it removes itself from RunPod (STUDIO_POD_IDLE_S keeps it waiting a while first). If a pod dies mid-run, its message comes back to the queue within five minutes and another worker takes the run over. The keys are kept in the pod's settings on RunPod, so rotate the IAM user's key if they may have been seen, and delete it when you stop running there.