Skip to main content

Flytekit Memory Machine Cloud Plugin

Flyte Connector plugin to allow executing Flyte tasks using MemVerge Memory Machine Cloud.

To install the plugin, run the following command:

pip install flytekitplugins-mmcloud

To get started with MMCloud, refer to the MMCloud User Guide.

Getting Started

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

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 connector 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.

Example

example.py workflow example:

import pandas as pd
from flytekit import ImageSpec, Resources, task, workflow
from sklearn.datasets import load_wine
from sklearn.linear_model import LogisticRegression

from flytekitplugins.mmcloud import MMCloudConfig

image_spec = ImageSpec(packages=["scikit-learn"], registry="docker.io/memverge")


@task
def get_data() -> pd.DataFrame:
    """Get the wine dataset."""
    return load_wine(as_frame=True).frame


@task(task_config=MMCloudConfig(), container_image=image_spec)  # Task will be submitted as MMCloud job
def process_data(data: pd.DataFrame) -> pd.DataFrame:
    """Simplify the task from a 3-class to a binary classification problem."""
    return data.assign(target=lambda x: x["target"].where(x["target"] == 0, 1))


@task(
    task_config=MMCloudConfig(submit_extra="--migratePolicy [enable=true]"),
    requests=Resources(cpu="1", mem="1Gi"),
    limits=Resources(cpu="2", mem="4Gi"),
    container_image=image_spec,
    environment={"KEY": "value"},
)
def train_model(data: pd.DataFrame, hyperparameters: dict) -> LogisticRegression:
    """Train a model on the wine dataset."""
    features = data.drop("target", axis="columns")
    target = data["target"]
    return LogisticRegression(max_iter=3000, **hyperparameters).fit(features, target)


@workflow
def training_workflow(hyperparameters: dict) -> LogisticRegression:
    """Put all of the steps together into a single workflow."""
    data = get_data()
    processed_data = process_data(data=data)
    return train_model(
        data=processed_data,
        hyperparameters=hyperparameters,
    )

Connector Image

Install flytekitplugins-mmcloud in the connector image.

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

Sample Dockerfile for building an connector image:

FROM python:3.11-slim-bookworm

WORKDIR /root
ENV PYTHONPATH /root

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

CMD pyflyte serve connector --port 8000

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flytekitplugins_mmcloud-1.16.28.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flytekitplugins_mmcloud-1.16.28-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file flytekitplugins_mmcloud-1.16.28.tar.gz.

File metadata

File hashes

Hashes for flytekitplugins_mmcloud-1.16.28.tar.gz
Algorithm Hash digest
SHA256 8d5bf83cc5528ea93cef28cafd7dc5fc499e9b6bf32aed224bab83043fcb0f8b
MD5 d40301e7edba67cd11d4917d05186724
BLAKE2b-256 f2ba267cc9467f964b5c31580dc9c9c7b11c92281306ac99f9dff5b2260f722b

See more details on using hashes here.

File details

Details for the file flytekitplugins_mmcloud-1.16.28-py3-none-any.whl.

File metadata

File hashes

Hashes for flytekitplugins_mmcloud-1.16.28-py3-none-any.whl
Algorithm Hash digest
SHA256 f136cb25897b1e1cb92dd5fd176c5627ab521d3e1f42b04cf6270acc505bdaeb
MD5 5d31c4ea1e1a86387b7a2bccd117f676
BLAKE2b-256 daa75bf7464ad6e24ca26146c7a3a44f5755920a039ee2f2a6d29955cfffc2aa

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.16.28 This release

2 files

1.16.27

2 files

1.16.26

2 files

1.16.25

2 files

1.16.24

2 files

1.16.23

2 files

1.16.22

2 files

1.16.21

2 files

1.16.20

2 files

1.16.19

2 files

1.16.16

2 files

1.16.15

2 files

1.16.14

2 files

1.16.13

2 files

1.16.12

2 files

1.16.11

2 files

1.16.10

2 files

1.16.9

2 files

1.16.8

2 files

1.16.7

2 files

1.16.6

2 files

1.16.5

2 files

1.16.4

2 files

1.16.3

2 files

1.16.2

2 files

1.16.1

2 files

1.16.0

2 files

1.15.4

2 files

1.15.3

2 files

1.15.2

2 files

1.15.1

2 files

1.15.0

2 files

1.14.9

2 files

1.14.8

2 files

1.14.7

2 files

1.14.6

2 files

1.14.5

2 files

1.14.4

2 files

1.14.3

2 files

1.14.2

2 files

1.14.1

2 files

1.14.0

2 files

1.13.15

2 files

1.13.14

2 files

1.13.13

2 files

1.13.12

2 files

1.13.11

2 files

1.13.10

1 file

1.13.9

2 files

1.13.8

2 files

1.13.7

2 files

1.13.6

2 files

1.13.5

2 files

1.13.4

2 files

1.13.3

2 files

1.13.2

2 files

1.13.1

2 files

1.13.0

2 files

1.12.3

2 files

1.12.2

2 files

1.12.0

2 files

1.11.0

2 files

1.10.7

2 files

1.10.3

2 files

1.10.2

2 files

1.10.1

2 files

1.10.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page