You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/06/13 09:00:07 UTC

[GitHub] Katiyman opened a new issue #2364: Error When running simple C++ code in openwhisk as action

Katiyman opened a new issue #2364: Error When running simple C++ code in openwhisk as action
URL: https://github.com/apache/incubator-openwhisk/issues/2364
 
 
   
   
   ## Environment details:
   
   * local deployment: ubuntu 16.04 
   * Docker version 17.05.0-ce, build 89658be
   
   ## Steps to reproduce the issue:
   
   1.   Created file helloworld.cpp with the below code
   ```
   #include <iostream>
   using namespace std;
   main()
   {
      std::cout << "Hello World!";
       return 0;
   }
   ```
   
   2.  build docker using docker build -t nsn7/cpp .   
   docker file content (followed docker skeleton) 
   ```
   # Dockerfile for example whisk docker action
   FROM openwhisk/dockerskeleton
   
   ENV FLASK_PROXY_PORT 8080
   
   ### Add source file(s)
   ADD cpp_code/helloworld.cpp /action/helloworld.cpp
   
   RUN export http_proxy=http://87.254.212.120:8080 && \
       export https_proxy=http://87.254.212.120:8080 && \
       apk add --no-cache --virtual .build-deps \
           bzip2-dev \
           g++ \
           libc-dev \
   ### Compile source file(s)
    && cd /action; g++ -o exec helloworld.cpp \
    && apk del .build-deps
   
   CMD ["/bin/bash", "-c", "cd actionProxy && python -u actionproxy.py"]
   ```
   3.   created action using 
   
   >  wsk -i action create --docker cpp nsn7/cpp
   
   4. invoke action 
   
   > wsk -i action invoke --blocking cpp
   5.Check logs 
   **2017-06-13T08:05:49.09817066Z  stderr: Error loading shared library libstdc++.so.6: No such file or directory (needed by /action/exec)
   2017-06-13T08:05:49.098335657Z stderr: Error loading shared library libgcc_s.so.1: No such file or directory (needed by /action/exec)
   2017-06-13T08:05:49.098347561Z stderr: Error relocating /action/exec: _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc: symbol not found
   2017-06-13T08:05:49.098353631Z stderr: Error relocating /action/exec: _ZNSt8ios_base4InitD1Ev: symbol not found
   2017-06-13T08:05:49.098359138Z stderr: Error relocating /action/exec: _ZNSt8ios_base4InitC1Ev: symbol not found
   2017-06-13T08:05:49.098364727Z stderr: Error relocating /action/exec: _ZSt4cout: symbol not found
   2017-06-13T08:05:49.098562006Z stdout:
   2017-06-13T08:05:49.09924034Z  stderr: XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX
   2017-06-13T08:05:49.099242089Z stdout: XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX**
   
   
   ## Provide the expected results and outputs:
   
   ```
   Hello world
   ```
   
   
   ## Provide the actual results and outputs:
   
   ```
   {
       "error": "The action did not return a dictionary."
   }
   
   ```
   
   ## Additional information you deem important:
   * first docker action
   * 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services