Commit Graph

140 Commits

Author SHA1 Message Date
Guillaume Raffy e17287fcf8 - fixed pylint warnings
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-29 20:24:16 +02:00
Guillaume Raffy d9e2199d2e cocluto v1.0.30 - rewrote SimpaDbUtil.ISqlConnection as sqldb.ISqlConnection for performance reasons
- sqldb.ISqlConnection provides the same functionality as SimpaDbUtil.ISqlConnection, with much greater performance thanks to python contexts. However the interface is not compatible, so codes wanting to switch from SimpaDbUtil.ISqlConnection to sqldb.ISqlConnection need adjusting.
- migrated quman to use sqldb.ISqlConnection (as a result the sync now takes 3seconds instead of 60, because of the drastic reductin of calls to mysql and ssh)
- SimpaDbUtil.ISqlConnection will be deleted once every code using SimpaDbUtil.ISqlConnection has been migrated to sqldb.ISqlConnection

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-29 20:11:28 +02:00
Guillaume Raffy a7f65a9e66 cocluto v1.0.29 - fixed bug that caused quman to not use the right domain name for alambix compute nodes
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-27 16:16:42 +02:00
Guillaume Raffy 0cac428957 cocluto v1.0.28 - fixed bug that caused quman to misfunction with SshAccessedMysqlDb backend
- replaced ISqlDatabaseBackend.get_last_insert_id() with ISqlDatabaseBackend.query_insert(),  as ISqlDatabaseBackend.get_last_insert_id() cannot work with SshAccessedMysqlDb (each call always returns 0 because mysql starts a new session each time)

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-27 15:01:56 +02:00
Guillaume Raffy d2c973c7ed cocluto v1.0.27 - fixes bug in returned table of SshAccessedMysqlDb.query('select...') and SshAccessedMysqlDb.get_last_insert_id()
- splitted  ISqlDatabaseBackend.query() into ISqlDatabaseBackend.query() and the more specialized SqlDatabaseBackend.query_select ()
- this way the return type of query_select is explicit (a Table).
- it also allows robust sql query parsing (usin json).
- replaced calls to ISqlDatabaseBackend.query('select ...') with calls to ISqlDatabaseBackend.query_select()

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-26 16:39:55 +02:00
Guillaume Raffy 5856ac0951 cocluto v1.0.26 - fixed bug in quman's Sge backend that caused Sge.get_status() o fail
( it used the non existing method QueueMachine.is_enabled())

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-26 16:16:43 +02:00
Guillaume Raffy aa6c84ef80 cocluto v1.0.25 - changed default db_user and ssh_user to qumandbw instead of qumanw
- so that it matches the quman database setup used at IPR

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-26 16:12:06 +02:00
Guillaume Raffy 24bfb1af95 cocluto v1.0.24 - fixed bug in quman's Sge backend that aused QstatParser to fail
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-26 16:08:12 +02:00
Guillaume Raffy fb5e9fcfa4 cocluto v1.0.23 - fixed bug in the mechanism detecting the availbaility of qmod
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-21 17:43:03 +02:00
Guillaume Raffy eef27f1dd2 cocluto v1.0.22 - fixes a bug that causes quman to fail when using mysql backend
- added the method ISqlDatabaseBackend.get_last_insert_id because the actual sql function is different in sqlite (last_insert_rowid) and mysql  (last_insert_id), the query is different for both backends

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-05-21 17:41:13 +02:00
Guillaume Raffy 6974f51221 cocluto v1.0.21 - added the option --db-def to quman
- this option allows the quman to work with user configurable database system as a backend. the default uses the database for alambix cluster
- also improved the output of show-disable-requests

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-10 17:58:26 +02:00
Guillaume Raffy c80e3cd382 cocluto v1.0.20 - fixes warnings when installing cocluto
```
WARNING: Missing build requirements in pyproject.toml for file:///home/graffy/work/simpaweb/cocluto.git.
  WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
```

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-10 13:52:04 +02:00
Guillaume Raffy 9266ad8278 cocluto v1.0.19 - added the update-db action to quman
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-10 13:28:36 +02:00
Guillaume Raffy 381ec9f1af cocluto v1.0.18 - fixed a bug that caused submodules to be excluded from install
eg problem visible with the command:
> /usr/bin/python3 -m pip install --root=/ git+https://git.ipr.univ-rennes.fr/cellinfo/cocluto to

then:
```sh
root@alambix50:~# quman
Traceback (most recent call last):
  File "/usr/local/bin/quman", line 5, in <module>
    from cocluto.quman import main
  File "/usr/local/lib/python3.11/dist-packages/cocluto/quman.py", line 13, in <module>
    from cocluto.ClusterController.QstatParser import QstatParser
```

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-10 10:18:06 +02:00
Guillaume Raffy f64e31b420 cocluto v1.0.17 - added json option to quman so that the user can choose to get results in machine friendly (json) or human friendly format
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-03 18:08:58 +02:00
Guillaume Raffy 04adbbc684 cocluto v1.0.16 - overhauld quman arguments parsing
- quman's argument parsing now uses subparsers to allow for more actions than enable and disable
- added the show-disables action to quman
- added a test mode for the command line quman, that allows the user to test quman using quman's user interface
- renamed disable tag as disable id, as it's more meaningful (identfies a disable request)
- made user errors more user-friendly (ie not polluted with call stack)

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-03 17:01:56 +02:00
Guillaume Raffy 25afd32504 cocluto v1.0.15 - added user friedly error message when qmod is not available
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-03 14:20:37 +02:00
Guillaume Raffy 4cc541d9c3 cocluto v1.0.14 - added support to full queues to quman
Whith this feature, it's now possible to disable an entire queue (and not only one queue machine), with

```sh
quman d main.q --disable-tag admin.graffy.bug4242 --reason 'preparing cluster to shutdown for power shortage, see bug 4242'
```
-  also replaced the term queue name with queue machine for clarity, now that we have both QueueMachineId and QueueId

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-03 11:58:47 +02:00
Guillaume Raffy bfe1eeb084 cocluto v1.0.13 - improvements to quman
- the userid and the host fqdn of are now recorded
- found better names (more appropriate and easier to understand)
  - disable reason -> disable request
  - requester -> disable tag

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-02 19:31:31 +02:00
Guillaume Raffy 12be70500b fixed bug that caused quman test to fail because the temporary directory is missing
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-02 18:13:39 +02:00
Guillaume Raffy 7acaa1ad5a added continuous integration to cocluto
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-02 18:09:17 +02:00
Guillaume Raffy 0f0d5f800e v 1.0.12
- fixed bug in request_queue_activation, which caused it to always enable the queue, even if there are other disables
- added a synchronization mechanism to quman which patches the database to ensure the database is coherent with the current activation of the queues

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-01 19:08:06 +02:00
Guillaume Raffy f5dce0bf10 v 1.0.11
- added IGridEngine abstraction that allows to switch between dry-run mode and normal mode
- added more commandes to the test

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-01 17:31:45 +02:00
Guillaume Raffy a7d92a3f99 v 1.0.10
- fixed iteration bug in qman
- added missing unit test

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-01 16:33:46 +02:00
Guillaume Raffy 3beba78ecc started to develop quman, a tool to handle multiple disable requests on the same queue
- to make this work, cocluto now uses a pyproject.toml configuration
- cocluto v1.0.9
- this is still work in progress, but the basic behaviour

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3093]
2026-04-01 16:12:17 +02:00
Guillaume Raffy ba3d410b3f now that non ipr (ietr) machines have been migrated from physix to alambix, updated the graphs generator accordingly to exclude these machines from the graphs.
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3560]
fixes [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=4335]
2026-03-06 19:03:54 +01:00
Guillaume Raffy a8b477978d now powermap draws redundant cables as dash lines.
fixes - Bug 4250 - incohérence des consommations affichées par powermap
2025-12-11 14:23:07 +01:00
Guillaume Raffy 8a2c46c377 cocluto v1.08
- fixed bug that caused `draw_machine_age_pyramid_graph` to fail when some cluster machines get  older than 20 years. Increased the age limit to 25 years, and added clipping to the graph to cope with some machines even older than this

fixes [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=4101]
2025-06-24 16:10:09 +02:00
Guillaume Raffy 8679ae2ca5 cocluto v 1.07
fixed logic error foudn when working on [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3979]
2024-11-15 16:41:41 +01:00
Guillaume Raffy 27493f2ed7 fixed logic error foudn when working on [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3979] 2024-11-15 16:40:23 +01:00
Guillaume Raffy e5ced9e8bb cocluto v1.06
- fixed bug in SshAccessedMysqlDb which didn't handle the fields with is_autoinc_index properly
- fixed bug in SshAccessedMysqlDb which failed when a field description contained double quotes
- improved SshAccessedMysqlDb.query(), which now displays the error message on failure
- fixed bug in SshAccessedMysqlDb.table_exists,which failed when the table didn't exist.

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3958]
2024-11-13 14:38:01 +01:00
Guillaume Raffy fbf565fd8a cocluto v1.05
- added to the class `ISqlDatabaseBackend` the ability to delete a sql table
- also added `SshAccessedMysqlDb`: an implementation of `ISqlDatabaseBackend` that implements the sql database as a remote sql database accessed using ssh
- added unit tests to validate the backends SshAccessedMysqlDb and SqliteDb

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3958]
2024-11-12 17:36:53 +01:00
Guillaume Raffy 101fb6d8b2 cocluto v1.04
- added to the class `ISqlDatabaseBackend` the ability to create a sql table
- also added `SqliteDb`: an implementation of `ISqlDatabaseBackend` that implements the sql database as a sqlite3 database

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3958]
2024-11-05 15:15:48 +01:00
Guillaume Raffy e86197c083 cocluto v1.03:
- added Inventory methods related to gpus
- added a missing dependency (mysqlclient); nb this change dates back from a few months.

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3945]
2024-09-17 18:49:33 +02:00
Guillaume Raffy 9f4a80b11e fixed styling errors and added more type hinting to increase maintainability of cocluto
- all styling errors are now fixed, but there are still warnings and information
- most functions have been converted to snake case
- most functions now have type hinting

work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3873]
2024-06-14 15:52:32 +02:00
Guillaume Raffy 6bf69f909b refactored cluster related code (renamed Job as Task and Job2 as Job to avoid confusion)
when Job2 was introduced, it was actually representing a job, but the class Job (which actually represented a Task, and this was misleading) already existed

also:
- added type hinting to ease code understanding
- took this opportunity to fix styling issues
2024-06-13 13:59:49 +02:00
Guillaume Raffy f36b2d9d9c cocluto v1.02 : adapted code to the recent addition of the guaranteed_util field in the machines table
fixes [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3792]
2024-03-13 15:50:47 +01:00
Guillaume Raffy 1ddf7270d4 fixed bug that caused the dependency pygraphviz to not be installed while being needed
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3790]
2024-03-13 14:26:41 +01:00
Guillaume Raffy 5e402a2e45 added type hinting to PowerDiagram
work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3790]
2024-03-12 18:15:04 +01:00
Guillaume Raffy e58f06e14a added missing requirement (pygraphviz is used by cocluto.PowerDiagram)
work related to https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3790
2024-03-12 18:14:07 +01:00
Guillaume Raffy 4853446fa0 fixed code incompatible with python3 in powerdiagram 2024-03-12 18:12:36 +01:00
Guillaume Raffy 891182587d fixed bug: made parseQstatOutput handle domains other than ipr.univ-rennes1.fr properly
before this fix, `parseQstatOutput` created a list of machines with a hardcoded ipr.univ-rennes1.fr domain, resulting in potentatially wrong fqdn

work related to https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3693
2023-11-17 18:28:20 +01:00
Guillaume Raffy 5bf1cbe664 now alambix is also considered as a cluster 2023-11-14 18:39:05 +01:00
Guillaume Raffy 88fba0fdb0 fixed regression from commit 270304f58e
- this bug was found when working on Bug 3575 - la page physix status renvoit internal server error
- in order to ease the detection of such regressions, added a unittest that covers this code
2023-06-08 11:18:07 +02:00
Guillaume Raffy 14a58dcd0a fixed a missing import error (time) that was detected by one of the applications that used cocluto
in order to detect these kind of errors easily, I've added a unit test system in cocluto
2023-06-07 18:23:46 +02:00
Guillaume Raffy 270304f58e fixed pylint errors and cleaned up
work related to Bug 3315 - make simpaweb django app a packageable application
2023-05-23 17:27:12 +02:00
Guillaume Raffy 7a5d32dec0 fixed bug that caused TypeError: '<=' not supported between instances of 'NoneType' and 'int'
work related to Bug 3315 - make simpaweb django app a packageable application
2023-05-23 12:10:29 +02:00
Guillaume Raffy 654e449007 added logging mechanism to ease debugging
work related to Bug 3315 - make simpaweb django app a packageable application
2023-05-23 11:43:29 +02:00
Guillaume Raffy c387b9dce2 fixed warning 'RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used'
work related to Bug 3315 - make simpaweb django app a packageable application
2023-05-23 11:35:15 +02:00
Guillaume Raffy b5c2c886f1 migrated code using dict that was no longer compatible with python3
iteritems() was removed in python3, see https://wiki.python.org/moin/Python3.0#Built-In_Changes

work related to Bug 3315 - make simpaweb django app a packageable application
2023-05-23 11:29:59 +02:00