oar-team / oar3

OAR: versatile resource and job manager for cluster (third generation)
Other
8 stars 11 forks source link

Cannot delete host from database #14

Closed Nyk0 closed 2 years ago

Nyk0 commented 2 years ago

Hi,

I have a strange issue with oar, i took the version from here :

https://github.com/oar-team/oar3/releases/tag/3.0.0.dev7

Installation from Debian packages on Bullseye.

I come from oar 2.5. I tried to add a node :

# oarnodesetting -a -h node1 -p cpu=1 -p core=2

This command failed because I forgot to create resources :

# oarproperty -a cpu && oarproperty -a core && oarproperty -c -a host
Added property: cpu
Added property: core
Added property: host

However, oar created something, so I set the node to Dead state :

# oarnodesetting -h node1 -s Dead

Seems to be OK :

# oarnodes
network_address: node1
resource_id: 1
state: Dead
properties: type=default, network_address=node1, cpuset=0,
besteffort=YES, deploy=NO, desktop_computing=NO,
available_upto=2147483647, last_available_upto=, drain=NO

And I tried to delete it :

# oarremoveresource 1
#ERROR: None

I have an error and the node is not deleted :

# oarnodes
network_address: node1
resource_id: 1
state: Dead
properties: type=default, network_address=node1, cpuset=0, besteffort=YES, deploy=NO, desktop_computing=NO, available_upto=2147483647, last_available_upto=, drain=NO, cpu=, core=, host=

If you want, I can reset the database and try to make :

# oarproperty -a cpu && oarproperty -a core && oarproperty -c -a host

BEFORE the node addition ? This is not a problem for me, it's a test cluster in virtual machines.

Nyk0 commented 2 years ago

I reset database and add resources again :

root@admin:~# oarnodes
No nodes to display...
root@admin:~# oarproperty -a cpu && oarproperty -a core && oarproperty -c -a host
Added property: cpu
Added property: core
Added property: host
root@admin:~# oarnodesetting -a -h node1 -p host=node1 -p cpu=1 -p core=2
New resource added: node1
Set property host to 'node1'...
1 resource(s) updated.
Set property cpu to '1'...
1 resource(s) updated.
Set property core to '2'...
1 resource(s) updated.
root@admin:~# oarnodes
network_address: node1
resource_id: 1
state: Alive
properties: type=default, network_address=node1, cpuset=0, besteffort=YES, deploy=NO, desktop_computing=NO, available_upto=2147483647, last_available_upto=, drain=NO, cpu=1, core=2, host=node1
root@admin:~# oarnodesetting -h node1 -s Dead
node1 --> Dead
Check jobs to delete on host: node1
root@admin:~# oarnodes
network_address: node1
resource_id: 1
state: Dead
properties: type=default, network_address=node1, cpuset=0, besteffort=YES, deploy=NO, desktop_computing=NO, available_upto=2147483647, last_available_upto=, drain=NO, cpu=1, core=2, host=node1
root@admin:~# oarremoveresource 1
#ERROR: None
adfaure commented 2 years ago

Hello, thanks for reporting the issue. Let me know if you still have problems with this.

Nyk0 commented 2 years ago

Seems to be good, but when I set the node to Dead I have a message that wasn't here before :

root@admin:~# oarnodesetting -h node1 -s Dead
node1 --> Dead
Check jobs to delete on host: node1
/usr/local/lib/python3.9/dist-packages/oar/lib/node.py:361: SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
  .filter(~Job.id.in_(subq))

However, the node is Dead :

root@admin:~# oarnodes
network_address: node1
resource_id: 1
state: Dead
properties: type=default, network_address=node1, cpuset=0, besteffort=YES, deploy=NO, desktop_computing=NO, available_upto=2147483647, last_available_upto=, drain=NO, cpu=1, core=2, host=

Delete the resource :

root@admin:~# oarremoveresource 1
#ERROR: None

This time it's good :

root@admin:~# oarnodes
No nodes to display...