Skip to content

Implement Server Info RPC interface

Timo Furrer requested to merge server-info-rpc into master
  • Generate Ruby bindings for Server Info RPC

This change set contains generated ruby bindings for the new Server Info RPC interface.

Refs #549 (closed)

Changelog: added

  • Implement Server Info RPC interface

This change set implements a server-only module that offers a new RPC endpoint to retrieve server (KAS) information. This interface is intended to be used by GitLab Rails to know about the exact KAS version that is running. This interface is the first iteration of #549 (closed) and currently only returns the server info of the KAS that handles the server request.

The server info currently only contains build information like the version, build ref and build time. The build ref is called commit id in other places. However, that's not really accurate, so it makes sense to already expose it more accurately.

The intention is that in a later iteration an additional field is added that contains a list of server info objects for all KAS replicas. This data may be stored and queried in and from Redis. This has to be defined though and is out of scope of this change set. However, the interface code in here should be able to be extended smoothly.

Refs #549 (closed)

Changelog: added

Test protocol

I've tested the built gem in local GDK by implementing the following method on the Kas Client:

def get_server_info
  request = Gitlab::Agent::ServerInfo::Rpc::GetServerInfoRequest.new()

  stub_for(:server_info)
    .get_server_info(request, metadata: metadata)
end

and calling it from gdk rails console, like this:

[1] pry(main)> client = Gitlab::Kas::Client.new()
=> #<Gitlab::Kas::Client:0x0000000173235068>
[2] pry(main)> client.get_server_info()
=> <Gitlab::Agent::ServerInfo::Rpc::GetServerInfoResponse: current_server_info: <Gitlab::Agent::ServerInfo::ServerInfo: version: "v17.0.0-rc1-24-g06dbc13d", build_ref: "06dbc13d", build_time: <Google::Protobuf::Timestamp: seconds: 1714380975, nanos: 0>>>
[3] pry(main)>
Edited by Timo Furrer

Merge request reports