Repository navigation
feat(azure): VM updates and data disks, resource SKUs, and the AI Search and OpenAI ingestion data planes - #116
Open
Joey Lin (jlinpw) wants to merge 12 commits into
Conversation
…uspend and resume acceleratorTypes answers aggregatedList, list and get from a per-zone catalog that WithAcceleratorTypes sets. regionInstances.bulkInsert places instances in the region's zones by its locationPolicy and shares the zonal bulkInsert's naming, conflict and minCount rules. instances.suspend and resume move a running instance through SUSPENDING to SUSPENDED and back.
Zonal instance group managers: insert, get, list, aggregatedList, delete, createInstances, deleteInstances, listManagedInstances and setInstanceTemplate. A group creates real instances from its template, which instances.get and list see, and reports them with their instanceStatus and currentAction; deleting a group deletes its instances, and a template a group uses cannot be deleted. Resize requests: insert, get, list, cancel and delete, moving from ACCEPTED through CREATING to SUCCEEDED as WithSettleAfter and Settle allow, with the 412 the API gives a cancel or delete in the wrong state. Server.FailResizeRequest and Server.FailResizeAttempt end a request in FAILED or record a failed attempt on one still waiting, as want of quota or capacity does.
# Conflicts: # gcp/compute/instances.go # gcp/compute/server.go
Server.Search serves a search service's indexes, data sources, indexers (with runs and status) and documents, authenticated with its admin keys. Server.OpenAI serves an Azure OpenAI account's ingestion jobs, authenticated with its account keys. Indexer runs and ingestion jobs settle as other operations do, and faults can fail them. FailProvisioning leaves a resource Failed, and FailSubnetCheck makes Managed Lustre subnet checks fail with the error the API defines.
Organization.NoCountry and NoDefaultUsageLocation make GET /organization answer countryLetterCode or defaultUsageLocation as null, as Graph does for a tenant set up without them.
…version updates Resource SKUs list the catalog WithResourceSKUs sets, filtered by location. A VM create whose operation fails leaves the VM Failed, powerOff stops a VM, an update that changes a VM's customData or SSH public keys fails with PropertyChangeNotAllowed, and a PATCH updates a gallery image version's tags, publishingProfile and safetyProfile.
# Conflicts: # azure/arm/server.go
# Conflicts: # azure/arm/server.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the
azure/armandazure/graphstand-ins so code that provisions VMs, scale sets and Azure AI services can be tested through the official Azure SDK for Go, instead of the SDK's per-service fake servers or hand-written HTTP stand-ins.Stacked on #115. Both come from the same fork, so GitHub shows #115's commits here too until it merges. The changes in this PR are the five commits after
0e437f3, and they touch onlyazure/.Virtual machine updates and data disks.
PATCHtakes tags andstorageProfile.dataDisks. Renaming the OS disk fails withPropertyChangeNotAllowed, and other properties fail with 400 as not supported, so callers change them with a PUT.createOption: Attach), each at its own lun from 0 to 63. A PUT or PATCH that listsdataDisksreplaces them: a disk it leaves out, or markstoBeDetached, is detached. Attaching a disk another VM holds fails with 409OperationNotAllowed.deleteOptionisDelete. Deleting a group that holds a disk a VM elsewhere has attached fails withResourceGroupDeletionBlocked.Resource SKUs.
WithResourceSKUs(...)sets the SKUs a subscription is offered, with locations, zones, capabilities and restrictions.resourceSkuslist takes the one$filterAzure supports (location eq '...'), and any other filter fails with 400. The default is still none.More VM behavior.
FailOperationfault, such asAllocationFailed) leaves the VMFailed, as Azure does: it keeps its interfaces and OS disk, has no power state, and its instance view showsProvisioningState/failed/{code}. A PUT over it provisions it again. Previously a failed create left nothing.powerOffshows the VM stopping, then stopped, with its OS disk still attached.osProfile.customDataor the Linux SSH public keys fails with 409PropertyChangeNotAllowed, as Azure refuses both.Gallery image version updates.
PATCHmerges tags,publishingProfileandsafetyProfile;storageProfile,securityProfileandrestorefail with 400.blockDeletionBeforeEndOfLifeis recorded, not enforced.Azure AI Search data plane (
Server.Search(), served likeServer.Blob()):indexes/xorindexes('x'). Also indexersearch.runandsearch.status, Index Documents, and a GET document search.api-key; a missing or wrong key fails with 403. A get or delete of something that doesn't exist answers 404.If-Match/If-None-MatchandPrefer: return=minimalbehave as documented. A data source's connection string reads back as null, and<unchanged>keeps it.disabled. A run staysinProgressuntilWithSettleAfter's reads are spent orSettle, and a second run while one is in progress fails with 409.Azure OpenAI ingestion jobs (
Server.OpenAI()):PUTandGET {endpoint}openai/ingestion/jobs/{id}on an OpenAI or AIServices account, found by its custom subdomain. Each call needs key1 or key2; a wrong key fails with 401. A job isrunninguntil settled, thensucceeded.Seeding methods, for states a fault can't leave behind:
Server.FailProvisioning(id)leaves a resourceFailed.Server.FailSubnetCheck(subnet, message)fails a Managed Lustre subnet check with the body the API defines.Graph.
graph.OrganizationtakesNoCountryandNoDefaultUsageLocation, so/organizationcan answer those fields as null, as Graph does.Data-plane faults are named after the REST spec's operation IDs (
Indexes_Delete,Indexers_Run,IngestionJobs_Create, ...).FailOperationonIndexers_Runends the run intransientFailure, and onIngestionJobs_Createit returns a job that hasfailed.The package documentation lists where the stand-in differs from Azure, including:
WithPolicy.Testing
sdktest/azure/arm:datadisks_test.go, and new cases incompute_test.goandarm_test.go, go througharmcompute(virtual machines, disks, resource SKUs, gallery image versions) andarmresources. The Search and OpenAI data planes are tested over plain HTTP, as their REST references document them, the way the Blob data plane is.sdktest/azure/graph:TestOrganizationWithoutCountrygoes through the official Graph client.make checkpasses (on Go 1.27.4; 1.27.3's standard library has GO-2026-6859, which govulncheck reports regardless of this change).make benchagainst canary forazure/arm, withbenchstatover 10 runs each. Times are unchanged within noise, and bytes and allocations per op are the same:The two faster rows reflect a noisy canary run (±23% and ±37%), not a speedup.
Checklist
make checkpasses