Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor cluster factory #1591

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Refactor cluster factory #1591

merged 1 commit into from
Dec 17, 2024

Conversation

carolineechen
Copy link
Collaborator

No description provided.

Copy link
Collaborator Author

carolineechen commented Dec 13, 2024

@carolineechen carolineechen force-pushed the cluster-refactor branch 6 times, most recently from 53330c2 to c70bd63 Compare December 13, 2024 23:21
@carolineechen carolineechen marked this pull request as ready for review December 13, 2024 23:22
@@ -445,6 +445,10 @@ def config(self, condensed: bool = True):

return config

def _update_values(self, new_values: Dict[str, str]):
Copy link
Collaborator

@jlewitt1 jlewitt1 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these values always guaranteed to be a string? thinking about an image arg for example which we might need to serialize or convert to RNS address?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update the type to Dict[str, Any], I think serialization should happen through config()/from_config() but will double check the comparison of name to config

@carolineechen carolineechen force-pushed the cluster-refactor branch 3 times, most recently from c5429ab to 9a6c165 Compare December 16, 2024 18:50
subprocess.run(cmd, shell=True, check=True)
logger.info(f"Kubernetes context has been set to: {context}")
except subprocess.CalledProcessError as e:
logger.info(f"Error setting context: {e}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if we should actually raise an exception if we fail to set the context or namespace? we don't do it in den either, but this could lead to undesired behavior the user wouldn't want (ex: launching in a different namespace)

ssl_certfile=ssl_certfile,
domain=domain,
den_auth=den_auth,
cluster_args = locals().copy()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit and maybe just me, but was initially confused by the naming here, since cluster_args really behaves like kwargs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea using it as an easy way to get a dict out of the input args to easily pass around and use to check against cluster config, instead of manually creating a dict by passing in each arg as before (easy to miss an arg / forget to update when we add new factory args), but open to other approaches or naming, did you have one in mind?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya i like the way its extracted, its cleaner that way.. i think we can leave as is since it's not really "user facing" anyway

@carolineechen carolineechen force-pushed the cluster-refactor branch 4 times, most recently from c4dabdd to 52339b5 Compare December 17, 2024 02:59
@carolineechen carolineechen merged commit c18041e into main Dec 17, 2024
12 checks passed
@carolineechen carolineechen deleted the cluster-refactor branch December 17, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants