Tags: AWS, GCP, AliCloud, Integration, Advanced

Memory Machine Cloud plugin

Note

This is a legacy implementation of the Memory Machine Cloud integration. We recommend using the Memory Machine Cloud agent instead.

MemVerge Memory Machine Cloud (MMCloud)—available on AWS, GCP, and AliCloud—empowers users to continuously optimize cloud resources during runtime, safely execute stateful tasks on spot instances, and monitor resource usage in real time. These capabilities make it an excellent fit for long-running batch workloads. Flyte can be integrated with MMCloud, allowing you to execute Flyte tasks using MMCloud.

Installation

To install the plugin, run the following command:

pip install flytekitplugins-mmcloud

To get started with MMCloud, see the MMCloud user guide.

Flyte deployment configuration

The MMCloud plugin is enabled in FlytePropeller’s configuration.

Getting Started

This plugin allows executing PythonFunctionTask using MMCloud without changing any function code.

@task(task_config=MMCloudConfig())
def to_str(i: int) -> str:
    return str(i)

Resource (cpu and mem) requests and limits, container images, and environment variable specifications are supported.

ImageSpec may be used to define images to run tasks.

Credentials

The following secrets are required to be defined for the agent server:

  • mmc_address: MMCloud OpCenter address

  • mmc_username: MMCloud OpCenter username

  • mmc_password: MMCloud OpCenter password

Defaults

Compute resources:

  • If only requests are specified, there are no limits.

  • If only limits are specified, the requests are equal to the limits.

  • If neither resource requests nor limits are specified, the default requests used for job submission are cpu="1" and mem="1Gi", and there are no limits.

Agent Image

Install flytekitplugins-mmcloud in the agent image.

A float binary (obtainable via the OpCenter) is required. Copy it to the agent image PATH.

Sample Dockerfile for building an agent image:

FROM python:3.11-slim-bookworm

WORKDIR /root
ENV PYTHONPATH /root

# flytekit will autoload the agent if package is installed.
RUN pip install flytekitplugins-mmcloud
COPY float /usr/local/bin/float

# For flytekit versions <= v1.10.2, use pyflyte serve.
# CMD pyflyte serve --port 8000
# For flytekit versions > v1.10.2, use pyflyte serve agent.
CMD pyflyte serve agent --port 8000

Example usage

For a usage example, see the Memory Machine Cloud example page.