Integrate deployment metadata service for locking and state#4856
Integrate deployment metadata service for locking and state#4856shreyas-goenka wants to merge 15 commits intomainfrom
Conversation
|
Commit: 342fef8
|
|
|
||
| // Report skip actions to the metadata service. On initial registration, | ||
| // these are recorded as INITIAL_REGISTER operations. | ||
| if action == deployplan.Skip && b.OperationReporter != nil { |
There was a problem hiding this comment.
move the initial registration up
| @@ -0,0 +1,6 @@ | |||
| Local = true | |||
| Cloud = false | |||
There was a problem hiding this comment.
The service needs to roll out to prod before we enable this on cloud.
4bbbe9c to
7b26260
Compare
| assert.True(t, ok) | ||
| assert.Equal(t, tmpdms.VersionTypeDestroy, vt) | ||
|
|
||
| _, ok = goalToVersionType(GoalBind) |
There was a problem hiding this comment.
support can be added as a followup.
Approval status: pending
|
Add server-side deployment locking and state management via the Deployment Metadata Service (DMS), gated behind DATABRICKS_BUNDLE_MANAGED_STATE=true. Key changes: - DeploymentLock interface with factory (DMS or filesystem based on env) - DMS lock: version-based locking with heartbeat, operation reporting - State read/write via ListResources/CreateOperation with per-resource state - withDeploymentLock helper extracts lock boilerplate from deploy/destroy - Temporary DMS client (libs/tmpdms) mirroring future SDK-generated code - Mock DMS server for acceptance tests - 6 acceptance tests covering deploy, destroy, plan, summary, sequential deploys, and adding resources with remote state Co-authored-by: Isaac
…troy phases Co-authored-by: Isaac
LoadStateFromDMS is a state-loading function, not a lock function. Moving it to statemgmt where it belongs alongside other state management code. Co-authored-by: Isaac
When we just created the deployment, LastVersionID is necessarily empty so we can start at version "1" directly. Co-authored-by: Isaac
Co-authored-by: Isaac
Print requests inline in output.txt and clear remaining requests at the end of each script so out.requests.txt is not generated. Also update sequential-deploys test to add/remove resources across deploys, asserting create and delete operations are captured. Co-authored-by: Isaac
…erations - Print DMS requests inline in output.txt via print_requests.py - Update sequential-deploys to test create/delete across deploys - Add protoLogs replacement to stabilize flaky telemetry timing - Regenerate out.requests.txt golden files Co-authored-by: Isaac
If CreateDeployment fails, the workspace should not contain a dangling deployment ID pointing to a non-existent server record. Co-authored-by: Isaac
The old lock.Acquire mutator checked for fs.ErrPermission and fs.ErrNotExist and reported possible permission denied errors. This was lost when refactoring to the DeploymentLock interface. Co-authored-by: Isaac
Add print_requests.py cleanup at the end of each script to clear remaining recorded requests, preventing out.requests.txt from being generated as a golden file. DMS requests are already printed inline in output.txt. Co-authored-by: Isaac
Open out.requests.txt with explicit utf-8 encoding to handle non-ASCII characters in request bodies. Co-authored-by: Isaac
Regenerated with Python 3.11 after fixing the UnicodeDecodeError. The output.txt files now contain the inline DMS request assertions without the Python traceback errors. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
7339f0b to
65c2aae
Compare
Summary
Integrates the Deployment Metadata Service (DMS) as an alternative backend for deployment locking and resource state management. Gated behind
DATABRICKS_BUNDLE_MANAGED_STATE=true.When enabled:
ListResources/CreateOperation) instead of local state filesKey implementation details
DeploymentLockinterface (lock.go) with two implementations:workspaceFilesystemLock(existing behavior) andmetadataServiceLock(DMS)resolveDeploymentIDreads deployment ID from workspaceresources.json, or generates a new UUID for fresh deployments (written only afterCreateDeploymentsucceeds)LoadStateFromDMSpopulates the state DB fromListResourcesinstead of reading local filesPushResourcesStateis a no-op with DMS (state is persisted per-operation to the server)--planflag and bind/unbind are not supported with DMSTest plan
acceptance/bundle/dms/covering: deploy with resource creation, sequential deploys with create/delete, plan + summary, deploy errors, and lock release errorsplanActionToOperationActionmapping