Add deployment status feature and cmdlet for deploying Yams applications #51
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.
Hi guys,
I finally found some time to work on the deployment status feature for YAMS. This feature makes it possible to get the status of the YAMS cluster for visualization and deployment monitoring purposes.
I originally thought about making the deployment status available in a
DeploymentStatus.json
blob but I quickly realized that race conditions between nodes trying to update this blob make it a bottleneck. Instead, I went with a blob per node. The deployment status blobs are published atapplications/status/clusters/clusterName/instances/instanceId
where
instanceId
is a text blob containing the deployment status of a particular node. The deployment status of a given node looks as follows:This blob is published every time YAMS looks for updates (default is 5 seconds), even if there are no changes in the cluster. Basically the status of the application pool on the node will be flushed to the blob every time YAMS does a periodic check for application updates. In fact, If the deployment status file for a given node is not updated for a longer than expected period of time, it's an indication that the YAMS host is down or is having trouble reaching storage (basically the timestamp provided can be used to monitor the node health).
Consumers of the deployment status need to know the instance id in order to consume the status of a given node directly (this is easy to get for cloud services). If not, the
BlobStorageDeploymentRepository
exposes an Api to get the cluster deployment status; which lists all the blobs in the blob directory corresponding to the cluster and finds out the instances ids based on the blobs names (it also uses a TTL to ignore old leftover blobs). Unfortunately, blob storage does not have a TTL feature and YAMS will not do the cleanup for you at this point (which is only relevant when you redeploy the cluster or scale it down).In addition to the deployment status, I added a PowerShell cmdlet that makes it easy to deploy YAMS with VSTS. Below is an example script that you can use in VSTS to deploy a service that uses two clusters, one is a front end (Web Api) and the other is an Orleans cluster.
This cmdlet takes advantage of the deployment status feature to allow the caller to optionally wait for the deployment to complete (i.e. all apps have been started). This is very useful to validate that the deployment went well and maybe follow it with some deployment verification tests that perform health checks and warm up the service.
I didn't get the chance yet to add extensive unit tests but the main features have been tested with end to end tests. I also updated the Yams Overview and added a tutorial of how to deploy YAMS with VSTS, which takes advantage of the deployment status feature and the powershell cmdlets.
Please share your thoughts and suggestions!
Thanks,
Nehme
Resolves #11 and partially #44