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

Allow user aliases as viable inputs to --user argument #46

Open
matthewfeickert opened this issue Nov 16, 2020 · 5 comments
Open

Allow user aliases as viable inputs to --user argument #46

matthewfeickert opened this issue Nov 16, 2020 · 5 comments
Assignees
Labels
enhancement user request Request submitted by user

Comments

@matthewfeickert
Copy link
Collaborator

It would be nice if for commands like pandamon it was possible to give user name aliases (e.g. dguest or feickert) as valid inputs to the --user option. For example,

$ pandamon user.dguest --days 100

gives output and it would be nice if

$ pandamon --user dguest --days 100

gave the same output (it currently gives no results).

Currently though we see that the only allowed inputs for --user are

$ python -m pip show pandamonium | grep Version
Version: 0.2.1
$ pandamon --help
usage: pandamon [-h] [-u USER] [-d DAYS] [-s [STREAM] | -g] [-c]
                [--force-color] [-t] [-b] [-j] [-m] [-i FILT [FILT ...]]
                [-r RNGE] [-a] [-f]
                [taskname]

Script to retreve datasets (input or output) in submitted jobs

With a specified search string, will search for datasets with that
name. If the name doesn't end in `*` or `/`, append a wildcard.
if the string is '-', the datasets are read from stdin.

The user name can be specified via environment variable to reduce
clutter.

positional arguments:
  taskname              initial search string

optional arguments:
  -h, --help            show this help message and exit
  -u USER, --user USER  full user name, or blank for all (please set
                        GRID_USER_NAME environment variable) Note that this
                        should be your full name, i.e. "Daniel Joseph Antrim"
@matthewfeickert matthewfeickert added enhancement user request Request submitted by user labels Nov 16, 2020
@matthewfeickert matthewfeickert self-assigned this Nov 16, 2020
@matthewfeickert
Copy link
Collaborator Author

matthewfeickert commented Nov 17, 2020

I now see that in

$ pandamon user.dguest --days 100

user.dguest is being passed in as taskname and not user, as user would be "Dan Guest" if it were to be passed in.

What I'd like to propose doing (and have done in a branch) is to change

  • user to username
  • Create argument user that would be the user alias (which I think is probably more useful if you wanted to query other people than needing their full name)
  • Set taskname to "user.{}".format(args.user) if taskname is not set

which would give args of

$ pandamon --help
usage: pandamon [-h] [-u USER] [--username USERNAME] [-d DAYS] [-s [STREAM] |
                -g] [-c] [--force-color] [-t] [-b] [-j] [-m]
                [-i FILT [FILT ...]] [-r RNGE] [-a] [-f]
                [taskname]

Script to retreve datasets (input or output) in submitted jobs

With a specified search string, will search for datasets with that
name. If the name doesn't end in `*` or `/`, append a wildcard.
if the string is '-', the datasets are read from stdin.

The username can be specified via environment variable to reduce
clutter.

positional arguments:
  taskname              initial search string

optional arguments:
  -h, --help            show this help message and exit
  -u USER, --user USER  User CERN alias
  --username USERNAME   full ATLAS PanDA username, or blank for all (please
                        set GRID_USER_NAME environment variable) Note that
                        this should be your full name, i.e. "Daniel Joseph
                        Antrim"

@dguest As this changes the API what do you think here?

@dguest
Copy link
Owner

dguest commented Nov 18, 2020

It doesn't sound terrible, although typing pandamon -u dguest isn't that much better than typing pandamon user.dguest or pandamon *dguest

It might be a bit "magic" but we could also consider prefixing anything "non-standard" looking with user.. We can't just prefix everything with user. because people might also want to use group.* or valid* or mc16_13TeV.* and so on. Or maybe that's a terrible idea.

@dguest
Copy link
Owner

dguest commented Nov 18, 2020

The other issue with your proposal is that steals -u from the full user name. I actually use this flag a lot to look for other people's jobs. Actually I often use things like pandamon group.perf-flavtag -u '' to list every job that has been submitted under one group. Maybe we could make that cleaner than an empty string...

@matthewfeickert
Copy link
Collaborator Author

The other issue with your proposal is that steals -u from the full user name. I actually use this flag a lot to look for other people's jobs.

@dguest How do you find out other people's PanDA usernames easily? They don't seem to be uniform given that mine is "Matthew Carl Feickert" and yours is just "Dan Guest". The motivation here was that it seems far easier to get a CERN user alias for people then to hunt down the PanDA username.

Actually I often use things like pandamon group.perf-flavtag -u '' to list every job that has been submitted under one group.

This is a very nice use case of an instance where you aren't looking at individual users. Thanks for giving me a test. 👍

@dguest
Copy link
Owner

dguest commented Nov 19, 2020

I think I usually just looked people up on the panda webpage. Maybe you can do something with the api...

Anyway, the way I usually use the -u flag is just to set it to ''. It's not really the best argument for keeping that flag around: we could just as well have a -n flag for "no username" or something and then make --username a long option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement user request Request submitted by user
Projects
None yet
Development

No branches or pull requests

2 participants