Skip to content

Commit 8fa4637

Browse files
author
Your Name
committed
Update for python3
1 parent abaf1ae commit 8fa4637

File tree

3 files changed

+26
-53
lines changed

3 files changed

+26
-53
lines changed

Dockerfile

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,38 @@ FROM ubuntu:18.04
22

33
RUN sed -i s/^deb-src.*// /etc/apt/sources.list
44

5-
RUN apt-get update && apt-get install --yes sudo python python-pip vim git-core crudini jq && \
6-
pip install --upgrade pip && \
5+
RUN apt-get update && apt-get install --yes sudo python3-dev python3-pip vim git-core crudini jq && \
6+
apt clean && \
7+
pip3 --no-cache-dir install --upgrade pip setuptools && \
78
useradd -u 65500 -m rally && \
89
usermod -aG sudo rally && \
9-
echo "rally ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/00-rally-user
10+
echo "rally ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/00-rally-user && \
11+
mkdir /rally && chown -R rally:rally /rally
1012

11-
COPY etc/motd /etc/motd
12-
WORKDIR /opt/rundeck
13-
COPY bindep.txt /opt/rundeck/
13+
RUN pip install git+https://github.com/openstack/rally-openstack.git --constraint https://raw.githubusercontent.com/openstack/rally-openstack/master/upper-constraints.txt --no-cache-dir && \
14+
pip3 install pymysql psycopg2-binary --no-cache-dir
1415

15-
# ensure that we have all system packages installed
16-
RUN pip install bindep && apt-get install --yes $(bindep -b | tr '\n' ' ')
17-
18-
RUN pip install git+https://github.com/openstack/rally-openstack.git --constraint https://raw.githubusercontent.com/openstack/rally-openstack/master/upper-constraints.txt && \
19-
pip install pymysql && \
20-
pip install psycopg2 && \
21-
mkdir /etc/rally && \
22-
echo "[database]" > /etc/rally/rally.conf && \
23-
echo "connection=sqlite:////home/rally/data/rally.db" >> /etc/rally/rally.conf
16+
COPY ./etc/motd_for_docker /etc/motd
2417
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' >> /etc/bash.bashrc
25-
# Cleanup pip
26-
RUN rm -rf /root/.cache/
27-
28-
# Pre-download tempest to speed up runs
29-
RUN git clone --bare https://opendev.org/openstack/tempest /opt/tempest
3018

3119
USER rally
3220
ENV HOME /home/rally
33-
RUN mkdir -p /home/rally/data && mkdir ~/.rally && cp /etc/rally/rally.conf ~/.rally/ && rally db recreate &&\
34-
rally verify create-verifier --name default --type tempest
21+
RUN mkdir -p /home/rally/.rally
22+
23+
RUN touch ~/.rally/rally.conf
24+
RUN crudini --set ~/.rally/rally.conf database connection sqlite:////home/rally/.rally/rally.db
25+
26+
RUN rally db recreate
27+
28+
# Docker volumes have specific behavior that allows this construction to work.
29+
# Data generated during the image creation is copied to volume only when it's
30+
# attached for the first time (volume initialization)
31+
RUN rally verify create-verifier --name default --type tempest
3532

3633
COPY bin/rally-verify-wrapper.sh /usr/bin/rally-verify-wrapper.sh
3734
COPY bin/rally-extract-tests.sh /usr/bin/rally-extract-tests.sh
3835

39-
# Docker volumes have specific behavior that allows this construction to work.
4036
# Data generated during the image creation is copied to volume only when it's
4137
# attached for the first time (volume initialization)
42-
VOLUME ["/home/rally/data"]
43-
ENTRYPOINT ["rally"]
38+
VOLUME ["/home/rally/.rally"]
39+
ENTRYPOINT ["/bin/bash"]

bindep.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.

etc/motd renamed to etc/motd_for_docker

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
# #
44
# WARNING: DO NOT OVERRIDE /home/rally DIRECTORY #
55
# #
6-
# /home/rally/data - a default place with rally database. Use it for #
6+
# /home/rally/.rally - a default place with rally database. Use it for #
77
# mounting own directories and synchronizing rally database. #
8-
# /home/rally/source - a directory with documentation, pre created tasks, #
9-
# sampes and source code #
8+
# /rally/source - a directory with documentation, pre created tasks, #
9+
# samples and source code #
1010
# /etc/rally/rally.conf - a default configuration file of rally. To override #
1111
# it, mount custom configuration file to /home/rally/.rally/rally.conf #
1212
# #
1313
# Rally at readthedocs - http://rally.readthedocs.org #
1414
# How to contribute - http://rally.readthedocs.org/en/latest/contribute.html #
1515
# If you have any questions, you can reach the Rally team by: #
1616
# * e-mail - [email protected] with tag [Rally] in #
17-
# subject #
18-
# * gitter - https://gitter.im/xRally/Lobby room #
17+
# subject #
18+
# * Gitter - https://gitter.im/xRally/Lobby room #
1919
# * irc - "#openstack-rally" channel at freenode.net #
2020
###############################################################################

0 commit comments

Comments
 (0)