Deploying a sample worker
In this step, a sample worker container is used.
The sample container can handle a few sample commands:
- testCommand
- echo
- utcNow
Add worker to the configuration file
taskurai-tasks-sample/Taskurai.yaml
options:
taskurai:
accountId: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
instanceId: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
deployment:
deploySecrets: false
state:
defaultStateStore: DefaultStateStore
hubs:
DefaultHub:
description: Default Compute and State Hub
type: External
kind: AzureManagedHub
stateStores:
DefaultStateStore:
type: DefaultStateStore
kind: Dedicated
environment:
- name: accountName
secretReference:
value: default
- name: storageTier
secretReference:
value: Standard_LRS
- name: containerName
secretReference:
value: default
hub: DefaultHub
workers:
SampleWorker:
container:
imageName: taskurai-worker-sample
image: arcbuildbypublicsamplesprdweu.azurecr.io/taskurai-worker-sample:latest
resourceAllocation: Cpu_0_25_Memory_0_5Gi
scaling:
scaleOutTaskCount: 100
minInstances: 0
maxInstances: 2
environment:
- name: ENV_VARIABLE_TEST
value: test123
options:
hub: DefaultHub
cleanupCompletedTasksAfterSeconds: 2592000
Deploy worker to Taskurai
taskurai worker deploy
Testing your setup
To verify that the worker has been successfully deployed to Taskurai, use the following command:
taskurai worker show --name SampleWorker
When the deployment is successful, you should see output similar to the following:
# Signed into Taskurai
SampleWorker
├── General
│ └── ╭──────────────────────┬──────────────╮
│ │ Setting │ Value │
│ ├──────────────────────┼──────────────┤
│ │ Name │ SampleWorker │
│ │ Provisioning State │ Succeeded │
│ │ Import Configuration │ null │
│ ╰──────────────────────┴─ ─────────────╯
├── Container
│ └── ╭───────────────────────────┬────────────────────────────────────────────────────────────────────────╮
│ │ Setting │ Value │
│ ├───────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ │ Image Name │ taskurai-worker-sample │
│ │ Image │ arcbuildbypublicsamplesprdweu.azurecr.io/taskurai-worker-sample:latest │
│ │ Resource Allocation │ Cpu_0_25_Memory_0_5Gi │
│ │ Server │ null │
│ │ User Name │ null │
│ │ Password Secret Reference │ null │
│ ╰───────────────────────────┴────────────────────────────────────────────────────────────────────────╯
├── Scaling
│ └── ╭──────────────────────┬───────╮
│ │ Setting │ Value │
│ ├──────────────────────┼───────┤
│ │ Scale Out Task Count │ 100 │
│ │ Min Instances │ 0 │
│ │ Max Instances │ 2 │
│ ╰──────────────────────┴───────╯
├── Secrets
│ └── ╭─────────╮
│ │ Secrets │
│ ╰─────────╯
├── Environment
│ └── ╭───────────────────┬─────────────────┬─────────┬──────────╮
│ │ Name │ SecretReference │ Value │ Imported │
│ ├───────────────────┼─────────────────┼─────────┼──────────┤
│ │ ENV_VARIABLE_TEST │ null │ test123 │ null │
│ ╰───────────────────┴─────────────────┴─────────┴──────────╯
├── Commands
│ └── ╭────────────────────╮
│ │ Commands │
│ ├────────────────────┤
│ │ echo │
│ │ TestCommand │
│ │ TestCommand2 │
│ │ TestTimeoutCommand │
│ │ UtcNow │
│ ╰────────────────────╯
└── Options
└── Options
├── General
│ └── ╭───────────────────────────────────────┬───────────────────╮
│ │ Setting │ Value │
│ ├───────────────────────────────────────┼───────────────────┤
│ │ Auto Register Commands │ true │
│ │ Cleanup Completed Tasks After Seconds │ 2592000 │
│ │ Cleanup State After Seconds │ null │
│ │ Command Stale Timeout Seconds │ 60 │
│ │ Command Timeout Seconds │ 300 │
│ │ Default State Store │ DefaultStateStore │
│ │ Inline Step Retry Delay Threshold Sec │ 60 │
│ │ Max Concurrent Tasks │ 1 │
│ │ Queue Reader Idle Interval Msec │ 1000 │
│ │ Queue Reader Interval Msec │ -1 │
│ │ Use System Assigned Identity │ null │
│ │ Stale Tasks After Seconds │ 3600 │
│ │ Hub │ DefaultHub │
│ │ Workload Profile Name │ null │
│ ╰───────────────────────────────────────┴───────────────────╯
└── User Assigned Identities
└── ╭────────────────────────╮
│ UserAssignedIdentities │
╰────────────────────────╯