m1yag1.globus.globus_compute module – Manage Globus Compute Endpoints and Functions

Note

This module is part of the m1yag1.globus collection (version 0.6.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install m1yag1.globus.

To use it in a playbook, specify: m1yag1.globus.globus_compute.

New in m1yag1.globus 1.0.0

Synopsis

  • Create, update, or delete Globus Compute Endpoints

  • Register and manage Globus Compute Functions

  • Configure compute endpoint settings and executors

  • Support for High Assurance endpoints and functions

  • System-level multi-user endpoint management (setup/teardown)

Parameters

Parameter

Comments

auth_method

string

Authentication method to use.

If not specified, auto-detects based on available credentials.

When client_id and client_secret are provided, uses client_credentials.

Otherwise falls back to cli (reads tokens from globus-cli storage).

Choices:

  • "client_credentials"

  • "cli"

authentication_policy_id

string

Authentication policy ID for HA endpoints

client_id

string

Globus Auth client ID for client_credentials authentication.

Can also be set via the GLOBUS_CLIENT_ID environment variable.

client_secret

string

Globus Auth client secret for client_credentials authentication.

Can also be set via the GLOBUS_CLIENT_SECRET environment variable.

conda_env

string

Conda environment to use

description

string

Description of the compute endpoint

endpoint_id

string

UUID of the endpoint (for updates or function registration)

endpoint_root

string

Root directory for endpoint configurations (for system-level management)

Default: "/root/.globus_compute"

executor_type

string

Type of executor to use

Choices:

  • "HighThroughputExecutor" ← (default)

  • "ThreadPoolExecutor"

  • "ProcessPoolExecutor"

function_code

string

Python function code as a string (for resource_type=function)

function_file

string

Path to Python file containing the function (for resource_type=function)

function_id

string

UUID of the function (for updates/deletes)

globus_venv_path

string

Path to Globus virtualenv (for system-level management)

Default: "/opt/globus-venv"

high_assurance

boolean

Enable high assurance for this endpoint

Choices:

  • false ← (default)

  • true

manage_system

boolean

Manage system-level multi-user endpoint (not just API registration)

Choices:

  • false ← (default)

  • true

max_workers

integer

Maximum number of workers

Default: 1

name

string / required

Name of the compute endpoint or function

provider

dictionary

Provider configuration

public

boolean

Whether the endpoint should be public

Choices:

  • false ← (default)

  • true

resource_type

string

Type of resource to manage

Choices:

  • "endpoint" ← (default)

  • "function"

state

string

Desired state of the resource

Choices:

  • "present" ← (default)

  • "absent"

subscription_id

string

Globus subscription ID for HA endpoints

worker_init

string

Worker initialization script

Notes

Note

  • Authentication is required for all Globus API operations.

  • For client_credentials auth, register a confidential client at https://developers.globus.org.

  • For cli auth, run globus login first to cache tokens.

  • The cli method reads tokens from ~/.globus/cli/storage.db.

  • For cli auth with multiple profiles, set GLOBUS_PROFILE environment variable.

  • Set GLOBUS_SDK_ENVIRONMENT to sandbox or test for non-production environments.

See Also

See also

Globus Auth Documentation

Official Globus authentication documentation

Globus CLI

Command-line interface for Globus

Examples

- name: Create a Globus Compute endpoint
  globus_compute:
    name: "research-cluster"
    description: "Research cluster compute endpoint"
    public: false
    executor_type: "HighThroughputExecutor"
    max_workers: 4
    conda_env: "my-env"
    provider:
      type: "LocalProvider"
      init_blocks: 1
      max_blocks: 2
    state: present

- name: Create a High Assurance Compute endpoint
  globus_compute:
    resource_type: endpoint
    name: "ha-endpoint"
    description: "High assurance compute endpoint"
    public: false
    subscription_id: "923ac990-9914-11ed-af9f-c53a64a5b6b4"
    high_assurance: true
    authentication_policy_id: "{{ auth_policy_id }}"
    executor_type: "HighThroughputExecutor"
    max_workers: 2
    state: present

- name: Register a function on HA endpoint
  globus_compute:
    resource_type: function
    name: "my_test_function"
    endpoint_id: "{{ ha_endpoint_id }}"
    description: "Test function for HA endpoint"
    function_code: |
      def my_test_function(x):
          return x * 2
    state: present

- name: Register function from file
  globus_compute:
    resource_type: function
    name: "data_processor"
    endpoint_id: "{{ endpoint_id }}"
    function_file: "/path/to/function.py"
    state: present

- name: Delete a compute endpoint
  globus_compute:
    name: "old-endpoint"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

changed

boolean

Whether the resource was changed

Returned: always

endpoint_id

string

ID of the created/managed compute endpoint

Returned: when state=present and resource_type=endpoint

function_id

string

ID of the registered function

Returned: when state=present and resource_type=function

name

string

Name of the compute endpoint or function

Returned: always

Authors

  • m1yag1