-
Notifications
You must be signed in to change notification settings - Fork 22
feat(notebooks): use normalized parameter names PS-13855 blocked on paperspace/PS_API#1764 #288
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
Changes from all commits
c934bc1
598874a
a6d876e
51fef58
0746a82
879aa6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| @attr.s | ||
| class Notebook(object): | ||
| id = attr.ib(type=str, default=None) | ||
| machine_type = attr.ib(type=str, default=None) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ |
||
| vm_type_id = attr.ib(type=int, default=None) | ||
| vm_type_label = attr.ib(type=str, default=None) | ||
| container_id = attr.ib(type=int, default=None) | ||
|
|
@@ -17,6 +18,7 @@ class Notebook(object): | |
| cluster_id = attr.ib(type=str, default=None) | ||
| registry_username = attr.ib(type=str, default=None) | ||
| registry_password = attr.ib(type=str, default=None) | ||
| command = attr.ib(type=str, default=None) | ||
| default_entrypoint = attr.ib(type=str, default=None) | ||
| container_user = attr.ib(type=str, default=None) | ||
| shutdown_timeout = attr.ib(type=int, default=None) | ||
|
|
@@ -57,6 +59,7 @@ def url(self): | |
| @attr.s | ||
| class NotebookStart(object): | ||
| notebook_id = attr.ib(type=str, default=None) | ||
| machine_type = attr.ib(type=str, default=None) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to leave the old fields in the models because the responses have not been updated to the new field names yet. |
||
| vm_type_id = attr.ib(type=int, default=None) | ||
| vm_type_label = attr.ib(type=str, default=None) | ||
| cluster_id = attr.ib(type=str, default=None) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,14 +9,17 @@ class NotebookSchema(BaseSchema): | |
| MODEL = models.Notebook | ||
|
|
||
| id = marshmallow.fields.Str() | ||
| machine_type = marshmallow.fields.Str(load_from="machineType", dump_to="machineType") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ |
||
| vm_type_id = marshmallow.fields.Int(load_from="vmTypeId", dump_to="vmTypeId") | ||
| vm_type_label = marshmallow.fields.Str(load_from="vmTypeLabel", dump_to="vmTypeLabel") | ||
| container_id = marshmallow.fields.Int(load_from="containerId", dump_to="containerId", allow_none=True) | ||
| container = marshmallow.fields.Str(load_from="container", dump_to="container", allow_none=True) | ||
| container_name = marshmallow.fields.Str(load_from="containerName", dump_to="containerName", allow_none=True) | ||
| name = marshmallow.fields.Str() | ||
| cluster_id = marshmallow.fields.Str(load_from="clusterId", dump_to="clusterId") | ||
| registry_username = marshmallow.fields.Str(load_from="registryUsername", dump_to="registryUsername") | ||
| registry_password = marshmallow.fields.Str(load_from="registryPassword", dump_to="registryPassword") | ||
| command = marshmallow.fields.Str(load_from="command", dump_to="command") | ||
| default_entrypoint = marshmallow.fields.Str(load_from="defaultEntrypoint", dump_to="defaultEntrypoint") | ||
| container_user = marshmallow.fields.Str(load_from="containerUser", dump_to="containerUser") | ||
| shutdown_timeout = marshmallow.fields.Int(load_from="shutdownTimeout", dump_to="shutdownTimeout") | ||
|
|
@@ -52,14 +55,15 @@ class NotebookSchema(BaseSchema): | |
| def preprocess(self, data, **kwargs): | ||
| data = copy.copy(data) | ||
|
|
||
| utils.base64_encode_attribute(data, "default_entrypoint") | ||
| utils.base64_encode_attribute(data, "command") | ||
| return data | ||
|
|
||
|
|
||
| class NotebookStartSchema(BaseSchema): | ||
| MODEL = models.NotebookStart | ||
|
|
||
| notebook_id = marshmallow.fields.Str(load_from="notebookId", dump_to="notebookId") | ||
| machine_type = marshmallow.fields.Str(load_from="machineType", dump_to="machineType") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ |
||
| vm_type_id = marshmallow.fields.Int(load_from="vmTypeId", dump_to="vmTypeId") | ||
| vm_type_label = marshmallow.fields.Str(load_from="vmTypeLabel", dump_to="vmTypeLabel") | ||
| name = marshmallow.fields.Str(load_from="notebookName", dump_to="notebookName") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| unset PAPERSPACE_API_KEY | ||
| unset PAPERSPACE_WEB_URL | ||
| unset PAPERSPACE_CONFIG_HOST | ||
| unset PAPERSPACE_CONFIG_LOG_HOST | ||
| unset PAPERSPACE_CONFIG_EXPERIMENTS_HOST | ||
| unset PAPERSPACE_CONFIG_EXPERIMENTS_HOST_V2 | ||
| unset PAPERSPACE_CONFIG_SERVICE_HOST |
Uh oh!
There was an error while loading. Please reload this page.