Skip to content

Commit 7acdcfb

Browse files
committed
[Test-Operator] Move entrypoint scripts
We want to be able to run test pods spawned by the test-operator with readOnlyRootFileSystem. This requires mounting of ephemeral storage to /var/lib/X [1]. In this repository all write actions can be performed (e.g., installation of additional plugins for tempest). Mounting of the ephemeral storage causes removal of the run_X.sh [1] script and other data that are stored in the /var/lib/X directory during the container build (e.g., tobiko source code directory). Therefore, we need to move it to a different location. This patch moves: - all the entrypoint scripts for test operator related images under /usr/local/bin. - all source code downloaded during the build of a container to /usr/local/src - all images downloaded during the build of a container to /usr/local/share [1] X = [tempest|tobiko|ansibletest|horizontest] Depends-On: openstack-k8s-operators/ci-framework#2579
1 parent a8aa6bd commit 7acdcfb

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

container-images/tcib/base/ansible-tests/ansibleTests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ tcib_actions:
44
- run: bash /usr/local/bin/uid_gid_manage {{ tcib_user }}
55
- run: dnf -y install {{ tcib_packages.common | join(' ') }} && dnf clean all && rm -rf /var/cache/dnf
66
- run: pip3 install ansible==2.9.27 openstacksdk
7-
- run: cp /usr/share/tcib/container-images/tcib/base/ansible-tests/run_ansible.sh /var/lib/ansible/run_ansible.sh
8-
- run: chmod +x /var/lib/ansible/run_ansible.sh
7+
- run: cp /usr/share/tcib/container-images/tcib/base/ansible-tests/run_ansible.sh /usr/local/bin/run_ansible.sh
8+
- run: chmod +x /usr/local/bin/run_ansible.sh
99
- run: chown -R ansible:ansible /var/lib/ansible
1010

11-
tcib_entrypoint: /var/lib/ansible/run_ansible.sh
11+
tcib_entrypoint: /usr/local/bin/run_ansible.sh
1212

1313
tcib_packages:
1414
common:

container-images/tcib/base/os/horizontest/horizontest.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ tcib_actions:
1313
curl -s -L
1414
https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz
1515
| tar -zxvf - -C /usr/local/bin/
16-
- run: curl -OL http://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img -o /var/lib/horizontest/cirros-0.6.2-x86_64-disk
17-
- run: cp /usr/share/tcib/container-images/tcib/base/os/horizontest/run_horizontest.sh /var/lib/horizontest/run_horizontest.sh
18-
- run: chmod +x /var/lib/horizontest/run_horizontest.sh
16+
- run: curl -OL http://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img -o /usr/local/share/cirros-0.6.2-x86_64-disk
17+
- run: cp /usr/share/tcib/container-images/tcib/base/os/horizontest/run_horizontest.sh /usr/local/bin/run_horizontest.sh
18+
- run: chmod +x /usr/local/bin/run_horizontest.sh
1919

20-
tcib_entrypoint: /var/lib/horizontest/run_horizontest.sh
20+
tcib_entrypoint: /usr/local/bin/run_horizontest.sh
2121

2222
tcib_packages:
2323
common:

container-images/tcib/base/os/horizontest/run_horizontest.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ set -x
44

55
HORIZONTEST_DIR=/var/lib/horizontest
66
HORIZON_LOGS_DIR_NAME=${HORIZON_LOGS_DIR_NAME:-"horizon"}
7-
IMAGE_FILE="/var/lib/horizontest/cirros-0.6.2-x86_64-disk.img"
8-
IMAGE_FILE_NAME=cirros-0.6.2-x86_64-disk
9-
IMAGE_FILE_NAME_WITH_SIZE="cirros-0.6.2-x86_64-disk (20.4 MB)"
107
IMAGE_URL=http://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img
118
PROJECT_NAME=horizontest
129
USER_NAME=horizontest
@@ -17,6 +14,12 @@ SELENIUM_EXPLICIT_WAIT=180
1714
SELENIUM_PAGE_TIMEOUT=120
1815
SELENIUM_IMPLICIT_WAIT=30
1916
HORIZONTEST_DEBUG_MODE="${HORIZONTEST_DEBUG_MODE:-false}"
17+
IMAGE_FILE_NAME=cirros-0.6.2-x86_64-disk
18+
IMAGE_FILE_NAME_WITH_SIZE="cirros-0.6.2-x86_64-disk (20.4 MB)"
19+
IMAGE_FILE="/usr/local/share/${IMAGE_FILE_NAME}"
20+
if [[ ! -f "${IMAGE_FILE}" ]]; then
21+
IMAGE_FILE="/var/lib/horizontest/${IMAGE_FILE_NAME}"
22+
fi
2023

2124
# assert mandatory variables have been set
2225
[[ -z ${ADMIN_USERNAME} ]] && echo "ADMIN_USERNAME not set" && exit 1

container-images/tcib/base/os/tempest/tempest-all/tempest-all.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ tcib_actions:
1111
- run: mkdir -p /var/lib/kolla/config_files
1212
- run: chown -R tempest.tempest /var/lib/tempest
1313
- run: touch /var/lib/kolla/config_files/config.json
14-
- run: cp /usr/share/tcib/container-images/tcib/base/os/tempest/run_tempest.sh /var/lib/tempest/run_tempest.sh
15-
- run: chmod +x /var/lib/tempest/run_tempest.sh
14+
- run: cp /usr/share/tcib/container-images/tcib/base/os/tempest/run_tempest.sh /usr/local/bin/run_tempest.sh
15+
- run: chmod +x /usr/local/bin/run_tempest.sh
1616

17-
tcib_entrypoint: /var/lib/tempest/run_tempest.sh
17+
tcib_entrypoint: /usr/local/bin/run_tempest.sh
1818

1919
tcib_packages:
2020
common:

container-images/tcib/base/os/tempest/tempest.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ tcib_actions:
99
- run: mkdir -p /var/lib/kolla/config_files
1010
- run: chown -R tempest.tempest /var/lib/tempest
1111
- run: touch /var/lib/kolla/config_files/config.json
12-
- run: cp /usr/share/tcib/container-images/tcib/base/os/tempest/run_tempest.sh /var/lib/tempest/run_tempest.sh
13-
- run: chmod +x /var/lib/tempest/run_tempest.sh
12+
- run: cp /usr/share/tcib/container-images/tcib/base/os/tempest/run_tempest.sh /usr/local/bin/run_tempest.sh
13+
- run: chmod +x /usr/local/bin/run_tempest.sh
1414

15-
tcib_entrypoint: /var/lib/tempest/run_tempest.sh
15+
tcib_entrypoint: /usr/local/bin/run_tempest.sh
1616

1717
tcib_packages:
1818
common:

container-images/tcib/base/tobiko/run_tobiko.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -x
44

55
TOBIKO_DIR=/var/lib/tobiko
6+
TOBIKO_SRC_DIR=/usr/local/src/tobiko
67
TOBIKO_DEBUG_MODE="${TOBIKO_DEBUG_MODE:-false}"
78

89
function catch_error_if_debug {
@@ -34,6 +35,7 @@ TOBIKO_LOGS_DIR_NAME=${TOBIKO_LOGS_DIR_NAME:-"tobiko"}
3435
[ ! -z ${TOBIKO_NUM_PROCESSES} ] && export TOX_NUM_PROCESSES=${TOBIKO_NUM_PROCESSES}
3536

3637
pushd ${TOBIKO_DIR}
38+
cp -r ${TOBIKO_SRC_DIR} tobiko
3739
chown tobiko:tobiko -R tobiko
3840
pushd tobiko
3941
[ ! -z ${TOBIKO_UPDATE_REPO} ] && git pull --rebase

container-images/tcib/base/tobiko/tobiko.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ tcib_actions:
1313
curl -s -L
1414
https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz
1515
| tar -zxvf - -C /usr/local/bin/
16-
- run: 'git clone https://opendev.org/x/tobiko /var/lib/tobiko/tobiko'
17-
- run: 'pip install -e /var/lib/tobiko/tobiko -c /var/lib/tobiko/tobiko/upper-constraints.txt -r /var/lib/tobiko/tobiko/extra-requirements.txt'
16+
- run: 'git clone https://opendev.org/x/tobiko /usr/local/src/tobiko'
17+
- run: 'pip install -e /usr/local/src/tobiko -c /usr/local/src/tobiko/upper-constraints.txt -r /usr/local/src/tobiko/extra-requirements.txt'
1818
- run: >-
19-
mkdir -p /var/lib/tobiko/.downloaded-images && curl
19+
curl
2020
https://cloud-images.ubuntu.com/minimal/releases/jammy/release/ubuntu-22.04-minimal-cloudimg-amd64.img
21-
-o /var/lib/tobiko/.downloaded-images/ubuntu-minimal
21+
-o /usr/local/share/ubuntu-minimal
2222
- run: python3 -m pip install --upgrade pip
2323
- run: python3 -m pip install 'tox==4.13'
24-
- run: cp /usr/share/tcib/container-images/tcib/base/tobiko/run_tobiko.sh /var/lib/tobiko/run_tobiko.sh
25-
- run: chmod +x /var/lib/tobiko/run_tobiko.sh
24+
- run: cp /usr/share/tcib/container-images/tcib/base/tobiko/run_tobiko.sh /usr/local/bin/run_tobiko.sh
25+
- run: chmod +x /usr/local/bin/run_tobiko.sh
2626
- run: chown -R tobiko.tobiko /var/lib/tobiko
2727

28-
tcib_entrypoint: /var/lib/tobiko/run_tobiko.sh
28+
tcib_entrypoint: /usr/local/bin/run_tobiko.sh
2929

3030
tcib_packages:
3131
common:

0 commit comments

Comments
 (0)