Skip to content

SessMan: dedicated gRPC message types#485

Merged
PawelPlesniak merged 10 commits intodevelopfrom
jamesturner246/simpler_grpc
Jul 23, 2025
Merged

SessMan: dedicated gRPC message types#485
PawelPlesniak merged 10 commits intodevelopfrom
jamesturner246/simpler_grpc

Conversation

@jamesturner246
Copy link
Contributor

@jamesturner246 jamesturner246 commented Jul 18, 2025

Resolves DUNE-DAQ/drunc_ui#496

This is the first in a series of changes which will replace the existing generic gRPC messages (arbitrary data packed to any) to a simpler and more reliable system of purpose-built gRPC messages.

This first PR starts with the Session Manager. Next will come Process Manager and then Controller. There is a sister PR in the druncschema repository required to run this (DUNE-DAQ/druncschema#58).

One can test by running describe, list_all_sessions and list_all_configs on a connected Session Manager driver.

Benefits:

  1. type safety is better. We know what a message's type is for free
  2. No more Any-type packing and unpacking. This is inefficient and hard to follow.
  3. We will be able to make better use of in-built gRPC features, such as authentication.

@PawelPlesniak
Copy link
Collaborator

This looks good, but just to clarify the OldDescription object is a placeholder until all of the Description objects are corrected to the actual object they are describing with individual 'Description' objcets in the respective .proto, right?

@jamesturner246 jamesturner246 linked an issue Jul 22, 2025 that may be closed by this pull request
@jamesturner246
Copy link
Contributor Author

jamesturner246 commented Jul 22, 2025

Correct. OldDescription is transitional until all services use the new Description.

Ed. Well actually I will use the same Description type across all, since they all will be identical. No point duplicating.

@PawelPlesniak
Copy link
Collaborator

Tested by running a drunc_session_manager in one shell, and in an interactive python shell ran

>>> from drunc.session_manager.session_manager_driver import SessionManagerDriver
>>> from drunc.utils.shell_utils import create_dummy_token_from_uname
>>> token = create_dummy_token_from_uname()
>>> d = SessionManagerDriver(address="localhost:50000", token=token, aio_channel=False)
>>> d.describe()
type: "session_manager"
name: "session_manager"
session: "session_manager"
commands {
  name: "describe"
  data_type: "None"
  help: "List the methods exposed by this endpoint."
  return_type: "description_pb2.Description"
}
commands {
  name: "list_all_sessions"
  data_type: "None"
  help: "List all active sessions."
  return_type: "session_manager_pb2.AllActiveSessions"
}
commands {
  name: "list_all_configs"
  data_type: "None"
  help: "List all available configurations."
  return_type: "session_manager_pb2.AllConfigKeys"
}

>>> d.list_all_sessions()
name: "session_manager"
active_sessions {
  name: "dummy_session"
  user: "dummy_user"
  config_key {
    file: "dummy_config_file"
    session_id: "dummy_config_session_id"
  }
}

>>> d.list_all_configs()
name: "session_manager"
config_keys {
  file: "example-configs.data.xml"
  session_id: "local-tpreplay-config"
}
config_keys {
  file: "example-configs.data.xml"
  session_id: "local-crt-bern-1x1-config"
}
config_keys {
  file: "example-configs.data.xml"
  session_id: "local-crt-grenoble-1x1-config"
}
config_keys {
  file: "example-configs.data.xml"
  session_id: "local-2x3-config"
}
config_keys {
  file: "example-configs.data.xml"
  session_id: "local-1x1-config"
}
config_keys {
  file: "example-configs.data.xml"
  session_id: "ehn1-tpreplay-config"
}
config_keys {
  file: "example-configs.data.xml"
  session_id: "ehn1-local-2x3-config"
}
config_keys {
  file: "example-configs.data.xml"
  session_id: "ehn1-local-1x1-config"
}
config_keys {
  file: "lrSession-r.data.xml"
  session_id: "lr-session"
}
config_keys {
  file: "lrSession-v.data.xml"
  session_id: "lr-session"
}
config_keys {
  file: "lrSession-singleapp.data.xml"
  session_id: "lr-session"
}
config_keys {
  file: "lrSession-separate.data.xml"
  session_id: "lr-session"
}
config_keys {
  file: "lrSession.data.xml"
  session_id: "lr-session"
}
config_keys {
  file: "lrSession-g.data.xml"
  session_id: "lr-session"
}
config_keys {
  file: "lrSession-gg.data.xml"
  session_id: "lr-session"
}
config_keys {
  file: "timing.data.xml"
  session_id: "test-session"
}
config_keys {
  file: "appSession.data.xml"
  session_id: "test-session"
}

Copy link
Collaborator

@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.

Tested manually
Also passed MSQT, although is independent of tests ran there
LGTM

@PawelPlesniak PawelPlesniak merged commit 810c05c into develop Jul 23, 2025
1 of 2 checks passed
@PawelPlesniak PawelPlesniak deleted the jamesturner246/simpler_grpc branch July 23, 2025 15:03
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.

gRPC dedicated messages: Session Manager gRPC dedicated messages: Session Manager

2 participants