diff options
author | fmenguy <francoisregis.menguy@orange.com> | 2020-11-16 17:01:33 +0100 |
---|---|---|
committer | fmenguy <francoisregis.menguy@orange.com> | 2021-04-28 11:00:55 +0200 |
commit | 83c4a7885d7c32901ff7335bdbef9d8d9f4417d7 (patch) | |
tree | a9a9a5ed6f6e6ef5eb3413d5d9be809409b8e719 /nfvbenchvm/dib/elements/nfvbenchvm/post-install.d | |
parent | ffa058dfad5d98c6af50126748cd5798ed7b3d94 (diff) |
NFVBENCH-196: New NFVbench image for generator part (nfvbench and TRex codes inside VM)5.0.0
Change-Id: Id919a1b9dbf5e04b198d022432ed5c64232a27ba
Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
Diffstat (limited to 'nfvbenchvm/dib/elements/nfvbenchvm/post-install.d')
9 files changed, 61 insertions, 10 deletions
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script index 6f133d1..f18ed60 100755 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/02-testpmd-script @@ -1,5 +1,9 @@ #!/bin/bash +if [ $DIB_DEV_IMAGE != "loopvm" ]; then + exit 0 +fi + DPDK=dpdk-18.02 DPDK_UNTAR=dpdk-18.02 @@ -15,8 +19,6 @@ export RTE_KERNELDIR=/lib/modules/$kernel_version/build export ARCH=x86 make -j4 install T=x86_64-native-linuxapp-gcc -cp usertools/dpdk-devbind.py ../dpdk -# cp tools/dpdk_nic_bind.py ../dpdk/dpdk-devbind.py cp x86_64-native-linuxapp-gcc/app/testpmd ../dpdk cp x86_64-native-linuxapp-gcc/kmod/igb_uio.ko ../dpdk echo "set promisc all off" > /dpdk/testpmd_cmd.txt diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-add-execute-attribute b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-add-execute-attribute deleted file mode 100755 index a13ab95..0000000 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-add-execute-attribute +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -chmod +x /etc/rc.d/rc.local -chmod +x /etc/sysconfig/network-scripts/ifcfg-eth0 diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local new file mode 100644 index 0000000..3311530 --- /dev/null +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/03-copy-rc-local @@ -0,0 +1,8 @@ +#!/bin/bash + +# set accurate rc.local file corresponding to current image built +if [ $DIB_DEV_IMAGE = "loopvm" ]; then + mv /etc/rc.d/rc.local.loopvm /etc/rc.d/rc.local +else + mv /etc/rc.d/rc.local.generator /etc/rc.d/rc.local +fi
\ No newline at end of file diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute new file mode 100644 index 0000000..666d9dc --- /dev/null +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/04-add-execute-attribute @@ -0,0 +1,7 @@ +#!/bin/bash + +chmod +x /etc/rc.d/rc.local +chmod +x /etc/sysconfig/network-scripts/ifcfg-eth0 +chmod +x /etc/profile.d/nfvbench.sh +chmod +x /nfvbench/configure-nfvbench.sh +chmod +x /nfvbench/start-nfvbench.sh diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package index 2d74ff5..9707841 100755 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/50-pip-package @@ -2,7 +2,7 @@ cd /tmp wget https://bootstrap.pypa.io/get-pip.py -python get-pip.py +python3 get-pip.py -pip install setuptools wheel -pip install pyyaml +pip3 install setuptools wheel pbr +pip3 install pyyaml diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit index dc51030..1a0dec9 100755 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/51-cloudcfg-edit @@ -7,6 +7,9 @@ user = "cloud-user" with open(cloudcfg) as f: cfg = yaml.safe_load(f) +# allow SSH password auth +cfg['ssh_pwauth'] = "1" + try: if cfg['system_info']['default_user']['name']: synver = "2" diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script new file mode 100644 index 0000000..9162952 --- /dev/null +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/52-nfvbench-script @@ -0,0 +1,31 @@ +#!/bin/bash + +if [ $DIB_DEV_IMAGE != "generator" ]; then + exit 0 +fi + +# TRex installation +mkdir -p /opt/trex +mkdir /var/log/nfvbench + +wget --no-cache --no-check-certificate https://trex-tgn.cisco.com/trex/release/$TREX_VER.tar.gz +tar xzf $TREX_VER.tar.gz -C /opt/trex +rm -f /$TREX_VER.tar.gz +rm -f /opt/trex/$TREX_VER/trex_client_$TREX_VER.tar.gz +cp -a /opt/trex/$TREX_VER/automation/trex_control_plane/interactive/trex /usr/local/lib/python3.6/site-packages/ +rm -rf /opt/trex/$TREX_VER/automation/trex_control_plane/interactive/trex + +# NFVbench installation +cd /opt +git clone https://gerrit.opnfv.org/gerrit/nfvbench +cd nfvbench/ +pip3 install . --use-deprecated=legacy-resolver +cp xtesting/testcases.yaml /usr/local/lib/python3.6/site-packages/xtesting/ci/testcases.yaml +python3 ./docker/cleanup_generators.py +rm -rf /opt/nfvbench/.git +rm -rf /opt/nfvbench/nfvbench +# symlink to NFVbench sources +ln -s /usr/local/lib/python3.6/site-packages/nfvbench /opt/nfvbench/nfvbench +# persist env variables +echo "export TREX_VER=\"$TREX_VER\"" >> /etc/profile.d/nfvbench.sh +echo "export TREX_EXT_LIBS=\"/opt/trex/$TREX_VER/external_libs\"" >> /etc/profile.d/nfvbench.sh diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script new file mode 100644 index 0000000..64e8877 --- /dev/null +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/53-sshd-script @@ -0,0 +1,4 @@ +#!/bin/bash + +# Set UseDNS no value in sshd_config to reduce time to connect +echo "UseDNS no" >> /etc/ssh/sshd_config
\ No newline at end of file diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup index 14e9f27..e48ca52 100755 --- a/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup +++ b/nfvbenchvm/dib/elements/nfvbenchvm/post-install.d/99-cleanup @@ -1,3 +1,3 @@ #!/bin/bash -yum erase -y python-devel libyaml-devel numactl-devel kernel-devel kernel-headers kernel-lt-headers kernel-lt-devel gcc +yum erase -y python-devel libyaml-devel numactl-devel kernel-devel kernel-headers kernel-lt-headers kernel-lt-devel gcc git python3-dev libpython3.6-dev |