Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MQTT container log limitation #1686

Merged

Conversation

atrovato
Copy link
Contributor

@atrovato atrovato commented Jan 13, 2023

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • [ ] If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community for testing before merging.
  • [ ] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • [ ] Did you add fake requests data for the demo mode (front/src/config/demo.js) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

Add log limit on MQTT container.
I add a new service variable to track the container update.
Image : atrovato/gladys:mqtt-log-limit

@atrovato
Copy link
Contributor Author

Sorry, I didn't have the time to test it in real life yet.

@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Base: 97.27% // Head: 97.27% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (adfe9c0) compared to base (3d2ffc8).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1686   +/-   ##
=======================================
  Coverage   97.27%   97.27%           
=======================================
  Files         643      643           
  Lines        9686     9687    +1     
=======================================
+ Hits         9422     9423    +1     
  Misses        264      264           
Impacted Files Coverage Δ
server/services/mqtt/lib/constants.js 100.00% <ø> (ø)
server/services/mqtt/lib/updateContainer.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@atrovato atrovato requested a review from VonOx January 13, 2023 19:34
@atrovato atrovato force-pushed the mqtt-docker-limit-logs branch 3 times, most recently from 12eb888 to e0683a7 Compare January 14, 2023 09:08
@atrovato
Copy link
Contributor Author

I changed my choice, I use the existing service variable to know if docker file is at the latest revision.

@atrovato atrovato force-pushed the mqtt-docker-limit-logs branch from e0683a7 to c4483a1 Compare January 14, 2023 09:10
@atrovato atrovato force-pushed the mqtt-docker-limit-logs branch from c4483a1 to adfe9c0 Compare January 14, 2023 09:13
@atrovato
Copy link
Contributor Author

Ok, I tested it, I can see this when I docker inspect gladys:

            "LogConfig": {
                "Type": "json-file",
                "Config": {
                    "max-size": "10m"
                }
            },

Works fine according to me :)

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on my side, works fine! Thanks for this PR 🙏

@Pierre-Gilles Pierre-Gilles merged commit 1e02ce6 into GladysAssistant:master Jan 20, 2023
@relativeci
Copy link

relativeci bot commented Jan 20, 2023

Job #998: Bundle Size — 7.01MiB (0%).

1e02ce6(current) vs 6d7d3e8 master#997(baseline)

Metrics (no changes)
                 Current
Job #998
     Baseline
Job #997
Initial JS 3.03MiB 3.03MiB
Initial CSS 294.78KiB 294.78KiB
Cache Invalidation 0% 0%
Chunks 52 52
Assets 148 148
Modules 1258 1258
Duplicate Modules 2 2
Duplicate Code 0.03% 0.03%
Packages 111 111
Duplicate Packages 8 8
Total size by type (no changes)
                 Current
Job #998
     Baseline
Job #997
CSS 312.43KiB 312.43KiB
Fonts 93.55KiB 93.55KiB
HTML 13.58KiB 13.58KiB
IMG 1.64MiB 1.64MiB
JS 4.95MiB 4.95MiB
Media 0B 0B
Other 4.95KiB 4.95KiB

View job #998 reportView master branch activity

@atrovato atrovato deleted the mqtt-docker-limit-logs branch March 18, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants