Git Product home page Git Product logo

softwareaccounting's People

Contributors

fossing avatar hugostrand avatar kmjonsson avatar micket avatar pontus avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

pontus c3se uppmax

softwareaccounting's Issues

License missing

There is no license information.
There should be licensing information for the entire project and in the individual source files.

The exception is extras/sgas-sa-registrant/LICENSE which specifies Apache, but the actual registrant script only contain copyright info.

Incorrect unused PyYAML imports

These PyYAML imports don't look right:

try:
from yaml import CLoader as YamlLoader, CDumper as YamlDumper
except ImportError:
from yaml import SafeLoader as YamlLoader, SafeDumper as YamlDumper

try:
from yaml import CLoader as YamlLoader, CDumper as YamlDumper
except ImportError:
from yaml import SafeLoader as YamlLoader, SafeDumper as YamlDumper

This comes from the fix for #1. If importing CLoader/CDumper fails we use SafeLoader/SafeDumper, which does not do the same thing.

The non-C versions of CLoader/CDumper is Loader/Dumper, and the C-versions of SafeLoader/SafeDumper is CSafeLoader/CSafeDumper.

As far as I can tell these imports are not used anywhere so a good fix is probably to remove them.

Request: Tagged release(s)

Dear all,

We would like to put this into production at C3SE, but we do not want to simply checkout the master branch and install. Could you please put a release tag on a commit when you are ready so that we can use that release in production?

Best regards,
Hugo

Please add swap to the collected data

cpus = self._cpucount(self.read_cgroup("cpuset", "cpuset.cpus"))
memory_usage = self.read_cgroup("memory", "memory.usage_in_bytes")
memory_limit = self.read_cgroup("memory", "memory.limit_in_bytes")
memory_max_usage = self.read_cgroup("memory", "memory.max_usage_in_bytes")
self.store(
{
"cpus": cpus,
"memory_usage": memory_usage,
"memory_limit": memory_limit,
"memory_max_usage": memory_max_usage,
}
)

E.g.

        cpus = self._cpucount(self.read_cgroup("cpuset", "cpuset.cpus"))
        memory_usage = self.read_cgroup("memory", "memory.usage_in_bytes")
        memory_limit = self.read_cgroup("memory", "memory.limit_in_bytes")
		memory_usage_and_swap = self.read_cgroup("memory", "memory.memsw.usage_in_bytes")
        memory_max_usage = self.read_cgroup("memory", "memory.max_usage_in_bytes")

        self.store(
            {
                "cpus": cpus,
                "memory_usage": memory_usage,
                "memory_limit": memory_limit,
                "memory_swap": str(int(memory_usage_and_swap) - int(memory_usage)),
		"memory_max_usage": memory_max_usage,
            }
        )

Empty sams.output.File key crashes collector

While commenting stuff out to get a minimal config I discovered that having an empty sams.output.File: key in the config file causes the collector to crash.

I am guessing other scripts and modules might behave in a similar way, but have not verified this with anything else than the collector and sams.output.File:.

$ cat /etc/sams/sams-collector.yaml
---
sams.collector:  
  pid_finder: sams.pidfinder.Slurm
  samplers:
    - sams.sampler.Core
    - sams.sampler.Software
  outputs:
    - sams.output.File

sams.output.File:
$ sams-collector --jobid=1 
2021-05-07 18:40:04,522 __main__:ERROR Failed to initialize: sams.output.File
2021-05-07 18:40:04,522 __main__:ERROR argument of type 'NoneType' is not iterable

Packages sams.software and sams.backend are not installed

$ sams-software-updater.py
2019-06-26 14:21:40,200 __main__:ERROR Failed to initialize: sams.software.Regexp
2019-06-26 14:21:40,200 __main__:ERROR No module named software.Regexp
Traceback (most recent call last):
  File "/usr/bin/sams-software-updater.py", line 83, in start
    Updater = sams.core.ClassLoader.load(updater,'Software')
  File "/usr/lib/python2.7/site-packages/sams/core.py", line 112, in load
    module = __import__(package,globals(),locals(),[class_name])
ImportError: No module named software.Regexp

as well as

$ sams-software-updater.py
2019-06-26 14:21:50,409 __main__:ERROR Failed to initialize: sams.software.Regexp
2019-06-26 14:21:50,409 __main__:ERROR No module named backend.SoftwareAccounting
Traceback (most recent call last):
  File "/usr/bin/sams-software-updater.py", line 92, in start
    Backend = sams.core.ClassLoader.load(backend,'Backend')
  File "/usr/lib/python2.7/site-packages/sams/core.py", line 112, in load
    module = __import__(package,globals(),locals(),[class_name])
ImportError: No module named backend.SoftwareAccounting

Inconsistent naming

The naming is of this software is somewhat inconsistent. Naming things is hard, but I think it would be a good idea to think a bit about what this software should be called and then do some renaming.

The repository is named softwareaccounting.git.

setup.py specifies name='sams-software-accounting'. So the prefix sams- is added and "software-accounting" gets a hyphen.

The defaults, documentation and examples use "softwareaccounting" (for example /var/spool/softwareaccounting) without sams and no hyphen. Except for the registrant which uses /var/spool/sgas-sa and /var/log/sgas-sa-registration.log.

The Python module is named sams and config files are installed to /etc/sams rather than /etc/sams-software-accounting.

There is another unrelated, and empty(!) sams package on PyPI. https://pypi.org/project/sams

The script file names starts with sams-, except for the registrant which is sgas-sa-registrant.
How this project relates to SGAS is not documented except for the link in extras/README.md

The sams- scripts are installed with a .py extension, the registrant is not.
I suggest dropping the extensions for aesthetic reasons.

The config files have names like sams-*.yaml which is somewhat redundant as they are already in /etc/sams.
The exception is the registrant that uses sgas-sa-registrant.conf.

This is not just me having OCD tendencies... The inconsistencies makes it a bit harder to build RPM packages, and also I have to remember which paths/names starts with sams-/sgas- and where hyphens are used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.