-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New Resource: azurerm_machine_learning_registry
#22870
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.
Thanks @wuxu92. I've made a first pass and have some questions regarding the design of this resource. I think there's some work to be done there.
Datastore *datastore.DatastoreClient | ||
MachineLearningComputes *machinelearningcomputes.MachineLearningComputesClient | ||
Workspaces *workspaces.WorkspacesClient | ||
RegistryManagementClient *registrymanagement.RegistryManagementClient |
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.
Alphabetical ordering
Datastore *datastore.DatastoreClient | |
MachineLearningComputes *machinelearningcomputes.MachineLearningComputesClient | |
Workspaces *workspaces.WorkspacesClient | |
RegistryManagementClient *registrymanagement.RegistryManagementClient | |
Datastore *datastore.DatastoreClient | |
MachineLearningComputes *machinelearningcomputes.MachineLearningComputesClient | |
RegistryManagementClient *registrymanagement.RegistryManagementClient | |
Workspaces *workspaces.WorkspacesClient |
Datastore: datastoreClient, | ||
MachineLearningComputes: computesClient, | ||
RegistryManagementClient: registryClient, | ||
Workspaces: workspacesClient, |
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 here
// with this stateWait, it can still read old value if from different server cluster. | ||
deadline, ok := ctx.Deadline() | ||
if !ok { | ||
return fmt.Errorf("no deadline for ctx") |
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.
return fmt.Errorf("no deadline for ctx") | |
return fmt.Errorf("internal-error: no deadline for ctx") |
"region_details": { | ||
Type: pluginsdk.TypeList, | ||
Required: true, | ||
ForceNew: true, | ||
MinItems: 1, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"acr_details": { | ||
Type: pluginsdk.TypeList, | ||
Optional: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"system_created_acr_account": { | ||
Type: pluginsdk.TypeList, | ||
Optional: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"acr_account_name": { | ||
Type: pluginsdk.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"acr_account_sku": { | ||
Type: pluginsdk.TypeString, | ||
Optional: true, | ||
ValidateFunc: validation.StringInSlice([]string{ | ||
"Premium", | ||
}, false), | ||
}, | ||
|
||
"arm_resource_id": { | ||
Type: pluginsdk.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
"user_created_acr_account": { | ||
Type: pluginsdk.TypeList, | ||
Optional: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"arm_resource_id": { | ||
Type: pluginsdk.TypeString, | ||
Optional: true, | ||
ValidateFunc: validation.StringIsNotEmpty, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, |
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.
There's potential to simplify this a lot and make this more user friendly. In what instances is a container registry created for the user by the service? Do they have to supply the sku type that they want?
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.
you are right. users cannot set these fields (system_created_acr_account
and user_created_acr_account
) in Portal but the API supports them. should we make the whole system_created_acr_account
as Computed
. if no user_created_acr_account
provided then use the system_created_acr_account
by default.
"storage_account_details": { | ||
Type: pluginsdk.TypeList, | ||
Optional: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"system_created_storage_account": { | ||
Type: pluginsdk.TypeList, | ||
Optional: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"blob_public_access_allowed": { | ||
Type: pluginsdk.TypeBool, | ||
Optional: true, | ||
Default: false, | ||
}, | ||
|
||
"arm_resource_id": { | ||
Type: pluginsdk.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"storage_account_name": { | ||
Type: pluginsdk.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"storage_account_type": { | ||
Type: pluginsdk.TypeString, | ||
Optional: true, | ||
ValidateFunc: validation.StringInSlice([]string{ | ||
"Standard_LRS", | ||
"Standard_GRS", | ||
"Standard_RAGRS", | ||
"Standard_ZRS", | ||
"Standard_GZRS", | ||
"Standard_RAGZRS", | ||
"Premium_LRS", | ||
"Premium_ZRS", | ||
}, false), | ||
}, | ||
|
||
"storage_account_hns_enabled": { | ||
Type: pluginsdk.TypeBool, | ||
Optional: true, | ||
Default: false, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
"user_created_storage_account": { | ||
Type: pluginsdk.TypeList, | ||
Optional: true, | ||
Elem: &pluginsdk.Resource{ | ||
Schema: map[string]*pluginsdk.Schema{ | ||
"arm_resource_id": { | ||
Type: pluginsdk.TypeString, | ||
Required: true, | ||
ValidateFunc: validation.StringIsNotEmpty, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, |
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 question posed above applies here.
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.
According to the MSFT learn docs region_details
would specify a primary region which cannot be changed after creation as well as additional regions for replication.
There is also a separate endpoint defined in the swagger for removing the additional regions.
Considering the above, the schema needs a significant overhaul to reflect that better and to bring the user experience more in-line with other resources in the provider.
I've left a comment in-line on what the schema needs to look like.
I'd also like to suggest reviewing our property naming guidelines again since many of the names here oppose the customs that we have in the provider today e.g. abbreviating acr -> container registry, appending block names with _details, _config, _properties etc.
internal/services/machinelearning/machine_learning_registry_resource.go
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
func (m MachineLearningRegistryResource) Update() sdk.ResourceFunc { |
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.
The additional regions, now renamed to replica_locations
in the schema, should be updatable, or in the very least, removable. Can you please investigate?
This PR is being labeled as "stale" because it has not been updated for 30 or more days. If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone. If you need some help completing this PR, please leave a comment letting us know. Thank you! |
Closing as there has been no action/change to this draft PR for a couple months now. please do reopen if this is ready for review. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Draft for swagger API Issue
Fixes #22565
there is a cache inconsistency issue in the UPDATE,
so it may still read the old value after updating thetags
field. but only the tags field can be updated. is this acceptable for this resource?there are eventually consistency issues in Update/RemoveRegions API. This resource can be merged once the issue addressed by service team. I have reach out to service team but I am still waiting for their response.