|
1 | 1 | ## Preparation |
2 | 2 | *** |
3 | 3 |
|
4 | | -Prepare input for cortx_setup. There are two files in this folder. |
5 | | -a. cluster.yaml |
6 | | -b. config.yaml |
7 | | - |
8 | | -Install cortx-utils and cortx-provisioner, cortx-components rpms.Make sure PYTHON_PATH includes src folder, if you are not using rpm. |
| 4 | +Follow below steps for preparing test enviorment for running provisioner tests |
9 | 5 | ```bash |
10 | | -yum install -y yum-utils |
11 | | -sudo pip3 install -r https://raw.githubusercontent.com/Seagate/cortx-utils/main/py-utils/python_requirements.txt |
12 | | -sudo pip3 install -r https://raw.githubusercontent.com/Seagate/cortx-utils/main/py-utils/python_requirements.ext.txt |
13 | | -# Install cortx py-utilsby follwing below document |
14 | | -https://github.com/Seagate/cortx-utils/wiki/Build-and-Install-cortx-py-utils |
15 | | - |
16 | | -# Build Cortx-provisioner rpm |
17 | | -yum install rpm-build -y |
18 | | -rm -rf ./dist |
19 | | -./jenkins/build.sh # Build RPM |
20 | | -ls ./dist/ |
21 | | -sudo yum localinstall ./dist/cortx-provisioner-2.0.0-1_c9e8891.noarch.rpm |
22 | | -cortx_setup --help |
23 | | - |
24 | | -# Mock the components to run the bootstrap command |
25 | | -echo -e "#!/bin/bash\necho $*" > /opt/seagate/cortx/utils/bin/utils_setup; |
26 | | -echo -e "#!/bin/bash\necho $*" > /opt/seagate/cortx/csm/bin/csm_setup; |
27 | | -chmod +x /opt/seagate/cortx/hare/bin/utils_setup; |
28 | | -chmod +x /opt/seagate/cortx/motr/bin/csm_setup; |
| 6 | +# Install rpm-build rpm |
| 7 | +$ yum install rpm-build -y |
| 8 | + |
| 9 | +# Build utils RPM |
| 10 | +$ git clone https://github.com/Seagate/cortx-utils -b main |
| 11 | +$ sudo pip3 install -r https://raw.githubusercontent.com/Seagate/cortx-utils/main/py-utils/python_requirements.txt |
| 12 | +$ sudo pip3 install -r https://raw.githubusercontent.com/Seagate/cortx-utils/main/py-utils/python_requirements.ext.txt |
| 13 | +$ sudo yum install -y gcc rpm-build python36 python36-pip python36-devel python36-setuptools openssl-devel libffi-devel python36-dbus |
| 14 | +$ cd cortx-utils/ |
| 15 | +$ ./jenkins/build.sh -v 2.0.0 -b 2 |
| 16 | +$ cd ./py-utils/dist |
| 17 | +$ sudo yum install -y cortx-py-utils-*.noarch.rpm |
| 18 | + |
| 19 | +# Build provisioner RPM |
| 20 | +$ git clone https://github.com/Seagate/cortx-prvsnr -b main |
| 21 | +$ cd cortx-prvsnr |
| 22 | +$ rm -rf ./dist |
| 23 | +$ ./jenkins/build.sh |
| 24 | +$ ls ./dist/ |
| 25 | +$ sudo yum localinstall -y ./dist/cortx-provisioner-2.0.0-1_abcd056.noarch.rpm |
| 26 | +$ cortx_setup --help |
| 27 | + |
| 28 | +# Create env variable NODE_NAME on node with hostname as value |
| 29 | +$ export NODE_NAME=<node-hostname> |
| 30 | + |
| 31 | +# Prepare cluster.yaml and config.yaml files |
| 32 | +$ cp /opt/seagate/cortx/provisioner/conf/config.yaml.sample /etc/cortx/solution/config.yaml |
| 33 | +$ cp /opt/seagate/cortx/provisioner/conf/cluster.yaml.sample /etc/cortx/solution/cluster.yaml |
| 34 | +# Note: Edit cluster.yaml file by putting vm machine-id and hostname in control-node section |
| 35 | + |
| 36 | +# Mock control node |
| 37 | +$ mkdir /opt/seagate/cortx/csm |
| 38 | +$ mkdir /opt/seagate/cortx/csm/bin |
| 39 | +$ cat <<EOF >> /opt/seagate/cortx/csm/bin/csm_setup |
| 40 | +#!/bin/bash |
| 41 | +
|
| 42 | +EOF |
| 43 | +$ chmod +x /opt/seagate/cortx/csm/bin/csm_setup |
| 44 | + |
| 45 | +# Prapare RELEASE.INFO file on vm at location : /opt/seagate/cortx/RELEASE.INFO |
| 46 | + |
| 47 | +# Prepare machine-id symlink |
| 48 | +$ rm -rf /etc/machine-id |
| 49 | +$ ln -s /etc/cortx/config/machine-id /etc/machine-id |
| 50 | + |
| 51 | +# Note : everytime /etc/machine-id will be changed by provisioner so it needs to be updated in cluster.yaml everytime before rerunning provisioner. |
29 | 52 | ``` |
30 | 53 |
|
31 | 54 | ## Testing Manually |
32 | 55 |
|
33 | 56 | Run apply command |
34 | 57 | ```python |
35 | | -cortx_setup.py config apply -f yaml://`pwd`/config.yaml -c yaml:///tmp/cluster.conf |
36 | | -cortx_setup.py config apply -f yaml://`pwd`/cluster.yaml -c yaml:///tmp/cluster.conf |
| 58 | +config apply -f yaml://`pwd`/config.yaml -c yaml:///tmp/cluster.conf |
| 59 | +config apply -f yaml://`pwd`/cluster.yaml -c yaml:///tmp/cluster.conf |
37 | 60 | ``` |
38 | 61 |
|
39 | 62 | Run bootstrap command |
40 | 63 | ```python |
41 | | -cortx_setup.py cluster bootstrap -c yaml:///tmp/cluster.conf |
| 64 | +cluster bootstrap -c yaml:///tmp/cluster.conf |
42 | 65 | ``` |
43 | 66 |
|
44 | | -output will look something like this... |
45 | | -```bash |
46 | | -motr_setup post_install --config yaml:/etc/cortx/cortx.conf --services io |
47 | | -hare_setup post_install --config yaml:/etc/cortx/cortx.conf --services all |
48 | | -s3_setup post_install --config yaml:/etc/cortx/cortx.conf --services io,auth,bg_consumer |
49 | | -utils_setup post_install --config yaml:/etc/cortx/cortx.conf --services message_bus |
50 | | -csm_setup post_install --config yaml:/etc/cortx/cortx.conf --services agent |
51 | | -motr_setup post_install --config yaml:/etc/cortx/cortx.conf --services fsm |
52 | | -s3_setup post_install --config yaml:/etc/cortx/cortx.conf --services bg_producer |
53 | | -``` |
54 | 67 |
|
55 | 68 | Run the following command |
56 | 69 | **Running The Tests** |
|
0 commit comments