[docker] Fix configuration
* fix lable of database section. it should be [database] instead of [db] * create `/home/rally/data` dir by rally user instead of root, so rally could operate the database there. * modify the volume path * update the docs Change-Id: Ia4df80e2ce570ede4582c875c0550d5ba8da60d9
This commit is contained in:
parent
a150575fd6
commit
6ba63eadf7
@ -10,8 +10,8 @@ COPY . /home/rally/source
|
|||||||
WORKDIR /home/rally/source
|
WORKDIR /home/rally/source
|
||||||
|
|
||||||
RUN pip install . --constraint upper-constraints.txt && \
|
RUN pip install . --constraint upper-constraints.txt && \
|
||||||
mkdir /etc/rally && mkdir /home/rally/data && \
|
mkdir /etc/rally && \
|
||||||
echo "[db]" > /etc/rally/rally.conf && \
|
echo "[database]" > /etc/rally/rally.conf && \
|
||||||
echo "connection=sqlite:////home/rally/data/rally.db" >> /etc/rally/rally.conf
|
echo "connection=sqlite:////home/rally/data/rally.db" >> /etc/rally/rally.conf
|
||||||
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
|
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
|
||||||
>> /etc/bash.bashrc; echo '\
|
>> /etc/bash.bashrc; echo '\
|
||||||
@ -37,10 +37,10 @@ RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \
|
|||||||
|
|
||||||
USER rally
|
USER rally
|
||||||
ENV HOME /home/rally
|
ENV HOME /home/rally
|
||||||
RUN rally db recreate
|
RUN mkdir /home/rally/data && rally db recreate
|
||||||
|
|
||||||
# Docker volumes have specific behavior that allows this construction to work.
|
# Docker volumes have specific behavior that allows this construction to work.
|
||||||
# Data generated during the image creation is copied to volume only when it's
|
# Data generated during the image creation is copied to volume only when it's
|
||||||
# attached for the first time (volume initialization)
|
# attached for the first time (volume initialization)
|
||||||
VOLUME ["/home/rally"]
|
VOLUME ["/home/rally/data"]
|
||||||
ENTRYPOINT ["rally"]
|
ENTRYPOINT ["rally"]
|
||||||
|
@ -113,48 +113,41 @@ the Rally git repository and run:
|
|||||||
docker build -t myrally .
|
docker build -t myrally .
|
||||||
|
|
||||||
If you build your own Docker image, substitute ``myrally`` for
|
If you build your own Docker image, substitute ``myrally`` for
|
||||||
``rallyforge/rally`` in the commands below.
|
``xrally/xrally-openstack`` in the commands below.
|
||||||
|
|
||||||
The Rally Docker image is configured to store local settings and the
|
The Rally Docker image is configured to store the database in the user's home
|
||||||
database in the user's home directory. For persistence of these data,
|
directory - ``/home/rally/data/rally.sqlite``. For persistence of these data,
|
||||||
you may want to keep this directory outside of the container. This may
|
you may want to keep this directory outside of the container. This may
|
||||||
be done via the following steps:
|
be done via 2 ways:
|
||||||
|
|
||||||
.. code-block:: bash
|
* use a docker image. In this case you do not need to initialize the database
|
||||||
|
|
||||||
sudo mkdir /var/lib/rally_container
|
.. code-block:: bash
|
||||||
sudo chown 65500 /var/lib/rally_container
|
|
||||||
docker run -it -v /var/lib/rally_container:/home/rally rallyforge/rally
|
|
||||||
|
|
||||||
.. note::
|
docker volume create --name rally_volume
|
||||||
|
docker run -v rally_volume:/home/rally/data xrally/xrally-openstack deployment create --name "foo"
|
||||||
|
|
||||||
In order for the volume to be accessible by the Rally user
|
* mount the directory to container. In this case, there is ability to transmit
|
||||||
(uid: 65500) inside the container, it must be accessible by UID
|
task files inside the container, but you will need to initialize the database
|
||||||
65500 *outside* the container as well, which is why it is created
|
by yourself
|
||||||
in ``/var/lib/rally_container``. Creating it in your home directory is only
|
|
||||||
likely to work if your home directory has excessively open
|
|
||||||
permissions (e.g., ``0755``), which is not recommended.
|
|
||||||
|
|
||||||
You can find all task samples, docs and pre created tasks at /opt/rally/.
|
.. code-block:: bash
|
||||||
Also you may want to save the last command as an alias:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
sudo mkdir /var/lib/rally_container
|
||||||
|
sudo chown 65500 /var/lib/rally_container
|
||||||
|
docker run -v /var/lib/rally_container:/home/rally/data xrally/xrally-openstack db create
|
||||||
|
docker run -v /var/lib/rally_container:/home/rally/data xrally/xrally-openstack deployment create --name "foo"
|
||||||
|
|
||||||
echo 'alias dock_rally="docker run -it -v /var/lib/rally_container:/home/rally rallyforge/rally"' >> ~/.bashrc
|
.. note::
|
||||||
|
|
||||||
After executing ``dock_rally``, or ``docker run ...``, you will have
|
In order for the volume to be accessible by the Rally user
|
||||||
bash running inside the container with Rally installed. You may do
|
(uid: 65500) inside the container, it must be accessible by UID
|
||||||
anything with Rally, but you need to create the database first:
|
65500 *outside* the container as well, which is why it is created
|
||||||
|
in ``/var/lib/rally_container``. Creating it in your home directory is only
|
||||||
.. code-block:: console
|
likely to work if your home directory has excessively open
|
||||||
|
permissions (e.g., ``0755``), which is not recommended.
|
||||||
user@box:~/rally$ dock_rally
|
|
||||||
rally@1cc98e0b5941:~$ rally db recreate
|
|
||||||
rally@1cc98e0b5941:~$ rally deployment list
|
|
||||||
There are no deployments. To create a new deployment, use:
|
|
||||||
rally deployment create
|
|
||||||
rally@1cc98e0b5941:~$
|
|
||||||
|
|
||||||
|
You can find all task samples, docs and pre created tasks at /home/rally/source
|
||||||
In case you have SELinux enabled and Rally fails to create the
|
In case you have SELinux enabled and Rally fails to create the
|
||||||
database, try executing the following commands to put SELinux into
|
database, try executing the following commands to put SELinux into
|
||||||
Permissive Mode on the host machine
|
Permissive Mode on the host machine
|
||||||
|
Loading…
Reference in New Issue
Block a user