{"id":19888242,"url":"https://github.com/project-codeflare/codeflare-sdk","last_synced_at":"2026-04-02T23:31:23.898Z","repository":{"id":65337878,"uuid":"556865814","full_name":"project-codeflare/codeflare-sdk","owner":"project-codeflare","description":"An intuitive, easy-to-use python interface for batch resource requesting, access, job submission, and observation. Simplifying the developer's life while enabling access to high-performance compute resources, either in the cloud or on-prem.","archived":false,"fork":false,"pushed_at":"2024-10-29T08:55:03.000Z","size":5866,"stargazers_count":22,"open_issues_count":88,"forks_count":44,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-10-29T09:21:58.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/project-codeflare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-24T17:00:43.000Z","updated_at":"2024-10-29T08:03:45.000Z","dependencies_parsed_at":"2023-12-20T19:42:02.906Z","dependency_job_id":"9156c0e6-b00e-4266-b104-56d85e93b169","html_url":"https://github.com/project-codeflare/codeflare-sdk","commit_stats":{"total_commits":79,"total_committers":5,"mean_commits":15.8,"dds":"0.44303797468354433","last_synced_commit":"2348361d77864256127677f541f44047e48ee89b"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-codeflare%2Fcodeflare-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-codeflare%2Fcodeflare-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-codeflare%2Fcodeflare-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-codeflare%2Fcodeflare-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/project-codeflare","download_url":"https://codeload.github.com/project-codeflare/codeflare-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280190,"owners_count":20912966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T18:06:44.022Z","updated_at":"2026-04-02T23:31:23.891Z","avatar_url":"https://github.com/project-codeflare.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeFlare SDK\n\n[![Python application](https://github.com/project-codeflare/codeflare-sdk/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/project-codeflare/codeflare-sdk/actions/workflows/unit-tests.yml)\n![coverage badge](./coverage.svg)\n\nAn intuitive, easy-to-use python interface for batch resource requesting, access, job submission, and observation. Simplifying the developer's life while enabling access to high-performance compute resources, either in the cloud or on-prem.\n\nFor guided demos and basics walkthroughs, check out the following links:\n\n- Guided demo notebooks available [here](https://github.com/project-codeflare/codeflare-sdk/tree/main/demo-notebooks/guided-demos), and copies of the notebooks with [expected output](https://github.com/project-codeflare/codeflare-sdk/tree/main/demo-notebooks/guided-demos/notebook-ex-outputs) also available\n- these demos can be copied into your current working directory when using the `codeflare-sdk` by using the `codeflare_sdk.copy_demo_nbs()` function\n- Additionally, we have a [video walkthrough](https://www.youtube.com/watch?v=U76iIfd9EmE) of these basic demos from June, 2023\n\nFull documentation can be found [here](https://project-codeflare.github.io/codeflare-sdk/index.html)\n\n## Installation\n\nCan be installed via `pip`: `pip install codeflare-sdk`\n\n## Authentication\n\nCodeFlare SDK uses [kube-authkit](https://github.com/opendatahub-io/kube-authkit) for Kubernetes authentication, supporting multiple authentication methods:\n\n- **Auto-Detection** - Automatically detects kubeconfig or in-cluster authentication\n- **Token-Based** - Authenticate with API server token\n- **OIDC** - OpenID Connect authentication with device flow or client credentials\n- **OpenShift OAuth** - Native OpenShift OAuth support\n- **Kubeconfig** - Traditional kubeconfig file authentication\n- **In-Cluster** - Service account authentication when running in a pod\n\n### Quick Start\n\n```python\nfrom kube_authkit import get_k8s_client, AuthConfig\nfrom codeflare_sdk import set_api_client, Cluster, ClusterConfiguration\n\n# Option 1: Auto-detect authentication (recommended - no explicit auth needed!)\ncluster = Cluster(ClusterConfiguration(\n    name='my-cluster',\n    num_workers=2,\n))\ncluster.apply()\n\n# Option 2: OIDC authentication\nauth_config = AuthConfig(\n    method=\"oidc\",\n    oidc_issuer=\"https://your-oidc-provider.com\",\n    client_id=\"your-client-id\",\n    use_device_flow=True\n)\napi_client = get_k8s_client(config=auth_config)\nset_api_client(api_client)  # Register with CodeFlare SDK\n\n# Option 3: OpenShift OAuth with token\nauth_config = AuthConfig(\n    k8s_api_host=\"https://api.example.com:6443\",\n    token=\"your-token\"\n)\napi_client = get_k8s_client(config=auth_config)\nset_api_client(api_client)  # Register with CodeFlare SDK\n\n# Now create your cluster\ncluster = Cluster(ClusterConfiguration(\n    name='my-cluster',\n    num_workers=2,\n))\ncluster.apply()\n```\n\n### Migration from Legacy Authentication\n\nIf you're using the deprecated `TokenAuthentication` or `KubeConfigFileAuthentication` classes, please see our [Migration Guide](./docs/auth_migration_guide.md) for detailed instructions on updating to kube-authkit.\n\n**Legacy classes (deprecated):**\n```python\n# ⚠️ Deprecated - will be removed in v1.0.0\nfrom codeflare_sdk import TokenAuthentication\nauth = TokenAuthentication(token=\"...\", server=\"...\")\nauth.login()\n```\n\n**New recommended approach:**\n```python\n# ✅ Recommended - Auto-detection (no explicit auth needed!)\nfrom codeflare_sdk import Cluster, ClusterConfiguration\ncluster = Cluster(ClusterConfiguration(name=\"my-cluster\"))\n\n# ✅ For OIDC or OpenShift OAuth with token\nfrom kube_authkit import AuthConfig, get_k8s_client\nfrom codeflare_sdk import set_api_client\n\nauth_config = AuthConfig(\n    k8s_api_host=\"https://api.example.com:6443\",\n    token=\"your-token\"\n)\napi_client = get_k8s_client(config=auth_config)\nset_api_client(api_client)  # Register with CodeFlare SDK\n```\n\n## Development\n\nPlease see our [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed instructions.\n\n## Release Instructions\n\n### Automated Releases\n\nIt is possible to use the Release Github workflow to do the release. This is generally the process we follow for releases\n\n### Manual Releases\n\nThe following instructions apply when doing release manually. This may be required in instances where the automation is failing.\n\n- Check and update the version in \"pyproject.toml\" file.\n- Commit all the changes to the repository.\n- Create Github release (\u003chttps://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release\u003e).\n- Build the Python package. `poetry build`\n- If not present already, add the API token to Poetry.\n`poetry config pypi-token.pypi API_TOKEN`\n- Publish the Python package. `poetry publish`\n- Trigger the [Publish Documentation](https://github.com/project-codeflare/codeflare-sdk/actions/workflows/publish-documentation.yaml) workflow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-codeflare%2Fcodeflare-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproject-codeflare%2Fcodeflare-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-codeflare%2Fcodeflare-sdk/lists"}