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

Revert "Revert "Simpler status endpoint"" #31

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

plasorak
Copy link
Collaborator

@plasorak plasorak commented Nov 6, 2024

@PawelPlesniak
Copy link
Contributor

Came across an issue with this.
The controller stub does not have the status method but it has the old ones, namely get_status and get_children_status. Steps to recreate

source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh 
setup_dbt latest
dbt-create -n NFD_DEV_241107_A9 241107
cd 241107
. env.sh
cd sourcecode
git clone git@github.com:DUNE-DAQ/drunc -b develop
git clone git@github.com:DUNE-DAQ/druncschema -b develop
cd druncschema
git checkout revert-30-revert-27-plasorak/status
cd ..
dbt-build
dbt-workarea-env
cd drunschema
./generate_protos
cd drunc
pip install -e .
git checkout revert-296-revert-239-plasorak/recursive-statuses
drunc-unified-shell ssh-standalone config/daqsystemtest/example-configs.data.xml local-1x1-config
boot
status

I added self._log.warning(f"{self.stub.__dict__=}") tto L183 of drunc.utils.shell_utils.py, which got

drunc-unified-shell > status
           WARNING  shell_utils.py:183      controller_driver:      self.stub.__dict__={'ls': <grpc._channel._UnaryUnaryMultiCallable object at 0x7f724821fbc0>, 'describe':             
                    <grpc._channel._UnaryUnaryMultiCallable object at 0x7f724821fa70>, 'get_children_status': <grpc._channel._UnaryUnaryMultiCallable object at 0x7f724821fdf0>,         
                    'get_status': <grpc._channel._UnaryUnaryMultiCallable object at 0x7f724821fd10>, 'describe_fsm': <grpc._channel._UnaryUnaryMultiCallable object at 0x7f724821f370>,  
                    'execute_fsm_command': <grpc._channel._UnaryUnaryMultiCallable object at 0x7f72482cf1b0>, 'include': <grpc._channel._UnaryUnaryMultiCallable object at               
                    0x7f72482ce7a0>, 'exclude': <grpc._channel._UnaryUnaryMultiCallable object at 0x7f72482ce810>, 'take_control': <grpc._channel._UnaryUnaryMultiCallable object at     
                    0x7f7248399fc0>, 'surrender_control': <grpc._channel._UnaryUnaryMultiCallable object at 0x7f7248398ac0>, 'who_is_in_charge': <grpc._channel._UnaryUnaryMultiCallable 
                    object at 0x7f7248399d20>}                                                                                                                                           
AttributeError: 'ControllerStub' object has no attribute 'status'
           WARNING  core.py:50      click_shell.core:       Traceback (most recent call last):                                                                                           
                      File "/nfs/home/pplesnia/nightlyDev/241107/.venv/lib/python3.10/site-packages/click_shell/core.py", line 34, in invoke_                                            
                        command.main(args=shlex.split(arg),                                                                                                                              
                      File                                                                                                                                                               
                    "/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.1/spack-0.22.0/opt/spack/linux-almalinux9-x86_64/gcc-12.1.0/py-click-8.1.7-rfosehaodhycdhjdju6ywpfiqy6gc6l
                    m/lib/python3.10/site-packages/click/core.py", line 1078, in main                                                                                                    
                        rv = self.invoke(ctx)                                                                                                                                            
                      File                                                                                                                                                               
                    "/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.1/spack-0.22.0/opt/spack/linux-almalinux9-x86_64/gcc-12.1.0/py-click-8.1.7-rfosehaodhycdhjdju6ywpfiqy6gc6l
                    m/lib/python3.10/site-packages/click/core.py", line 1434, in invoke                                                                                                  
                        return ctx.invoke(self.callback, **ctx.params)                                                                                                                   
                      File                                                                                                                                                               
                    "/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.1/spack-0.22.0/opt/spack/linux-almalinux9-x86_64/gcc-12.1.0/py-click-8.1.7-rfosehaodhycdhjdju6ywpfiqy6gc6l
                    m/lib/python3.10/site-packages/click/core.py", line 783, in invoke                                                                                                   
                        return __callback(*args, **kwargs)                                                                                                                               
                      File                                                                                                                                                               
                    "/cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.1/spack-0.22.0/opt/spack/linux-almalinux9-x86_64/gcc-12.1.0/py-click-8.1.7-rfosehaodhycdhjdju6ywpfiqy6gc6l
                    m/lib/python3.10/site-packages/click/decorators.py", line 45, in new_func                                                                                            
                        return f(get_current_context().obj, *args, **kwargs)                                                                                                             
                      File "/nfs/home/pplesnia/nightlyDev/241107/sourcecode/drunc/src/drunc/controller/interface/commands.py", line 42, in status                                        
                        statuses = obj.get_driver('controller').status()                                                                                                                 
                      File "/nfs/home/pplesnia/nightlyDev/241107/sourcecode/drunc/src/drunc/controller/controller_driver.py", line 31, in status                                         
                        return self.send_command('status', outformat = Status)                                                                                                           
                      File "/nfs/home/pplesnia/nightlyDev/241107/sourcecode/drunc/src/drunc/utils/shell_utils.py", line 184, in send_command                                             
                        cmd = getattr(self.stub, command) # this throws if the command doesn't exist                                                                                     
                    AttributeError: 'ControllerStub' object has no attribute 'status' 

This was not expected - I checked druncschema/python_not_for_dunedaq/controller_pb2 and controller_grpc_pb2 and status was there, strange...

@plasorak
Copy link
Collaborator Author

plasorak commented Nov 8, 2024

You need to

cd druncschema
./generate_protos
pip install -e . ## <- you forgot this

Copy link
Contributor

@PawelPlesniak PawelPlesniak left a comment

Choose a reason for hiding this comment

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

LGTM
Tested, working

@plasorak plasorak merged commit a07226f into develop Nov 8, 2024
1 check passed
@plasorak plasorak deleted the revert-30-revert-27-plasorak/status branch November 8, 2024 12:47
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.

2 participants