The Function specification defines an Application Programming Interface (API) to which a Function must comply in order to be used with Automate. The specification is designed to be agnostic of the type or purpose of software packaged into a Function.Documentation Index
Fetch the complete documentation index at: https://docs.speckle.systems/llms.txt
Use this file to discover all available pages before exploring further.
Definitions
Several terms are used with frequency in this document and require definition:- Speckle: Speckle is a platform for exchanging data between different software applications, allowing users to collaborate and communicate AEC-related data.
- AEC: Architecture, Engineering, and Construction industry.
- Automate: Automate is a platform which allows users to run Functions.
- Automation: An Automation is a configuration of a Function which is ready to be run on events from changes in a Speckle model, or on demand.
- Function: A Function is a small piece of packaged software which performs a specific task. Functions are the building blocks of Automate.
- Image: An Image is a standardised method of packaging and distributing content. An Image is defined by the Open Container Initiative Image Format Specification.
- OCI: Open Container Initiative. The OCI is a lightweight, open governance structure (project), formed under the auspices of the Linux Foundation, for the express purpose of creating open industry standards around container formats and runtime.
Notational Conventions
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” are to be interpreted as described in RFC 2119 (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, March 1997). The key words “unspecified”, “undefined”, and “implementation-defined” are to be interpreted as described in the [rationale for the C99 standard][c99-unspecified]. An implementation is not compliant if it fails to satisfy one or more of the MUST, MUST NOT, REQUIRED, SHALL, or SHALL NOT requirements for the protocols it implements. An implementation is compliant if it satisfies all the MUST, MUST NOT, REQUIRED, SHALL, and SHALL NOT requirements for the protocols it implements.Specification
- A Function MUST be packaged as an OCI Image, compliant with the Open Container Initiative Image Format Specification
- A Function MUST be able to be run in an environment compliant with the Open Container Initiative Runtime Specification.
-
A Function SHOULD NOT specify an
Entrypointin its OCI Image. If anEntrypointis specified it will be ignored. Instead theEntrypointshould be provided to Automate as the first values of the function version command, which will be passed to the function when it is run. -
A Function SHOULD NOT specify a
Cmdin its OCI Image. If aCmdis specified it will be ignored. Instead, theCmdshould be provided to Automate as the Function Version command, which will pass it to the Function when it is run. -
A Function SHOULD expect that the
argsprovided as part of theprocess(see OCI Runtime Specification) will be the Function Version command provided by the Function author to Automate, followed by one additional arguments in sequential order. For example/usr/local/bin/function /speckle/automate.jsonwhere/usr/local/bin/functionis the Function Version command provided by the Function author to Automate, and/speckle/automate.jsonis the first additional argument provided by Automate to the Function. -
The first argument provided to the Function SHALL be a string representing the path-absolute rule for Posix systems. For example
/speckle/input.json. -
The contents of
AUTOMATE_FUNCTION_INPUT_PATHWILL conform to the following json schema:
- A Function MUST expect to be run as a non-root Posix-platform user.
- A Function MUST expect to be run in a Linux Process.
-
A Function MUST expect to be run with Posix-process
rlimitsset. - A Function MUST expect to be run without any allowed Linux Capabilities and without the ability to add new privileges. For example, a Function will not have the capability to bind to a port number less than 1024.
- A Function MUST run on AMD 64-bit architecture.
- A Function SHOULD NOT expect to accept incoming network connections from outside localhost network. Any incoming network connections will be blocked or ignored by the supporting infrastructure and not routed to the Function. A Function MAY make outbound network connections (within the limitations of Speckle’s Terms of Service).
- A Function MUST comply with Speckle’s Terms of Service. Speckle reserve the right to remove or block any Function from its platform for any reason.