AsyncService

📘

Note

While using TrueFoundry python SDK type is not a required field in any of the imported classes

AsyncService

Description

Describes the configuration for the async-service

Schema

{
  "type": "string",
  "replicas": 1,
  "rollout_strategy": {
    "type": "string",
    "max_unavailable_percentage": 25,
    "max_surge_percentage": 0
  },
  "worker_config": {
    "input_config": {
      "type": "string",
      "queue_url": "string",
      "region_name": "string",
      "visibility_timeout": 0,
      "wait_time_seconds": 19,
      "auth": {
        "aws_access_key_id": "string",
        "aws_secret_access_key": "string",
        "aws_session_token": "string"
      }
    },
    "output_config": {
      "type": "string",
      "queue_url": "string",
      "region_name": "string",
      "auth": {
        "aws_access_key_id": "string",
        "aws_secret_access_key": "string",
        "aws_session_token": "string"
      }
    }
  }
}

Properties

Name

Type

Required

Description

type

string

false

+

value=async-service

replicas

any

false

Replicas of service you want to run

rollout_strategy

Rolling

false

This strategy updates the pods in a rolling fashion such that a subset of the
total pods are replaced with new version at one time.
A commonly used strategy can be to have maxUnavailablePercentage close to 0 so that there
is no downtime and keep the maxSurgePercentage to around 25%. If you are anyways running
a large number of pods, the service can often tolerate a few pods going down - so you
max maxUnavailablePercentage = 10 and maxSurgePercentage=0. You can read about it more
here

worker_config

WorkerConfig

false

Describes the configuration for the Worker Config

AsyncServiceAutoscaling

Description

Describes an Async Service Autoscaling configuration

Schema

{
  "metrics": {
    "type": "string",
    "queue_length": 0
  }
}

Properties

NameTypeRequiredDescription
metricsSQSQueueMetricConfigfalseDescribes a SQS Queue Metric Configuration

Worker-Config

WorkerConfig

Description

Describes the configuration for the Worker Config

Schema

{
  "input_config": {
    "type": "string",
    "queue_url": "string",
    "region_name": "string",
    "visibility_timeout": 0,
    "wait_time_seconds": 19,
    "auth": {
      "aws_access_key_id": "string",
      "aws_secret_access_key": "string",
      "aws_session_token": "string"
    }
  },
  "output_config": {
    "type": "string",
    "queue_url": "string",
    "region_name": "string",
    "auth": {
      "aws_access_key_id": "string",
      "aws_secret_access_key": "string",
      "aws_session_token": "string"
    }
  }
}

Properties

NameTypeRequiredDescription
input_configSQSInputConfigtrueDescribes the configuration for the input SQS worker
output_configSQSOutputConfigtrueDescribes the configuration for the output SQS worker

SQSInputConfig

Description

Describes the configuration for the input SQS worker

Schema

{
  "type": "string",
  "queue_url": "string",
  "region_name": "string",
  "visibility_timeout": 0,
  "wait_time_seconds": 19,
  "auth": {
    "aws_access_key_id": "string",
    "aws_secret_access_key": "string",
    "aws_session_token": "string"
  }
}

Properties

Name

Type

Required

Description

type

string

true

+

value=sqs

queue_url

string

true

AWS SQS Queue URL of Subscriber

region_name

string

true

AWS Region Name

visibility_timeout

integer

true

A period during which Amazon SQS prevents all consumers from receiving and processing the message. If one message takes 5 seconds to process, you can set this number to 7 or any number higher than 5. This will ensure that while the message is being processed, it will not be available to other replicas. For more information, see

here

wait_time_seconds

integer

true

Wait timeout for long polling. For more information, see

here

auth

AWSAccessKeyAuth

true

AWS Access Key based Authentication for Basic Service Authentication

SQSOutputConfig

Description

Describes the configuration for the output SQS worker

Schema

{
  "type": "string",
  "queue_url": "string",
  "region_name": "string",
  "auth": {
    "aws_access_key_id": "string",
    "aws_secret_access_key": "string",
    "aws_session_token": "string"
  }
}

Properties

Name

Type

Required

Description

type

string

true

+

value=sqs

queue_url

string

true

AWS SQS Queue URL of Publisher

region_name

string

true

AWS Region Name

auth

AWSAccessKeyAuth

true

AWS Access Key based Authentication for Basic Service Authentication

SQSQueueMetricConfig

Description

Describes a SQS Queue Metric Configuration

Schema

{
  "type": "string",
  "queue_length": 0
}

Properties

Name

Type

Required

Description

type

string

true

+

value=sqs

queue_length

integer

true

Upper limit of the number of backlog messages the auto-scaler will try to maintain per replica. If you set this number to 10 and have 30 messages in the queue and one replica, the auto-scaler will scale the number of replicas to 3.

AWSAccessKeyAuth

Description

AWS Access Key based Authentication for Basic Service Authentication

Schema

{
  "aws_access_key_id": "string",
  "aws_secret_access_key": "string",
  "aws_session_token": "string"
}

Properties

NameTypeRequiredDescription
aws_access_key_idstringtrueAWS Access Key ID
aws_secret_access_keystringtrueAWS Secret Access Key for the user to authenticate with
aws_session_tokenstringfalseAWS Session Token, only required when using temporary credentials