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

Get container id from mountinfo when cgroup is empty #1648

Merged
merged 2 commits into from
Nov 15, 2022

Conversation

magarcia
Copy link
Contributor

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

This PR fixes #1647, when /proc/self/cgroup doesn't contain the container ID it tries to get it from /proc/self/mountinfo.

@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

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

Coverage data is based on head (0950d00) compared to base (12c54ee).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1648   +/-   ##
=======================================
  Coverage   96.81%   96.81%           
=======================================
  Files         660      660           
  Lines        9628     9650   +22     
=======================================
+ Hits         9321     9343   +22     
  Misses        307      307           
Impacted Files Coverage Δ
server/lib/system/system.getGladysContainerId.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.

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.

Thanks for this PR! 🙏

Have you tried this PR in real life with docker-compose? (You can build a Gladys docker image very easily directly from Github, I can explain how if needed)

server/lib/system/system.getGladysContainerId.js Outdated Show resolved Hide resolved
@magarcia
Copy link
Contributor Author

magarcia commented Nov 13, 2022

Thanks for this PR! 🙏

Have you tried this PR in real life with docker-compose? (You can build a Gladys docker image very easily directly from Github, I can explain how if needed)

I didn't try on docker-compose yet. If you can explain how to build the docker image directly from GitHub it would be nice, I have some trouble setting up the project on the Apple Silicon (I'm using GitHub Codespaces to develop 😅)

@Pierre-Gilles
Copy link
Contributor

@magarcia

If you can explain how to build the docker image directly from GitHub it would be nice

It's very easy! In your fork, create 3 environnement variable for Github Actions pointing to a DockerHub account (to push the image to):

DOCKERHUB_PASSWORD (can be an API KEY password)
DOCKERHUB_REPO (the docker image to push too, example: `magarcia/gladys-test` )
DOCKERHUB_USER (your username on DockerHub)

Then, go to:

Screenshot 2022-11-14 at 15 00 31

Choose the arch you want to build (you can build all, but it takes 1 hour 20 minutes, if you want to try on amd64 cpu only, can be a 2 minutes build )

Screenshot 2022-11-14 at 15 00 43

I have some trouble setting up the project on the Apple Silicon

Weird, I'm on Apple Silicon too (M1 Pro) and it works fine!

If you want we can talk about it on the forum, are you on the forum? (our international forum: https://en-community.gladysassistant.com/, we also have a french forum but it seems you're from spain! :) )

@VonOx
Copy link
Contributor

VonOx commented Nov 14, 2022

@Pierre-Gilles Tested on my side, no regression

I'm waiting for image to test with compose.

@magarcia
Copy link
Contributor Author

@Pierre-Gilles @VonOx tested with compose and works without issue. 😄

Copy link
Contributor

@VonOx VonOx left a comment

Choose a reason for hiding this comment

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

@Pierre-Gilles docker & docker-compose ok
Thanks @magarcia

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.

Looks good to me! Thanks for this PR and for your work 🙏

@Pierre-Gilles
Copy link
Contributor

@magarcia Did you manage to install Gladys on M1 chip ? I can help if needed :)

@Pierre-Gilles Pierre-Gilles merged commit ff8a0fc into GladysAssistant:master Nov 15, 2022
@Pierre-Gilles
Copy link
Contributor

@all-contributors please add @magarcia for code

@allcontributors
Copy link
Contributor

@Pierre-Gilles

I've put up a pull request to add @magarcia! 🎉

@relativeci
Copy link

relativeci bot commented Nov 15, 2022

Job #732: Bundle Size — 7MiB (0%).

ff8a0fc(current) vs 03a4eb8 master#727(baseline)

Metrics (no changes)
                 Current
Job #732
     Baseline
Job #727
Initial JS 3.06MiB 3.06MiB
Initial CSS 294.87KiB 294.87KiB
Cache Invalidation 0% 0%
Chunks 52 52
Assets 148 148
Modules 1252 1252
Duplicate Modules 2 2
Duplicate Code 0.03% 0.03%
Packages 106 106
Duplicate Packages 8 8
Total size by type (no changes)
                 Current
Job #732
     Baseline
Job #727
CSS 312.84KiB 312.84KiB
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 #732 reportView master branch activity

@Pierre-Gilles
Copy link
Contributor

@magarcia Fix is live in latest version of Gladys!

https://github.com/GladysAssistant/Gladys/releases/tag/v4.12.2

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.

Gladys doesn't keep the MQTT Brocker URL after docker restart when using docker-compose
3 participants