Introduction to Tapis Actors

What is Tapis?

Tapis is TACC’s Application Programming Interface
  • Science-as-a-Service platform

  • Web services that provide access to TACC resources

  • Can provide access to other resources

  • Supports common file and compute job operations

  • Used by TACC Portals

More information about Tapis and its current and future capabilities is available at: The Tapis Project

What is Tapis Actors?

Tapis Actors is a form of serverless computing like AWS Lambda, Firebase Functions, or OpenFaas, but are tailored to support the needs of research computing.

What is the use case?

I need X to happen when Y occurs.
  • I need to load a JSON file into a database when it is uploaded to my $WORK

  • I need to send an email to my supervisor when this analysis detects something interesting

  • I need to launch the next stage in workflow when the current stage completes successfully

  • I need to generate and email a report when the time is 1:00 PM each day

  • I need to compute a value N when given an input P

The Tapis Actors API lets you deploy functions or services that accomplish these (and many other) use cases.

Tapis Actors also lets you:
  • Avoid lockin
    • Built as Docker containers

    • Underlying platform is free and open-source

  • Deploy any code
    • Write new function code in any language

    • Bring in legacy software and binaries

  • Run at any scale
    • Automatically scale up when needed

    • Scale to zero when not

Tapis Actors can run standalone, be composed into complex workflows, or integrated with external third-party platforms. They serve as connecting threads amongst the complex systems in our commercial and research computing ecosystems.

What is an Actor?

For our purposes, an Actor is a container-based function-as-a-service deployed on a software platform called Abaco, where it will follow the actor model of concurrent computation.

In response to a message it receives, an Actor can
  • Make local decisions

  • Create more actors

  • Send more messages

  • Determine how to respond to the next message received.

Actors may modify their own private state, but can only affect each other indirectly through messaging. The actor model is characterized by concurrency of computation within and among actors, dynamic actor creation, requirement for actor addresses in messages, and interaction only through direct message passing.

In the Tapis Actors implementation, each actor registered in the system is associated with a Docker image. Actor containers are executed in response to messages posted to their inbox, which itself is given by a URI exposed via the system. In the process of executing each actor container state, logs and execution statistics are collected.

Typically, functions performed by actors are quick and require little processing power. Use cases with more substantial run times or resource requirements are usually best addressed using Tapis Apps.

How Does an Actor Work?

The function an actor performs is specified as the default command in a Docker container. Code for this function is written based around a handful of core assumptions:

  1. The message is passed via an environment variable MSG

  2. Supplemental environment variables can be specified when the actor is deployed

  3. Parameters can be provided alongside the message, which are passed as additional environment variables

  4. The execution environment is read-only and unpriveleged

  5. Inbound network connections are disallowed

  6. Outbound network connections are unrestricted

  7. The execution environment is destroyed when the function has completed

  8. STDERR and STDOUT are captured by the Abaco platform for later review

Depending on the configuration of your specific Tapis Actors tenant, the following additional assumptions may apply. For the tacc.prod tenant running at TACC, they absolutely do.

  1. A Tapis access token is available via an environment variable

  2. The TACC $WORK filesystem is mounted and writeable at /work

  3. Code will run as your TACC-default user and group ID

Workflow

The workflow for bworking with Actors will be covered in detail in this tutorial, but briefly, is as follows:

  • Write code and package into a Docker container

  • Push the container to a public container registry (DockerHub)

  • Register an actor to use the container

  • Send a message to the actor

  • Verify execution by inspecting the logs

  • (Optional) Update container or actor

  • (Optional) Share the actor with other users

  • (Optional) Delete the actor

Learn More

For a full reference guide to actors, see the Tapis Actors online documentation.