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

refine the doc of run xcat in docker

This commit is contained in:
immarvin 2016-03-29 04:54:41 -04:00
parent dca721d039
commit 6be2a770cb
3 changed files with 42 additions and 39 deletions

View File

@ -32,30 +32,32 @@ xCAT shippes 2 Docker images for Docker host with different architecture:
Each of the xCAT Docker images above has 3 tags corresponding to different xCAT release inside Docker image:
* "latest" : the latest xCAT release
* the specified xCAT release: "2.11" is supported
* "dev": the latest xCAT development snapshot build
* "2.11" : xCAT 2.11 release
* "dev" : the latest xCAT development snapshot build
A Docker image with the specified tag should be denoted in format "[docker image name]:[tag]", for example, "xcat/xcat-ubuntu-x86_64:2.11". The tag is "latest" by default if not specified.
A Docker image with specified tag should be denoted in format "[docker image name]:[tag]", for example, "xcat/xcat-ubuntu-x86_64:2.11". If not specified, default tag is "latest".
Run xCAT in Docker
------------------
Each container with xCAT Docker image running inside is a xCAT management node, the container connect to the compute nodes and hardware control points in the cluster via "bridge" network on the Docker host. Generally, a xCAT container should connect to 2 types of networks:
Each container with xCAT Docker image running inside is a xCAT management node, the container connects to the compute nodes and hardware control points in the cluster via "bridge" network on the Docker host. Generally, a xCAT container should connect to 2 types of networks( the 2 types of networks might be one network in some cluster):
* "provnet": provision network connecting to compute nodes, i.e, a bridge "provbr" attached to the network interface facing the compute nodes on Docker host
* "hwmgtnet": hardware management network connecting to the hardware control points, i.e, a bridge "hwmgtbr" attached to the network interface facing the hardware control points
* "mgtnet": Management network, the network used by the Management Node to install operating systems and manage the nodes. The Management Node and in-band Network Interface Card (NIC) of the nodes are connected to this network. A bridge "mgtbr" will be created and attached to the network interface facing the compute nodes on Docker host
* "svcnet": Service network, the network used by the Management Node to control the nodes using out-of-band management using the Service Processor. A bridge "svcbr" will be created and attached to the network interface facing the hardware control points
You are required to determine and specify some necessary information, so that xCAT is well configured and running when the container is started. These information includes:
You are required to determine and specify some necessary information, so that xCAT is well configured and running when the container is started. This includes:
* Docker container: xCAT Docker image with specified xCAT release; the data volumes with directories on Docker host including xCAT DB tables, the osimage resources and xCAT logs, which can be used to save and restore the data of xCAT service
* network information: the network configuration of the xCAT container
* cluster information: the domain of the cluster
These information can be specified in 2 ways to run xCAT container:
* in options and arguments of docker commands such as "docker network create" or "docker run"
The information can be specified in 2 ways to run xCAT container:
* in options and arguments of docker commands such as ``docker network create`` or ``docker run``
* in the "docker-compose.yml", which contains all the configuration to start xCAT containers with Compose. This is the recommended way to start xCAT container.
The 2 ways are described step-by-step in the following sections of this documentation.
The 2 ways are described step-by-step in the following sections of this documentation. We recommend you start xCAT container with Compose.
When xCAT Docker container is started, you can access it with ``sudo docker attach``, however, we recommend you to access it via "ssh".
@ -65,14 +67,15 @@ When xCAT Docker container is started, you can access it with ``sudo docker atta
:maxdepth: 2
setup_docker_host.rst
run_xcat_in_docker_native.rst
run_xcat_in_docker_compose.rst
run_xcat_in_docker_native.rst
Work with xCAT
--------------
Once xCAT Docker container is run, you can use xCAT with the shell inside the container. Since the ssh service has also been enabled on the Docker container startup, you can also connect to the container via ssh, the default password for the user "root" is "cluster".
Once xCAT Docker container is running, you can use xCAT with the shell inside the container. Since the ssh service has been enabled on the Docker container startup, you can connect to the container via ssh. The default root password is "cluster".
Once you attach or ssh to the container, you will find that xCAT is running and configured, you can play with xCAT and manage your cluster now.
@ -83,7 +86,7 @@ If you start up the xCAT Docker container by following the steps described in se
Save and Restore xCAT data
----------------------------
According to the policy of Docker, Docker image should only be the service deployment unit, it is not recommended to save data in Docker image. Docker use "Data Volume" to save persisent data inside container, which can be simply taken as a shared directory between Docker host and Docker container.
According to the policy of Docker, Docker image should only be the service deployment unit, it is not recommended to save data in Docker image. Docker uses "Data Volume" to save persisent data inside container, which can be simply taken as a shared directory between Docker host and Docker container.
For dockerized xCAT, there are 3 volumes recommended to save and restore xCAT user data.

View File

@ -1,5 +1,5 @@
Run xCAT in Docker with Compose
===============================
Run xCAT in Docker with Compose (Recommended)
=============================================
An example configuration in the documentation
@ -25,7 +25,7 @@ Compose v1.7.0 or above should be installed on Docker host: ::
Customize docker-compose file
-----------------------------
xCAT shippes a docker-compose template `docker-compose.yml <https://github.com/immarvin/xcat-docker/blob/master/docker-compose.yml>`_, which is a self-description file including all the configurations to run xCAT in container. You can make up your compose file based on it if you are familiar with `Compose file <https://docs.docker.com/compose/compose-file/>`_ , otherwise, you can simply customize it with the following steps:
xCAT ships a docker-compose template `docker-compose.yml <https://github.com/immarvin/xcat-docker/blob/master/docker-compose.yml>`_, which is a self-description file including all the configurations to run xCAT in container. You can make up your compose file based on it if you are familiar with `Compose file <https://docs.docker.com/compose/compose-file/>`_ , otherwise, you can simply customize it with the following steps:
::
image: [xCAT docker image name]:[tag]
@ -33,46 +33,46 @@ xCAT shippes a docker-compose template `docker-compose.yml <https://github.com/i
specify the name and tag of xCAT Docker image, for example "xcat/xcat-ubuntu-x86_64:2.11"
::
extra_hosts:
- "xcatmn.[cluster domain name] xcatmn:[Container's IP address in provision network]"
- "xcatmn.[cluster domain name] xcatmn:[Container's IP address in management network]"
specify the cluster domain name, fox example "clusters.com", and the IP address of container running xCAT Docker image, such as "10.0.0.101"
::
networks:
hwmgtnet:
ipv4_address : [Container's IP address in hardware management network]
svcnet:
ipv4_address : [Container's IP address in service network]
provnet:
ipv4_address : [Container's IP address in provision network]
mgtnet:
ipv4_address : [Container's IP address in management network]
specify the IP address of Docker container in hardware management network and provision network. Sometimes, the "hwmgtnet" is the same as "provnet", the "hwmgtnet" should be omitted by commented the 2 lines out
specify the IP address of Docker container in service network and management network. If the "svcnet" is the same as "mgtnet", the 2 "svcnet" lines should be commented out.
::
networks:
#provision network, attached to the network interface on Docker host
#management network, attached to the network interface on Docker host
#facing the nodes to provision
provnet:
mgtnet:
driver: "bridge"
driver_opts:
com.docker.network.bridge.name: "provbr"
com.docker.network.bridge.name: "mgtbr"
ipam:
config:
- subnet: [subnet of provbr in CIDR]
gateway:[IP address of provbr]
- subnet: [subnet of mgtbr in CIDR]
gateway:[IP address of mgtbr]
#hardware management network, attached to the network interface on
#service network, attached to the network interface on
#Docker host facing the bmc network
hwmgtnet:
svcnet:
driver: "bridge"
driver_opts:
com.docker.network.bridge.name: "hwmgtbr"
com.docker.network.bridge.name: "svcbr"
ipam:
config:
- subnet: [subnet of hwmgtbr in CIDR]
gateway: [IP address of hwmgtbr]
- subnet: [subnet of svcbr in CIDR]
gateway: [IP address of svcbr]
specify the network configuration of bridge networks "provnet" and "hwmgtnet", the network configuration of the bridge networks should be same as the network interfaces attached to the bridges.
specify the network configuration of bridge networks "mgtnet" and "svcnet", the network configuration of the bridge networks should be same as the network interfaces attached to the bridges. The "mgtnet" and "svcnet" might the same network in some cluster, in this case, you can only create and connect to 1 network.
::
volumes:
#the "/install" volume is used to keep user data in xCAT,
@ -94,9 +94,9 @@ Start xCAT Docker container with Compose
----------------------------------------
After the "docker-compose.yml" is ready, the xCAT Docker container can be started with [1]_ ::
docker-compose -f "docker-compose.yml" up -d; ifconfig eno1 0.0.0.0; brctl addif provbr eno1; ip link set provbr up;docker-compose logs -f
docker-compose -f "docker-compose.yml" up -d; ifconfig eno1 0.0.0.0; brctl addif mgtbr eno1; ip link set mgtbr up;docker-compose logs -f
This command starts up the Docker container and attaches the network interface "eno1" of Docker host to the bridge network "provbr". It is a little complex due to a Compose bug `#1003 <https://github.com/docker/libnetwork/issues/1003>`_ . The commands should be run successively in one line to avoid breaking the network connection of the network interface of Docker host.
This command starts up the Docker container and attaches the network interface "eno1" of Docker host to the bridge network "mgtbr". It is a little complex due to a Compose bug `#1003 <https://github.com/docker/libnetwork/issues/1003>`_ . The commands should be run successively in one line to avoid breaking the network connection of the network interface of Docker host.
To remove the container, you can run ::
@ -114,5 +114,5 @@ Known Issues
"Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable."
please do not worry and just ignore it, the container has already been running. It is a Docker bug `#1214 <https://github.com/docker/compose/issues/1214>`_
You can ignore it, the container has already been running. It is a Docker bug `#1214 <https://github.com/docker/compose/issues/1214>`_

View File

@ -1,8 +1,8 @@
setup Docker host
Setup Docker host
=================
Install Dockerc Engine
----------------------
Install Docker Engine
---------------------
The Docker host to run xCAT Docker image should be a baremental or virtual server with Docker v1.10 or above installed. For the details on system requirements and Docker installation, please refer to `Docker Installation Docs <https://docs.docker.com/engine/installation/>`_.