chore: add a pure C worker example#174
Draft
jfonseca-aneo wants to merge 1 commit into
Draft
Conversation
aneojgurhem
reviewed
Apr 28, 2026
Comment on lines
+25
to
+27
| # Clone and build the SDK from the feature branch (introduces ARMONIK_STATUS_RETRY) | ||
| ARG SDK_BRANCH=jf/retryExcep | ||
| RUN git clone --branch "${SDK_BRANCH}" --depth 1 \ |
Contributor
There was a problem hiding this comment.
note: change it when release is available
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The ArmoniK C++ SDK already provides a worker wrapper in C++. This adds a sample showing how to write a worker usingthe lower-level C ABI (
ArmoniKSDKInterface.h) directly, without the C++ SDK worker wrapper. This is useful for users who want to implement workers in pure C or in any language that can expose a C-compatible shared library.Description
Adds a new
cpp/HelloWorldCsample. The worker is a pure C shared library that implements the fivearmonik_*functions from
ArmoniKSDKInterface.h:armonik_create_service/armonik_destroy_servicearmonik_enter_session/armonik_leave_sessionarmonik_call— dispatches onfunction_nameto demonstrate three behaviors:hello: appends" World!"to the payload and returnsARMONIK_STATUS_OKerror: returnsARMONIK_STATUS_ERROR(permanent task failure, no retry)retry: returnsARMONIK_STATUS_RETRY(transient failure, ArmoniK reschedules up tomax_retries)The client is written in C++ using the existing ArmoniK C++ SDK and selects the behavior via
--error/--retryCLI flags.
Testing
Tested end-to-end against a local ArmoniK deployment with a
cppdynamicpartition:hello): task completes successfully, result is"Hello, World!".--error): task fails permanently withTASK_STATUS_ERROR: Permanent error requested by client.--retry): task is retried three times (max_retries=3) then fails with the transient errormessage.
Expected outputs for all three modes are documented in the README.
Impact
ArmoniKSDKInterface.his the only compile-time dependency.Additional Information
.sofilename must not include an SDK version suffix (unlike C++ SDK workers), because the dynamicworker loads it by the exact name passed in
TaskOptions.Checklist