-
Notifications
You must be signed in to change notification settings - Fork 1
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
Client command list #202
Comments
This looks like a complete list of commands, but I'd like to see a way of seeing the last n transfers that were cancelled or ignored as well as the last n transfers that were run (which i assume is action list) . - You mentioned this was more server metrics but it would be useful regardless |
I've added a |
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.
After getting some familiarity working on the client for a while, I've removed the I think it's better to limit the groups to "concrete" objects: Groups, Node, Acqs, Files (including File Copies). I've dispersed the functionality of the removed groups to the other ones. Let me know what you think, and if you can see any gap in functionality that I've missed. |
This is based on my suggestion to remove the `action` group in #202, which I think was ill-defined. Instead: * Adds an `--actions` flag to `node show` and `group show` to show relevant `StorageTransferAction`s affecting the node/group. * Adds an `--all` flag to `node show` and `group show` to provide a way to list everything without having to know what lists what. * Adds two new commands to manipulate `StorageTransferAction`s: * `group auto-sync GROUP NODE` to set/clear the autosync flag * `node auto-clean NODE GROUP` to set/clear the autoclean flag For a given (NODE, GROUP) pair, these two commands modify the same row in the `StorageTransferAction` table (the pair has to be unique in the table). So, there's ambiguity over which command goes with which "noun". The way I've done it, the command is associated with the object that the auto-action modifies (auto-sync adds files to GROUP; auto-clean deletes files from NODE). There's probably an argument for doing it the other way; I'm not sure it matters much, so long as we are consistent about it. Also: should the command names have a dash in them? Or would `group autosync GROUP NODE` etc. be better?
This is based on my suggestion to remove the `action` group in #202, which I think was ill-defined. Instead: * Adds an `--actions` flag to `node show` and `group show` to show relevant `StorageTransferAction`s affecting the node/group. * Adds an `--all` flag to `node show` and `group show` to provide a way to list everything without having to know what lists what. * Adds two new commands to manipulate `StorageTransferAction`s: * `group auto-sync GROUP NODE` to set/clear the autosync flag * `node auto-clean NODE GROUP` to set/clear the autoclean flag For a given (NODE, GROUP) pair, these two commands modify the same row in the `StorageTransferAction` table (the pair has to be unique in the table). So, there's ambiguity over which command goes with which "noun". The way I've done it, the command is associated with the object that the auto-action modifies (auto-sync adds files to GROUP; auto-clean deletes files from NODE). There's probably an argument for doing it the other way; I'm not sure it matters much, so long as we are consistent about it. Also: should the command names have a dash in them? Or would `group autosync GROUP NODE` etc. be better?
This is based on my suggestion to remove the `action` group in #202, which I think was ill-defined. Instead: * Adds an `--actions` flag to `node show` and `group show` to show relevant `StorageTransferAction`s affecting the node/group. * Adds an `--all` flag to `node show` and `group show` to provide a way to list everything without having to know what lists what. * Adds two new commands to manipulate `StorageTransferAction`s: * `group auto-sync GROUP NODE` to set/clear the autosync flag * `node auto-clean NODE GROUP` to set/clear the autoclean flag For a given (NODE, GROUP) pair, these two commands modify the same row in the `StorageTransferAction` table (the pair has to be unique in the table). So, there's ambiguity over which command goes with which "noun". The way I've done it, the command is associated with the object that the auto-action modifies (auto-sync adds files to GROUP; auto-clean deletes files from NODE). There's probably an argument for doing it the other way; I'm not sure it matters much, so long as we are consistent about it. Also: should the command names have a dash in them? Or would `group autosync GROUP NODE` etc. be better?
Not much to fix here. The extension tables aren't handled but they can't be unless we were to create some sort of new extension type which provides a list of tables to create. Given that the only use of such an extension would be to pass them to `create_tables` in this function, it may be more trouble than it's worth. Probably easier for both alpenhorn and the extension creators to just tell them to create their own tables. In any case, it's very low priority. I had another command in the `db` group listed in #202 called `status`. Not sure it's going to get implemented. Not sure what it would tell us. Perhaps more useful would be an integrity-checking `db check` command. But neither are on the table at the moment.
After developing the on-demand import framework for the daemon (#235) I've been thinking about the need to have the ability to manually modify Archive entries in the database with the CLI. With that in mind, I've added the following commands to the list above to permit that: ArchiveAcq
ArchiveFile
ArchiveFileCopyThese command also use the "file" command group for simplicity)
|
After "file list", this was less involved that I feared it would be. I think there's potential to add more ways of searching for files, but this is good for now. There are always going to be limits to how much selection can be done with the CLI. For very complex queries, users are going to have to access the ORM directly and make their own queries. This is the last command I wanted to implement from the command list. So, I'm going to say this closes #202, unless someone can come up with an argument to promote one of the proposed commands I suggested, which otherwise will get left on the back-burner. After all these command PRs are merged there is still going to be one or more clean-up passes to do on the CLI before I'm willing to leave it alone for the time-being.
After "file list", this was less involved that I feared it would be. I think there's potential to add more ways of searching for files, but this is good for now. There are always going to be limits to how much selection can be done with the CLI. For very complex queries, users are going to have to access the ORM directly and make their own queries. This is the last command I wanted to implement from the command list in #202, unless someone can come up with an argument to promote one of the proposed commands I suggested, which otherwise will get left on the back-burner. After all these command PRs are merged there is still going to be one or more clean-up passes to do on the CLI before I'm willing to leave it alone for the time-being. Closes #248
Everything in my list is now implemented. |
A proposal for the client command list, to see what we need. Per #122, we will stick to
<noun> <verb>
:db
- database maintenance fix(CLI): fix "db init" #231db init
- create tables, if necessarydb status
. Status of what?db check
. Check integrity (table interconnections)group
- for StorageGroup: Implementation fix(client): Fix "group" command group and client test-suite #204group autosync GROUP NODE
: feat(CLI): StorageTransferAction support #228group create
- create new groupgroup list
- list groupsgroup modify GROUP
- edit group metadatagroup nodes GROUP
- list nodes in groupgroup rename GROUP
- rename groupgroup show GROUP
- show StorageGroup record--actions
- to show auto-actions: feat(CLI): StorageTransferAction support #228--transfers
- to summarise pending transfers in feat(CLI): group/node show --transfers #238group sync GROUP NODE
fix(CLI): Re-implement sync command #233node sync NODE GROUP
group add-node
. See Possible command:alpenhorn group add-node
#205node
- for StorageNode: Partial implementation fix(client): First part of "node" command group fix #221node activate NODE
- activate nodenode autoclean NODE GROUP
: feat(CLI): StorageTransferAction support #228node clean
- clean node of file copies fix(CLI): re-implement "node clean" #223--include-bad
- also clean suspect/corrupt files. feat(daemon): Permit deletion of bad files #226--days
flag for theclean
command #89node create
- create new node.create_node
should include the option for setting StorageNode.username #39node deactivate NODE
- deactivate nodeSeenode files NODE...
list files on nodefile status
node init
feat(CLI): node init command #237node list
- list nodes (curently called "status")alpenhorn status --all
#121node modify NODE
- edit node metadatanode rename NODE
- rename nodenode scan
- scan the node for known files to add (in alpenhorn-1 this was called "import-files", but in alpenhorn-2 client currently called "scan") fix(CLI): Re-implement "node scan" #236node show NODE
- show StorageNode record: feat(cli): Add "node show" command #224--actions
- to show auto-actions: feat(CLI): StorageTransferAction support #228--transfers
- to summarise pending transfers out feat(CLI): group/node show --transfers #238node stats NODE
- show file counts/sizes on nodenode sync NODE GROUP
fix(CLI): Re-implement sync command #233sync
command #106node verify NODE PATH...
re-verify file(s) on node. fix(CLI): Re-implement "node verify" #229verify
command assumes the target node is locally available. #141acq
- for ArchiveAcq: Implementation fix(client): Fix "acq" command group #206acq create NAME
- create newArchiveAcq
record feat(CLI): "acq create" command #239acq files ACQ
- listArchiveFile
s in ACQacq list --node=<NODE> --group=<GROUP>
- list acquisitions, optionally limited to node/groupacq show ACQ
- showArchiveAcq
record for ACQmerged intoacq where ACQ
- which nodes contain files from ACQ?show
file
- for ArchiveFile and ArchiveFileCopyfile clean FILE...
setArchiveFileCopy.has_file
for existing record feat(CLI): "file clean" command #257file create NAME ACQ
create newArchiveFIle
record directly feat(CLI): "file create" command #251file find
listArchiveFileCopy
s feat(CLI): "file find" command #261verify
should show files already known to be corrupt) #45file import PATH
request import ofPATH
by daemon feat(CLI): "file import" command #249file list
- listArchiveFile
s feat(CLI): "file list" command #247file modify
- modifyArchiveFile
data (MD5 and size) feat(CLI): "file modify" command #255file show FILE
showArchiveFile
record feat(CLI): "file show" command #246file state FILE NODE
get/update/createArchiveFileCopy
record for FILE on NODE feat(CLI): "file state" command. #259file status FILE
summarise ArchiveFileCopy status across storage nodesfile show
file sync FILE NODE GROUP
- transfer file from node to group feat(CLI): "file sync" command #256seefile where FILE
- list nodes containing filefile show --nodes
Dispersed totransfer
- for ArchiveFileCopyRequestgroup/node/file
. See comment belowtransfer request NODE GROUP FILE...
- create transfer request for file(s) from node to groupfile transfer
transfer cancel NODE GROUP FILE
- cancel pending request for FILE from NODE to GROUPfile transfer --cancel
transfer list
- list transfersfile status --show-transfers
transfer pending
- list pending transfer statsgroup show --show-transfers
node show --show-transfers
file status --show-transfers
transfer sync NODE GROUP
- sync node to group (transfer all file not already present in group)node sync
group sync
Dispersed toaction
- for StorageTransferActiongroup/node
. See comment belowaction list
- list StorageTransferActionnode show --show-actions
group show --show-actions
action show NODE GROUP
- show StorageTransferAction for node-to-groupnode show --show-actions
group show --show-actions
group auto-sync
node auto-clean
Not sure about this. It's very different to the rest of the alpenhorn commands.transport
- transport disk stuff.transport create
- yikes Formerly calledformat-transport
.psutil
package to handle disk partitioning+formatting #8CH-
prefix for transport disk names configurable #124transport mount
- mount and activatetransport unmount
- deactivate and unmounttransport list
- list transport disksgroup show TRANSPORT_GROUP_NAME --show-nodes
The text was updated successfully, but these errors were encountered: