All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] Adding board availability status to fserver
@ 2021-04-14  5:31 Pavan Arun Deshpande
  2021-04-14 21:01 ` Tim.Bird
  0 siblings, 1 reply; 2+ messages in thread
From: Pavan Arun Deshpande @ 2021-04-14  5:31 UTC (permalink / raw
  To: Bird, Tim, tbird20d; +Cc: fuego


[-- Attachment #1.1: Type: text/plain, Size: 1320 bytes --]

Hi Tim,

I have added a status variable to the board dictionary in the
do_put_board() function of ftc script.
Here are procedure to change board availability status and put that on the
fserver:

   - change the status variable value either up or down according to board
   availability.
   - run the following command in the ttc container:

                       ftc put-board  <board_name>
  then it will reflect in <board_name>.json file on the fserver

please find the patch file of the ftc script and also the snapshot of the
rpi.json below.

Thanks and regards
Pavan Arun Deshpande

-- 






This
message contains confidential information and is intended only 
for the
individual(s) named. If you are not the intended
recipient, you are 
notified that disclosing, copying, distributing or taking any
action in 
reliance on the contents of this mail and attached file/s is strictly
prohibited. Please notify the
sender immediately and delete this e-mail 
from your system. E-mail transmission
cannot be guaranteed to be secured or 
error-free as information could be
intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain
viruses. The sender therefore does 
not accept liability for any errors or
omissions in the contents of this 
message, which arise as a result of e-mail
transmission.

[-- Attachment #1.2: Type: text/html, Size: 1638 bytes --]

[-- Attachment #2: rpi_json.png --]
[-- Type: image/png, Size: 9341 bytes --]

[-- Attachment #3: ftc.patch --]
[-- Type: text/x-patch, Size: 547 bytes --]

diff --git a/scripts/ftc b/scripts/ftc
index b0fe0ad..e8428e4 100755
--- a/scripts/ftc
+++ b/scripts/ftc
@@ -4025,7 +4025,7 @@ def do_put_board(conf, options):
         error_out("Unrecognized board %s" % (board_name))
 
     url = conf.SERVER_URL_BASE+"put_board"
-    board_dict = {"host": conf.host, "board": board_name }
+    board_dict = {"host": conf.host, "board": board_name, "status":"up"}
     # FIXTHIS - probably want to send a lot more data here (in do_put_board)
     # but this is a start
     resp = requests.post(url, board_dict)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Fuego] Adding board availability status to fserver
  2021-04-14  5:31 [Fuego] Adding board availability status to fserver Pavan Arun Deshpande
@ 2021-04-14 21:01 ` Tim.Bird
  0 siblings, 0 replies; 2+ messages in thread
From: Tim.Bird @ 2021-04-14 21:01 UTC (permalink / raw
  To: pavan.ad, tbird20d; +Cc: fuego

Thanks for working on this.

Here is some feedback.  When sending patches, it is helpful if the patch is "inline"
in the e-mail, instead of provided as an attachment.  When the patch is inline
in the body of the e-mail, I can quote it, and comment on individual lines or
sections, directly inside my email client.  This make it much easier to do reviews
and give feedback.

Please see the following for instructions about sending patches:
http://fuegotest.org/wiki/License_And_Contribution_Policy#Submitting_contributions

(and maybe look at this also: https://www.kernel.org/doc/html/latest/process/submitting-patches.html)

Also, this patch is missing the Signed-off-by line.  Please see this section:
http://fuegotest.org/wiki/License_And_Contribution_Policy#Contributor_agreement
for details about this.  Do a 'git log' of ftc to see other commits, to see what
the Signed-off-by lines look like.

Please make sure your patches include an appropriate "Signed-off-by" line
in the future.  Note that if you have git configured with your name and e-mail,
git will add a Signed-off-by line for you when you use the '-s' option with git commit.
ex: 'git commit -s'

See additional comments inline below.

> -----Original Message-----
> From: Pavan Arun Deshpande <pavan.ad@pathpartnertech.com>
> 
> Hi Tim,
> 
> I have added a status variable to the board dictionary in the do_put_board() function of ftc script.
> Here are procedure to change board availability status and put that on the fserver:
> 
> *	change the status variable value either up or down according to board availability.

How does one do this?  In your patch, I only see a hardcoded value of "up" for the status,
and this value is embedded in the ftc source code.  Are you suggesting to edit 'ftc' when
a user wants to change the value of the status on the server?

Note that "do_put_board() takes an argument of "options", that has the remainder
of the command line arguments from the command.

One way to allow for dynamically changing the fserver board status from the command line
would be to pass in values on the command line.  So the command line would look like this:

ftc put-board bbb status=enabled
or
ftc put-board bbb status=disabled "status_description=down for lab maintenance. should be back on April 19"

Another possibility is for ftc to read status data from the local Fuego board file, and put that
into the request to update the board.

So, instead of giving the status on the ftc command line, a user would add it to the board
using the 'ftc set-var' command, and then the 'ftc put-board' could read server-relevant fields
from the system and send those to update the server with the information.

I'm not sure that "status" is the right field name for this.  status can refer to a number of different
attributes of the board.  In might include such things as reservation status, power status,
lab availability status, etc.  However, I can't think of a better field name for this at the moment.

Another issue, besides the name of the field in the board json file, is the set of values the field
is allowed to have.  In one of the existing boards I have the value of "Available".  You have "up"
in your patch.  In my example above I use "enabled" and "disabled" as possible values.

Since the 'status' field may be used by Fuego to determine whether to proceed with a test,
the set of values that are allowed should be specified.  That is, Fuego needs to know what
value strings to match against to control its operations relative to the board.
What I envision is that either fserver or ftc will reject operations for the board when it is in the "disabled" or "down" state, and requests will either be rejected, or deferred.

Also, I'm not sure that it's a good idea to overload the 'put-board' command with this attribute
update capability.  The put-board command is for originally registering the board with 
the server, and is intended to hold things like static data.  I think it might be better to create a
new command to update the board data, so the command would be something like:

 'ftc update-board bbb status=disabled'

This may require that I add another API to the server, to support this operation (separate
from the put-board operation).

> *	run the following command in the ttc container:
> 
> 
>                        ftc put-board  <board_name>
>   then it will reflect in <board_name>.json file on the fserver
> 
> please find the patch file of the ftc script and also the snapshot of the rpi.json below.

Adding the 'status' attribute to the board's json file on the server is the right approach.
But, as stated above, I'm not sure that 'status' is the field name I'd prefer for this.
Let me know what you think.

Overall, I think it would be good to give an overview of what I'm trying to accomplish
with the fserver system.  The main goal is to allow people to easily request that a test
be performed on a board in a different lab.  This is to allow people to have access to
boards and hardware that they otherwise would not have access to.  But I have other
secondary goals as well, that influence the design and architecture of the server, its APIs
and the ftc commands related to it.  Maybe I should do a presentation on one of our
conference calls, to describe the vision and architecture of the system, to help PPT
developers (including yourself) to understand what I'd like to accomplish with this system.

> 
> Thanks and regards
> Pavan Arun Deshpande
> 
> 
 
> This message contains confidential information and is intended only for the individual(s) named. If you are not the intended recipient, you
> are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this mail and attached file/s is strictly
> prohibited. Please notify the sender immediately and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be
> secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The
> sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail
> transmission.

This e-mail footer is a problem for contributing to open source projects.  The statement
in the footer directly contradicts the act of putting the message on a public mailing list.
I (mostly) ignore such footers in e-mails sent to the fuego mailing lists.  However, other
open source projects will explicitly ignore any emails that contain confidentiality and legal
notices like the one above.

I know you probably have no control over this footer (it's probably added automatically by 
your e-mail server).  But, if there's any way to avoid having this appear in your emails,
please remove it.  This will make it easier for you to contribute to open source projects.

Regards,
 -- Tim


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-14 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-14  5:31 [Fuego] Adding board availability status to fserver Pavan Arun Deshpande
2021-04-14 21:01 ` Tim.Bird

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.