Skip to content

Commit c85bee3

Browse files
authored
Notebook Instance Lifecycle Configuration Code + Integration test (#75)
This is a pull request for the Notebook Instance Lifecycle configuration operator and it's integration test. Files modified: generator.yaml: Adds necessary status fields, hooks, errors for Notebook Instance Lifecycle Configuration. Files added: delta_post_compare.go.tpl: hook that uses functions in custom_delta.go to update the delta(difference between latest/desired). sdk_update_post_set_output.go.tpl: hook that makes the controller re queue after an update. custom_delta.go: Contains function to compare the onCreate and onStart fields of the Notebook Instance Life cycle Configuration. hooks.go: Contains the requeueWhileUpdating variable that is used in sdk.go to requeue after an update, this is to make sure the LastModifiedTime status field gets updated. test_notebook_instance_lifecycle.py: Contains the integration test for the Notebook Instance Lifecycle configuration. This integration test creates, updates and deletes a Notebook Instance Lifecycle configuration. notebook_instance_lifecycle_config.yaml: Contains the crd(thats used for the integration test) for Notebook Instance Lifecycle configuration.
1 parent 74a8ec3 commit c85bee3

30 files changed

+2105
-5
lines changed

apis/v1alpha1/generator.yaml

+40-1
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,45 @@ resources:
725725
template_path: common/sdk_delete_pre_build_request.go.tpl
726726
sdk_delete_post_request:
727727
template_path: common/sdk_delete_post_request.go.tpl
728+
NotebookInstanceLifecycleConfig:
729+
exceptions:
730+
errors:
731+
404:
732+
code: ValidationException
733+
message_prefix: Unable to describe Notebook Instance Lifecycle Config
734+
terminal_codes:
735+
- ResourceLimitExceeded
736+
- ResourceNotFound
737+
- ResourceInUse
738+
- OptInRequired
739+
- InvalidParameterCombination
740+
- InvalidParameterValue
741+
- MissingParameter
742+
- MissingAction
743+
- InvalidQueryParameter
744+
- MalformedQueryString
745+
- InvalidAction
746+
- UnrecognizedClientException
747+
hooks:
748+
delta_post_compare:
749+
template_path: notebook_instance_lifecycle_config/delta_post_compare.go.tpl
750+
sdk_update_post_set_output:
751+
template_path: notebook_instance_lifecycle_config/sdk_update_post_set_output.go.tpl
752+
fields:
753+
LastModifiedTime:
754+
is_read_only: true
755+
print:
756+
name: LAST-MODIFIED-TIME
757+
from:
758+
operation: DescribeNotebookInstanceLifecycleConfig
759+
path: LastModifiedTime
760+
CreationTime:
761+
is_read_only: true
762+
print:
763+
name: CREATION-TIME
764+
from:
765+
operation: DescribeNotebookInstanceLifecycleConfig
766+
path: CreationTime
728767
ignore:
729768
resource_names:
730769
- Algorithm
@@ -757,7 +796,7 @@ ignore:
757796
# ModelPackageGroup
758797
# - ModelQualityJobDefinition
759798
# - MonitoringSchedule
760-
- NotebookInstanceLifecycleConfig
799+
# - NotebookInstanceLifecycleConfig
761800
# - NotebookInstance
762801
- Pipeline
763802
- PresignedDomainUrl

apis/v1alpha1/notebook_instance_lifecycle_config.go

+76
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/types.go

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

+165
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/controller/main.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)