anatools.anaclient.channels module

Channels Functions

build_channel(self, channelfile, ignore=['data/', 'output/'], verify=False)

Build the Docker image of a channel.

Parameters
  • channelfile (str) – The channel file for the channel to build.

  • ignore (list, optional) – List of files or directories to ignore during the build.

  • verify (bool, optional) – If True, verifies the image by running the anautils command.

Returns

A boolean that indicates if the channel Docker image was successfully built.

Return type

bool

create_channel(self, name, description=None, organizationId=None, volumes=[], instance=None, timeout=120, interfaceVersion=1)

Create a channel for your organization.

Parameters
  • name (str) – Channel name.

  • description (str) – Description of the channel

  • organizationId (str) – Organization ID. Defaults to current if not specified.

  • volumes (list[str]) – List of the data volume names to associate with this channel.

  • instance (str) – AWS Instance type.

  • timeout (int) – Maximum runtime of a channel run.

  • interface (int) – The ana interface version number.

Returns

channel data

Return type

list[dict]

delete_channel(self, channelId)

Delete a channel of your organization.

Parameters

channelId (str) – Id of channel to delete.

Returns

Status

Return type

str

deploy_channel(self, channelId=None, channelfile=None, image=None)

Deploy the Docker image of a channel.

Parameters
  • channelId (str) – ChannelId that you are pushing the image to. If the channelId isn’t specified, it will use the image name to lookup the channelId.

  • channelfile (str) – Name of the channel file to look for.

  • image (str) – The Docker image name. This should match the channel name when running ana. If image is not specified, it will use the channel name for the channelId.

Returns

deploymentId for current round of deployment or an error message if something went wrong

Return type

str

edit_channel(self, channelId, name=None, description=None, volumes=None, instance=None, timeout=None, status=None, interfaceVersion=None, preview=None)

Edit a channel for your organization.

Parameters
  • channelId (str) – ChannelId ID of the channel to edit.

  • name (name) – The new name to give the channel.

  • description (str) – Description of the channel

  • volumes (list[str]) – Data volumes for the channel.

  • instance (str) – Instance type to run the channel on.

  • timeout (int) – Maximum runtime for the channel run.

  • status (str) – The status of the channel.

  • interface (int) – The ana interface version number.

  • preview (bool) – Enable or disable the preview for the channel.

Returns

If true, the channel was successfully edited.

Return type

bool

get_channel_documentation(self, channelId)

Returns channel documentation as markdown text.

Parameters

channelID (str) – The channelId of the channel

Returns

The markdown file for channel documentation.

Return type

str

get_channel_nodes(self, channelId, fields=None)

Get the nodes for a channel.

Parameters
  • channelId (str) – Channel Id to filter.

  • fields (list) – List of fields to return, leave empty to get all fields.

Returns

channel node schema data

Return type

list[dict]

get_channels(self, organizationId=None, workspaceId=None, channelId=None, cursor=None, limit=None, filters=None, fields=None)

Fetches all

Parameters
  • organizationId (str) – Filter channel list on what’s available to the organization.

  • workspaceId (str) – Filter channel list on what’s available to the workspace.

  • channelId (str) – Filter channel list on the specific channelId.

  • cursor (str) – Cursor for pagination.

  • limit (int) – Maximum of channels to return.

  • filters (dict) – Filters that limit output to entries that match the filter

  • fields (list) – List of fields to return, leave empty to get all fields.

Returns

List of channels associated with user, workspace, organization or channelId.

Return type

list[dict]

get_deployment_status(self, deploymentId, stream=False)

Retrieves status for a channel’s deployment.

Parameters
  • deploymentId (str) – The deploymentId to retrieve status for

  • stream (bool) – Flag to print information to the terminal so the user can avoid constant polling to retrieve status.

Returns

Deployment status.

Return type

list[dict]

get_node_documentation(self, channelId, node, fields=None)

Retrieves the markdown documentation for a node.

Parameters
  • channelId (str) – The channelId of the channel

  • node (str) – The node to retrieve documentation for.

  • fields (list[str]) – List of fields to retrieve for the node documentation.

Returns

The markdown documentation for the node.

Return type

str

profile_channel(self, graphId=None, channelId=None, instances=None, workspaceId=None)

Profile a channel using a graph on the Rendered.ai Platform.

Parameters
  • name (str) – Name for dataset.

  • graphId (str) – ID of the staged graph to create dataset from.

  • description (str) – Description for new dataset.

  • runs (int) – Number of times a channel will run within a single job. This is also how many different images will get created within the dataset.

  • priority (int) – Job priority.

  • seed (int) – Seed number.

  • workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.

Returns

Success or failure message about dataset creation.

Return type

str

upload_channel_documentation(self, channelId, mdfile)

Uploads a markdown file for channel documentation.

Parameters
  • channelID (str) – The channelId of the channel

  • mdfile (str) – The filepath of the markdown file used for channel documentation.

Returns

Success/Failure of channel documenation upload.

Return type

bool