Client SDKs
Armada's client SDKs give application developers language-specific access to the same job, queue, status, health, and event contracts. Java, Python, .NET, Rust, and Scala clients use generated protocol types around gRPC services so that applications can submit and control work, inspect its state, and follow job-set progress without defining their own wire format. See Protobuf APIs and events for the shared service and event model.
Shared client model
Each SDK follows the same broad application flow: create a connection, build a request from Armada's contract types, call a service, and consume a response or event stream. The language surface differs, but the server-facing concepts remain queue, job set, job, job run, and event.
The SDKs expose these capability groups:
| Capability | Application purpose |
|---|---|
| Job submission | Send one or more pod-based job requests to a queue and job set. |
| Job control | Cancel, preempt, or change the priority of submitted jobs where the client supports the operation. |
| Job inspection | Read job states, details, run details, and errors. |
| Event watching | Receive state and lifecycle changes for a job set as a stream. |
| Queue access | Create, update, read, list, or delete queues in clients that expose queue operations. |
| Health checks | Check whether the submit or event service reports itself as serving. |
| Authentication and transport | Connect with plaintext or secure transport and attach credentials according to the client API. |
The request types carry Kubernetes pod specifications because Armada schedules Kubernetes-shaped workloads. The clients therefore expose generated Kubernetes types or accept the generated contract messages directly rather than replacing the pod model with a language-only abstraction.
Client capability profiles
The five clients do not expose identical breadth. Python and the generated .NET surface are closest to the full contract, while the Java and Scala wrappers focus on common job, queue, health, and event use. Rust combines an async application API with generated service clients for submission, control, queue, retry-policy, job-query, and event operations.
| Client | Main application shape | Notable surface |
|---|---|---|
| Java | Blocking calls plus callback-based event streaming | Submission, cancellation, status, queue reads, health, and event streams. |
| Python | Synchronous and AsyncIO clients | Job control, job and run queries, queue management, health, event streams, typed event conversion, and a separate log client. |
| .NET | Direct generated gRPC clients | Applications use generated service clients and protobuf messages. The client tests exercise health, submission, cancellation, queue lookup, errors, and event watching against an in-process gRPC server. |
| Rust | Async client with typed request helpers and generated service clients | Submission, job-set control, queue and retry-policy services, job queries, event watching, auth providers, TLS choices, deadlines, and compile-time job request construction. |
| Scala | Blocking and Future-based calls | Submission, status, cancellation, queue access, health, and job-set event watching. |
Job submission and control
Job submission turns a queue name, a job-set identifier, and one or more Kubernetes pod specifications into a server request. The server returns a result for each item, including its assigned job ID or an error. This lets applications submit a batch and then use the returned IDs or the shared job-set identifier for later control and observation.
The clients make the common request shapes fit their host language:
- Java and Scala build generated protobuf messages with language-native builders and setters.
- Python provides helpers for queue and job request items while still returning protobuf messages.
- .NET uses generated message classes and service clients directly.
- Rust provides a typed job-item builder and re-exports the request and Kubernetes types from the crate's public API. Its generated service clients also expose the shared submit, queue, retry-policy, and job-query contracts.
Control operations act on a job ID, a set of job IDs, or a whole job set. The shared contract also supports state filters for job-set cancellation and priority changes for selected jobs or a job set. Applications should treat the returned response or gRPC status as the result of the request rather than assuming that a call means that every target reached a final state.
Job state and event observation
Job queries provide point-in-time views. Event watching provides an ordered stream of changes for a job set, with each message carrying an event ID and one event variant such as submitted, queued, running, succeeded, failed, cancelled, or preempted. Together, the query and event interfaces support both initial state reads and live progress tracking.
The event flow is shared across the SDKs even when its host-language form differs. This diagram shows the normal relationship between submission, watching, and state inspection.
flowchart LR
A[Application builds job request] --> B[Submit service]
B --> C[Job IDs and submit result]
A --> D[Event service watches job set]
D --> E[Lifecycle event stream]
E --> F[Application updates its view]
F --> G[Job query for current details or errors]
C --> G
Python adds a typed Event view over the protobuf event. Its synchronous and AsyncIO clients also reconnect an event stream after a read timeout and resume from the last message ID. The Python package targets Python 3.10 or newer and publishes type information with the client package. Rust returns the stream and makes reconnection the caller's responsibility; callers preserve the last event ID and pass it when they create the next watch. Java and Scala expose generated event messages through blocking iterators or callback-oriented APIs.
Connection and authentication
Connection setup is part of each SDK's contract because the application must choose the transport and credential behavior before it calls a service. Plaintext is available for local or in-cluster use in the clients that provide explicit transport choices. Secure transport is available for deployed endpoints, and credentials are sent through the gRPC authorization metadata.
The SDKs use different connection ownership patterns:
- Java owns a managed channel and closes it through
AutoCloseable. - Python receives a gRPC channel from the application, so channel lifetime stays with the caller.
- .NET applications create a
GrpcChanneland use generated clients against it. - Rust creates an async channel through its connection methods. A client is cheap to clone and can be shared across async tasks.
- Scala can accept a managed channel or build one from host, port, SSL, and an optional bearer token.
Rust makes credential retrieval an explicit provider contract. A provider can return a static bearer value, Basic authentication, or a refreshed value for each call. The other wrappers shown here mainly attach a bearer token at channel creation, or leave channel and credential setup to the application and generated gRPC client.
Language-specific application surfaces
Java client
The Java client is a small synchronous wrapper around generated gRPC stubs. It gives Java applications direct methods for submit, cancel, status, queue reads, health, and event access; event access is either an iterator for blocking consumption or a StreamObserver callback for asynchronous delivery. The client is closed to release its managed channel.
References: client/…/ArmadaClient.java• L28-99 client/…/SubmitJob.java• L18-53 client/…/StreamEvents.java• L28-71
Python client
The Python package offers both a synchronous ArmadaClient and an ArmadaAsyncIOClient, with matching job, queue, health, and event concepts in synchronous and asynchronous forms. It targets Python 3.10 or newer and publishes type information so application code can use the package's typed surface. It also supplies request helpers for queue and pod-based job messages, converts raw event messages into an Event view, and provides JobLogClient for retrieving timestamped job log lines through the log service.
References: client/…/pyproject.toml• L1-14 client/…/pyproject.toml• L38-41 client/…/client.py• L93-150 client/…/client.py• L168-252 client/…/client.py• L254-459 client/…/asyncio_client.py• L92-155 client/…/event.py• L7-31 client/…/log_client.py• L15-42
.NET client
The .NET package exposes the generated C# contract types and gRPC service clients as a netstandard2.0 library. It includes the Armada and Kubernetes protobuf types needed to form requests, while applications choose the channel credentials and call the generated clients. The client test suite now uses a .NET 10 in-process gRPC server with hand-written service bindings, so it checks the client against the contract without a running Armada deployment. The tests cover health, submission, cancellation, queue lookup, a missing-queue error, and a job-set event stream.
References: client/…/ArmadaProject.Io.Client.csproj• L1-45 client/…/ArmadaProject.Io.Client.Test.csproj• L1-19 client/…/MockServer.cs• L43-90 client/…/MockServer.cs• L93-253 client/…/Tests.cs• L20-41 client/…/Tests.cs• L43-186
Rust client
The Rust crate is an async gRPC client for job submission, cancellation, and job-set event watching. It re-exports the shared Armada and Kubernetes contract types, including pod, networking, metadata, resource-quantity, and integer-or-string types, so Rust applications can describe Kubernetes-shaped jobs and related services with the same contract as the server. It adds auth and error types, and offers connection methods for plaintext, system-root TLS, or caller-supplied TLS configuration. Its generated contract layer also provides async clients for queue management, retry policies, submission control, event watching, and job queries. Its builder requires a pod specification before a job item can be built, which moves a key request rule into the Rust type system. The generated run-details contract includes the pod name for each run, so Rust callers can identify the run's pod when the service supplies that value.
References: client/…/lib.rs• L1-5 client/…/lib.rs• L58-72 client/…/lib.rs• L74-89 client/…/lib.rs• L181-197 client/…/client.rs• L16-24 client/…/client.rs• L86-128 client/…/client.rs• L213-270 client/…/client.rs• L374-470 client/…/builder.rs• L14-20 client/…/api.rs• L2286-2314 client/…/api.rs• L1260-1610 client/…/api.rs• L2128-2284 client/…/api.rs• L2473-2696 client/…/k8s.io.api.core.v1.rs• L3952-3976 client/…/k8s.io.api.core.v1.rs• L4746-4786 client/…/k8s.io.api.networking.v1.rs• L113-153 client/…/k8s.io.apimachinery.pkg.api.resource.rs• L2-5 client/…/k8s.io.apimachinery.pkg.apis.meta.v1.rs• L460-480 client/…/k8s.io.apimachinery.pkg.util.intstr.rs• L2-19
Scala client
The Scala client wraps ScalaPB-generated messages and gRPC stubs in a compact API. It supports blocking submission, status, queue, and health calls alongside Future-based cancellation and health calls, and it exposes job-set events as a Scala iterator with a resume message value. Connection construction supports a supplied managed channel, plaintext or SSL transport, and an optional bearer token.
References: client/…/ArmadaClient.scala• L25-89 client/…/ArmadaClient.scala• L91-129 client/…/Job.scala• L10-52
Contract evolution across SDKs
The protobuf definitions are the shared source of the request, response, enum, and event meaning. Each SDK generates or consumes language-specific types from those definitions, so a contract change must reach the generated surface and any hand-written wrapper that presents it to applications.
The most important compatibility boundary is the job request. The contract keeps the singular pod field for compatibility while the repeated pod-spec field is the current form used by the language examples and the Rust builder. Event consumers must also handle the event variants defined by the oneof; a new event variant can appear without changing the stream envelope. The generated Rust surface follows the current service definitions, including queue, retry-policy, job-query, submission-control, and event clients, and carries the Kubernetes types needed by pod and service-related job fields. Run details also carry the pod name when it is available, which gives clients a stable link from a run to its Kubernetes pod.
For the relationship between these SDKs and the underlying service definitions, continue to Protobuf APIs and events. For the wider contract map, see the parent page Platform contracts and clients.
Change checklist
When these files or sections are changed, remember to consider these:
- Update every generated-language client when a field, enum, service, or event
oneofchanges in pkg/…/*.proto. - Check hand-written wrappers for stale method coverage when a new RPC is added, especially the Java, Python, Rust, and Scala façades.
- Preserve the job request rule that current callers use repeated
pod_specswhile legacy singular fields remain available for compatibility. - Review event resume behavior when event IDs or watch request fields change. Python reconnects itself, while Rust callers manage the resume cursor.
- Keep Kubernetes protobuf versions and package paths aligned with the embedded pod and resource types exposed by each SDK.
- Recheck channel ownership and authorization behavior when transport or auth metadata changes. The clients do not all own channels in the same way.
- Keep the Python package's supported interpreter range and published type metadata aligned with the public client surface.
- Regenerate the Rust service clients when the shared service set changes, then check that the hand-written Rust façade exposes the intended subset.
- Keep the .NET in-process mock bindings and test cases aligned with the generated RPC names and message types they validate.
- Preserve the run-details pod-name field when query contracts change so Rust callers can still map a run to its pod.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A client sends a job request without the pod specification required by the contract | The server rejects the item or the Rust builder prevents construction | Supply pod_specs or use the Rust job request builder before submission. |
| An event consumer drops its stream without retaining the last message ID | Reconnection can miss the intended resume point or replay work | Store each received event ID and use the SDK's resume field when reconnecting. |
| An application uses a client method that does not match the chosen transport or channel ownership model | Calls fail at connection time or the channel remains open after use | Select the client's supported connection mode and close or retain the channel according to that SDK's ownership model. |
| A protobuf contract changes without regenerating or updating a wrapper | A client cannot compile or silently lacks the new contract capability | Treat the protobuf files, generated types, and hand-written façade as one change boundary. |
| An authorization value is missing or attached in the wrong form | Armada returns an authentication or permission error | Configure the channel or token provider with the complete scheme-prefixed authorization value required by the deployment. |
| A .NET mock binds an RPC with the wrong service or message shape | Client tests fail before they can check the intended behavior | Keep the mock binding descriptors and service methods aligned with the generated contract. |
| A caller assumes every run has a reported pod name | The caller shows an empty pod link or cannot identify older or not-yet-started runs | Treat the pod name as empty until the service supplies it and use the service's documented fallback behavior where applicable. |
Key files
| File | Why to read it |
|---|---|
| pkg/…/submit.proto | Defines job submission, control, queue, and submit-service contracts shared by the SDKs. |
| pkg/…/event.proto | Defines event variants, event IDs, watch requests, and the event service. |
| pkg/…/job.proto | Defines point-in-time job and run queries and state responses. |
| client/…/ArmadaClient.java | Shows the Java wrapper's common blocking and streaming surface. |
| client/…/pyproject.toml | Defines the Python package's supported interpreter range, gRPC dependencies, and published type metadata. |
| client/…/client.py | Shows the broad synchronous Python application API. |
| client/…/asyncio_client.py | Shows the asynchronous Python surface and stream behavior. |
client/DotNet/ArmadaProject.Io.Client/ArmadaProject.Io.Client.csproj | Shows the .NET package boundary and contract generation inputs. |
| client/…/MockServer.cs | Shows the in-process gRPC contract used to validate generated .NET clients. |
| client/…/Tests.cs | Shows the .NET health, submit, control, queue, error, and event checks. |
| client/…/lib.rs | Shows the Rust public contract types and client exports. |
| client/…/client.rs | Shows Rust connection, auth, submission, cancellation, and event-watch behavior. |
| client/…/builder.rs | Shows the Rust request-construction guarantee for pod-based jobs. |
| client/…/api.rs | Shows the generated Rust messages and async service clients for the shared contract, including run pod names. |
| client/…/k8s.io.api.core.v1.rs | Shows the generated Kubernetes pod and workload types exposed to Rust callers. |
| client/…/k8s.io.api.networking.v1.rs | Shows the generated Kubernetes ingress and networking types used by service-related contracts. |
| client/…/k8s.io.apimachinery.pkg.api.resource.rs | Shows the generated resource quantity types used in Kubernetes-shaped requests. |
| client/…/k8s.io.apimachinery.pkg.apis.meta.v1.rs | Shows generated Kubernetes metadata and label-selector types. |
| client/…/k8s.io.apimachinery.pkg.util.intstr.rs | Shows the generated Kubernetes value type that accepts either an integer or a string. |
| client/…/ArmadaClient.scala | Shows the Scala wrapper and its connection variants. |