2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

The usage and manpage for docker instance management command, mkdocker,lsdocker,rmdocker,rpower

This commit is contained in:
ertaozh 2016-01-21 01:41:57 -05:00
parent 97dd22a9ee
commit 79afc50693
10 changed files with 563 additions and 0 deletions

View File

@ -0,0 +1,92 @@
##########
lsdocker.1
##########
.. highlight:: perl
****
NAME
****
\ **lsdocker**\ - List docker instance.
********
SYNOPSIS
********
\ **lsdocker**\ \ *noderange*\ [\ **-l**\ |\ **--logs**\ ]
\ **lsdocker**\ \ *dockerhost*\
\ **lsdocker**\ [\ **-h**\ |\ **--help**\ ]
\ **lsdocker**\ {\ **-v**\ |\ **--version**\ }
***********
DESCRIPTION
***********
\ **lsdocker**\ To list docker instance info or all the running docker instance info if dockerhost is specified.
*******
OPTIONS
*******
\ **-l|--logs**\
To return the logs of docker instance. Only works for docker instance.
********
EXAMPLES
********
\*
To get info for docker instance "host01c01"
.. code-block:: perl
lsdocker host01c01
host01c01: 50800dfd8b5f ubuntu /bin/bash 2016-01-13T06:32:59 running /host01c01
\*
To get info for running docker instance on dockerhost "host01"
.. code-block:: perl
lsdocker host01
host01: 50800dfd8b5f ubuntu /bin/bash 2016-1-13 - 1:32:59 Up 12 minutes /host01c01
host01: 875ce11d5987 ubuntu /bin/bash 2016-1-21 - 1:12:37 Up 5 seconds /host01c02
********
SEE ALSO
********
mkdocker(1)|mkdocker.1, rmdocker(1)|rmdocker.1

View File

@ -0,0 +1,164 @@
##########
mkdocker.1
##########
.. highlight:: perl
****
NAME
****
\ **mkdocker**\ - Create docker instance.
********
SYNOPSIS
********
\ **mkdocker**\ \ *noderange*\ [\ **image**\ =\ **image_name**\ [\ **command**\ =\ **command**\ ]] [\ **dockerflag**\ =\ **flags_to_create_instance**\ ]
\ **mkdocker**\ [\ **-h**\ |\ **--help**\ ]
\ **mkdocker**\ {\ **-v**\ |\ **--version**\ }
***********
DESCRIPTION
***********
\ **rmdocker**\ To create docker instances with the specified image, command and/or dockerflags.
*******
OPTIONS
*******
\ **image**\
The docker image name that the instance will use.
\ **command**\
The command that the instance will run based on the \ **image**\ specified. The \ **image**\ option must be specified in order to use this option.
\ **dockerflag**\
A JSON string which will be used as parameters to create a docker. Please reference https://docs.docker.com/engine/reference/api/docker_remote_api_v1.21/ for more information about which parameters can be specified.
Some useful flags are:
\ **AttachStdin**\ =\ **true**\ |\ **false**\
Whether attaches to stdin.
\ **AttachStdout**\ =\ **true**\ |\ **false**\
Whether attaches to stdout.
\ **AttachStderr**\ =\ **true**\ |\ **false**\
Whether attaches to stderr.
\ **OpenStdin**\ =\ **true**\ |\ **false**\
Whether opens stdin.
\ **Tty**\ =\ **true**\ |\ **false**\
Attach standard streams to a tty, including stdin if it is not closed.
\ **NetworkDisabled**\ =\ **true**\
Disables networking for the docker instances, it can be used when specify static IP address for an instance after started.
\ **ExposedPorts**\
An object mapping ports to an empty object in the form of:
.. code-block:: perl
"ExposedPorts": { "<port>/\<tcp|udp>: {}" }
\ **HostConfig: {"Binds"}**\
A list of volume bindings for this docker instance, the form will be:
.. code-block:: perl
"HostConfig": {"Binds":["<dir_on_dockerhost>:<dir_in_instance>"]}
********
EXAMPLES
********
1. To create a basic docker instance with stdin opened
.. code-block:: perl
mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}"
host01c01: success
2. To create a docker instance with network disabled
.. code-block:: perl
mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"NetworkDisabled\":ture}"
host01c01: success
3. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir".
.. code-block:: perl
mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true,\"HostConfig\":{\"Binds\":[\"/srcdir:/destdir\"]}}"
host01c01: success
********
SEE ALSO
********
rmdocker(1)|rmdocker.1, lsdocker(1)|lsdocker.1

View File

@ -0,0 +1,48 @@
##########
rmdocker.1
##########
.. highlight:: perl
********
SYNOPSIS
********
\ **rmdocker**\ \ *noderange*\
\ **rmdocker**\ [\ **-h**\ |\ **--help**\ ]
\ **rmdocker**\ {\ **-v**\ |\ **--version**\ }
***********
DESCRIPTION
***********
\ **rmdocker**\ To remove docker instances with the specified node name.
********
EXAMPLES
********
.. code-block:: perl
rmdocker host01c01
host01c01: success
********
SEE ALSO
********
mkdocker(1)|mkdocker.1, lsdocker(1)|lsdocker.1

View File

@ -95,6 +95,13 @@ zVM specific:
\ **rpower**\ \ *noderange*\ [\ **on**\ |\ **off**\ |\ **reset**\ |\ **stat**\ |\ **softoff**\ ]
docker specific:
================
\ **rpower**\ \ *noderange*\ [\ **start**\ |\ **stop**\ |\ **restart**\ |\ **pause**\ |\ **unpause**\ |\ **state**\ ]
***********
DESCRIPTION
@ -305,6 +312,42 @@ OPTIONS
\ **start**\
To start a created docker instance.
\ **stop**\
To stop a created docker instance.
\ **restart**\
To restart a created docker instance.
\ **pause**\
To pause all processes in the instance.
\ **unpause**\
To unpause all processes in the instance.
\ **state**\
To get state of the instance.
\ **-h**\ |\ **--help**\
Prints out a brief usage message.

View File

@ -46,6 +46,8 @@ my %usage = (
rpower noderange [on|off|reset|stat|softoff]
MIC specific:
rpower noderange [stat|state|on|off|reset|boot]
docker specific:
rpower noderange [start|stop|restart|pause|unpause|state]
",
"rbeacon" =>
"Usage: rbeacon <noderange> [on|off|stat] [-V|--verbose]
@ -288,6 +290,13 @@ my %usage = (
rmvm [-p] [-f]
PPC (using Direct FSP Management) specific:
rmvm <noderange>",
"mkdocker" =>
"Usage: mkdocker <noderange> [image=<image_name> [command=<command>]] [dockerflag=<docker_flags>]",
"lsdocker" =>
"Usage: lsdocker <noderange>
lsdocker <noderange> [-l|--logs]",
"rmdocker" =>
"Usage: rmdocker <noderage>",
"lsslp" =>
"Usage: lsslp [-h|--help|-v|--version]
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM|IMM2|FSP]

View File

@ -0,0 +1,53 @@
=head1 NAME
B<lsdocker> - List docker instance.
=head1 SYNOPSIS
B<lsdocker> I<noderange> [B<-l>|B<--logs>]
B<lsdocker> I<dockerhost>
B<lsdocker> [B<-h>|B<--help>]
B<lsdocker> {B<-v>|B<--version>}
=head1 DESCRIPTION
B<lsdocker> To list docker instance info or all the running docker instance info if dockerhost is specified.
=head1 OPTIONS
=over 3
=item B<-l|--logs>
=back
To return the logs of docker instance. Only works for docker instance.
=head1 EXAMPLES
=over 3
=item *
To get info for docker instance "host01c01"
lsdocker host01c01
host01c01: 50800dfd8b5f ubuntu /bin/bash 2016-01-13T06:32:59 running /host01c01
=item *
To get info for running docker instance on dockerhost "host01"
lsdocker host01
host01: 50800dfd8b5f ubuntu /bin/bash 2016-1-13 - 1:32:59 Up 12 minutes /host01c01
host01: 875ce11d5987 ubuntu /bin/bash 2016-1-21 - 1:12:37 Up 5 seconds /host01c02
=back
=head1 SEE ALSO
L<mkdocker(1)|mkdocker.1>, L<rmdocker(1)|rmdocker.1>

View File

@ -0,0 +1,97 @@
=head1 NAME
B<mkdocker> - Create docker instance.
=head1 SYNOPSIS
B<mkdocker> I<noderange> [B<image>=B<image_name> [B<command>=B<command>]] [B<dockerflag>=B<flags_to_create_instance>]
B<mkdocker> [B<-h>|B<--help>]
B<mkdocker> {B<-v>|B<--version>}
=head1 DESCRIPTION
B<rmdocker> To create docker instances with the specified image, command and/or dockerflags.
=head1 OPTIONS
=over 3
=item B<image>
The docker image name that the instance will use.
=item B<command>
The command that the instance will run based on the B<image> specified. The B<image> option must be specified in order to use this option.
=item B<dockerflag>
A JSON string which will be used as parameters to create a docker. Please reference https://docs.docker.com/engine/reference/api/docker_remote_api_v1.21/ for more information about which parameters can be specified.
Some useful flags are:
=over 3
=item B<AttachStdin>=B<true>|B<false>
Whether attaches to stdin.
=item B<AttachStdout>=B<true>|B<false>
Whether attaches to stdout.
=item B<AttachStderr>=B<true>|B<false>
Whether attaches to stderr.
=item B<OpenStdin>=B<true>|B<false>
Whether opens stdin.
=item B<Tty>=B<true>|B<false>
Attach standard streams to a tty, including stdin if it is not closed.
=item B<NetworkDisabled>=B<true>
Disables networking for the docker instances, it can be used when specify static IP address for an instance after started.
=item B<ExposedPorts>
An object mapping ports to an empty object in the form of:
"ExposedPorts": { "<port>/\<tcp|udp>: {}" }
=item B<HostConfig: {"Binds"}>
A list of volume bindings for this docker instance, the form will be:
"HostConfig": {"Binds":["<dir_on_dockerhost>:<dir_in_instance>"]}
=back
=back
=head1 EXAMPLES
1. To create a basic docker instance with stdin opened
mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}"
host01c01: success
2. To create a docker instance with network disabled
mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"NetworkDisabled\":ture}"
host01c01: success
3. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir".
mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true,\"HostConfig\":{\"Binds\":[\"/srcdir:/destdir\"]}}"
host01c01: success
=head1 SEE ALSO
L<rmdocker(1)|rmdocker.1>, L<lsdocker(1)|lsdocker.1>

View File

@ -0,0 +1,26 @@
=head1 NAME
B<rmdocker> - Remove docker instance.
=head1 SYNOPSIS
B<rmdocker> I<noderange>
B<rmdocker> [B<-h>|B<--help>]
B<rmdocker> {B<-v>|B<--version>}
=head1 DESCRIPTION
B<rmdocker> To remove docker instances with the specified node name.
=head1 EXAMPLES
rmdocker host01c01
host01c01: success
=head1 SEE ALSO
L<mkdocker(1)|mkdocker.1>, L<lsdocker(1)|lsdocker.1>

View File

@ -50,6 +50,10 @@ B<rpower> I<noderange> [B<cycle>|B<softoff>]
B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<stat>|B<softoff>]
=head2 docker specific:
B<rpower> I<noderange> [B<start>|B<stop>|B<restart>|B<pause>|B<unpause>|B<state>]
=head1 DESCRIPTION
B<rpower> controls the power for a single or range of nodes, via the out-of-band path.
@ -199,6 +203,30 @@ To specify that the target node will be power down if B<suspend> action failed.
To specify that the target node will be reset if B<suspend> action failed.
=item B<start>
To start a created docker instance.
=item B<stop>
To stop a created docker instance.
=item B<restart>
To restart a created docker instance.
=item B<pause>
To pause all processes in the instance.
=item B<unpause>
To unpause all processes in the instance.
=item B<state>
To get state of the instance.
=item B<-h>|B<--help>
Prints out a brief usage message.

View File

@ -27,6 +27,9 @@ sub handled_commands {
lsvm => 'AAAusage',
chvm => 'AAAusage',
rmvm => 'AAAusage',
mkdocker => 'AAAusage',
lsdocker => 'AAAusage',
rmdocker => 'AAAusage',
#lsslp => 'AAAusage',
rflash => 'AAAusage',
mkhwconn => 'AAAusage',