API Reference

class ArmoniKApiException : public std::runtime_error

Subclassed by armonik::api::common::exceptions::ArmoniKTaskError, armonik::api::common::exceptions::ArmoniKTaskNotCompletedException

Public Functions

inline explicit ArmoniKApiException(const std::string &message)
class ArmoniKTaskError : public armonik::api::common::exceptions::ArmoniKApiException

Public Functions

inline explicit ArmoniKTaskError(const std::string &message, const armonik::api::grpc::v1::TaskError &task_error)
inline const char *what() const noexcept override
inline const std::string &taskId()
inline const std::vector<std::pair<std::string, std::string>> &error_details()

Private Members

std::string details
std::string taskId_
std::vector<std::pair<std::string, std::string>> status_details
class ArmoniKTaskNotCompletedException : public armonik::api::common::exceptions::ArmoniKApiException

Public Functions

inline explicit ArmoniKTaskNotCompletedException(const std::string &taskId, const std::string &message = "")

Public Members

const std::string taskId
class ArmoniKWorker : public armonik::api::grpc::v1::worker::Worker::Service

Subclassed by TestWorker

Public Functions

ArmoniKWorker(std::unique_ptr<armonik::api::grpc::v1::agent::Agent::Stub> agent)

Constructs a ArmoniKWorker object.

::grpc::Status Process(::grpc::ServerContext *context, const ::armonik::api::grpc::v1::worker::ProcessRequest *request, ::armonik::api::grpc::v1::worker::ProcessReply *response) override

Implements the Process method of the Worker service.

Parameters:
  • context – The ServerContext object.

  • request – The Process request

  • response – The ProcessReply object.

  • context – The ServerContext object.

  • reader – The request iterator

  • response – The ProcessReply object.

Returns:

The status of the method.

Returns:

The status of the method.

virtual ProcessStatus Execute(TaskHandler &taskHandler) = 0

Function which does the actual work.

Parameters:

taskHandler – Task handler

Returns:

Process status

::grpc::Status HealthCheck(::grpc::ServerContext *context, const ::armonik::api::grpc::v1::Empty *request, ::armonik::api::grpc::v1::worker::HealthCheckReply *response) override

Implements the HealthCheck method of the Worker service.

Parameters:
  • context – The ServerContext object.

  • request – The Empty object.

  • response – The HealthCheckReply object.

Returns:

The status of the method.

Private Members

armonik::api::common::logger::Logger logger_
std::unique_ptr<armonik::api::grpc::v1::agent::Agent::Stub> agent_
class ChannelFactory

Public Functions

explicit ChannelFactory(armonik::api::common::utils::Configuration configuration, common::logger::Logger &logger)

Creates a channel factory from the given configuration.

Parameters:
  • configuration – The channel configuration

  • logger – The logger

std::shared_ptr<::grpc::Channel> create_channel()

Creates the new gRPC channel.

Returns:

New channel

bool isSecureChannel() const noexcept
Returns:

A bool on whether the gRPC channel is secure or not

Private Members

armonik::api::common::logger::LocalLogger logger_
std::shared_ptr<::grpc::ChannelCredentials> credentials_ = {nullptr}
std::string endpoint_
armonik::api::common::utils::Configuration configuration_
bool is_secure_ = {false}
class ClefFormatter : public armonik::api::common::logger::IFormatter

Formatter for CLEF (Compact Log Event Format)

Public Functions

inline virtual std::string format(Level level, absl::string_view message, const Context &global_context, const Context &local_context, const Context &message_context) override

Format log message with context.

Parameters:
  • level – Log level to use for this message.

  • message – Message to write in the log.

  • global_contextContext that is set globally within the logger.

  • local_contextContext set locally.

  • message_contextContext specific to this very message.

Returns:

The formatted message.

class ComputePlane
#include <ComputePlane.h>

The ComputePlane class manages the communication addresses for workers and agents.

Public Functions

inline ComputePlane(const utils::Configuration &configuration)

Constructs a ComputePlane object with the given configuration.

Parameters:

configuration – The Configuration object containing address information.

inline const std::string &get_server_address() const

Returns the server address.

Returns:

A reference to the server address string.

inline grpc_socket_type get_server_socket_type() const

Returns the server socket type.

Returns:

The server socket type as a grpc_socket_type enum value.

inline void set_worker_address(absl::string_view worker_address)

Sets the worker address with the given socket address.

Parameters:

worker_address – The socket address to set for the worker.

inline void set_worker_socket_type(absl::string_view socket_type)

Sets the worker socket type.

Parameters:

socket_type – The socket type string from configuration.

inline void set_agent_address(absl::string_view agent_address)

Sets the agent address with the given agent address.

Parameters:

agent_address – The agent address to set for the agent.

inline void set_agent_socket_type(absl::string_view socket_type)

Sets the worker socket type.

Parameters:

socket_address – The socket type string from configuration.

inline const std::string &get_agent_address() const

Returns the agent address.

Returns:

A reference to the agent address string.

inline grpc_socket_type get_agent_socket_type() const

Returns the agent socket type.

Returns:

The agent socket type as a grpc_socket_type enum value.

Public Static Functions

static inline bool starts_with(absl::string_view s, absl::string_view prefix)
static inline std::string normalize_address(absl::string_view address)

Strips http/https schemes and ensures a valid gRPC address format.

Parameters:

address – The address to normalize, provided as an absl::string_view.

Returns:

The normalized address.

Private Members

std::string worker_address_

The worker address string.

std::string agent_address_

The agent address string.

grpc_socket_type worker_socket_type_
grpc_socket_type agent_socket_type_
struct Configuration

Public Members

int32_t data_chunk_max_size
class Configuration
#include <Configuration.h>

Interface for a configuration class that stores and manages key-value pairs.

Public Functions

Configuration() noexcept = default
Configuration(const Configuration&) = default
Configuration(Configuration&&) noexcept = default
Configuration &operator=(const Configuration&) = default
Configuration &operator=(Configuration&&) noexcept = default
~Configuration() = default
std::string get(const std::string &string) const

Get the value associated with the given key.

Parameters:

string – Key to look up.

Returns:

The value associated with the key, as a string.

void set(const std::string &string, const std::string &value)

Set the value associated with the given key.

Parameters:
  • string – Key to set the value for.

  • value – Value to set for the key.

void set(const Configuration &other)

Set the values from another Configuration object.

Parameters:

otherConfiguration object to copy values from.

const std::map<std::string, std::string> &list() const

List defined values of this configuration.

Note

Does not include environment variables

Configuration &add_json_configuration(absl::string_view file_path)

Add JSON configuration from a file.

Parameters:

file_path – Path to the JSON file.

Returns:

Reference to the current Configuration object.

Configuration &add_env_configuration()

Add environment variable configuration.

Returns:

Reference to the current Configuration object.

options::ComputePlane get_compute_plane() const

Get the current ComputePlane configuration.

Returns:

A ComputePlane object representing the current configuration.

options::ControlPlane get_control_plane() const

Get the current ControlPlane configuration.

Returns:

A ControlPlane object

Private Members

std::map<std::string, std::string> options_

Storage for the key-value pairs.

std::set<std::string> above_env_keys_
bool use_environment_ = false
class ConsoleWriter : public armonik::api::common::logger::IWriter

Console based Writer.

Public Functions

inline virtual void write(Level level, absl::string_view message) override

Write a formatted message to the log.

Thread-safe.

Parameters:
  • level – Log level to use for this message.

  • formatted – formatted message to write.

Private Members

std::mutex mutex_
class Context : public std::map<std::string, std::string>
#include <context.h>

Logger context.

class ControlPlane

Public Functions

ControlPlane(const utils::Configuration &config)
inline absl::string_view getEndpoint() const
inline absl::string_view getUserCertPemPath() const
inline absl::string_view getUserKeyPemPath() const
inline absl::string_view getUserP12Path() const
inline absl::string_view getCaCertPemPath() const
inline bool isSslValidation() const
inline const google::protobuf::Duration &getKeepAliveTime() const
inline const google::protobuf::Duration &getKeepAliveTimeInterval() const
inline const google::protobuf::Duration &getMaxIdleTime() const
inline int getMaxAttempts() const
inline double getBackoffMultiplier() const
inline const google::protobuf::Duration &getInitialBackoff() const
inline const google::protobuf::Duration &getMaxBackoff() const
inline const google::protobuf::Duration &getRequestTimeout() const
inline bool hasClientCertificate() const

Public Static Attributes

static constexpr char EndpointKey[] = "GrpcClient__Endpoint"
static constexpr char UserCertKey[] = "GrpcClient__CertPem"
static constexpr char UserKeyKey[] = "GrpcClient__KeyPem"
static constexpr char UserP12Key[] = "GrpcClient__CertP12"
static constexpr char CaCertKey[] = "GrpcClient__CaCert"
static constexpr char AllowUnsafeConnectionKey[] = "GrpcClient__AllowUnsafeConnection"
static constexpr char KeepAliveTimeKey[] = "GrpcClient__KeepAliveTime"
static constexpr char KeepAliveTimeIntervalKey[] = "GrpcClient__KeepAliveTimeInterval"
static constexpr char MaxIdleTimeKey[] = "GrpcClient__MaxIdleTime"
static constexpr char MaxAttemptsKey[] = "GrpcClient__MaxAttempts"
static constexpr char BackoffMultiplierKey[] = "GrpcClient__BackoffMultiplier"
static constexpr char InitialBackOffKey[] = "GrpcClient__InitialBackOff"
static constexpr char MaxBackOffKey[] = "GrpcClient__MaxBackOff"
static constexpr char RequestTimeoutKey[] = "GrpcClient__RequestTimeout"

Private Members

std::string endpoint_
std::string user_cert_pem_path_
std::string user_key_pem_path_
std::string user_p12_path_
std::string ca_cert_pem_path_
::google::protobuf::Duration keep_alive_time_
::google::protobuf::Duration keep_alive_time_interval_
::google::protobuf::Duration max_idle_time_
int max_attempts_ = {}
double backoff_multiplier_ = {}
::google::protobuf::Duration initial_backoff_
::google::protobuf::Duration max_backoff_
::google::protobuf::Duration request_timeout_
bool sslValidation_
class EventsClient

Public Functions

inline explicit EventsClient(std::unique_ptr<armonik::api::grpc::v1::events::Events::StubInterface> stub)
void wait_for_result_availability(std::string session_id, std::vector<std::string> result_ids)

Private Members

std::unique_ptr<armonik::api::grpc::v1::events::Events::StubInterface> stub
class FileWriter : public armonik::api::common::logger::IWriter

std::ostream -baked Writer

Public Functions

inline FileWriter(std::ostream &out)

Construct a FileWriter from a std::ostream&.

Parameters:

out – Stream to write to

inline virtual void write(Level, absl::string_view message) override

Write a formatted message to the log.

Thread-safe.

Parameters:
  • level – Log level to use for this message.

  • formatted – formatted message to write.

Private Members

std::ostream &out_
std::mutex mutex_
class GuuId
#include <GuuId.h>

The GuuId class provides a static method for generating UUIDs.

Public Static Functions

static inline std::string generate_uuid()

Generates a random UUID string.

This method generates a random UUID string, following the format “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”.

Returns:

A std::string containing the generated UUID.

interface IFormatter
#include <formatter.h>

Formatter interface to use by a logger.

Subclassed by armonik::api::common::logger::ClefFormatter, armonik::api::common::logger::PlainFormatter

Public Functions

virtual ~IFormatter()

Destructor.

virtual std::string format(Level level, absl::string_view message, const Context &global_context, const Context &local_context, const Context &message_context) = 0

Format log message with context.

Parameters:
  • level – Log level to use for this message.

  • message – Message to write in the log.

  • global_contextContext that is set globally within the logger.

  • local_contextContext set locally.

  • message_contextContext specific to this very message.

Returns:

The formatted message.

interface ILogger
#include <base.h>

Logger interface.

Subclassed by armonik::api::common::logger::LocalLogger, armonik::api::common::logger::Logger

Public Functions

virtual ~ILogger()

Destructor.

virtual void log(Level level, absl::string_view message, const Context &message_context = {}) = 0

Write a new message to the log.

Parameters:
  • level – Logging level to use for this message.

  • message – Message to log.

  • message_contextContext specific for this message.

inline void set_level(Level level) noexcept

Set the logging level.

Attention

Not thread safe.

Parameters:

level – Logging level.

inline Level get_level() const noexcept

Get the current logging level.

Attention

Not thread safe.

Returns:

The current logging level.

inline void verbose(absl::string_view message, const Context &message_context = {})

Write a new message to the log with verbose log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void debug(absl::string_view message, const Context &message_context = {})

Write a new message to the log with debug log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void info(absl::string_view message, const Context &message_context = {})

Write a new message to the log with info log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void warning(absl::string_view message, const Context &message_context = {})

Write a new message to the log with warning log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void error(absl::string_view message, const Context &message_context = {})

Write a new message to the log with error log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void fatal(absl::string_view message, const Context &message_context = {})

Write a new message to the log with fatal log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

Protected Functions

ILogger() noexcept = default

Default constructor.

inline explicit ILogger(Level level) noexcept

Constructs a logger with a logging level.

Parameters:

level – Logging level to use for the logger.

Protected Attributes

Level level_ = Level::Info
interface IWriter
#include <writer.h>

Writer interface to use by a logger.

Subclassed by armonik::api::common::logger::ConsoleWriter, armonik::api::common::logger::FileWriter

Public Functions

virtual ~IWriter()

Destructor.

virtual void write(Level level, absl::string_view formatted) = 0

Write a formatted message to the log.

Parameters:
  • level – Log level to use for this message.

  • formatted – formatted message to write.

class LocalLogger : public armonik::api::common::logger::ILogger
#include <local_logger.h>

Logger with a local context.

Public Functions

LocalLogger() = delete
LocalLogger(const LocalLogger&) = delete
LocalLogger &operator=(const LocalLogger&) = delete
LocalLogger(LocalLogger &&other) noexcept = default

Move constructor.

Parameters:

other – Local logger to move.

LocalLogger &operator=(LocalLogger &&other) noexcept = default

Move assignment operator.

Parameters:

other – Local logger to move.

Returns:

This.

~LocalLogger()

Destructor.

void context_add(std::string key, std::string value)

Add a new context entry.

Parameters:
  • key – Name of the entry.

  • value – Value of the entry.

const std::string &context_get(const std::string &key) const

Get Value of a context entry.

Parameters:

key – Name of the entry to fetch.

Returns:

Value of the entry.

void context_remove(const std::string &key)

Remove an entry from the context.

Parameters:

key – Name of the entry to remove.

virtual void log(Level level, absl::string_view message, const Context &message_context = {}) override

Write a new message to the log.

Parameters:
  • level – Logging level to use for this message.

  • message – Message to log.

  • message_contextContext specific for this message.

inline void set_level(Level level) noexcept

Set the logging level.

Attention

Not thread safe.

Parameters:

level – Logging level.

inline Level get_level() const noexcept

Get the current logging level.

Attention

Not thread safe.

Returns:

The current logging level.

inline void verbose(absl::string_view message, const Context &message_context = {})

Write a new message to the log with verbose log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void debug(absl::string_view message, const Context &message_context = {})

Write a new message to the log with debug log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void info(absl::string_view message, const Context &message_context = {})

Write a new message to the log with info log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void warning(absl::string_view message, const Context &message_context = {})

Write a new message to the log with warning log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void error(absl::string_view message, const Context &message_context = {})

Write a new message to the log with error log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void fatal(absl::string_view message, const Context &message_context = {})

Write a new message to the log with fatal log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

Protected Attributes

Level level_ = Level::Info

Private Functions

LocalLogger(IWriter *writer, IFormatter *formatter, const Context *global_context, Context local_context, Level level)

Private Members

IWriter *writer_
IFormatter *formatter_
const Context *global_context_
Context local_context_

Friends

friend class Logger
class Logger : public armonik::api::common::logger::ILogger
#include <logger.h>

Default Logger.

Public Functions

Logger(std::unique_ptr<IWriter> writer, std::unique_ptr<IFormatter> formatter, Level level = Level::Info)

Construct a new logger with custom writer and formatter.

Parameters:
  • writer – Writer used to write log messages.

  • formatter – Formatter used to format log messages with context.

  • level – Logging level to use for the logger.

Logger() = delete
Logger(const Logger&) = delete
Logger &operator=(const Logger&) = delete
Logger(Logger &&other) noexcept = default

Move constructor.

Parameters:

otherLogger to move.

Logger &operator=(Logger &&other) noexcept = default

Move assignment operator.

Parameters:

otherLogger to move.

Returns:

This.

~Logger()

Destructor.

void global_context_add(std::string key, std::string value)

Add a new global context entry.

Attention

Not thread safe.

Parameters:
  • key – Name of the entry.

  • value – Value of the entry.

const std::string &global_context_get(const std::string &key) const

Get Value of a global context entry.

Attention

Not thread safe.

Parameters:

key – Name of the entry to fetch.

Returns:

Value of the entry.

void global_context_remove(const std::string &key)

Remove an entry from the global context.

Attention

Not thread safe.

Parameters:

key – Name of the entry to remove.

void local_context_generator_add(std::string key, std::function<std::string()> value_generator)

Add a new local context generator entry.

Attention

Not thread safe.

Parameters:
  • key – Name of the entry.

  • value_generator – Value generator for the entry.

const std::function<std::string()> &local_context_generator_get(const std::string &key) const

Get Value generator of for a local context entry.

Attention

Not thread safe.

Parameters:

key – Name of the entry to fetch.

Returns:

Value generator for the entry.

void local_context_generator_remove(const std::string &key)

Remove a generator entry from the local context.

Attention

Not thread safe.

Parameters:

key – Name of the entry to remove.

LocalLogger local(Context local_context = {}) const

Create a logger with a local context that references this logger.

Parameters:

local_context – Local context to use.

virtual void log(Level level, absl::string_view message, const Context &message_context = {}) override

Write a new message to the log.

Thread-safe.

Parameters:
  • level – Logging level to use for this message.

  • message – Message to log.

  • message_contextContext specific for this message.

inline void set_level(Level level) noexcept

Set the logging level.

Attention

Not thread safe.

Parameters:

level – Logging level.

inline Level get_level() const noexcept

Get the current logging level.

Attention

Not thread safe.

Returns:

The current logging level.

inline void verbose(absl::string_view message, const Context &message_context = {})

Write a new message to the log with verbose log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void debug(absl::string_view message, const Context &message_context = {})

Write a new message to the log with debug log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void info(absl::string_view message, const Context &message_context = {})

Write a new message to the log with info log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void warning(absl::string_view message, const Context &message_context = {})

Write a new message to the log with warning log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void error(absl::string_view message, const Context &message_context = {})

Write a new message to the log with error log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

inline void fatal(absl::string_view message, const Context &message_context = {})

Write a new message to the log with fatal log level.

Parameters:
  • message – Message to log.

  • message_contextContext specific for this message.

Protected Attributes

Level level_ = Level::Info

Private Members

std::unique_ptr<IWriter> writer_
std::unique_ptr<IFormatter> formatter_
Context global_context_
std::map<std::string, std::function<std::string()>> local_context_generator_
class PartitionsClient

Public Functions

inline explicit PartitionsClient(std::unique_ptr<armonik::api::grpc::v1::partitions::Partitions::StubInterface> stub)
std::vector<armonik::api::grpc::v1::partitions::PartitionRaw> list_partitions(armonik::api::grpc::v1::partitions::Filters filters, int32_t &total, int32_t page = -1, int32_t page_size = 500, armonik::api::grpc::v1::partitions::ListPartitionsRequest::Sort sort = default_sort())
armonik::api::grpc::v1::partitions::PartitionRaw get_partition(std::string partition_id)

Private Members

std::unique_ptr<armonik::api::grpc::v1::partitions::Partitions::StubInterface> stub

Private Static Functions

static armonik::api::grpc::v1::partitions::ListPartitionsRequest::Sort default_sort()
struct payload_data
#include <SubmitterClient.h>

Data structure for task payload.

Param keys:

The expected output keys

Param payload:

The task payload

Param dependencies:

The dependencies of the task

Public Members

std::string keys
std::string payload
std::vector<std::string> dependencies
class PlainFormatter : public armonik::api::common::logger::IFormatter

Formatter for a plain text format.

Public Functions

inline PlainFormatter(bool styling)

Construct a plain text formatter.

Parameters:

styling – Whether terminal styling should be applied.

inline virtual std::string format(Level level, absl::string_view message, const Context &global_context, const Context &local_context, const Context &message_context) override

Format log message with context.

Parameters:
  • level – Log level to use for this message.

  • message – Message to write in the log.

  • global_contextContext that is set globally within the logger.

  • local_contextContext set locally.

  • message_contextContext specific to this very message.

Returns:

The formatted message.

Private Members

bool styling_ = false
class ProcessStatus

Public Functions

inline ProcessStatus()
inline explicit ProcessStatus(const char *error_message)
inline explicit ProcessStatus(std::string error_message)
inline bool ok() const
inline const std::string &details() const &
inline std::string &&details() &&
inline void set_ok()
inline void set_error(std::string details)

Public Static Attributes

static const ProcessStatus Ok
static const ProcessStatus Error

Private Functions

inline explicit ProcessStatus(bool ok, std::string error_message = "")

Private Members

bool ok_ = true
std::string details_
class ResultsClient

Public Functions

inline explicit ResultsClient(std::unique_ptr<armonik::api::grpc::v1::results::Results::StubInterface> stub)
std::vector<armonik::api::grpc::v1::results::ResultRaw> list_results(armonik::api::grpc::v1::results::Filters filters, int32_t &total, int32_t page = -1, int32_t page_size = 500, armonik::api::grpc::v1::results::ListResultsRequest::Sort sort = default_sort())

List the results

Note

If the results corresponding to the filters change while this call is going for page==-1, or between calls, then the returned values may not be consistent depending on the sorting used. For example, a sort by ascending creation date (the default) will be stable if results are being created in between requests.

Parameters:
  • filters – Filter to be used

  • total – Output for the total of results available from this request (used for pagination)

  • page – Page to request, use -1 to get all pages.

  • page_size – Size of the requested page, ignored if page is -1

  • sort – How the results are sorted, ascending creation date by default

Returns:

List of results

armonik::api::grpc::v1::results::ResultRaw get_result(std::string result_id)

Get a result by id

Parameters:

result_id – Result id

Returns:

Result information

std::map<std::string, std::string> get_owner_task_id(std::string session_id, std::vector<std::string> result_ids)

Get the ids of the tasks that should produce the results

Parameters:
  • session_id – Session Id

  • result_ids – List of result ids

Returns:

Mapping between a result_id the and corresponding owner task

std::map<std::string, std::string> create_results_metadata(std::string session_id, const std::vector<std::string> &names)

Create the metadata of multiple results at once Data have to be uploaded separately

Parameters:
  • session_id – Session id

  • names – Names of the results to be created

Returns:

Map matching the names to their result_id

std::map<std::string, std::string> create_results(absl::string_view session_id, const std::vector<std::string> &names)
template<class It, class T = typename std::iterator_traits<It>::value_type, class U = typename std::tuple_element<0, T>::type, class V = typename std::tuple_element<1, T>::type, class = decltype(materialize_string(std::declval<U>())), class = decltype(materialize_string(std::declval<V>())), class = typename std::enable_if<std::tuple_size<T>::value == 2>::type>
inline std::map<std::string, std::string> create_results(std::string session_id, It begin, It end)

Create results with data included in the request

Template Parameters:
  • It – Iterator of string pairs each made with : result name, result data

  • T – String pair type made of : result name, result data

  • U – Result name type

  • V – Result data type

Parameters:
  • session_id – Session Id

  • begin – Beginning of the iterator

  • end – End of the iterator

Returns:

Map matching the names to their result_id

template<class T>
inline auto create_results(std::string session_id, T &&iterable) -> decltype(create_results(std::move(session_id), iterable.begin(), iterable.end()))

Create results with data included in the request

Template Parameters:

T – Type of iterable of pairs of strings

Parameters:
  • session_id – Session id

  • iterable – Iterable of pairs of strings

Returns:

Map matching the names to their result_id

void upload_result_data(std::string session_id, std::string result_id, absl::string_view payload)

Upload data for result

Parameters:
  • session_id – Session id

  • result_id – Result Id

  • payload

std::string download_result_data(std::string session_id, std::string result_id)

Retrieve data from a result

Parameters:
  • session_id – Session id

  • result_id – Result Id

Returns:

Result data

void delete_results_data(std::string session_id, const std::vector<std::string> &result_ids)

Deletes the results data

Parameters:
  • session_id – Session id

  • result_ids – Result ids

void delete_results(const std::string &session_id, const std::vector<std::string> &result_ids)
Configuration get_service_configuration()

Get the service configuration

Returns:

Result service configuration

Private Functions

std::map<std::string, std::string> send_create_results(const armonik::api::grpc::v1::results::CreateResultsRequest &request)

Private Members

std::unique_ptr<armonik::api::grpc::v1::results::Results::StubInterface> stub

Private Static Functions

static armonik::api::grpc::v1::results::ListResultsRequest::Sort default_sort()
class SessionsClient
#include <SessionsClient.h>

Session client wrapper

Public Functions

inline explicit SessionsClient(std::unique_ptr<armonik::api::grpc::v1::sessions::Sessions::StubInterface> stub)
std::string create_session(armonik::api::grpc::v1::TaskOptions default_task_options, const std::vector<std::string> &partitions = {})

Create a new session

Parameters:
  • default_task_options – Default task options for the session

  • partitions – Partitions the session will be able to send tasks to

Returns:

Session id

armonik::api::grpc::v1::sessions::SessionRaw get_session(std::string session_id)

Get informations about the given session

Parameters:

session_id – Session id

Returns:

SessionRaw object containing information about the session

armonik::api::grpc::v1::sessions::SessionRaw cancel_session(std::string session_id)

Cancel a session

Parameters:

session_id – Session id

Returns:

SessionRaw object containing information about the session

std::vector<armonik::api::grpc::v1::sessions::SessionRaw> list_sessions(armonik::api::grpc::v1::sessions::Filters filters, int32_t &total, int32_t page = -1, int32_t page_size = 500, armonik::api::grpc::v1::sessions::ListSessionsRequest::Sort sort = default_sort)

List the Sessions

Note

If the sessions corresponding to the filters change while this call is going for page==-1, or between calls, then the returned values may not be consistent depending on the sorting used. For example, a sort by ascending creation date (the default) will be stable if sessions are being created in between requests.

Parameters:
  • filters – Filter to be used

  • total – Output for the total of session available for this request (used for pagination)

  • page – Page to request, use -1 to get all pages.

  • page_size – Size of the requested page, ignored if page is -1

  • sort – How the sessions are sorted, ascending creation date by default

Returns:

List of sessions

armonik::api::grpc::v1::sessions::SessionRaw pause_session(std::string session_id)

Pause a session

Parameters:

session_id – Session Id

Returns:

SessionRaw object containing information about the session

armonik::api::grpc::v1::sessions::SessionRaw resume_session(std::string session_id)

Resume a session

Parameters:

session_id – Session Id

Returns:

SessionRaw object containing information about the session

armonik::api::grpc::v1::sessions::SessionRaw purge_session(std::string session_id)

Purge a session

Parameters:

session_id – Session Id

Returns:

SessionRaw object containing information about the session

armonik::api::grpc::v1::sessions::SessionRaw delete_session(std::string session_id)

Delete a session

Parameters:

session_id – Session Id

Returns:

SessionRaw object containing information about the session

armonik::api::grpc::v1::sessions::SessionRaw stop_submission_session(std::string session_id, bool client = true, bool worker = true)

Stop a new tasks submission in a session

Parameters:
  • session_id – Session Id

  • client – boolean to stop client’s task submission

  • worker – boolean to stop worker’s task submissions

Returns:

SessionRaw object containing information about the session

armonik::api::grpc::v1::sessions::SessionRaw close_session(std::string session_id)

Resume a session

Parameters:

session_id – Session Id

Returns:

SessionRaw object containing information about the session

Private Members

std::unique_ptr<armonik::api::grpc::v1::sessions::Sessions::StubInterface> stub

Private Static Attributes

static const armonik::api::grpc::v1::sessions::ListSessionsRequest::Sort default_sort = get_default_sort()
class SubmitterClient
#include <SubmitterClient.h>

The SubmitterClientExt class provides methods to create and manage task submissions.

Public Functions

SubmitterClient(std::unique_ptr<armonik::api::grpc::v1::submitter::Submitter::StubInterface> stub)

Construct a new Submitter Client object.

Construct a new Submitter Client:: Submitter Client object.

Parameters:

stub – the gRPC client stub

std::string create_session(armonik::api::grpc::v1::TaskOptions default_task_options, const std::vector<std::string> &partition_ids)

Creates a new session with the control plane.

Create a new session.

Parameters:
  • default_task_options – The default task options.

  • partition_ids – The partition ids.

  • partition_ids – The partitions ids.

  • default_task_options – The default task options.

std::future<armonik::api::grpc::v1::submitter::CreateTaskReply> create_tasks_async(std::string session_id, armonik::api::grpc::v1::TaskOptions task_options, const std::vector<armonik::api::grpc::v1::TaskRequest> &task_requests)

Creates tasks asynchronously with the specified options and requests.

Asynchronously create tasks.

Parameters:
  • session_id – The session ID.

  • task_options – The task options.

  • task_requests – The vector of task requests.

  • session_id – The session ID.

  • task_options – The TaskOptions object.

  • task_requests – A vector of TaskRequest objects.

Returns:

A future create task reply object.

Returns:

A future containing a CreateTaskReply object.

std::pair<std::vector<std::string>, std::vector<std::string>> submit_tasks_with_dependencies(std::string session_id, armonik::api::grpc::v1::TaskOptions task_options, const std::vector<payload_data> &payloads_with_dependencies, int max_retries)

Submits tasks with dependencies to the session context.

Submit tasks with dependencies.

Parameters:
  • session_id – The session id.

  • task_options – The task options.

  • payloads_with_dependencies – A vector of tuples containing the payload, its data, and its dependencies.

  • max_retries – The maximum number of retries for submitting tasks.

  • session_id – The session ID.

  • task_options – The task options

  • payloads_with_dependencies – A vector of tuples containing task payload and its dependencies.

  • max_retries – Maximum number of retries.

Returns:

A vector of submitted task IDs.

Returns:

A vector of task IDs.

std::future<std::string> get_result_async(const armonik::api::grpc::v1::ResultRequest &result_request)

Get result without streaming.

Asynchronously gets tasks.

Parameters:
  • result_request – The vector of result requests.

  • result_request – A vector of ResultRequest objects.

Returns:

A vector containing the data associated to the result

Returns:

A future containing data result.

std::map<std::string, armonik::api::grpc::v1::result_status::ResultStatus> get_result_status(const std::string &session_id, const std::vector<std::string> &result_ids)

Public Static Functions

static std::vector<std::future<std::vector<armonik::api::grpc::v1::submitter::CreateLargeTaskRequest>>> to_request_stream(const std::vector<armonik::api::grpc::v1::TaskRequest> &task_requests, std::string session_id, armonik::api::grpc::v1::TaskOptions task_options, size_t chunk_max_size)

Converts task requests into a vector of future large task request objects.

Convert task_requests to request_stream.

Parameters:
  • task_requests – The vector of task requests.

  • session_id – The session ID.

  • task_options – The task options.

  • chunk_max_size – The maximum chunk size.

  • task_requests – A vector of TaskRequest objects.

  • session_id – The session ID.

  • task_options – The TaskOptions object.

  • chunk_max_size – Maximum chunk size.

Returns:

A vector of future large task request objects.

Returns:

A vector of futures containing CreateLargeTaskRequest objects.

static std::future<std::vector<armonik::api::grpc::v1::submitter::CreateLargeTaskRequest>> task_chunk_stream(const armonik::api::grpc::v1::TaskRequest &task_request, bool is_last, size_t chunk_max_size)

Creates a large task request object with specified parameters.

Create a task_chunk_stream.

Parameters:
  • task_request – The task request.

  • is_last – Indicates if this is the last task request in the stream.

  • chunk_max_size – The maximum chunk size.

  • task_request – The TaskRequest object.

  • is_last – A boolean indicating if this is the last request.

  • chunk_max_size – Maximum chunk size.

Returns:

A future large task request object.

Returns:

A future containing a vector of CreateLargeTaskRequest objects.

Private Members

std::unique_ptr<armonik::api::grpc::v1::submitter::Submitter::StubInterface> stub_
struct TaskCreation

Public Members

std::string payload_id

Payload Id

std::vector<std::string> expected_output_keys

Expected output keys

std::vector<std::string> data_dependencies = {}

Data dependencies, none by default

armonik::api::grpc::v1::TaskOptions taskOptions = get_no_task_options()

Per task task options, none by default

Public Static Functions

static inline armonik::api::grpc::v1::TaskOptions get_no_task_options()

Default “no task option” value

Returns:

A task option to use to ignore the task options parameter

class TaskHandler
#include <TaskHandler.h>

The TaskHandler class provides methods to create and handle tasks.

Public Functions

TaskHandler(armonik::api::grpc::v1::agent::Agent::Stub &client, const armonik::api::grpc::v1::worker::ProcessRequest &request)

Construct a new Task Handler object.

Parameters:
  • client – the agent client

  • request – The process request

  • client – the agent client

  • request_iterator – The request iterator

std::future<armonik::api::grpc::v1::agent::CreateTaskReply> create_tasks_async(armonik::api::grpc::v1::TaskOptions task_options, const std::vector<armonik::api::grpc::v1::TaskRequest> &task_requests)

Create a tasks async object.

Parameters:
  • task_options – The Task Options used for this batch of tasks

  • task_requests – List of task requests

Returns:

Successfully sent task

std::future<void> send_result(std::string key, absl::string_view data)

Send task result.

Parameters:
  • key – the key of result

  • data – The result data

Returns:

A future containing a vector of ResultReply

std::vector<std::string> get_result_ids(std::vector<armonik::api::grpc::v1::agent::CreateResultsMetaDataRequest_ResultCreate> results)

Get the result ids object.

Parameters:

results – The results data

Returns:

std::vector<std::string> list of result ids

const std::string &getSessionId() const

Get the Session Id object.

Returns:

std::string

const std::string &getTaskId() const

Get the Task Id object.

Returns:

std::string

const std::string &getPayload() const

Get the Payload object.

Returns:

std::vector<std::byte>

const std::map<std::string, std::string> &getDataDependencies() const

Get the Data Dependencies object.

Returns:

std::vector<std::byte>

const armonik::api::grpc::v1::TaskOptions &getTaskOptions() const

Get the Task Options object.

Returns:

armonik::api::grpc::v1::TaskOptions

const std::vector<std::string> &getExpectedResults() const

Get the Expected Results object.

Returns:

google::protobuf::RepeatedPtrField<std::string>

const armonik::api::grpc::v1::Configuration &getConfiguration() const

Get the Configuration object.

Returns:

armonik::api::grpc::v1::Configuration

Public Static Functions

static std::future<std::vector<armonik::api::grpc::v1::agent::CreateTaskRequest>> task_chunk_stream(armonik::api::grpc::v1::TaskRequest task_request, bool is_last, const std::string &token, size_t chunk_max_size)

Create a task_chunk_stream.

Parameters:
  • task_request – a task request

  • is_last – A boolean indicating if this is the last request.

  • chunk_max_size – Maximum chunk size.

Returns:

std::future<std::vector<armonik::api::grpc::v1::agent::CreateTaskRequest>>

static std::vector<std::future<std::vector<armonik::api::grpc::v1::agent::CreateTaskRequest>>> to_request_stream(const std::vector<armonik::api::grpc::v1::TaskRequest> &task_requests, armonik::api::grpc::v1::TaskOptions task_options, const std::string &token, size_t chunk_max_size)

Convert task_requests to request_stream.

Parameters:
  • task_requests – List of task requests

  • task_options – The Task Options used for this batch of tasks

  • chunk_max_size – Maximum chunk size.

Returns:

std::vector<std::future<std::vector<armonik::api::grpc::v1::agent::CreateTaskRequest>>>

Private Members

armonik::api::grpc::v1::agent::Agent::Stub &stub_
const armonik::api::grpc::v1::worker::ProcessRequest &request_
std::string session_id_
std::string task_id_
armonik::api::grpc::v1::TaskOptions task_options_
std::vector<std::string> expected_result_
std::string payload_
std::map<std::string, std::string> data_dependencies_
std::string token_
armonik::api::grpc::v1::Configuration config_
std::string data_folder_
struct TaskInfo

Public Members

std::string task_id

Id of the task

std::vector<std::string> expected_output_ids

Expected output result ids

std::vector<std::string> data_dependencies

Data dependencies of the task

std::string payload_id

Id of the payload

class TasksClient

Public Functions

inline explicit TasksClient(std::unique_ptr<armonik::api::grpc::v1::tasks::Tasks::StubInterface> stub)
std::vector<armonik::api::grpc::v1::tasks::TaskSummary> list_tasks(armonik::api::grpc::v1::tasks::Filters filters, int32_t &total, int32_t page = -1, int32_t page_size = 500, armonik::api::grpc::v1::tasks::ListTasksRequest::Sort sort = default_sort())

List the Tasks

Note

This function returns a summary view of each task

Note

If the tasks corresponding to the filters change while this call is going for page==-1, or between calls, then the returned values may not be consistent depending on the sorting used. For example, a sort by ascending creation date (the default) will be stable if tasks are being created in between requests.

Parameters:
  • filters – Filter to be used

  • total – Output for the total of session available for this request (used for pagination)

  • page – Page to request, use -1 to get all pages.

  • page_size – Size of the requested page, ignored if page is -1

  • sort – How the tasks are sorted, ascending creation date by default

Returns:

List of tasks summary

std::vector<armonik::api::grpc::v1::tasks::TaskDetailed> list_tasks_detailed(armonik::api::grpc::v1::tasks::Filters filters, int32_t &total, int32_t page = -1, int32_t page_size = 500, armonik::api::grpc::v1::tasks::ListTasksRequest::Sort sort = default_sort())

List the Tasks

Note

This function returns a detailed view of each task

Note

If the tasks corresponding to the filters change while this call is going for page==-1, or between calls, then the returned values may not be consistent depending on the sorting used. For example, a sort by ascending creation date (the default) will be stable if tasks are being created in between requests.

Parameters:
  • filters – Filter to be used

  • total – Output for the total of session available for this request (used for pagination)

  • page – Page to request, use -1 to get all pages.

  • page_size – Size of the requested page, ignored if page is -1

  • sort – How the tasks are sorted, ascending creation date by default

Returns:

List of tasks summary

armonik::api::grpc::v1::tasks::TaskDetailed get_task(std::string task_id)

Get informations about the given task

Parameters:

session_id – Task id

Returns:

TaskDetailed object containing information about the task

std::vector<armonik::api::grpc::v1::tasks::TaskSummary> cancel_tasks(const std::vector<std::string> &task_ids)

Cancel a list of tasks

Parameters:

task_ids – List of task ids

Returns:

Vector of TaskSummary objects containing information about the canceled tasks

std::map<std::string, std::vector<std::string>> get_result_ids(const std::vector<std::string> &task_ids)

Get the result ids of each task

Parameters:

task_ids – List of tasks

Returns:

Map associating the task id to its result ids

std::map<armonik::api::grpc::v1::task_status::TaskStatus, int32_t> count_tasks_by_status(armonik::api::grpc::v1::tasks::Filters filters)

Count tasks by status

Parameters:

filters – Task filter, optional

Returns:

Map of each task status and its count

std::vector<armonik::api::common::TaskInfo> submit_tasks(std::string session_id, const std::vector<armonik::api::common::TaskCreation> &task_creations, const armonik::api::grpc::v1::TaskOptions &task_options = no_task_options)

Create tasks metadata and submit task for processing

Parameters:
  • session_id – Session id

  • task_creations – List of task creations

  • task_options – Task options common for this submission. Will be merged with the session task options

Returns:

List of submitted task info

Private Members

std::unique_ptr<armonik::api::grpc::v1::tasks::Tasks::StubInterface> stub

Private Static Functions

static armonik::api::grpc::v1::tasks::ListTasksRequest::Sort default_sort()

Private Static Attributes

static const armonik::api::grpc::v1::TaskOptions no_task_options = armonik::api::common::TaskCreation::get_no_task_options()
class TestWorker : public armonik::api::worker::ArmoniKWorker

Public Functions

inline explicit TestWorker(std::unique_ptr<armonik::api::grpc::v1::agent::Agent::Stub> agent)
inline virtual armonik::api::worker::ProcessStatus Execute(armonik::api::worker::TaskHandler &taskHandler) override

Function which does the actual work.

Parameters:

taskHandler – Task handler

Returns:

Process status

::grpc::Status Process(::grpc::ServerContext *context, const ::armonik::api::grpc::v1::worker::ProcessRequest *request, ::armonik::api::grpc::v1::worker::ProcessReply *response) override

Implements the Process method of the Worker service.

Parameters:
  • context – The ServerContext object.

  • request – The Process request

  • response – The ProcessReply object.

  • context – The ServerContext object.

  • reader – The request iterator

  • response – The ProcessReply object.

Returns:

The status of the method.

Returns:

The status of the method.

::grpc::Status HealthCheck(::grpc::ServerContext *context, const ::armonik::api::grpc::v1::Empty *request, ::armonik::api::grpc::v1::worker::HealthCheckReply *response) override

Implements the HealthCheck method of the Worker service.

Parameters:
  • context – The ServerContext object.

  • request – The Empty object.

  • response – The HealthCheckReply object.

Returns:

The status of the method.

struct versions_info
#include <VersionsClient.h>

Data structure for components version.

Param api:

ArmoniK API version

Param core:

ArmoniK CORE version

Public Members

std::string api
std::string core
class VersionsClient
#include <VersionsClient.h>

Versions Client wrapper

Public Functions

inline explicit VersionsClient(std::unique_ptr<armonik::api::grpc::v1::versions::Versions::StubInterface> stub)
versions_info list_versions()

Get versions of ArmoniK components

Returns:

Mapping between component names and their versions

Private Members

std::unique_ptr<armonik::api::grpc::v1::versions::Versions::StubInterface> stub
class WorkerServer
#include <WorkerServer.h>

Represents the worker server for ArmoniK API.

Public Functions

inline explicit WorkerServer(const common::utils::Configuration &configuration)

Constructor for the WorkerServer class.

Parameters:

configuration – A shared pointer to the Configuration object.

inline void run()

Public Members

common::logger::Logger logger

Public Static Functions

template<class Worker, typename ...Args>
static inline std::shared_ptr<WorkerServer> create(common::utils::Configuration configuration, Args&&... args)

Create a WorkerServer instance with the given configuration.

Template Parameters:
  • Worker – The worker class to be used

  • Args – Argument types to construct the worker, apart from the agent stub

Parameters:
  • configuration – Shared pointer to the Configuration object

  • args – Arguments to construct the worker, apart from the agent stub

Returns:

A shared pointer to the created WorkerServer instance

Private Members

::grpc::ServerBuilder builder_
::grpc::ChannelArguments channel_arguments_
std::unique_ptr<::grpc::Server> instance_server

Unique pointer to the gRPC server instance.

std::shared_ptr<::grpc::Channel> channel

Shared pointer to the gRPC channel.

namespace armonik

The armonik namespace contains classes and functions related to the ArmoniK API.

The armonik::api::common::utils namespace provides utility classes and functions for the ArmoniK API.

namespace api
namespace client

Functions

template<class T, class = decltype(absl::string_view(std::declval<T>()))>
std::string materialize_string(T &&x)
inline std::string materialize_string(std::string &&x)
std::string read_file(const absl::string_view &path)
Parameters:

path – The path to the file to be read

Returns:

content of the file as a std::string

bool initialize_protocol_endpoint(const common::options::ControlPlane &controlPlane, std::string &endpoint)

Check if it’s https connexion.

Parameters:
  • controlPlane – The control plane object for the current configuration

  • endpoint – The endpoint

Returns:

a boolean on wether http or https connexion

std::shared_ptr<CertificateProviderInterface> create_certificate_provider(absl::string_view rootCertificate, absl::string_view userPublicPem, absl::string_view userPrivatePem)
Parameters:
  • rootCertificate – The root certificate to validate the server one against

  • userPublicPem – The client certificate for mTLS

  • userPrivatePem – The client key for mTLS

Returns:

a pointer to a certificate provider interface

Variables

const std::string root_self_signed  = R"(-----BEGIN CERTIFICATE REQUEST-----MIIEhjCCAm4CAQAwQTELMAkGA1UEBhMCRlIxEzARBgNVBAgMClNvbWUtU3RhdGUxDjAMBgNVBAcMBVBhcmlzMQ0wCwYDVQQKDARBbmVvMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA3lBl8so+JRen+tfbrytXMmYAvjt/WquctbkbFIN6prdpuShiRb6kX9jobcOQCleQ08LBLPPoQ7AemymPxT0dq+YPFw33LgrIBpKe0JWYzujBUjj39b1EmKonnsx+C6DL2KSkIf7ayoBNdjDgunWkVC4M6hoJE7XYyZ78HKndfuvLC4zs3o1EizvSpp+O/IzD/y5pnZEBoxMLCRNB8vD7w7mQMhx+6Amx7KkfCDKLOQO4/K2x8r4Y65+IvxFMyxUsR1Z5XPVv37u7u2akbh3HlUE+m0xzVOk+BmHFYxm/eEAF4p1Jt3bZWu03eF4f8tmgN31Rv0uV+BRN7na44inXNnyd+2qczaCI1IQmsy23Vu0AeX61Gu06ifViJAybbcWll3VQjWqj5XtsN2+yr2bGfZw8fpjGXVWTL0+nZSqZPWSoIYlXMHjcygWyMJXTMVTTN+fV7dd9s1LFVnpdHFFOtmRzY8FlRRSpOoqG8XQXXsk0pE9904wHaXcwSEe4KtuzgZgNngRCtT61G6k+onhrGa6UVCKpfvMYtS3NEsMNNYsYI5Hn7Unj/0xBO6IM5Os6PImWWMk8rLSXC3IdtEAHgShS+/xbh2ZVOveSeMXWaecmu2RIe5wQa5ZXLr03XtkdMB1pebJbdoFrs0ev/sklk1dZfbX06vJSd8eokM9oIIcCAwEAAaAAMA0GCSqGSIb3DQEBCwUAA4ICAQCr75dBYjypzqDqQ6TiKWuYO8rq6TIhpdZHw5ystwvD6sn+tPbc7iNbnvDF6GeTgMdKAuwNz0YJMZq9v39hZzTCyMqRLNlTTU3kYaTWGHDK0HE2O3pHKppHAc2YbAsSxuS8KMHx0wW0abVHiEeudc/nULJppX1/ObouzLGSJJwZctXEzk/Ye7bD1sneSqVnrdFD1IOBVQVRGoJznAt7WWxvGk9LPW51+MybzTilL4rk5+ezA4UCIMrQCDwZcI+UCcKqDajDz+7kn81f1K4g1G6dTh+M8qIVlx6/Bfy3P6DHF1ww0i/hRQht1O9cyUo3mDZzAq20OsIDvkhjNGma/IEbkZ9z0P5C/5YwAW+GuwG2GrD016y5OjZVrAG/KIfyS6FLQfgN/ww5Y9tK6vO5XkelED7zNPrqem1zkId2H0Az5dIC2OpnAg3+NuGrehfIXziiY+8MGIivqI/Rulnv7m2l2vjHi66KGztDm5ohMdfjitFIfPDFYPMH7KES4vivic8zlq9FJYNp8tUYEBR1wW7W03IJPm6epUwvXHPjId/qBjlBixZt2ZqC8X4S95wAfVjtS3O33Zsm4oevwlvywfYIK8nTG5SDbDCNVTg3w/OQLQQdWUl6FunmYinukBgmqnsJnwgrhzBENbmgbgfOZZWGtG5ODENbwc+KqiSg9c9iqA==-----END CERTIFICATE REQUEST-----)"

In TLS without SSL validation, this certificate is used for the function TlsCredentials options when a root certificate is not provided

namespace common
namespace exceptions
namespace logger

Enums

enum class Level

Logging Level datatype.

Values:

enumerator Verbose
enumerator Debug
enumerator Info
enumerator Warning
enumerator Error
enumerator Fatal

Functions

std::unique_ptr<IFormatter> formatter_clef()

Get a formatter for the CLEF format.

Returns:

Pointer to the formatter.

std::unique_ptr<IFormatter> formatter_plain(bool styling = false)

Get a formatter for plain text format.

Parameters:

styling – Whether terminal styling should be applied.

Returns:

Pointer to the formatter.

constexpr absl::string_view level_name(Level level)

Convert a log level into a static string view.

Parameters:

level – Log level to convert.

Returns:

String view representing the log level.

std::unique_ptr<IWriter> writer_console()

Get a Writer to the console.

Returns:

Pointer to the writer.

std::unique_ptr<IWriter> writer_file(std::ostream &out)

Get a Writer to a std::ostream.

Parameters:

out – Stream to write to.

Returns:

Pointer to the writer.

namespace logger
namespace logger
namespace options

This namespace contains common options for the armonik API.

Enums

enum grpc_socket_type

Enumerates the types of gRPC sockets supported by armonik API.

Values:

enumerator tcp

TCP/IP socket type.

enumerator UnixDomainSocket

Unix domain socket type.

namespace utils

Functions

::grpc::ChannelArguments getChannelArguments(const Configuration &config)

Get custom channel arguments for channel creation

Parameters:

configConfiguration

Returns:

Channel arguments

::grpc::ChannelArguments getChannelArguments(const options::ControlPlane &config)

Get custom channel arguments for channel creation

Parameters:

config – Control Plane configuration

Returns:

Channel arguments

std::string getServiceConfigJson(const armonik::api::common::options::ControlPlane &config)

Generate the service config for the channel arguments

Parameters:

config – Control Plane configuration

Returns:

Json of the service

static inline void ltrim(std::string &s)
static inline void rtrim(std::string &s)
static inline void trim(std::string &s)
static inline std::string ltrim_copy(std::string s)
static inline std::string rtrim_copy(std::string s)
static inline std::string trim_copy(std::string s)
inline std::string pathJoin(const std::string &p1, const std::string &p2)
::google::protobuf::Duration duration_from_values(long long int days = 0, long long int hours = 0, long long int minutes = 0, long long int seconds = 0, int nanoseconds = 0)

Creates a duration from the given values

Note

Make sure that the resulting number of seconds and the nanoseconds are of the same sign for the duration to be valid

Parameters:
  • days – Days

  • hours – Hours

  • minutes – Minutes

  • seconds – Seconds

  • nanoseconds – Nanoseconds

Returns:

Duration with the right value

::google::protobuf::Duration duration_from_timespan(const std::string &timespan)

Creates a duration from timespan string

Parameters:

timespan – string with format [-][d.]hh:mm:ss[.fffffffff]

Returns:

Duration in accordance with timespan

namespace EnvConfiguration

Functions

inline void fromEnv(Configuration &config)
inline Configuration fromEnv()
namespace JsonConfiguration

Functions

void fromPath(Configuration &config, absl::string_view filepath)
void fromString(Configuration &config, absl::string_view json_string)
inline Configuration fromPath(absl::string_view filepath)
inline Configuration fromString(absl::string_view json_string)
namespace grpc
namespace v1
namespace agent
namespace events
namespace partitions
namespace sessions
namespace submitter
namespace versions
namespace worker
namespace Worker
namespace worker
namespace experimental
namespace simdjson
namespace std
file ChannelFactory.h
#include “logger/logger.h
#include “logger/writer.h
#include “utils/Configuration.h
#include <grpcpp/channel.h>
#include <grpcpp/security/credentials.h>
file EventsClient.h
#include “events_common.pb.h”
#include “events_service.grpc.pb.h”
file PartitionsClient.h
#include “partitions_common.pb.h”
#include “partitions_service.grpc.pb.h”
file ResultsClient.h
#include “results_service.grpc.pb.h”
#include <type_traits>
file SessionsClient.h
#include “sessions_common.pb.h”
#include “sessions_service.grpc.pb.h”
file SubmitterClient.h
#include <future>
#include <string>
#include “submitter_common.pb.h”
#include “submitter_service.grpc.pb.h”
file TasksClient.h
#include “tasks_common.pb.h”
#include “tasks_service.grpc.pb.h”
#include “objects/Task.h
file VersionsClient.h
#include “versions_common.pb.h”
#include “versions_service.grpc.pb.h”
file ChannelFactory.cpp
#include “channel/ChannelFactory.h
#include “options/ControlPlane.h
#include “utils/ChannelArguments.h
#include <grpcpp/create_channel.h>
#include <grpcpp/security/credentials.h>
#include <grpcpp/security/tls_credentials_options.h>
#include <fstream>
#include <sstream>
#include <utility>
file EventsClient.cpp
#include “events/EventsClient.h
#include “events_common.pb.h”
#include “events_service.grpc.pb.h”
#include “objects.pb.h”
file PartitionsClient.cpp
#include <utility>
file ResultsClient.cpp
#include “results/ResultsClient.h
#include <sstream>
file SessionsClient.cpp
#include “sessions_common.pb.h”
#include “sessions_service.grpc.pb.h”
#include <utility>

Functions

static ListSessionsRequest::Sort get_default_sort()
file SubmitterClient.cpp
#include <future>
#include <sstream>
#include <string>
#include “objects.pb.h”
#include “submitter_common.pb.h”
#include “submitter_service.grpc.pb.h”
file TasksClient.cpp
#include “tasks/TasksClient.h
#include <sstream>

Functions

static inline ::grpc::Status call_stub_list(armonik::api::grpc::v1::tasks::Tasks::StubInterface *stub, const armonik::api::grpc::v1::tasks::ListTasksRequest &request, armonik::api::grpc::v1::tasks::ListTasksDetailedResponse *response)
static inline ::grpc::Status call_stub_list(armonik::api::grpc::v1::tasks::Tasks::StubInterface *stub, const armonik::api::grpc::v1::tasks::ListTasksRequest &request, armonik::api::grpc::v1::tasks::ListTasksResponse *response)
template<typename T, typename U, class = decltype(std::declval<U>().tasks()), class = decltype(std::declval<U>().total())>
static std::vector<T> list_tasks_common(armonik::api::grpc::v1::tasks::Tasks::StubInterface *stub, armonik::api::grpc::v1::tasks::Filters filters, int32_t &total, int32_t page, int32_t page_size, armonik::api::grpc::v1::tasks::ListTasksRequest::Sort sort)

Common function called to list tasks

Template Parameters:
  • T – Result value type (TaskSummary or TaskDetailed

  • U – Response type

Parameters:
  • stub – Task stub

  • filters – Filter to be used

  • total – Output for the total of session available for this request (used for pagination)

  • page – Page to request, use -1 to get all pages.

  • page_size – Size of the requested page, ignored if page is -1

  • sort – How the tasks are sorted, ascending creation date by default

Returns:

Vector of information about the tasks

file VersionsClient.cpp
file ArmoniKApiException.h
#include <stdexcept>
file ArmoniKTaskError.h
#include “ArmoniKApiException.h
#include <objects.pb.h>
#include <sstream>
#include <vector>
file ArmoniKTaskNotCompletedException.h
#include “ArmoniKApiException.h
file base.h
#include “context.h
#include “level.h

Logger interface.

file context.h
#include <map>
#include <string>

Logger context.

file formatter.h
#include <memory>
#include “fwd.h
#include “level.h

Formatter interface.

file fwd.h

Forward declarations for logger classes.

file level.h
#include <absl/strings/string_view.h>

Logging levels.

file local_logger.h
#include “base.h
#include “context.h
#include “fwd.h
#include “level.h

Logger with a local context.

file logger.h
#include <functional>
#include <memory>
#include “base.h
#include “context.h
#include “fwd.h
#include “level.h
#include “local_logger.h
file util.h
#include <absl/strings/string_view.h>
#include <fmt/std.h>

Functions

fmt::string_view to_fmt(const absl::string_view sv)
file writer.h
#include <iosfwd>
#include <memory>
#include “level.h

Writter interface.

file Task.h
#include “tasks_common.pb.h”
#include <string>
#include <vector>
file ComputePlane.h
#include “GrpcSocketType.h
#include <sstream>
file ControlPlane.h
#include “utils/Configuration.h
#include <cmath>
#include <google/protobuf/duration.pb.h>
file GrpcSocketType.h
file ChannelArguments.h
#include “utils/Configuration.h
#include <grpcpp/support/channel_arguments.h>
file Configuration.h
#include <absl/strings/string_view.h>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>

Interface for a configuration class that stores and manages key-value pairs.

file EnvConfiguration.h
#include “utils/Configuration.h

Header file for the EnvConfiguration class.

file GuuId.h
#include <iomanip>
#include <iostream>
#include <random>

Header file for the GuuId class, providing a UUID generation method.

file JsonConfiguration.h
#include “utils/Configuration.h

Definition of a JSON configuration class that inherits from Configuration.

file string_utils.h
#include <algorithm>
#include <cctype>
#include <locale>
#include <string>
file Utils.h
#include “google/protobuf/duration.pb.h”
file formatter.cpp
#include <chrono>
#include <fmt/chrono.h>
#include <fmt/color.h>
#include <fmt/compile.h>
#include <fmt/format.h>
#include “logger/context.h
#include “logger/level.h
#include “logger/formatter.h
#include “logger/util.h
file local_logger.cpp
#include “logger/context.h
#include “logger/formatter.h
#include “logger/logger.h
#include “logger/writer.h
#include “logger/local_logger.h
file logger.cpp
#include “logger/context.h
#include “logger/formatter.h
#include “logger/local_logger.h
#include “logger/writer.h
#include “logger/logger.h
file writer.cpp
#include <iostream>
#include <mutex>
#include “logger/writer.h
file ControlPlane.cpp
#include “options/ControlPlane.h
#include “utils/Configuration.h
#include “utils/Utils.h
file ChannelArguments.cpp
#include “utils/ChannelArguments.h
#include “options/ControlPlane.h
#include <google/protobuf/util/json_util.h>
#include <sstream>

Functions

template<typename T, typename Tin>
T saturate_cast(Tin in, T max_value = std::numeric_limits<T>::max())
int getMilliseconds(const google::protobuf::Duration &duration)
file Configuration.cpp
#include “utils/Configuration.h
#include “options/ComputePlane.h
#include “options/ControlPlane.h
file JsonConfiguration.cpp
#include <iostream>
#include <simdjson.h>

Functions

void populate(armonik::api::common::utils::Configuration &config, const std::string &prefix, const dom::element &element)

Populates the given config with the given json element using a prefix.

Parameters:
  • config – JsonConfiguration to populate

  • prefix – Prefix for the key

  • element – json element

file Utils.cpp
#include “utils/Utils.h
#include <absl/strings/str_split.h>
#include <cmath>
#include <iomanip>
file main.cpp
#include <iostream>
#include <memory>
#include <grpc++/grpc++.h>
#include “grpcpp/support/sync_stream.h”
#include “objects.pb.h”
#include “utils/WorkerServer.h
#include “Worker/ArmoniKWorker.h
#include “Worker/ProcessStatus.h
#include “Worker/TaskHandler.h

Functions

int main(int argc, char **argv)
file WorkerServer.h
#include <functional>
#include <grpcpp/create_channel.h>
#include <grpcpp/security/credentials.h>
#include <memory>
#include <sstream>
#include <thread>
#include “grpcpp/server_builder.h”
#include “agent_common.pb.h”
#include “agent_service.grpc.pb.h”
#include “Worker/ProcessStatus.h
#include “Worker/TaskHandler.h
#include “logger/formatter.h
#include “logger/logger.h
#include “logger/writer.h
#include “options/ComputePlane.h
#include “options/GrpcSocketType.h
#include “utils/Configuration.h

Contains the WorkerServer class, which represents the worker server for ArmoniK API.

file ArmoniKWorker.h
#include <iostream>
#include <memory>
#include <string>
#include <grpc++/grpc++.h>
#include “grpcpp/support/sync_stream.h”
#include “objects.pb.h”
#include “utils/Configuration.h
#include “utils/WorkerServer.h
#include “worker_common.pb.h”
#include “worker_service.grpc.pb.h”
#include “ProcessStatus.h
#include “Worker/TaskHandler.h
file ProcessStatus.h
#include <string>
#include <utility>
file TaskHandler.h
#include <future>
#include <string>
#include “agent_common.pb.h”
#include “agent_service.grpc.pb.h”
#include “worker_common.pb.h”
#include “worker_service.grpc.pb.h”
file ArmoniKWorker.cpp
#include <iostream>
#include <memory>
#include <string>
#include <utility>
#include <grpc++/grpc++.h>
#include “grpcpp/support/sync_stream.h”
#include “objects.pb.h”
#include “utils/Configuration.h
#include “utils/WorkerServer.h
#include “worker_common.pb.h”
#include “worker_service.grpc.pb.h”
#include “Worker/ArmoniKWorker.h
#include “Worker/TaskHandler.h
file ProcessStatus.cpp
#include “Worker/ProcessStatus.h
file TaskHandler.cpp
#include “Worker/TaskHandler.h
#include “utils/string_utils.h
#include <fstream>
#include <future>
#include <sstream>
#include <string>
#include “agent_common.pb.h”
#include “agent_service.grpc.pb.h”
#include “worker_common.pb.h”
#include “worker_service.grpc.pb.h”
dir packages/cpp/ArmoniK.Api.Client
dir packages/cpp/ArmoniK.Api.Common
dir packages/cpp/ArmoniK.Api.Worker
dir packages/cpp/ArmoniK.Api.Worker.Tests
dir packages/cpp/ArmoniK.Api.Client/header/channel
dir packages/cpp/ArmoniK.Api.Client/source/channel
dir packages/cpp
dir packages/cpp/ArmoniK.Api.Client/header/events
dir packages/cpp/ArmoniK.Api.Client/source/events
dir packages/cpp/ArmoniK.Api.Common/header/exceptions
dir packages/cpp/ArmoniK.Api.Client/header
dir packages/cpp/ArmoniK.Api.Common/header
dir packages/cpp/ArmoniK.Api.Worker/header
dir packages/cpp/ArmoniK.Api.Common/header/logger
dir packages/cpp/ArmoniK.Api.Common/source/logger
dir packages/cpp/ArmoniK.Api.Common/header/objects
dir packages/cpp/ArmoniK.Api.Common/header/options
dir packages/cpp/ArmoniK.Api.Common/source/options
dir packages
dir packages/cpp/ArmoniK.Api.Client/header/partitions
dir packages/cpp/ArmoniK.Api.Client/source/partitions
dir packages/cpp/ArmoniK.Api.Client/header/results
dir packages/cpp/ArmoniK.Api.Client/source/results
dir packages/cpp/ArmoniK.Api.Client/header/sessions
dir packages/cpp/ArmoniK.Api.Client/source/sessions
dir packages/cpp/ArmoniK.Api.Client/source
dir packages/cpp/ArmoniK.Api.Common/source
dir packages/cpp/ArmoniK.Api.Worker.Tests/source
dir packages/cpp/ArmoniK.Api.Worker/source
dir packages/cpp/ArmoniK.Api.Client/header/submitter
dir packages/cpp/ArmoniK.Api.Client/source/submitter
dir packages/cpp/ArmoniK.Api.Client/header/tasks
dir packages/cpp/ArmoniK.Api.Client/source/tasks
dir packages/cpp/ArmoniK.Api.Common/header/utils
dir packages/cpp/ArmoniK.Api.Common/source/utils
dir packages/cpp/ArmoniK.Api.Worker/header/utils
dir packages/cpp/ArmoniK.Api.Client/header/versions
dir packages/cpp/ArmoniK.Api.Client/source/versions
dir packages/cpp/ArmoniK.Api.Worker/header/Worker
dir packages/cpp/ArmoniK.Api.Worker/source/Worker