Comments (11)
Issue-Label Bot is automatically applying the label feature_request
to this issue, with a confidence of 0.95. Please mark this comment with 👍 or 👎 to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
from worker.
So to summarize the request (and make sure I'm getting it correctly) your asking to have a flag in the worker configuration that when set will only send reports on updates.
something like:
report_on_update_only: false
- the default setting, will send all reportsreport_on_update_only: true
- will only send a report if a change happened
from worker.
Hello @naorlivne
Thanks for the Response
So to summarize the request (and make sure I'm getting it correctly) your asking to have a flag in the worker configuration that when set will only send reports on updates.
something like:
report_on_update_only: false
- the default setting, will send all reportsreport_on_update_only: true
- will only send a report if a change happened
Yes this solves the problem that's mentioned in the first paragraph of the feature request comment
I want the complete device update history and store only those report which contains the status of updates. ( i.e. Fail or Success ) This data can be purged after 11 or 12 months if required.
Is it possible to do what I have mentioned below =>
To elaborate the above two points I want the current behavior where I get the device state ( for example if container is running, ram, CPU, etc ) continuously according to the NEBULA_MANAGER_CHECK_IN_TIME which I can purge after some time ( for example six months ) but for another behavior I want the update report ( in this I am expecting when was device was updated and which release it has ) only if the end device is updated successfully or the update failed. I want to maintain the data for second behavior for more time comparatively than the first behavior.
To summarize, is it possible to have two reports i.e. worker reports about the update only when the update happens on Edge device ( Either fail or success ) and also another report where worker continuously reports the device state ( i.e. Report's that it is sending currently, for example, CPU and ram consumption. ) depending on the NEBULA_MANAGER_CHECK_IN_TIME
.
from worker.
having two reports at the same time would make for a lot of redundant data so it's not something I feel comfortable adding in, I will however won't mind having another field added that states if each document updated anything or not in the same reports stream which can be used to filter with a query param on.
from worker.
Hello @naorlivne
Thanks for the Response.
having two reports at the same time would make for a lot of redundant data so it's not something I feel comfortable adding in, I will however won't mind having another field added that states if each document updated anything or not in the same reports stream which can be used to filter with a query param on.
Yes, It seems quite convincing about the redundant data.
To summarize, is it possible to have two reports i.e. worker reports about the update only when the update happens on Edge device ( Either fail or success ) and also another report where worker continuously reports the device state ( i.e. Report's that it is sending currently, for example, CPU and ram consumption. ) depending on the NEBULA_MANAGER_CHECK_IN_TIME.
Since the current report data contains a lot of relevant information about the device state, it could be possible to use the reports for monitoring the Edge Device.
So to summarize the request (and make sure I'm getting it correctly) your asking to have a flag in the worker configuration that when set will only send reports on updates.
something like:
report_on_update_only: false - the default setting, will send all reports
report_on_update_only: true - will only send a report if a change happened
Considering the use case I mentioned if one is only interested in a device update this seems to be a better solution.
from worker.
I'll implement 2 things in Nebula in regards to this:
The first being the report_on_update_only as we discussed above & The second is I'll add a query param filter to the report that will filter the reports down only to those where Nebula had an ID changed on the worker configuration (when it was really updated), let's call this field "updated":
- When "updated" is true it only returns those reports that had a change in them
- When "updated" is false it only returns those fields that didn't had a change in them
- When "updated" is undeclared (or possibly a wildcard *) it returns everything
So for your use case you'll likely want to do something as follows:
- Set report_on_update_only as false
- Whenever you want to check the devices cpu\mem\etc you send the /reports query without the updated field
- Whenever you want to ensure a device updated you send the query with the updated field set to true and only get reports which had the device updated in them
from worker.
Okay
from worker.
Added the features discussed above to the latest\master branch\release.
from worker.
Hello @naorlivne
Thanks for accepting the feature request.
I have cloned the worker repository on the raspberry pi.
I am facing an issue when I give REPORT_ON_UPDATE_ONLY: true
as the boolean value under the environment
section inside the worker's docker-compose.yml
.
docker-compose.yml =>
version: '3'
services:
worker:
container_name: worker
build:
context: .
dockerfile: Dockerfile
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
hostname: worker
environment:
REGISTRY_HOST: < registry_url >
REGISTRY_AUTH_USER: < registry_username >
REGISTRY_AUTH_PASSWORD: < registry_password >
MAX_RESTART_WAIT_IN_SECONDS: 0
NEBULA_MANAGER_AUTH_USER: < nebula_manager_username >
NEBULA_MANAGER_AUTH_PASSWORD: < nebula_manager_password >
NEBULA_MANAGER_HOST: < nebula_manager_url >
NEBULA_MANAGER_PORT: < nebula_manager_server_port >
NEBULA_MANAGER_PROTOCOL: < nebula_manager_protocol >
NEBULA_MANAGER_CHECK_IN_TIME: 5
DEVICE_GROUP: test
KAFKA_BOOTSTRAP_SERVERS: < nebula_kafka_cluster >:9092
KAFKA_TOPIC: nebula-reports
REPORT_ON_UPDATE_ONLY: true
I get the following error =>
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.worker.environment.REPORT_ON_UPDATE_ONLY contains true, which is an invalid type, it should be a string, number, or a null
But when I give REPORT_ON_UPDATE_ONLY: 'true'
it works properly. Also, I have tested if I get the report only when an update is done and it is working properly.
So to confirm if the value type for REPORT_ON_UPDATE_ONLY
key is string I referred to this documentation and I found that it is given as a boolean.
from worker.
That's a docker\linux issue, when you setting the environment
field your actually setting the environment variables of it, which in linux can only be a string.
Because your using docker-compose (which is based on YAML) when you pass true
or false
the YAML interpreter docker-compose is using goes with boolean, which fails once it reaches the point of the docker-compose that actually tries setting the envvars to it.
The param is boolen (so if you where to set it via a JSON\YAML\ETC config file you would need to set it to boolen) but as your using docker-compose to create the envvars you have to hardcode it to be a string first as you found out above.
TL;DR:
It's the expected behaviour, noting wrong.
from worker.
Okay Thank you @naorlivne
from worker.
Related Issues (20)
- Connecting to a nebula managr hosted at a non root path HOT 3
- Query about a container running standalone script !! HOT 3
- Dependabot couldn't authenticate with https://pypi.python.org/simple/ HOT 1
- Prune image API not working HOT 3
- Cron jobs do not work per schedule if its frequency is shorter than the check-in time of worker HOT 2
- Build breaking due to unavailable package `freeze` HOT 3
- Add automated unit tests HOT 2
- Move automatic Docker imags build from Docker Hub to Travis-CI HOT 1
- have worker have the option to connect to the managers with a UUID token instead of basic auth HOT 1
- Self update worker container on deployed remote devices HOT 11
- Add cron jobs management support HOT 1
- Auto match version to branch on deployment and have it part of the report generated for the optional reporting system HOT 1
- fix creating new branch from last push not starting travis run due to auto added changelog having the [skip travis] flag on the commit message HOT 1
- Facing issue in running worker on remote device. HOT 6
- Facing issue in creating reporting kafka connection object HOT 5
- How to check if edge device is updated successfully? HOT 6
- Facing issue in configuring AWS ECR as a registry using credential helper for Nebula worker. HOT 7
- Consider moving ARM CI/CD build to drone.io HOT 1
- Create containers multiarch manifest file to allow single container multiarch support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from worker.