-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add wait for status update #186
Add wait for status update #186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment: In the future, may be clearer to name the branch on the origin like sdk_v0.2.0-branch
(just because we have differences in the app vs sdk numbering and it also follows the tag name format to prefix with 'sdk'). Anyway, we can nuke these branches when they've served their purpose.
openapi_docker_config = docker_config.copy() | ||
openapi_docker_config['resource_request'] = \ | ||
turing.generated.models.ResourceRequest(**openapi_docker_config['resource_request']) | ||
openapi_docker_config['env'] = [turing.generated.models.EnvVar(**env_var) for env_var in openapi_docker_config['env']] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made some additional changes - they look pretty minor but they were causing some bugs in the unit tests after the refactoring suggested earlier.
Essentially, the previous implementation of the setter methods were mutating the dictionaries that were being passed to it as arguments, which is dangerous and might lead to unintended effects. These new changes simply create new working dictionaries that are only used within the scope of the setter.
cc @krithika369
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Thanks for addressing them. We need to propagate these changes to main later as well.
self._config = config | ||
if self._config is not None and 'project_id' in self._config: | ||
self.config['project_id'] = int(self._config['project_id']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as the one I just commented on, though the fix here was to simply reorder the statements.
Okay thanks for your comments! I'll be merging this now. |
Context
This update to the Turing SDK adds commits to the existing release of Turing SDK (
v0.2.0
), which serve to introduce aversion
attribute in theRouter
SDK. Thisversion
attribute (as well as a router's other attributes) gets updated whenwait_for_status
gets called on aRouter
instance. Whenwait_for_status
returns successfully, theversion
attribute would be expected to contain the current router version number.This update is mainly targeted at scenarios when one updates a router - right after calling
update
, the existing router version that is deployed remains the same while the new version enters thepending
state. Instead of having to query the status of the Router actively in order to retrieve the new router version id when it has finally been deployed successfully, the user can simply be assured that his/herRouter
instance has a newly updated version id when the waiting function has returned succesfully.