Roles

A user must be assigned the admin application role to execute any of the examples described on this page.

Manage Compute Pool

Winning Variant creates its own compute pool that it uses to run its services in an isolated environment. The admin application role is granted the following permissions: OPERATE, MODIFY, USAGE, MONITOR . This means that an admin can alter the compute pool directly.

For instance, to scale up the pool:

ALTER COMPUTE POOL WINNING_VARIANT_EXPERIMENTATION_POOL SET
  MAX_NODES = 2;

Manage Services

The Winning Variant services can be managed by an admin using the following stored procedures (all within the management schema):

ProcedureDescription
suspend_services()Suspends all services.
suspend_config_service()Suspends just the configuration service.
suspend_variant_service()Suspends just the variant service.
resume_services()Resumes all services.
resume_config_service()Resumes the configuration service.
resume_variant_service()Resumes the variant service.
get_service_status()Gets the status of all services.
get_service_endpoints()Shows ingress URLs for all services.
alter_variant_service_warehouse(<WH>)Changes the query warehouse used by the Variant API service.
alter_variant_service_instances(...)Changes the instance configuration for the Variant API service. (read more below)

Examples

USE <application_name>;

-- Suspend all services
CALL management.suspend_services();

-- Check status of services
CALL management.get_service_status();

Scaling the Variant API

To scale the Variant API service (such as after scaling up the compute pool), call management.alter_variant_service_instances(<MIN INSTANCES>, <MAX_INSTANCES>, <MIN_READY_INSTANCES>).

For instance, on a compute pool with 5 nodes, you may want at least 2 instances (<MIN INSTANCES>) with both ready (<MIN_READY_INSTANCES>) and the ability to scale up to all 5 nodes <MAX_INSTANCES>). That command would look like:

management.alter_variant_service_instances(2, 5, 2)

Configuration Properties

While certain components of the app are configurable directly via SQL (i.e., scaling a compute pool), other components may be configured indirectly.

Properties

PropertyDescriptionDefault
VARIANTAPI:CONFIG_REFRESH_SECONDSHow often (in seconds) to refresh the configuration in the Variant API from the underlying tables. The Variant API must be restarted for this to take effect.

Variant API instances are automatically updated with new configuration in real-time, however this exists as a safety fallback to ensure that configuration is fresh.
21600
(6 hours)

Set configuration property

To set a property, execute the following procedure:

CALL management.set_config_property('<property>', '<value>')

Example

-- Set the Variant API to refresh configuration every 5 minutes
CALL management.set_config_property('VARIANTAPI:CONFIG_REFRESH_SECONDS', '300')

All values are stored as strings. So even a number, such as 100 should be stored as '100'.

Get configuration properties

To see the current configuration properties, perform a SELECT from management.config_properties.

Example

-- See all configuration properties
SELECT * FROM management.config_properties;