trainline / consul-deployment-agent Goto Github PK
View Code? Open in Web Editor NEWCross-platform deployment agent for Environment Manager
License: Other
Cross-platform deployment agent for Environment Manager
License: Other
As part of trainline/environment-manager#12, Environment Manager now supports the "disabling" of services - preventing any future infrastructure from installing particular services. This is done by adding a Status
value to the key/value store.
To complete this feature the Consul Deployment Agent needs to first check for the existence of this property and ignore installations if the Status
value is 'Disabled'.
Given that you have defined the following in healthchecks.yml
:
some-service-is-running:
name: some-service-is-running
local_script: is-running.ps1
interval: 10
the check that will be generated by CDA will look like:
"checks": {
"order-notification-service-is-running": {
"command": "C:\\temp\\e3c9cfb0-f92c-11e6-be86-8389fd3ece3c\\archive\\healthchecks\\sensu\\is-running.ps1",
"interval": 10
}
}
}
when running this check, Sensu client will always timeout and eventually, by the look of it, stop. this is because Sensu client doesn't know how to run PowerShell scripts out of the box. looking at other system checks, e.g. consul-deployment-agent, we need to define the check as follows for it to run properly:
"checks": {
"order-notification-service-is-running": {
"command": "powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -file \"C:\\temp\\e3c9cfb0-f92c-11e6-be86-8389fd3ece3c\\archive\\healthchecks\\sensu\\is-running.ps1\"",
"interval": 10
}
}
}
now, because of the way we have to define checks using the yaml file specification, i.e. local_script
or server_script
+ script_arguments
, it means that Windows users cannot include the powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -file
bit of the command as this won't match a filename on disk. this validation is done in CDA before registering a check.
We are getting alerts raised by Sensu shortly after deployments that are caused by how we are handling check scripts ans Sensu client's inability to pick up check definition changes quickly enough.
For example:
my-check.sh
{
"checks" : {
"check-name": {
"command": "/temp/deployments/1/healthchecks/sensu/my-check.sh"
}
}
}
{
"checks" : {
"check-name": {
"command": "/temp/deployments/2/healthchecks/sensu/my-check.sh"
}
}
}
/temp/deployments/1
is deleted by deployment agent/temp/deployments/1/healthchecks/sensu/my-check.sh
no longer exists on disk.Potential solutions:
/opt/application_name/healthchecks/sensu/my-script.sh
. When redeploying, we would end up overwriting the existing script to ensure that the checks currently defined still work.Hello,
It seems unzipping certain type or archives are not supported.
Here is the stracktrace hit while trying to deploy my app:
[2017-08-03 15:41:38,237] [DEBUG] Extracting /opt/consul-deployment-agent/deployments/dummy-service/dummy-id/bundle.zip to /opt/consul-deployment-agent/deployments/dummy-service/dummy-id/archive.
[2017-08-03 15:41:40,358] [ERROR] 'ascii' codec can't decode byte 0xf0 in position 19: ordinal not in range(128)
Traceback (most recent call last):
File "agent/deployment_stages/common.py", line 19, in run
File "agent/deployment_stages/download_bundle_from_s3.py", line 25, in _run
File "zipfile.py", line 1024, in extract
File "zipfile.py", line 1065, in _extract_member
File "posixpath.py", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 19: ordinal not in range(128)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.