Skip to content

Make cta-admin JSON only

Problem

As decided previously, the cta-ops-admin tool is intended to be used as a cmd line wrapper for the cta-admin command (in addition to provided the operators with tools for other day-to-day tape-related tasks).

Reference:

However, the adoption of cta-ops-admin by the CTA developers and operators has been inconsistent and low...
This is mostly due to the fact that cta-admin is able to format the output data in a human-readable way. This makes it enough for a few tasks, despite the fact that cta-ops-admin provides much more powerful functionalities and is simpler to configure/modify/develop.

An example of a functionality not intended to be covered by the cta-admin tool is the parsing of CTA Catalogue errors thrown back to the user (example: #755 (closed)).

Proposal

I leave here two options for discussion.

My suggestion is to move on with the 1st one immediately, and only move gradually to the 2nd one once the gRPC CTA frontend has been fully adopted by our team in production.

1. (Phase 1) Remove the text formatter functionality from cta-admin

The pretty printing of the cta-admin tool is coded in the CtaAdminTextFormatter.cpp/hpp file.
If we remove this functionality, we will be left with printing only in JSON.

This should discourage operators/developers from using the cta-admin tool directly.

Instead, the cta-ops-admin tool, which feeds itself from the cta-admin JSON output, will become a much more attractive option for any human usage.

2. (Phase 2) Deprecate the entire cta-admin tool

At some point in the near future, we expect the new gRPC CTA Frontend to support all admin commands (streaming and non-streaming) with gRPC:

At this point, the use-case for the cta-admin tool is expected to become redundant.
Instead of using it, we should be to use the Python cta-ops-admin tool to communicate directly with the CTA Frontend using gRPC and the Protobuf definitions.

gRPC is fully supported in Python, which makes that work easy. Even printing the JSON output should be possible with just a few lines of code.

(EDIT) Agreed solution

We have decided, in the last dev meeting (from 12th July 2024), to go directly for the deprecation of the cta-admin tool in favour of cta-ops-admin.

  • It will use gRPC to interact directly with the CTA Frontend.
  • It needs a deprecation plan to allow other sites from pass from cta-admin to cta-ops-admin.

In addition, we have decided to make both cta-ops-admin and cta-admin read-only (ls command), unless the user has the credentials/permissions that allow him to do modifications (add/ch/rm commands).

Edited by Joao Afonso