nosinovacao / name-sdk Goto Github PK
View Code? Open in Web Editor NEWA dependencies management library designed to expose and access dependencies information.
License: BSD 3-Clause "New" or "Revised" License
A dependencies management library designed to expose and access dependencies information.
License: BSD 3-Clause "New" or "Revised" License
if something is not correctly configured to work properly the warning messages should help to solve the issue.
In this case it should describe or point to some urls where an explanation is presented.
[WARN] Could not register with http://registry1.name.local.internal:80/api/v1: An error occurred while sending the request. The server name or address could not be resolved.
Add a version resolver for Kafka service, not depending on Kafka driver (only protocol network level).
Currently, NAME does not support elasticsearch integration.
In order to obtain elasticsearch information, one should perform the following query:
# curl http://elasticsearch:9200
{
"name" : "a5045f503f93",
"cluster_name" : "use",
"cluster_uuid" : "Czl7TeOvTEe0-8sXhiKUNw",
"version" : {
"number" : "5.5.1",
"build_hash" : "19c13d0",
"build_date" : "2017-07-18T20:44:24.823Z",
"build_snapshot" : false,
"lucene_version" : "6.6.0"
},
"tagline" : "You Know, for Search"
}
Add a version resolver for Redis cache.
Just like the other version resolvers we can't depend on any redis client implementation, as such we must use the REdis Serialization Protocol to identify the version used by the server.
The explore dependencies feature appears to be ill-designed and is making unnecessary requests forward.
Review ServiceVersionResolver.cs
In some cases, when fetching a dependency manifest, said dependency may return a 200 status code even if NAME is not listening in that endpoint. Currently NAME fails to deserialize the manifest from the response and fails for that dependency.
Before deserializing the manifest, NAME should look at the returned X-NAME-Manifest-Endpoint header and check if the requested endpoint was the same as the header, if true, it should deserialize the manifest. Otherwise it should abort and try to get the manifest from the correct endpoint.
As of now, the startup healthcheck is always synchronous. As a result, when there are unreachable dependencies and/or dependencies without NAME installed (or any other unresponsive situation from the dependencies) at various levels, the application might take up to 20 seconds to start (max. timeout for the startup healthcheck as of now).
When ThrowOnDependenciesFail is false, that wait is not necessary at all and is indeed detrimental to NAME acceptance and roll-out.
Changes
As is, the port in which NAME is listening is sent to the Registry as null when using the WebApi and AspNetCore packages.
Getting the port is not trivial, and some discussion may be needed.
For apps hosted in IIS we can use the Microsoft.Web.Administration
namespace to get this information, so at least the NAME.WebApi package should send the port.
AppVeyor and Travis-CI should detect the build warnings and somehow fail the build if any is encountered.
For AppVeyor, a good starting point may be to use the provided logger.
This allows use cases where the maximum version of a dependency is specified by just one portion of the version.
Dependency A depends on the major version 3 of Dependency B, regardless of the minor version.
One would have to set the minimum version to 3 and maximum version to 3.99999.99999 which is far from ideal.
Ideally, one could set the minimum version 3 and maximum version to 3.*, which would match any version with the major portion 3.
By @suvl at nosinovacao/name-registry-api#1
A field should be added to the manifest providing insight on the error level of the last announced manifest. That field should have three levels, as suggested (not final):
- OK: no errors
- WARN: the current errors won't let NAME know if there's anything wrong or not (dependencies do not have NAME installed or NAME version is invalid)
- ERR: all other errors not included in WARN
In some scenarios, the MongoDB version checker, cannot read correctly the BSON format for a specific datatype, in this case the timestamp format.
Error message: "[Error] Don’t know elementType=17"
MongoDB version: v3.4.15
DataTypes: https://docs.mongodb.com/manual/reference/operator/query/type/
Like it exists the "/manifest/ui" with a specific format to expose the manifest. It should also exist an endpoint like "/manifest/flowchart" to support a flowchart language to display the dependencies in a flow chart way.
For more info: https://mermaidjs.github.io/
For more info in the flow chart part: https://mermaidjs.github.io/flowchart.html
With Asp.Net Core, the standard behaviour for managing settings is with the use of the IConfigurationProvider
.
The dependencies.json should support a new connectionstring Locator IConfigurationProvider
which takes accepts the key
element containing the name of the setting as described in the microsoft documentation (i.e. section:subsection:key).
The IConfigurationProvider
class is in the Microsoft.Extensions.Configuration.Abstractions nuget package, since we don't want to add this dependency in the main NAME package we need to add an extension point in the DependenciesReader.ReadDependencies
method that allows the caller to inject custom IConnectionStringProvider
s.
Furthermore NAMEAspNetCoreConfiguration
should optionally take in the IConfigurationProvider
and use the new extension point.
When behind an SSL Termination proxy, NAME sets the url in the manifest ui HTML with the HTTP protocol instead of HTTPS. This causes the javascript request to fail.
In order to resolve this and prevent future problems, the url to be set in the HTML should be relative instead of absolute.
Currently, when NAME is not installed on the target service dependency, the manifest outputs the message "Dependency Service is not reachable", this should be changed to return a relevant message, such as "NAME is not installed."
To do this, NAME should check if the header X-NAME-Manifest-Location is present when a service dependency check fails.
There are scenarios where connection strings are set using environment variables (e.g. docker), that scenarios should be supported.
Add a new EnvironmentConnectionStringLocator
class and change the dependencies file parser to read the locator, which only receives the environment variable name.
If you set a '\t' character before a comment in the dependencies.json file, the parser will fail to recognize the line as a comment and will fail to load the file.
In the dependencies file parser, when removing the comments from the file, instead of checking for lines starting with ' ', all white characters (except '\n') should be checked.
When we have an external dependency that does not have NAME nor we can control the source code of that dependency it makes sense to allow a different dependency check. For instance, check for a simple HTTP GET an check the returned HTTP Status Code.
Proposal of change:
{ "name": "WebPA Tridium", "min_version": "1.0", "max_version": "1.*", "check_override_uri": "{connection_string}/health", "check_override_codes": "200;400;401", "connection_string": { "locator": "IConfiguration", "key": "WebPaHttpClient:BaseUrl" } }
New properties:
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.