Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Using bash script:Put the following bash script on the server and run it :

    Code Block
    languagebash
    #!/bin/bash
    
    set_versions () {
        DOCKER_VERSION=17.12.1.ce-1.fc27
        DOCKER_COMPOSE_VERSION=1.22.0
    }
    
    
    enable_root_ssh () {
        sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
        sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
        service sshd restart
        echo -e "arthur\narthur" | passwd root
    }
    
    update_os () {
        dnf -y install fedora-upgrade
    }
    
    docker_install_configure () {
        dnf -y remove docker \
                      docker-client \
                      docker-client-latest \
                      docker-common \
                      docker-latest \
                      docker-latest-logrotate \
                      docker-logrotate \
                      docker-selinux \
                      docker-engine-selinux \
                      docker-engine
        dnf -y install dnf-plugins-core
        dnf config-manager \
         --add-repo \
    
        https://download.docker.com/linux/fedora/docker-ce.repo
        dnf -y install docker-ce-$DOCKER_VERSION
        systemctl start docker
        mkdir -p /etc/systemd/system/docker.service.d/
        cat > /etc/systemd/system/docker.service.d/override.confg<< EOF
    [Service]
    Environment="http_proxy=http://10.144.1.10:8080/"
    Environment="https_proxy=http://10.144.1.10:8080/"
    Environment="no_proxy=10.157.167.132,127.0.0.1,localhost,.noklab.net,.int.net.nokia.com,.ext.net.nokia.com,.int.nokia.com,.nsn-rdnet.com,.nsn-net.net,.inside.nokiasiemensnetworks.com,.access.nokiasiemensnetworks.com,.nsn-intra.net,.inside.nsn.com,.access.nsn.com"
    EOF
        systemctl daemon-reload
        systemctl restart docker
        docker login -u docker -p docker nexus3.onap.org:10003
    }
    docker_compose_install () {
        curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
        chmod +x /usr/local/bin/docker-compose
    }
    pnf_sim_file_checkout () {
        mkdir ~/sim/
        mkdir ~/sim/ssh
        cd ~/sim/ssh/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/ssh/ssh_host_rsa_key;hb=HEAD" -O ssh_host_rsa_key
        cd ~/sim/ssh/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/ssh/ssh_host_rsa_key.pub;hb=HEAD" -O ssh_host_rsa_key.pub
        mkdir ~/sim/sftp
        cd ~/sim/sftp/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/sftp/sftp-file.txt;hb=HEAD" -O sftp-file.txt
        mkdir ~/sim/config
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/config/config.json;hb=HEAD" -O config.json
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/config/netconf.env;hb=HEAD" -O netconf.env
        mkdir ~/sim/json_schema
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/json_schema/input_validator.json;hb=HEAD" -O input_validator.json
        cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/json_schema/output_validator_ves_schema_30.0.1.json;hb=HEAD" -O output_validator_ves_schema_30.0.1.json
        mkdir ~/sim/netconf
        cd ~/sim/netconf/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/netconf/pnf-simulator.data.xml;hb=HEAD" -O pnf-simulator.data.xml
        cd ~/sim/netconf/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/netconf/pnf-simulator.yang;hb=HEAD" -O pnf-simulator.yang
        cd ~/sim/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/docker-compose.yml;hb=HEAD" -O docker-compose.yml
        cd ~/sim/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/simulator.sh;hb=HEAD" -O simulator.sh
        chmod 654 ~/sim/simulator.sh
    }
    
    start_simulator (){
       ~/sim/simulator.sh start
    }
    
    set_versions
    enable_root_ssh
    update_os
    docker_install_configure
    docker_compose_install
    pnf_sim_file_checkout
    start_simulator
  • Using heat template:

    Heat template used  to deploy PnP PNF simulator on open stack can be found in:
    https://gerrit.onap.org/r/gitweb?p=integration.git;a=tree;f=test/mocks/pnfsimulator/deployment;hb=HEAD
    Deployment requires to fill define following parameters:
    • flavor_name
    • Image name - use fesdora/centos/redhat base image with dnf support
    • Key pair name
    • Public network name or ID
    • Private network name or ID
    • Private subnetwork name or ID
    • Proxy (optional parameter, format http://10.10.10.10:8080/, default is empty string)

  • Verify that all docker containers are up :

    Code Block
    languagebash
    [root@pnf-sim ~]# docker ps -a
    CONTAINER ID        IMAGE                                             COMMAND                  CREATED             STATUS                          PORTS                  NAMES
    bf0e6872738a        nexus3.onap.org:10003/onap/pnf-simulator:latest   "/bin/sh -c 'java -c…"   11 minutes ago      Restarting (1) 47 seconds ago                          pnf-simulator
    05f16489d3ca        sysrepo/sysrepo-netopeer2:latest                  "/usr/bin/supervisor…"   14 minutes ago      Up 14 minutes                   0.0.0.0:830->830/tcp   netopeer
    f1e73511a75e        atmoz/sftp:alpine                                 "/entrypoint sftp-us…"   14 minutes ago      Up 14 minutes                   0.0.0.0:2222->22/tcp   sftp-server
    
    

...