Introduction

This option is for developers working locally on SDC.

SDC Simulator is a project that enables emulation of WEB server that provides security policy and sign-on to the SDC component in dev environments.

  •  Provides a sign on to the basic user roles/functionalities
  •  Creation of basic user accounts

Docker compilation - Docker Maven Build Profile (io.fabric8 maven Plugin)

If you are using ONAP-Vagrant environment you can deploy the simulator by:

Set up the DOCKER_HOST environmental variable

To set environmental variable in Windows (the docker engine environment):

  1. Run `cmd`
  2. Issue command  `set NAME=VALUE`
set DOCKER_HOST=tcp://192.168.50.5:2375
  • To check if the variable set succeeded issue:
echo %DOCKER_HOST%

To compile sdc-simulator docker:

1.  Run 

mvn clean install -pl utils/webseal-simulator -P docker

2.  Copy the script /sdc-chef-os/scripts/docker_run.sh to the docker engine environment and run:

start only simulator built local
/data/scripts/docker_run.sh -l -d sdc-sim -sim 
start only simulator pull docker from LF
/data/scripts/docker_run.sh -r <docker tag> -d sdc-sim -sim 

3. To verify that sdc-simulator docker is up and running run:

docker ps

Make sure that a docker with id: sdc-simulator exists

4. Enter to UI: `http://<ip address>:8285/login`

http://192.168.50.5:8285/login

Docker compilation - Docker Engine

1. Build web simulator WAR file run in project “webseal simulator”:

mvn clean install
  • This will generate war file (WSSimulator.war) in the target folder.
  • Check that WSSimulator.war exists after first step No.1 in webseal-simulator/sdc-simulator folder.

2. Ftp war file: webseal-simulator/sdc-simulator folder to your localhost vagrant machine which runs docker engine daemon.
3. Run `docker build -t onap/sdc-simulator:1.1-STAGING-latest <PATH/sdc-simulator>`

docker build -t onap/sdc-simulator:1.1-STAGING-latest /tmp/docker/sdc-simulator/
  • If running behind a proxy:

    docker build --build-arg http_proxy=http://URL:PORT --build-arg https_proxy=http://URL:PORT -t openecomp/sdc-simulator:1.1-STAGING-latest /tmp/docker/sdc-simulator/

4. Validate that images pushed to the local repo by executing:

docker images

5. Copy the script /sdc-chef-os/scriptsdocker_run.sh to the docker engine environment, make it executable (chmod ugo+x) and run: 

/data/scripts/docker_run.sh -l -d sdc-sim -sim 


6.To verify that sdc-simulator docker is up and running execute:

docker ps
  • If no docker sdc-simulator running execute `docker ps -a`

7. Enter to UI: http://<ip address>:8285/login

http://localhost:8285/login
  • No labels

19 Comments

  1. follow this step “Docker compilation - Docker Engine”

    the docker start failed,  the output is shown blow,     ~/chef-solo/environments is an empty dir  in docker

    how can I fix this?




    Unexpected API Request Failure:
    -------------------------------
    Object not found: chefzero://localhost:1/environments/__ENV-NAME__

    System Info:
    ------------
    chef_version=13.4.24
    platform=debian
    platform_version=9.1
    ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
    program_name=chef-solo worker: ppid=2290;start=11:22:18;
    executable=/opt/chef/bin/chef-solo


    Running handlers:
    [2017-10-14T11:22:18+08:00] ERROR: Running exception handlers
    Running handlers complete
    [2017-10-14T11:22:18+08:00] ERROR: Exception handlers complete
    Chef Client failed. 0 resources updated in 00 seconds
    [2017-10-14T11:22:18+08:00] FATAL: Stacktrace dumped to /root/chef-solo/cache/chef-stacktrace.out
    [2017-10-14T11:22:18+08:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
    [2017-10-14T11:22:18+08:00] ERROR: 404 "Not Found"
    [2017-10-14T11:22:18+08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

    1. Hi,

      On which machine are you trying to run the simulator?

      Does this machine runs SDC?

      SDC-Simulator isn't a standalone project. It has to run on a machine running SDC

  2. this command faild in startup.sh  sdc-simulator's docker container.  because of no environment.

      chef-solo -c solo.rb -E ${CHEFNAME}


    but sdc-fe and sdc-be are stand in other container.  I guess there's no relationship (between the exceptioh and sdc)?

  3. Hi,

    Without ONAP-Vagrant environment, we can't access the sdc-simulator?


  4. Hi,

        I've tried to build the sec-simulator docker image by using the command, docker build -t openecomp/sdc-simulator:1.1-STAGING-latest /tmp/docker/sdc-simulator/, but it does't work.

       

    $ docker build -t onap/sdc-simulator:1.1-STAGING-latest /home/jetty/sdc-simulator/

    Sending build context to Docker daemon  2.022MB

    Step 1/10 : FROM onap/base_sdc-jetty:1.2.0-SNAPSHOT-latest

    pull access denied for onap/base_sdc-jetty, repository does not exist or may require 'docker login'

     

        I 've logged in nexus3.onap.org:10001 with name docker and password docker.

        could anybody tell me where I can get the basic image  onap/base_sdc-jetty:1.2.0-SNAPSHOT-latest ?


      1. Idan Amit

        Thanks , I've got the image by using the following command today.

        docker pull nexus3.onap.org:10001/onap/base_sdc-jetty:1.2.0-SNAPSHOT-latest

  5. Hi

    I am getting the following error when trying to run simulator_docker_run.sh

    Unable to find image 'onap/sdc-simulator:latest' locally

    docker: Error response from daemon: repository onap/sdc-simulator not found: does not exist or no pull access.

    There is no onap/sdc-simulator image in the nexus3.onap.org

    Request to help regarding this

    Thanks




    1. Hi,

      We're not publishing a docker of the sdc-simulator to the nexus. We only use local build of the project to deploy the simulator to the machine.


      You can run: mvn clean install -pl webseal-simulator -P docker in the project folder in order to build the docker and upload it to your local machine.


      Best Regards

  6. Hi

    The following exception is thrown when I am trying to login in

    http://localhost:8285/login


    Problem accessing /sdc1. Reason:

        Server Error

    Caused by:

    java.net.ConnectException: Connection refused (Connection refused)
    	at java.net.PlainSocketImpl.socketConnect(Native Method)
    	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    	at java.net.Socket.connect(Socket.java:589)
    	at java.net.Socket.connect(Socket.java:538)
    	at java.net.Socket.<init>(Socket.java:434)
    	at java.net.Socket.<init>(Socket.java:286)
    	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
    	at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
    	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
    	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
    	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    	at org.openecomp.sdc.webseal.simulator.SdcProxy.proxy(SdcProxy.java:133)
    	at org.openecomp.sdc.webseal.simulator.SdcProxy.doGet(SdcProxy.java:78)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:840)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772)
    	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:205)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
    	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
    	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
    	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
    	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    	at org.eclipse.jetty.server.Server.handle(Server.java:534)
    	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)
    	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
    	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    	at java.lang.Thread.run(Thread.java:748)
    



    1. Your sdc-BE is down please run health check to validate it's up and running

      1. sdc-BE is up still getting the same error - "Error writing to server" or "Connection reset"

  7. Hi,

    Webseal Simulator is up and running, am able to access login page at http://yourIP/login.
    What are the credentials to login and is there any guide explaining how to use webseal simulator once its up and running.

    1. Did you get the credentials? Can you let me know what the credentials are?

  8. Hi All,


    We have installed the SDC simulator along with SDC Simulator, details below:


    1305cd21819f nexus3.onap.org:10001/onap/sdc-simulator:latest "/root/startup.sh" 25 hours ago Up 25 hours 0.0.0.0:8285->8080/tcp, 0.0.0.0:8286->8443/tcp sdc-sim
    193c1035080a onap/dcae-fe:1.3.0 "/var/opt/dcae-fe/st…" 3 days ago Up 3 days 8080/tcp, 8082/tcp, 0.0.0.0:8183->8183/tcp, 8444/tcp, 0.0.0.0:9444->9444/tcp dcae-fe
    6c819a41d03e cac3edbbf0ec "/srv/docker-entrypo…" 3 days ago Up 3 days 0.0.0.0:8085->8085/tcp boring_heyrovsky
    6196e110194d onap/dcae-be:1.3.0 "/var/opt/dcae-be/st…" 4 days ago Up 3 days 0.0.0.0:8082->8082/tcp, 8080/tcp, 0.0.0.0:8444->8444/tcp dcae-be
    037daabb974c onap/sdc-kibana:1.4.0 "/root/startup.sh" 4 days ago Up 4 days 0.0.0.0:5601->5601/tcp sdc-kbn
    05a3d128e4ab nexus3.onap.org:10001/onap/sdc-frontend:1.4.0 "/root/startup.sh" 4 days ago Up 4 days 0.0.0.0:8181->8181/tcp, 8080/tcp, 0.0.0.0:9443->9443/tcp sdc-FE
    95676fe7e254 nexus3.onap.org:10001/onap/sdc-backend:1.4.0 "/root/startup.sh" 4 days ago Up 11 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp sdc-BE
    77c30eb42b96 nexus3.onap.org:10001/onap/sdc-onboard-backend:1.4.0 "/root/startup.sh" 4 days ago Up 4 days 0.0.0.0:8081->8081/tcp, 8080/tcp, 0.0.0.0:8445->8445/tcp sdc-onboard-BE
    faf90e8f06d4 nexus3.onap.org:10001/onap/sdc-cassandra:1.4.0 "/root/startup.sh /b…" 4 days ago Up 4 days 7000-7001/tcp, 0.0.0.0:9042->9042/tcp, 7199/tcp, 0.0.0.0:9160->9160/tcp sdc-cs
    55fe86999e65 nexus3.onap.org:10001/onap/sdc-elasticsearch:1.4.0 "/root/startup.sh /b…" 4 days ago Up 4 days 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp sdc-es


    Now I can access the SDC Simulator UI as well as Swagger Internal APIs


    But now the questions is:

             How to design a service chain using SDC? Is there any other UI available to created a service chain. If not then what is the methodology to design a service chain in SDC Dev env. 


  9. Can you provide the Dockerfile of onap/base_sdc-jetty, I hope to use openjdk to locate the memory problem. Thank you!

  10. I landed here from the readme, about simulator_docker_run.sh and here it's talking about docker_run.sh so I'm a bit confused (smile)


    Both exists, none are in the /data folder.. and they both seem to require a WORKSPACE variable. Which I have set to some random folder, I'm guessing that's not important ?


    Anyway here is my output with docker_run.sh:

    ⋊> ~/g/o/sdc on master ⨯ ./sdc-os-chef/scripts/docker_run.sh -l -d sdc-sim -sim                                                                                                                                                                       13:52:26
    
    
    Performing old dockers cleanup
    performing sdc-sim docker cleanup
    0f6a3194fd20
    Creating dir '/home/j/sdcworkspace/data/onap/cert'
    docker run sdc-webSimulator...
    Not running
    efdcdaec12efd90eb31c76b82326190758dd641bd66c4b0d85b710c745e912f0
    please wait while SDC-WEB-SIMULATOR is starting.....
    Monitor sdc-sim Docker
    /usr/lib/ruby/gems/2.5.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:230:in `parse_options': missing argument: -E (OptionParser::MissingArgument)
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application.rb:89:in `configure_chef'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application.rb:48:in `reconfigure'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application/solo.rb:233:in `reconfigure'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application/solo.rb:222:in `run'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/bin/chef-solo:25:in `<top (required)>'
    	from /usr/bin/chef-solo:23:in `load'
    	from /usr/bin/chef-solo:23:in `<main>'
    

    and then it loops.


    And here is with with simulator_docker_run.sh, seems pretty similar.


    > ~/g/o/sdc on master ⨯ ./utils/webseal-simulator/scripts/simulator_docker_run.sh                                                                                                                                                                    13:58:56
    performing old dockers cleanup
    e6dd207a3f9f
    44a54bf82dc4
    694139ee2f22
    85420eba9bf2
    202aa0c4230b
    
    44270e40b1383679cb65a3549006b2b2383b5b9b5c8074138f9dd40868649cdb
    ⋊> ~/g/o/sdc on master ⨯ docker ps -a | grep 44270                                                                                                                                                                                                    13:59:09
    44270e40b138        onap/sdc-simulator:latest                                  "/root/startup.sh"       12 seconds ago      Exited (1) 9 seconds ago                                                         sdc-sim
    ⋊> ~/g/o/sdc on master ⨯ docker logs sdc-sim                                                                                                                                                                                                          13:59:20
    /usr/lib/ruby/gems/2.5.0/gems/mixlib-cli-1.7.0/lib/mixlib/cli.rb:230:in `parse_options': missing argument: -E (OptionParser::MissingArgument)
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application.rb:89:in `configure_chef'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application.rb:48:in `reconfigure'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application/solo.rb:233:in `reconfigure'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/lib/chef/application/solo.rb:222:in `run'
    	from /usr/lib/ruby/gems/2.5.0/gems/chef-13.8.5/bin/chef-solo:25:in `<top (required)>'
    	from /usr/bin/chef-solo:23:in `load'
    	from /usr/bin/chef-sol


    I will investigate but I welcome any feedback or pointers (smile)