Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit e102d28

Browse files
author
Tanuja Shinde
authored
CORTX-32833: update readme.md file in provisioner/test for running un… (#6404)
* CORTX-32833: update readme.md file in provisioner/test for running unit tests Signed-off-by: Tanuja Shinde <[email protected]> * CORTX-32833: update readme.md file in provisioner/test for running unit tests Signed-off-by: Tanuja Shinde <[email protected]> Signed-off-by: Tanuja Shinde <[email protected]>
1 parent 948dee4 commit e102d28

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The same path needs to be passed to the provisioner entry point (cortx_deploy).
1919
## Mini Provisioner Orchestration
2020
There will be CORTX Provisioner Node in the system . Provisioner runs all the phases of all the components in a round-robin manner, in sequence for a given node only. CORTX Provisioner triggers cortx_setup config apply and bootstrap commands in all the nodes in parallel. So effectively, all the phases are run in sequence within a node but they all run in parallel to other nodes.
2121

22-
Following command is executed to invoke all the mini provisioners within the node.
22+
Following command is invoked for all the mini provisioners within the node for deployment/upgrade.
2323
```bash
2424
cortx_setup cluster bootstrap -c <Confstore-URL>
2525
```

test/README.md

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,69 @@
11
## Preparation
22
***
33

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
95
```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.
2952
```
3053

3154
## Testing Manually
3255

3356
Run apply command
3457
```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
3760
```
3861

3962
Run bootstrap command
4063
```python
41-
cortx_setup.py cluster bootstrap -c yaml:///tmp/cluster.conf
64+
cluster bootstrap -c yaml:///tmp/cluster.conf
4265
```
4366

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-
```
5467

5568
Run the following command
5669
**Running The Tests**

0 commit comments

Comments
 (0)