codeflare-sdk
codeflare-sdk copied to clipboard
add: Functionality to generate a ClusterConfiguration Template in the next notebook cell
Issue link
What changes have been made
This PR adds a new util function, generateClusterConfig.
The function will simplify the process of setting up a cluster by providing an unfilled ClusterConfiguration in the following cell.
Verification steps
- Build the sdk
- Open a new Notebook and install the sdk
- Import the generateClusterConfig function:
from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication, generateClusterConfig
- Now, running
generateClusterConfig()will add a new cell in the notebook with a ClusterConfiguration template:
cluster = Cluster(ClusterConfiguration(
name='',
head_cpus='',
head_memory='',
head_gpus='', # For GPU enabled workloads set the head_gpus and num_gpus
num_gpus='',
num_workers='',
min_cpus='',
max_cpus='',
min_memory='',
max_memory='',
image="", # Optional Field
write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources
local_queue="" # Specify the local queue manually
))
Checks
- [ ] I've made sure the tests are passing.
- Testing Strategy
- [ ] Unit tests
- [ ] Manual tests
- [ ] Testing is not required for this change
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign kpostoffice for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment