All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [fuego] pdu: add readme to board directory
@ 2019-07-11  4:12 Daniel Sangorrin
  2019-07-17  7:34 ` Tim.Bird
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Sangorrin @ 2019-07-11  4:12 UTC (permalink / raw)
  To: fuego

I put this in the boards directory because README.LAVA
was there as well. However, if you prefer to put it on
the documentation folder that would be fine too.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
---
 fuego-ro/boards/README.pdu | 146 +++++++++++++++++++++++++++++++++++++
 1 file changed, 146 insertions(+)
 create mode 100644 fuego-ro/boards/README.pdu

diff --git a/fuego-ro/boards/README.pdu b/fuego-ro/boards/README.pdu
new file mode 100644
index 0000000..f6050cf
--- /dev/null
+++ b/fuego-ro/boards/README.pdu
@@ -0,0 +1,146 @@
+Using power control
+===================
+
+To power on, off and reboot a board use.
+
+  $ ftc power-on -b bbb
+  $ ftc power-off -b bbb
+  $ ftc power-cycle -b bbb
+
+You can also specify multiple boards at once.
+
+  $ ftc power-on -b bbb,raspi3
+  $ ftc power-off -b bbb,raspi3
+  $ ftc power-cycle -b bbb,raspi3
+
+Adding board control to your board
+==================================
+
+First, you need to decide what board control software to use. For example,
+if you want to use PDUdaemon write:
+
+  $ vi fuego-ro/boards/bbb.board
+    BOARD_CONTROL="pdudaemon"
+
+If you prefer to use TTC then write
+
+  $ vi fuego-ro/boards/bbb.board
+    BOARD_CONTROL="ttc"
+
+Next, you need to provide the options required by the board control software
+that you chose.
+
+PDUdaemon-related board options
+-------------------------------
+
+First, you need to configure your PDU hostname and PORT.
+ - PDU_HOSTNAME: the hostname or IP address of your PDU. This needs to match
+   the one defined in the PDUDaemon configuration file (see below)
+ - PDU_PORT: the PDU port number that identifies the outlet where the board
+   is plugged.
+
+  $ vi fuego-ro/boards/bbb.board
+    BOARD_CONTROL="pdudaemon"
+    PDU_HOSTNAME=192.168.11.68
+    PDU_PORT=1
+
+You can optionally specify a delay.
+  - PDU_DELAY: seconds before command runs, or between off/on when rebooting
+    (default: 1 second)
+
+  $ vi fuego-ro/boards/bbb.board
+    BOARD_CONTROL="pdudaemon"
+    PDU_HOSTNAME=192.168.11.68
+    PDU_PORT=1
+    PDU_DELAY=5
+
+Finally, if you are running PDUDaemon outside of your host machine then you
+need to configure PDUDAEMON_HOSTNAME and PDUDAEMON_PORT.
+ - PDUDAEMON_HOSTNAME: hostname or IP address of the computer where the
+   PDUDaemon container is running (default: localhost)
+ - PDUDAEMON_PORT: port where PDUDaemon is listening (default: 16421)
+
+  $ vi fuego-ro/boards/bbb.board
+    BOARD_CONTROL="pdudaemon"
+    PDU_HOSTNAME=192.168.11.68
+    PDU_PORT=1
+    PDUDAEMON_HOSTNAME=localhost <-- change as necessary
+    PDUDAEMON_PORT=16421 <-- change only if you know what you are doing
+
+TTC-related board options
+-------------------------
+
+You only need to configure the TTC target name on your board. Otherwise,
+the board name will be used by default.
+
+  $ vi fuego-ro/boards/bbb.board
+    TTC_TARGET="bbb"
+
+PDUDaemon installation notes
+============================
+
+PDUDaemon can be installed quickly as a Docker container. The first step is to
+clone the source code.
+
+  $ git clone https://github.com/pdudaemon/pdudaemon
+  $ cd pdudaemon
+
+Next, configure the PDUDaemon's hostname and port. This is where the daemon
+will listen for requests.
+
+  $ vi share/pdudaemon.conf
+    {
+        "daemon": {
+            "hostname": "localhost", <-- PDUDaemon hostname or IP address
+            "port": 16421, <-- PDUDaemon port
+            "dbname": "pdudaemon",
+            "logging_level": "DEBUG",
+            "listener": "http"
+        },
+
+You also need to configure your PDU(s). Try to find a driver that supports
+your PDU under pdudaemon/drivers/ (e.g. ip9258.py). Open the driver file
+and check for adjustable settings (e.g., grep settings).
+
+  $ vi share/pdudaemon.conf
+    [...]
+        "pdus": {
+            "192.168.11.68": { <-- PDU hostname or IP address
+                "driver": "ip9258" <-- PDU driver
+            }
+        }
+    }
+
+If you cannot find a driver for your PDU, you will have to write one.
+Alternatively, you may be able to configure the "localcmdline" driver for
+your needs. The symbol %d represents a "port number" that identifies the
+outlet where a board is connected
+
+  $ vi share/pdudaemon.conf
+    [...]
+        "myscript_hostname": {
+            "driver": "localcmdline",
+            "cmd_on": "myscript %d on",
+            "cmd_off": "myscript %d off"
+        },
+
+Finally, build the Docker image and run it on the machine where the daemon
+is configured to run. Here we run it locally because we are using "localhost".
+
+  $ docker build -t pdudaemon --build-arg HTTP_PROXY=$http_proxy -f Dockerfile.dockerhub .
+  $ docker run --rm -it -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e NO_PROXY="$no_proxy" --net="host" pdudaemon:latest
+
+Test the installation manually
+------------------------------
+
+First, make sure that the PDUDaemon is reachable.
+
+  $ ping $PDUDAEMON_HOSTNAME
+
+Next, you can use CURL to power on and off the outlet number 1.
+
+  $ curl "http://localhost:16421/power/control/on?hostname=192.168.11.68&port=1"
+    OK - accepted request
+  $ curl "http://localhost:16421/power/control/off?hostname=192.168.11.68&port=1"
+    OK - accepted request
+
-- 
2.17.1


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

* Re: [Fuego] [fuego] pdu: add readme to board directory
  2019-07-11  4:12 [Fuego] [fuego] pdu: add readme to board directory Daniel Sangorrin
@ 2019-07-17  7:34 ` Tim.Bird
  0 siblings, 0 replies; 2+ messages in thread
From: Tim.Bird @ 2019-07-17  7:34 UTC (permalink / raw)
  To: daniel.sangorrin, fuego

I'm OK with putting this here.  But I'd like this information to also be available on
the wiki.  Can you add a page there somewhere?  Someday, the wiki pages
will be turned into reStructured docs inside the Documentation directory.
For now, having this in a README and on the wiki will suffice.

I haven't really tested the document for accuracy, but I'm trusing that it
at least worked for you.

Finally - I couldn't find this in your fuego 'next' branch.  Did you push your branch
to  bitbucket?

I'll hold off on applying this today, because it's much easier to apply from your
next branch than from the list.  But I can do it from the list if there's some problem
pushing it through your bitbucket repo.
 -- Tim
 

> -----Original Message-----
> From: Daniel Sangorrin
> 
> I put this in the boards directory because README.LAVA
> was there as well. However, if you prefer to put it on
> the documentation folder that would be fine too.
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
> ---
>  fuego-ro/boards/README.pdu | 146
> +++++++++++++++++++++++++++++++++++++
>  1 file changed, 146 insertions(+)
>  create mode 100644 fuego-ro/boards/README.pdu
> 
> diff --git a/fuego-ro/boards/README.pdu b/fuego-ro/boards/README.pdu
> new file mode 100644
> index 0000000..f6050cf
> --- /dev/null
> +++ b/fuego-ro/boards/README.pdu
> @@ -0,0 +1,146 @@
> +Using power control
> +===================
> +
> +To power on, off and reboot a board use.
> +
> +  $ ftc power-on -b bbb
> +  $ ftc power-off -b bbb
> +  $ ftc power-cycle -b bbb
> +
> +You can also specify multiple boards at once.
> +
> +  $ ftc power-on -b bbb,raspi3
> +  $ ftc power-off -b bbb,raspi3
> +  $ ftc power-cycle -b bbb,raspi3
> +
> +Adding board control to your board
> +==================================
> +
> +First, you need to decide what board control software to use. For example,
> +if you want to use PDUdaemon write:
> +
> +  $ vi fuego-ro/boards/bbb.board
> +    BOARD_CONTROL="pdudaemon"
> +
> +If you prefer to use TTC then write
> +
> +  $ vi fuego-ro/boards/bbb.board
> +    BOARD_CONTROL="ttc"
> +
> +Next, you need to provide the options required by the board control
> software
> +that you chose.
> +
> +PDUdaemon-related board options
> +-------------------------------
> +
> +First, you need to configure your PDU hostname and PORT.
> + - PDU_HOSTNAME: the hostname or IP address of your PDU. This needs to
> match
> +   the one defined in the PDUDaemon configuration file (see below)
> + - PDU_PORT: the PDU port number that identifies the outlet where the
> board
> +   is plugged.
> +
> +  $ vi fuego-ro/boards/bbb.board
> +    BOARD_CONTROL="pdudaemon"
> +    PDU_HOSTNAME=192.168.11.68
> +    PDU_PORT=1
> +
> +You can optionally specify a delay.
> +  - PDU_DELAY: seconds before command runs, or between off/on when
> rebooting
> +    (default: 1 second)
> +
> +  $ vi fuego-ro/boards/bbb.board
> +    BOARD_CONTROL="pdudaemon"
> +    PDU_HOSTNAME=192.168.11.68
> +    PDU_PORT=1
> +    PDU_DELAY=5
> +
> +Finally, if you are running PDUDaemon outside of your host machine then
> you
> +need to configure PDUDAEMON_HOSTNAME and PDUDAEMON_PORT.
> + - PDUDAEMON_HOSTNAME: hostname or IP address of the computer
> where the
> +   PDUDaemon container is running (default: localhost)
> + - PDUDAEMON_PORT: port where PDUDaemon is listening (default: 16421)
> +
> +  $ vi fuego-ro/boards/bbb.board
> +    BOARD_CONTROL="pdudaemon"
> +    PDU_HOSTNAME=192.168.11.68
> +    PDU_PORT=1
> +    PDUDAEMON_HOSTNAME=localhost <-- change as necessary
> +    PDUDAEMON_PORT=16421 <-- change only if you know what you are
> doing
> +
> +TTC-related board options
> +-------------------------
> +
> +You only need to configure the TTC target name on your board. Otherwise,
> +the board name will be used by default.
> +
> +  $ vi fuego-ro/boards/bbb.board
> +    TTC_TARGET="bbb"
> +
> +PDUDaemon installation notes
> +============================
> +
> +PDUDaemon can be installed quickly as a Docker container. The first step is
> to
> +clone the source code.
> +
> +  $ git clone https://github.com/pdudaemon/pdudaemon
> +  $ cd pdudaemon
> +
> +Next, configure the PDUDaemon's hostname and port. This is where the
> daemon
> +will listen for requests.
> +
> +  $ vi share/pdudaemon.conf
> +    {
> +        "daemon": {
> +            "hostname": "localhost", <-- PDUDaemon hostname or IP address
> +            "port": 16421, <-- PDUDaemon port
> +            "dbname": "pdudaemon",
> +            "logging_level": "DEBUG",
> +            "listener": "http"
> +        },
> +
> +You also need to configure your PDU(s). Try to find a driver that supports
> +your PDU under pdudaemon/drivers/ (e.g. ip9258.py). Open the driver file
> +and check for adjustable settings (e.g., grep settings).
> +
> +  $ vi share/pdudaemon.conf
> +    [...]
> +        "pdus": {
> +            "192.168.11.68": { <-- PDU hostname or IP address
> +                "driver": "ip9258" <-- PDU driver
> +            }
> +        }
> +    }
> +
> +If you cannot find a driver for your PDU, you will have to write one.
> +Alternatively, you may be able to configure the "localcmdline" driver for
> +your needs. The symbol %d represents a "port number" that identifies the
> +outlet where a board is connected
> +
> +  $ vi share/pdudaemon.conf
> +    [...]
> +        "myscript_hostname": {
> +            "driver": "localcmdline",
> +            "cmd_on": "myscript %d on",
> +            "cmd_off": "myscript %d off"
> +        },
> +
> +Finally, build the Docker image and run it on the machine where the
> daemon
> +is configured to run. Here we run it locally because we are using "localhost".
> +
> +  $ docker build -t pdudaemon --build-arg HTTP_PROXY=$http_proxy -f
> Dockerfile.dockerhub .
> +  $ docker run --rm -it -e http_proxy=$http_proxy -e
> https_proxy=$https_proxy -e NO_PROXY="$no_proxy" --net="host"
> pdudaemon:latest
> +
> +Test the installation manually
> +------------------------------
> +
> +First, make sure that the PDUDaemon is reachable.
> +
> +  $ ping $PDUDAEMON_HOSTNAME
> +
> +Next, you can use CURL to power on and off the outlet number 1.
> +
> +  $ curl
> "http://localhost:16421/power/control/on?hostname=192.168.11.68&port=1
> "
> +    OK - accepted request
> +  $ curl
> "http://localhost:16421/power/control/off?hostname=192.168.11.68&port=1
> "
> +    OK - accepted request
> +
> --
> 2.17.1
> 
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego

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

end of thread, other threads:[~2019-07-17  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11  4:12 [Fuego] [fuego] pdu: add readme to board directory Daniel Sangorrin
2019-07-17  7:34 ` 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.