I think the long form of specifying the server is not terrible for now. After all, aliases would make it a non-issue anyway. Pulling from an environment variable should be simple, and iirc has already been done for lc-tool. I think it's unlikely though, that one would commonly submit to moreb than one server frequently. In the long run, I think it would be nice to consider a command to store a default server to submit the jobbto, if none is specified.
Assuming the auth token has been previously stored, and the default server specified, that would simplify the command line to something like:
lava-tool submit-job test.jsonThanks,
Paul LarsonOn May 29, 2011 11:54 PM, "Michael Hudson-Doyle" <michael.hudson@linaro.org> wrote:
> Hi all,
>
> I'm working on the infrastructure that will underlie the scheduler
> command line api. Zygmunt and I have the technical side understood I
> think, but what I want to think aloud about is how the command line
> should work for a user. In particular, I wonder how much state the
> command line tool should save.
>
> The basic command line entry point is "submit a job". For now at least,
> the job will be a JSON file, so the simplest possible invocation would
> be:
>
> $ lava-tool submit-job test.json
>
> But this doesn't specify anything about where the job should go. The
> least effort solution would be to require a full specification on the
> command line:
>
> $ lava-tool submit-job --farm https://mwhudson:$token@validation.linaro.org test.json
>
> This is clearly a bad idea though: tokens will be long and unwieldy and
> passing it on the command line means they will be disclosed in ways that
> we should avoid (they'll appear in ps output for all users and could
> easily end up in log files).
>
> So we need a way of storing tokens. The easiest thing to do would be to
> store a token for a (username, host) pair, so you'd run a command like:
>
> $ lava-tool auth-add --token-file token-file https://mwhudson@validation.linaro.org
>
> Then you'd still need to specify the username and host on every
> invocation:
>
> $ lava-tool submit-job --farm https://mwhudson@validation.linaro.org test.json
>
> Would this be too unwieldy do you think? For scripted or cronjobbed
> invocations its probably fine, for the command line it might be a bit
> awkward. But I don't know how much call there is for a genuinely
> interactive tool here.
>
> I guess the point I've argued myself to here is that I should implement
> this long form for now, and if a need arises add more conveniences (for
> example, reading from an environment variable or adding a command to set
> the defaults). Does anyone disagree too strongly with that?
>
> Cheers,
> mwh
>
> _______________________________________________
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev