Deploy a compute module

Beta

The Compute Modules feature is in beta and may not be available on all enrollments.

Prerequisites

This section assumes you have already created a compute module Docker container. If you have not, you can follow the guide on how to create a basic Python compute module.

Publishing your compute module into Foundry

  1. Start by navigating to a project in Foundry that you want your compute module to live in.
  2. Select New -> Artifacts Repository.
  3. Under the Publish section, select Docker from the dropdown.

Artifacts Repository

  1. Under the Parameters change the Image Name to the name of your Docker image.

The tag latest is not supported for compute modules.

  1. Follow the instructions on the screen to publish your image into the repository.
  2. After publishing your image into the repository, navigate back to the overview page and you should see your image show up in 1-2 minutes.

Artifacts Docker Image View

Configuring your compute module

Now that you have your Docker image in Foundry, you are ready to run it as a compute module.

  1. Navigate to the project in Foundry that you want your compute module to live in.
  2. Select New -> Compute Module.
  3. Navigate to the Configure tab.

Compute Module Configure

  1. Select Add Container.
  2. Enter a name like mycomputemodule. Note that the name must be lowercase and cannot include spaces or special characters other than -.
  3. Select the repository that you published the Docker image into from the previous step.
  4. Select the image and the tag for the image you want to run.

Compute Module Container

  1. Select Confirm.
  2. Under Runtime, make sure Runtime V1 is selected.
  3. For this example compute module, you do not need to mount any volumes, add any external access, or change any of the scaling constraints.
  4. Select Save.

Fully Configured Compute Module

Your compute module is now ready to be started.

Running your compute module

  1. Navigate to the Overview tab for your compute module.
  2. Select Start.
  3. Wait for your compute module to enter into a Running state.

Running compute module

Querying your compute module

Now that your compute module is running, you can validate that the module works by sending test queries.

  1. Select the Query tab at the bottom of the overview screen.

Query Compute Module

  1. Enter the function name for your compute module. This function name is passed along in the request to your compute module, so it may differ from one compute module to another. For the compute module you built in the previous section, the supported queries are divide and multiply.

  2. Enter a value on which to execute the function specified above.

  3. Select Run and you should see the result of your compute module. Note that the first query may take some time if you have scale down to zero enabled.

    Multiply Query Result

Compute Modules can serve multiple functions; the example above executed multiply, but could also call the function divide.

Divide Query Result