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

New parameters needing client support #165

Open
2 of 7 tasks
ketiltrout opened this issue Jul 26, 2023 · 0 comments
Open
2 of 7 tasks

New parameters needing client support #165

ketiltrout opened this issue Jul 26, 2023 · 0 comments
Labels
cli Issues relating to the alpenhorn CLI enhancement ux User experience improvements.

Comments

@ketiltrout
Copy link
Member

ketiltrout commented Jul 26, 2023

The following parameters were added as part of the server rewrite and need to have support added to the client:

StorageGroup

Implementation: #204

  • StorageGroup.io_class: should check whether the io_class is supported and warn (but still allow)
  • StorageGroup.io_config: needs JSON support. Would be good to have the client vet the JSON and tell the user if required keys are missing and/or unknown keys are present for the io_class given.
    • the last part would require a way for the client to interrogate the I/O modules for the config metadata.

StorageNode

  • StorageNode.io_class See StorageGroup, above
  • StorageNode.io_config: See StorageGroup, above
  • StorageNode.auto_verify: a non-negative integer

ArchiveFileCopy

  • ArchiveFileCopy.ready: generally the server should be able to figure this out by itself, but I don't see a problem with having a way of manually manipulating this in the rare case it's needed

Also, now:

StorageTransferAction

  • all of it
@ketiltrout ketiltrout added enhancement ux User experience improvements. cli Issues relating to the alpenhorn CLI labels Jul 26, 2023
ketiltrout added a commit that referenced this issue Nov 4, 2024
Here's a start on getting the client working, which I've done to try to
gauge how much work it will entail. This PR updates and re-implements
command in the `group` command group, which manipulates StorageGroups.
(I think this is the easiest command group to do.)

## Test suite
This PR also re-engineers how the client is run in the test-suite.
There's now a `client` fixture that runs the client via
`click.testing.CliRunner` and performs rudimentary checks on the result.
This abstracts a lot of the routine rigamarole of running the CLI via
pytest, meaning the tests themselves can be relatively simple.

This system uses the same kind of persistent in-memory Sqlite database
that I used for the server end-to-end test to make it possible for the
client process and the test suite itself to access the same ephemeral
database.

## Client
Common command options (of which there are many) are being collected in
`client.options` along with common code to process them.

### Commands
(per the list in #202):

* `create` lets you set I/O class and I/O config. There is no vetting of
the I/O config data based on what the I/O class needs (see discussion in
#165). I think it's best to punt that downfield and worry about it in
the future.
* `list` is pretty simple. Shows I/O class but not I/O config, because I
don't think it fits very well in the tabular format, but I could be
convinced otherwise.
* `modify` has the same comments about I/O config vetting as `create`.
It can also fix broken JSON in the database.
* `rename` trivial
* `show` definitely willing to take suggestions on formatting here, as
well as what StorageNode columns should be presented with
`--node-details`. `--node-stats` is for showing counts/sizes of files
(see the `node stats` command in #202) and will be implemented when
`node stats` is implemented.

## Also
Fixed `common.logger.echo` which was broken from the start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues relating to the alpenhorn CLI enhancement ux User experience improvements.
Projects
None yet
Development

No branches or pull requests

1 participant