stefano casazza 7 年 前
コミット
aa7e4ae845

+ 3 - 3
frameworks/C++/ulib/src/cached_worlds.usp

@@ -56,11 +56,11 @@ static void usp_end_cached_worlds()
 
 
    if (cache)
    if (cache)
       {
       {
-      delete cache;
-      delete pworld_query;
+      U_DELETE(cache)
+      U_DELETE(pworld_query)
 
 
 #  ifndef AS_cpoll_cppsp_DO
 #  ifndef AS_cpoll_cppsp_DO
-      delete pvworld_query;
+      U_DELETE(pvworld_query)
 #  endif
 #  endif
       }
       }
 }
 }

+ 6 - 5
frameworks/C++/ulib/src/db.usp

@@ -19,8 +19,9 @@ static void usp_fork_db()
       {
       {
       U_WARNING("usp_fork_db(): we cound't connect to db");
       U_WARNING("usp_fork_db(): we cound't connect to db");
 
 
-      delete psql_db;
-             psql_db = U_NULLPTR;
+      U_DELETE(psql_db)
+
+      psql_db = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -40,9 +41,9 @@ static void usp_end_db()
 
 
    if (pstmt_db)
    if (pstmt_db)
       {
       {
-      delete pstmt_db;
-      delete pworld_db;
-      delete psql_db;
+      U_DELETE(pstmt_db)
+      U_DELETE(pworld_db)
+      U_DELETE(psql_db)
       }
       }
 }
 }
 #endif
 #endif

+ 4 - 3
frameworks/C++/ulib/src/edb.usp

@@ -20,8 +20,9 @@ static void usp_fork_edb()
       {
       {
       U_WARNING("usp_fork_edb(): connection disabled or failed");
       U_WARNING("usp_fork_edb(): connection disabled or failed");
 
 
-      delete es;
-             es = U_NULLPTR;
+      U_DELETE(es)
+
+      es = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -34,7 +35,7 @@ static void usp_end_edb()
 {
 {
    U_TRACE(5, "::usp_end_edb()")
    U_TRACE(5, "::usp_end_edb()")
 
 
-   if (es) delete es;
+   if (es) U_DELETE(es)
 }
 }
 #endif
 #endif
 -->
 -->

+ 5 - 4
frameworks/C++/ulib/src/equery.usp

@@ -24,8 +24,9 @@ static void usp_fork_equery()
       {
       {
       U_WARNING("usp_fork_equery(): connection disabled or failed");
       U_WARNING("usp_fork_equery(): connection disabled or failed");
 
 
-      delete es;
-             es = U_NULLPTR;
+      U_DELETE(es)
+
+      es = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -44,10 +45,10 @@ static void usp_end_equery()
 
 
    if (es)
    if (es)
       {
       {
-      delete es;
+      U_DELETE(es)
 
 
 #  ifndef AS_cpoll_cppsp_DO
 #  ifndef AS_cpoll_cppsp_DO
-      delete pvworld_query;
+      U_DELETE(pvworld_query)
 #  endif
 #  endif
       }
       }
 }
 }

+ 5 - 4
frameworks/C++/ulib/src/eupdate.usp

@@ -28,8 +28,9 @@ static void usp_fork_eupdate()
       {
       {
       U_WARNING("usp_fork_eupdate(): connection disabled or failed");
       U_WARNING("usp_fork_eupdate(): connection disabled or failed");
 
 
-      delete es;
-             es = U_NULLPTR;
+      U_DELETE(es)
+
+      es = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -54,10 +55,10 @@ static void usp_end_eupdate()
 
 
    if (es)
    if (es)
       {
       {
-      delete es;
+      U_DELETE(es)
 
 
 #  ifndef AS_cpoll_cppsp_DO
 #  ifndef AS_cpoll_cppsp_DO
-      delete pvworld_update;
+      U_DELETE(pvworld_update)
 #  endif
 #  endif
       }
       }
 }
 }

+ 4 - 4
frameworks/C++/ulib/src/fortune.h

@@ -20,7 +20,7 @@ public:
 
 
    Fortune()
    Fortune()
       {
       {
-      U_TRACE_REGISTER_OBJECT(5, Fortune, "")
+      U_TRACE_CTOR(5, Fortune, "")
 
 
       // coverity[uninit_ctor]
       // coverity[uninit_ctor]
 #  ifdef U_COVERITY_FALSE_POSITIVE
 #  ifdef U_COVERITY_FALSE_POSITIVE
@@ -30,19 +30,19 @@ public:
 
 
    Fortune(uint32_t _id, const UString& _message) : id(_id), message(_message)
    Fortune(uint32_t _id, const UString& _message) : id(_id), message(_message)
       {
       {
-      U_TRACE_REGISTER_OBJECT(5, Fortune, "%u,%V", _id, _message.rep)
+      U_TRACE_CTOR(5, Fortune, "%u,%V", _id, _message.rep)
       }
       }
 
 
    Fortune(const Fortune& f) : id(f.id), message((void*)U_STRING_TO_PARAM(f.message))
    Fortune(const Fortune& f) : id(f.id), message((void*)U_STRING_TO_PARAM(f.message))
       {
       {
-      U_TRACE_REGISTER_OBJECT(5, Fortune, "%p", &f)
+      U_TRACE_CTOR(5, Fortune, "%p", &f)
 
 
       U_MEMORY_TEST_COPY(f)
       U_MEMORY_TEST_COPY(f)
       }
       }
 
 
    ~Fortune()
    ~Fortune()
       {
       {
-      U_TRACE_UNREGISTER_OBJECT(5, Fortune)
+      U_TRACE_DTOR(5, Fortune)
       }
       }
 
 
    // SERVICE
    // SERVICE

+ 10 - 9
frameworks/C++/ulib/src/fortune.usp

@@ -22,8 +22,9 @@ static void usp_fork_fortune()
       {
       {
       U_WARNING("usp_fork_fortune(): we cound't connect to db");
       U_WARNING("usp_fork_fortune(): we cound't connect to db");
 
 
-      delete psql_fortune;
-             psql_fortune = U_NULLPTR;
+      U_DELETE(psql_fortune)
+
+      psql_fortune = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -36,7 +37,7 @@ static void usp_fork_fortune()
 
 
    pstmt_fortune->into(*pfortune);
    pstmt_fortune->into(*pfortune);
 
 
-   U_NEW(UString, pencoded, UString(100U));
+   U_NEW_STRING(pencoded, UString(100U));
    U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
    U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
    U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
    U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
 }
 }
@@ -48,12 +49,12 @@ static void usp_end_fortune()
 
 
    if (pstmt_fortune)
    if (pstmt_fortune)
       {
       {
-      delete pstmt_fortune;
-      delete pfortune;
-      delete pencoded;
-      delete pvfortune;
-      delete pfortune2add;
-      delete psql_fortune;
+      U_DELETE(pstmt_fortune)
+      U_DELETE(pfortune)
+      U_DELETE(pencoded)
+      U_DELETE(pvfortune)
+      U_DELETE(pfortune2add)
+      U_DELETE(psql_fortune)
       }
       }
 }
 }
 #endif
 #endif

+ 4 - 4
frameworks/C++/ulib/src/json.usp

@@ -18,8 +18,8 @@ static void usp_init_json()
    U_TRACE(5, "::usp_init_json()")
    U_TRACE(5, "::usp_init_json()")
 
 
 #ifndef AS_cpoll_cppsp_DO
 #ifndef AS_cpoll_cppsp_DO
-   U_NEW(UString, pkey,   U_STRING_FROM_CONSTANT("message"));
-   U_NEW(UString, pvalue, U_STRING_FROM_CONSTANT("Hello, World!"));
+   U_NEW_STRING(pkey,   UString(U_CONSTANT_TO_PARAM("message")));
+   U_NEW_STRING(pvalue, UString(U_CONSTANT_TO_PARAM("Hello, World!")));
 #endif
 #endif
 }
 }
 
 
@@ -29,8 +29,8 @@ static void usp_end_json()
    U_TRACE(5, "::usp_end_json()")
    U_TRACE(5, "::usp_end_json()")
 
 
 #ifndef AS_cpoll_cppsp_DO
 #ifndef AS_cpoll_cppsp_DO
-   delete pkey;
-   delete pvalue;
+   U_DELETE(pkey)
+   U_DELETE(pvalue)
 #endif
 #endif
 }
 }
 #endif
 #endif

+ 8 - 6
frameworks/C++/ulib/src/mdb.usp

@@ -5,7 +5,7 @@ TechEmpower Web Framework Benchmarks
 <!--#declaration
 <!--#declaration
 #include "world.h"
 #include "world.h"
 
 
-static bson_t* query;  
+static bson_t* query;
 static UMongoDBClient* mc;
 static UMongoDBClient* mc;
 
 
 static void usp_fork_mdb()
 static void usp_fork_mdb()
@@ -18,8 +18,9 @@ static void usp_fork_mdb()
       {
       {
       U_WARNING("usp_fork_mdb(): connection failed");
       U_WARNING("usp_fork_mdb(): connection failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -28,8 +29,9 @@ static void usp_fork_mdb()
       {
       {
       U_WARNING("usp_fork_mdb(): selectCollection() failed");
       U_WARNING("usp_fork_mdb(): selectCollection() failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -44,7 +46,7 @@ static void usp_end_mdb()
 
 
    if (query)
    if (query)
       {
       {
-      delete mc;
+      U_DELETE(mc)
 
 
       U_SYSCALL_VOID(bson_destroy, "%p", query);
       U_SYSCALL_VOID(bson_destroy, "%p", query);
       }
       }

+ 11 - 9
frameworks/C++/ulib/src/mfortune.usp

@@ -20,8 +20,9 @@ static void usp_fork_mfortune()
       {
       {
       U_WARNING("usp_fork_mfortune(): connection failed");
       U_WARNING("usp_fork_mfortune(): connection failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -30,13 +31,14 @@ static void usp_fork_mfortune()
       {
       {
       U_WARNING("usp_fork_mfortune(): selectCollection() failed");
       U_WARNING("usp_fork_mfortune(): selectCollection() failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
 
 
-   U_NEW(UString, pencoded, UString(100U));
+   U_NEW_STRING(pencoded, UString(100U));
    U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
    U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
    U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
    U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
 }
 }
@@ -48,10 +50,10 @@ static void usp_end_mfortune()
 
 
    if (pencoded)
    if (pencoded)
       {
       {
-      delete mc;
-      delete pencoded;
-      delete pvfortune;
-      delete pfortune2add;
+      U_DELETE(mc)
+      U_DELETE(pencoded)
+      U_DELETE(pvfortune)
+      U_DELETE(pfortune2add)
       }
       }
 }
 }
 #endif
 #endif

+ 8 - 6
frameworks/C++/ulib/src/mquery.usp

@@ -22,8 +22,9 @@ static void usp_fork_mquery()
       {
       {
       U_WARNING("usp_fork_mquery(): connection disabled or failed");
       U_WARNING("usp_fork_mquery(): connection disabled or failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -32,8 +33,9 @@ static void usp_fork_mquery()
       {
       {
       U_WARNING("usp_fork_mquery(): selectCollection() failed");
       U_WARNING("usp_fork_mquery(): selectCollection() failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -52,12 +54,12 @@ static void usp_end_mquery()
 
 
    if (query)
    if (query)
       {
       {
-      delete mc;
+      U_DELETE(mc)
 
 
       U_SYSCALL_VOID(bson_destroy, "%p", query);
       U_SYSCALL_VOID(bson_destroy, "%p", query);
 
 
 #  ifndef AS_cpoll_cppsp_DO
 #  ifndef AS_cpoll_cppsp_DO
-      delete pvworld_query;
+      U_DELETE(pvworld_query)
 #  endif
 #  endif
       }
       }
 }
 }

+ 8 - 6
frameworks/C++/ulib/src/mupdate.usp

@@ -22,8 +22,9 @@ static void usp_fork_mupdate()
       {
       {
       U_WARNING("usp_fork_mupdate(): connection disabled or failed");
       U_WARNING("usp_fork_mupdate(): connection disabled or failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -32,8 +33,9 @@ static void usp_fork_mupdate()
       {
       {
       U_WARNING("usp_fork_mupdate(): selectCollection() failed");
       U_WARNING("usp_fork_mupdate(): selectCollection() failed");
 
 
-      delete mc;
-             mc = U_NULLPTR;
+      U_DELETE(mc)
+
+      mc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -52,12 +54,12 @@ static void usp_end_mupdate()
 
 
    if (query)
    if (query)
       {
       {
-      delete mc;
+      U_DELETE(mc)
 
 
       U_SYSCALL_VOID(bson_destroy, "%p", query);
       U_SYSCALL_VOID(bson_destroy, "%p", query);
 
 
 #  ifndef AS_cpoll_cppsp_DO
 #  ifndef AS_cpoll_cppsp_DO
-      delete pvworld_update;
+      U_DELETE(pvworld_update)
 #  endif
 #  endif
       }
       }
 }
 }

+ 7 - 6
frameworks/C++/ulib/src/query.usp

@@ -23,8 +23,9 @@ static void usp_fork_query()
       {
       {
       U_WARNING("usp_fork_query(): we cound't connect to db");
       U_WARNING("usp_fork_query(): we cound't connect to db");
 
 
-      delete psql_query;
-             psql_query = U_NULLPTR;
+      U_DELETE(psql_query)
+
+      psql_query = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -50,12 +51,12 @@ static void usp_end_query()
 
 
    if (pstmt_query)
    if (pstmt_query)
       {
       {
-      delete pstmt_query;
-      delete pworld_query;
-      delete psql_query;
+      U_DELETE(pstmt_query)
+      U_DELETE(pworld_query)
+      U_DELETE(psql_query)
 
 
 #  ifndef AS_cpoll_cppsp_DO
 #  ifndef AS_cpoll_cppsp_DO
-      delete pvworld_query;
+      U_DELETE(pvworld_query)
 #  endif
 #  endif
       }
       }
 }
 }

+ 4 - 3
frameworks/C++/ulib/src/rdb.usp

@@ -19,8 +19,9 @@ static void usp_fork_rdb()
       {
       {
       U_WARNING("usp_fork_rdb(): %V", rc->UClient_Base::getResponse().rep);
       U_WARNING("usp_fork_rdb(): %V", rc->UClient_Base::getResponse().rep);
 
 
-      delete rc;
-             rc = U_NULLPTR;
+      U_DELETE(rc)
+
+      rc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -33,7 +34,7 @@ static void usp_end_rdb()
 {
 {
    U_TRACE(5, "::usp_end_rdb()")
    U_TRACE(5, "::usp_end_rdb()")
 
 
-   if (rc) delete rc;
+   if (rc) U_DELETE(rc)
 }
 }
 #endif
 #endif
 -->
 -->

+ 8 - 7
frameworks/C++/ulib/src/rfortune.usp

@@ -20,13 +20,14 @@ static void usp_fork_rfortune()
       {
       {
       U_WARNING("usp_fork_rfortune(): %V", rc->UClient_Base::getResponse().rep);
       U_WARNING("usp_fork_rfortune(): %V", rc->UClient_Base::getResponse().rep);
 
 
-      delete rc;
-             rc = U_NULLPTR;
+      U_DELETE(rc)
+
+      rc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
 
 
-   U_NEW(UString, pencoded, UString(100U));
+   U_NEW_STRING(pencoded, UString(100U));
    U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
    U_NEW(UVector<Fortune*>, pvfortune, UVector<Fortune*>);
    U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
    U_NEW(Fortune, pfortune2add, Fortune(0, U_STRING_FROM_CONSTANT("Additional fortune added at request time.")));
 }
 }
@@ -38,10 +39,10 @@ static void usp_end_rfortune()
 
 
    if (pencoded)
    if (pencoded)
       {
       {
-      delete rc;
-      delete pencoded;
-      delete pvfortune;
-      delete pfortune2add;
+      U_DELETE(rc)
+      U_DELETE(pencoded)
+      U_DELETE(pvfortune)
+      U_DELETE(pfortune2add)
       }
       }
 }
 }
 #endif
 #endif

+ 5 - 4
frameworks/C++/ulib/src/rquery.usp

@@ -19,8 +19,9 @@ static void usp_fork_rquery()
       {
       {
       U_WARNING("usp_fork_rquery(): %V", rc->UClient_Base::getResponse().rep);
       U_WARNING("usp_fork_rquery(): %V", rc->UClient_Base::getResponse().rep);
 
 
-      delete rc;
-             rc = U_NULLPTR;
+      U_DELETE(rc)
+
+      rc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -35,8 +36,8 @@ static void usp_end_rquery()
 
 
    if (pvworld_query)
    if (pvworld_query)
       {
       {
-      delete rc;
-      delete pvworld_query;
+      U_DELETE(rc)
+      U_DELETE(pvworld_query)
       }
       }
 }
 }
 #endif
 #endif

+ 5 - 4
frameworks/C++/ulib/src/rupdate.usp

@@ -19,8 +19,9 @@ static void usp_fork_rupdate()
       {
       {
       U_WARNING("usp_fork_rupdate(): %V", rc->UClient_Base::getResponse().rep);
       U_WARNING("usp_fork_rupdate(): %V", rc->UClient_Base::getResponse().rep);
 
 
-      delete rc;
-             rc = U_NULLPTR;
+      U_DELETE(rc)
+
+      rc = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -35,8 +36,8 @@ static void usp_end_rupdate()
 
 
    if (pvworld)
    if (pvworld)
       {
       {
-      delete rc;
-      delete pvworld;
+      U_DELETE(rc)
+      U_DELETE(pvworld)
       }
       }
 }
 }
 #endif
 #endif

+ 8 - 7
frameworks/C++/ulib/src/update.usp

@@ -22,8 +22,9 @@ static void usp_fork_update()
       {
       {
       U_WARNING("usp_fork_update(): we cound't connect to db");
       U_WARNING("usp_fork_update(): we cound't connect to db");
 
 
-      delete psql_update;
-             psql_update = U_NULLPTR;
+      U_DELETE(psql_update)
+
+      psql_update = U_NULLPTR;
 
 
       return;
       return;
       }
       }
@@ -52,13 +53,13 @@ static void usp_end_update()
 
 
    if (pstmt)
    if (pstmt)
       {
       {
-      delete pstmt;
-      delete pworld_update;
-      delete pvworld_update;
+      U_DELETE(pstmt)
+      U_DELETE(pworld_update)
+      U_DELETE(pvworld_update)
 
 
-      if (bpgsql == false) delete pstmt1;
+      if (bpgsql == false) U_DELETE(pstmt1)
 
 
-      delete psql_update;
+      U_DELETE(psql_update)
       }
       }
 }
 }
 #endif
 #endif

+ 4 - 4
frameworks/C++/ulib/src/world.h

@@ -19,7 +19,7 @@ public:
 
 
    World()
    World()
       {
       {
-      U_TRACE_REGISTER_OBJECT(5, World, "")
+      U_TRACE_CTOR(5, World, "")
 
 
       // coverity[uninit_ctor]
       // coverity[uninit_ctor]
 #  ifdef U_COVERITY_FALSE_POSITIVE
 #  ifdef U_COVERITY_FALSE_POSITIVE
@@ -29,19 +29,19 @@ public:
 
 
    World(uint32_t _id, uint32_t _randomNumber) : id(_id), randomNumber(_randomNumber)
    World(uint32_t _id, uint32_t _randomNumber) : id(_id), randomNumber(_randomNumber)
       {
       {
-      U_TRACE_REGISTER_OBJECT(5, World, "%u,%u", _id, _randomNumber)
+      U_TRACE_CTOR(5, World, "%u,%u", _id, _randomNumber)
       }
       }
 
 
    World(const World& w) : id(w.id), randomNumber(w.randomNumber)
    World(const World& w) : id(w.id), randomNumber(w.randomNumber)
       {
       {
-      U_TRACE_REGISTER_OBJECT(5, World, "%p", &w)
+      U_TRACE_CTOR(5, World, "%p", &w)
 
 
       U_MEMORY_TEST_COPY(w)
       U_MEMORY_TEST_COPY(w)
       }
       }
 
 
    ~World()
    ~World()
       {
       {
-      U_TRACE_UNREGISTER_OBJECT(5, World)
+      U_TRACE_DTOR(5, World)
       }
       }
 
 
    // JSON
    // JSON

+ 34 - 65
frameworks/C++/ulib/ulib-json.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,101 +12,69 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
-    make && make install
-
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp 
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(( 3 * $(nproc) / 2 ))" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
-
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+    --without-ssl --disable-HCRS --without-pcre --without-expat \
+    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
+	 --enable-static-server-plugin=http
+
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make json.la && \
+    cp .libs/json.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET 0|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 256|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV UMEMPOOL="58,0,0,41,273,-15,-14,-20,36"
 ENV UMEMPOOL="58,0,0,41,273,-15,-14,-20,36"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(( 3 * $(nproc) / 2 ))|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 34 - 65
frameworks/C++/ulib/ulib-json_fit.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,101 +12,69 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
-    make && make install
-
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp 
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
-
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+    --without-ssl --disable-HCRS --without-pcre --without-expat \
+    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
+	 --enable-static-server-plugin=http
+
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make json.la && \
+    cp .libs/json.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET 0|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 256|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV UMEMPOOL="58,0,0,41,273,-15,-14,-20,36"
 ENV UMEMPOOL="58,0,0,41,273,-15,-14,-20,36"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(nproc)|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 37 - 61
frameworks/C++/ulib/ulib-mongodb.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,102 +12,77 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
+RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.4.0/mongo-c-driver-1.4.0.tar.gz
+RUN tar xf mongo-c-driver-1.4.0.tar.gz
+RUN cd mongo-c-driver-1.4.0/ && \
+    ./configure --prefix=${IROOT} --libdir=${IROOT} --disable-automatic-init-and-cleanup && \
     make && make install
     make && make install
 
 
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(( 3 * $(nproc) / 2 ))" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
+    --without-ssl --disable-HCRS --without-pcre --without-expat \
+    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
+	 --enable-static-server-plugin=http \
     --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
     --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
 
 
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make mdb.la mquery.la mupdate.la mfortune.la && \
+    cp .libs/mdb.so .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET 0|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 256|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV MONGODB_HOST=tfb-database
 ENV MONGODB_HOST=tfb-database
 ENV UMEMPOOL="96,0,0,47,16401,-14,-20,-18,26"
 ENV UMEMPOOL="96,0,0,47,16401,-14,-20,-18,26"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(( 3 * $(nproc) / 2 ))|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 37 - 66
frameworks/C++/ulib/ulib-mysql.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,103 +12,73 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
-    make && make install
-
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "ORM_DRIVER mysql" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
+    --with-mysql \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
-
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+    --without-ssl --disable-HCRS --without-pcre --without-expat \
+    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
+    --enable-static-orm-driver='mysql' --enable-static-server-plugin=http
+
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make db.la query.la update.la fortune.la cached_worlds.la && \
+    cp .libs/db.so .libs/query.so .libs/update.so .libs/fortune.so .libs/cached_worlds.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET -2|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 256|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV ORM_DRIVER="mysql"
 ENV ORM_DRIVER="mysql"
-ENV UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
 ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass character-set=utf8 dbname=hello_world"
+ENV UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(nproc)|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 31 - 62
frameworks/C++/ulib/ulib-plaintext_fit.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,101 +12,69 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
-    make && make install
-
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp 
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
     --without-ssl --without-pcre --without-expat \
     --without-ssl --without-pcre --without-expat \
     --without-libz --without-libuuid --without-magic --without-libares \
     --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
-
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+	 --enable-static-server-plugin=http
+
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make plaintext.la && \
+    cp .libs/plaintext.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET 0|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 16384|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 8000|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV UMEMPOOL="58,0,0,41,16401,-14,-15,11,25"
 ENV UMEMPOOL="58,0,0,41,16401,-14,-15,11,25"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(nproc)|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 36 - 65
frameworks/C++/ulib/ulib-postgres.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,103 +12,73 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
-    make && make install
-
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(( 2 * $(nproc)))" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "ORM_DRIVER pgsql" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
-
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+    --with-pgsql \
+    --without-ssl --disable-HCRS --without-pcre --without-expat \
+    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
+    --enable-static-orm-driver='pgsql' --enable-static-server-plugin=http
+
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make db.la query.la update.la fortune.la cached_worlds.la && \
+    cp .libs/db.so .libs/query.so .libs/update.so .libs/fortune.so .libs/cached_worlds.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET -2|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 256|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV ORM_DRIVER="pgsql"
 ENV ORM_DRIVER="pgsql"
 ENV UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 ENV UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(( 2 * $(nproc)))|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 36 - 65
frameworks/C++/ulib/ulib-postgres_fit.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,103 +12,73 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
-    make && make install
-
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
-RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(nproc)" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET -2" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "LISTEN_BACKLOG 256" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "ORM_DRIVER pgsql" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
-    --without-ssl --without-pcre --without-expat \
-    --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
-
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+    --with-pgsql \
+    --without-ssl --disable-HCRS --without-pcre --without-expat \
+    --without-libz --without-libuuid --disable-HPRS --without-magic --without-libares \
+    --enable-static-orm-driver='pgsql' --enable-static-server-plugin=http
+
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make db.la query.la update.la fortune.la cached_worlds.la && \
+    cp .libs/db.so .libs/query.so .libs/update.so .libs/fortune.so .libs/cached_worlds.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET -2|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 256|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 100|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV ORM_DRIVER="pgsql"
 ENV ORM_DRIVER="pgsql"
 ENV UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 ENV UMEMPOOL="581,0,0,59,16409,-7,-20,-23,31"
 ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 ENV ORM_OPTION="host=tfb-database user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world client_encoding=UTF8"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(nproc)|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg

+ 31 - 62
frameworks/C++/ulib/ulib.dockerfile

@@ -1,8 +1,9 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.04
 
 
-RUN apt update
+COPY ./ ./
 
 
-RUN apt install -yqq software-properties-common build-essential curl locales wget unzip git \
+RUN apt update -yqq && \
+	 apt install -yqq software-properties-common build-essential curl locales wget unzip git \
     libmysqlclient-dev libpq-dev \
     libmysqlclient-dev libpq-dev \
     libpcre3 libpcre3-dev \
     libpcre3 libpcre3-dev \
     libssl-dev libcurl4-openssl-dev \
     libssl-dev libcurl4-openssl-dev \
@@ -11,101 +12,69 @@ RUN apt install -yqq software-properties-common build-essential curl locales wge
     libbz2-dev \
     libbz2-dev \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libxslt-dev libgdbm-dev ncurses-dev  \
     libffi-dev libtool bison libevent-dev \
     libffi-dev libtool bison libevent-dev \
-    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
-    liborc-0.4-0 libgnutls-dev \
-    libjson0-dev libmcrypt-dev libicu-dev \
-    re2c libnuma-dev
+    liborc-0.4-0 \
+    libmcrypt-dev libicu-dev \
+    re2c libnuma-dev \
+	 postgresql-server-dev-all libcap2-bin && \
+	 add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
+	 apt update -yqq && \
+	 apt install -yqq gcc-8 g++-8
 
 
 RUN locale-gen en_US.UTF-8
 RUN locale-gen en_US.UTF-8
+
 ENV LANG en_US.UTF-8
 ENV LANG en_US.UTF-8
 ENV LANGUAGE en_US:en
 ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 
 
-RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
-    apt update -yqq && \
-    apt install -yqq gcc-6 g++-6
-
+ENV CC=gcc-8
+ENV CXX=g++-8
+ENV AR=gcc-ar-8
+ENV RANLIB=gcc-ranlib-8
 ENV IROOT=/install
 ENV IROOT=/install
-ENV ULIB_VERSION=1.4.2
 ENV ULIB_ROOT=$IROOT/ULib
 ENV ULIB_ROOT=$IROOT/ULib
+ENV ULIB_VERSION=1.4.2
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
 ENV ULIB_DOCUMENT_ROOT=$ULIB_ROOT/ULIB_DOCUMENT_ROOT
-ENV CC=gcc-6
-ENV CXX=g++-6
-ENV AR=gcc-ar-6
-ENV RANLIB=gcc-ranlib-6
-
-RUN mkdir -p $ULIB_ROOT
-RUN mkdir -p $ULIB_DOCUMENT_ROOT
-
-RUN apt install -yqq postgresql-server-dev-all libcap2-bin
 
 
 WORKDIR $IROOT
 WORKDIR $IROOT
 
 
-# We need to install mongo-c-driver (we don't have a ubuntu package)
-RUN wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.1.10/mongo-c-driver-1.1.10.tar.gz
-RUN tar -xzf mongo-c-driver-1.1.10.tar.gz
-RUN cd mongo-c-driver-1.1.10/ && \
-    ./configure --prefix=$IROOT --libdir=$IROOT && \
-    make && make install
-
-# 1. Download ULib
+RUN mkdir -p $ULIB_DOCUMENT_ROOT 
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN wget -q -O ULib-${ULIB_VERSION}.tar.gz https://github.com/stefanocasazza/ULib/archive/v${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 RUN tar xf ULib-${ULIB_VERSION}.tar.gz
 
 
-# 2. Compile application (userver_tcp)
-# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
 WORKDIR $IROOT/ULib-$ULIB_VERSION
 WORKDIR $IROOT/ULib-$ULIB_VERSION
+
+# AVOID "configure: error: newly created file is older than distributed files! Check your system clock"
+#RUN cp /src/* src/ulib/net/server/plugin/usp 
 RUN find . -exec touch {} \;
 RUN find . -exec touch {} \;
-RUN cp -r tests/examples/benchmark/FrameworkBenchmarks/ULib/db $ULIB_ROOT
 
 
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "userver {" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "PORT 8080" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "PREFORK_CHILD 2" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "TCP_LINGER_SET 0 " >> $ULIB_ROOT/benchmark.cfg
+RUN echo "PREFORK_CHILD $(( 3 * $(nproc) / 2 ))" >> $ULIB_ROOT/benchmark.cfg
+RUN echo "TCP_LINGER_SET 0" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "LISTEN_BACKLOG 16384" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "ORM_DRIVER \"mysql pgsql\"" >> $ULIB_ROOT/benchmark.cfg
-RUN echo "CLIENT_FOR_PARALLELIZATION 100" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "DOCUMENT_ROOT $ULIB_DOCUMENT_ROOT " >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 RUN echo "}" >> $ULIB_ROOT/benchmark.cfg
 
 
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
 RUN USP_FLAGS="-DAS_cpoll_cppsp_DO" \
     ./configure --prefix=$ULIB_ROOT \
     ./configure --prefix=$ULIB_ROOT \
     --disable-static --disable-examples \
     --disable-static --disable-examples \
-    --with-mysql --with-pgsql \
     --without-ssl --without-pcre --without-expat \
     --without-ssl --without-pcre --without-expat \
     --without-libz --without-libuuid --without-magic --without-libares \
     --without-libz --without-libuuid --without-magic --without-libares \
-    --enable-static-orm-driver='mysql pgsql' --enable-static-server-plugin=http \
-    --with-mongodb --with-mongodb-includes="-I$IROOT/include/libbson-1.0 -I$IROOT/include/libmongoc-1.0" --with-mongodb-ldflags="-L$IROOT"
-# --enable-debug \
-#USP_LIBS="-ljson" \
-#cp $TROOT/src/* src/ulib/net/server/plugin/usp
-
-RUN make install
-RUN cd examples/userver && make install
-
-# Compile usp pages (no more REDIS)
-RUN cd src/ulib/net/server/plugin/usp && \
-    make json.la plaintext.la db.la query.la update.la fortune.la cached_worlds.la \
-          mdb.la mquery.la mupdate.la mfortune.la && \
-    cp .libs/json.so .libs/plaintext.so \
-        .libs/db.so   .libs/query.so  .libs/update.so  .libs/fortune.so .libs/cached_worlds.so \
-        .libs/mdb.so  .libs/mquery.so .libs/mupdate.so .libs/mfortune.so $ULIB_DOCUMENT_ROOT
+	 --enable-static-server-plugin=http
+
+RUN make install && \
+	 cd examples/userver && make install && \
+	 cd ../../src/ulib/net/server/plugin/usp && \
+    make plaintext.la && \
+    cp .libs/plaintext.so $ULIB_DOCUMENT_ROOT
 
 
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 ENV PATH=${ULIB_ROOT}/bin:${PATH}
 
 
 ADD ./ /ulib
 ADD ./ /ulib
 WORKDIR /ulib
 WORKDIR /ulib
 
 
-
-# 1. Change ULib Server (userver_tcp) configuration
-RUN sed -i "s|TCP_LINGER_SET .*|TCP_LINGER_SET 0|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|LISTEN_BACKLOG .*|LISTEN_BACKLOG 16384|g" $IROOT/ULib/benchmark.cfg
-RUN sed -i "s|CLIENT_FOR_PARALLELIZATION .*|CLIENT_FOR_PARALLELIZATION 8000|g"  $IROOT/ULib/benchmark.cfg
-
-# 2. Start ULib Server (userver_tcp)
 ENV UMEMPOOL="58,0,0,41,16401,-14,-15,11,25"
 ENV UMEMPOOL="58,0,0,41,16401,-14,-15,11,25"
 
 
-CMD sed -i "s|PREFORK_CHILD .*|PREFORK_CHILD $(( 3 * $(nproc) / 2 ))|g"  $IROOT/ULib/benchmark.cfg && \
-    setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip  $IROOT/ULib/bin/userver_tcp && \
+CMD setcap cap_sys_nice,cap_sys_resource,cap_net_bind_service,cap_net_raw+eip $IROOT/ULib/bin/userver_tcp && \
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg
     $IROOT/ULib/bin/userver_tcp -c $IROOT/ULib/benchmark.cfg