{"id":27659,"library":"codeflare-sdk","title":"CodeFlare SDK","description":"Python SDK for CodeFlare, providing high-level abstractions to deploy and manage Ray clusters on Kubernetes, with integrated job submission and resource management. Current version 0.37.0, requires Python >=3.11, <4.0, and is actively maintained with monthly releases.","status":"active","version":"0.37.0","language":"python","source_language":"en","source_url":"https://github.com/project-codeflare/codeflare-sdk","tags":["ray","kubernetes","distributed-computing","ml","cluster-management"],"install":[{"cmd":"pip install codeflare-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used to interact with Kubernetes API for cluster management.","package":"kubernetes","optional":false},{"reason":"Core distributed computing library that CodeFlare orchestrates.","package":"ray","optional":false}],"imports":[{"note":"Wrong module name: the correct package is 'codeflare_sdk', not 'codeflare'.","wrong":"from codeflare.cluster import Cluster","symbol":"Cluster","correct":"from codeflare_sdk import Cluster"},{"note":"ClusterConfiguration is exported from the top-level package, not from a submodule.","wrong":"from codeflare_sdk.config import ClusterConfiguration","symbol":"ClusterConfiguration","correct":"from codeflare_sdk import ClusterConfiguration"}],"quickstart":{"code":"from codeflare_sdk import Cluster, ClusterConfiguration\nimport os\n\n# Define cluster configuration\nconfig = ClusterConfiguration(\n    name='example-cluster',\n    namespace='default',\n    num_workers=2,\n    head_cpus='500m',\n    head_memory='2Gi',\n    worker_cpus='1',\n    worker_memory='4Gi',\n    min_workers=1,\n    max_workers=4,\n)\n\n# Create and start the cluster\ncluster = Cluster(config)\ncluster.up()\n# Wait for cluster to be ready\ncluster.wait_ready()\nprint(f\"Ray URI: {cluster.cluster_uri()}\")\n# Submit a simple Ray job\nimport ray\nray.init(cluster.cluster_uri())\n@ray.remote\ndef hello():\n    return \"Hello from Ray cluster\"\nprint(ray.get(hello.remote()))\n# Tear down\ncluster.down()","lang":"python","description":"Create a Ray cluster on Kubernetes, run a remote function, and tear down."},"warnings":[{"fix":"Migrate to Kuberay-based configurations. Remove any AppWrapper references.","message":"AppWrapper support removed in v0.34.0. Instantiation of Ray clusters now relies solely on Kuberay operator; any code using AppWrapper objects will break.","severity":"breaking","affected_versions":">=0.34.0"},{"fix":"Upgrade the Kuberay operator to a compatible version. Ensure Ray image aligns with the SDK's default.","message":"In v0.33.0, the immutable image tag for Ray was updated to Ray v2.52.1. Clusters created with older SDK versions (pre-0.33.0) may fail if the operator is not updated.","severity":"breaking","affected_versions":">=0.33.0"},{"fix":"Use only lowercase alphanumeric characters and hyphens; no underscores or uppercase.","message":"Cluster name must be a valid Kubernetes resource name (lowercase RFC 1123 subdomain). Since v0.36.0, invalid names cause early errors.","severity":"gotcha","affected_versions":">=0.36.0"},{"fix":"Replace any references to codeflare-operator with kuberay in your cluster configuration or environment.","message":"Usage of 'codeflare-operator' is deprecated; all operator references have been replaced with 'kuberay' in v0.35.0. Old cluster configurations may stop working.","severity":"deprecated","affected_versions":">=0.35.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install the package (pip install codeflare-sdk) and import as 'from codeflare_sdk import Cluster'.","cause":"Incorrect import path; the package is named 'codeflare_sdk', not 'codeflare'.","error":"ModuleNotFoundError: No module named 'codeflare'"},{"fix":"Use a lowercase name with only hyphens and alphanumeric characters, e.g., 'mycluster-1'.","cause":"Cluster name contains uppercase letters or underscores, which violates RFC 1123.","error":"ValueError: Invalid cluster name 'MyCluster_1'. Must be a valid Kubernetes resource name"},{"fix":"Ensure Kuberay operator is installed and use ClusterConfiguration without AppWrapper-related settings.","cause":"AppWrapper CRD is no longer available in the cluster; requires Kuberay operator.","error":"ClusterError: Failed to get RayCluster resource: 'appwrapper.codeflare.codeflare.dev \"...\" not found'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}