Quickstart

1. Install the Clusterfudge Python API locally

Run the following commands in your local terminal

pip install clusterfudge
python3 -m clusterfudge login

2. Run the fudgelet on a linux node

Run the following cmd on a linux server

curl https://get.clusterfudge.com/run.sh | CLUSTERFUDGE_API_KEY=$YOUR_API_KEY_HERE bash

3. Launch workload

Copy the following example into launch.py

import clusterfudge

def main():
    workload = "import os, time; task_id = os.environ.get('CLUSTERFUDGE_REPLICA_INDEX'); print(f'Hello from TASK_ID={task_id}'); time.sleep(60)"

    client = clusterfudge.Client()
    launch = client.create_launch(
        clusterfudge.CreateLaunchRequest(
            name="hello-world-example",
            description="Sleep 60 on 2 replicas with 1 CPU each.",
            jobs=[
                clusterfudge.Job(
                    short_name="hello_world",
                    replicas=2,
                    processes=[
                        clusterfudge.Process(
                            command=["python3", "-c", workload],
                        ),
                    ],
                ),
            ],
        )
    )

    print(f"Launched: launch/{launch.launch_id} 🎉")
    print("https://clusterfudge.clusterfudge.com/dashboard/launches/")

if __name__ == "__main__":
    main()

Launch your workload

python launch.py