hpc2n / softwareaccounting Goto Github PK
View Code? Open in Web Editor NEWSAMS software accounting system
License: GNU General Public License v2.0
SAMS software accounting system
License: GNU General Public License v2.0
softwareaccounting/sams/base.py
Line 161 in 691132f
The exception value e
isn't caught here.
It would be nice to be able to be able to request logging to syslog/journald instead of plain file.
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.
Since the aggregator sorts data to node-separated subdirectories, it would be nice if it did not rely on all those being precreated.
In short, this typically means using os.makedirs rather than os.mkdir.
stämmer ej; "avail" är "free"
ret[v] = dict(size=avail+used, free=avail, used=used)
Introduced in
b185fe6
replaced type
with isinstance
incorrectly.
should be isinstance(dct[key], dict)
in several places.
These PyYAML imports don't look right:
softwareaccounting/sams/base.py
Lines 6 to 9 in 5db6352
softwareaccounting/sams/core.py
Lines 3 to 6 in 5db6352
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.
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
It seems setup.py is not aware of sams-software-extractor.py
softwareaccounting/sams/sampler/SlurmCGroup.py
Lines 61 to 73 in 4a649a2
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,
}
)
Det är mycket små skillnader på extras/sgas-sa-registrant/bin/sgas-sa-registrant
i detta repo och bart-registrant
(https://github.com/hpc2n/bart/blob/master/bart-registrant).
Jag föreslår att koden slås ihop och bara underhålls på ett ställe. Eventuella nödvändiga skillnader borde kunna hanteras via konfiguration/parametrar.
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
$ 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
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.
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.