From 06cabb8595e522a9abf47659ba002bfb03041173 Mon Sep 17 00:00:00 2001 From: Sumeet Chhetri Date: Sat, 13 Jul 2024 22:18:25 +0530 Subject: [PATCH] Upgrade ffead-cpp to v7.0 --- .../C++/ffead-cpp/benchmark_config.json | 211 ++--- .../C++/ffead-cpp/benchmark_config_c1.json | 236 ------ .../C++/ffead-cpp/benchmark_config_c2.json | 157 ---- .../C++/ffead-cpp/benchmark_config_c3.json | 173 ---- .../C++/ffead-cpp/benchmark_config_orig.json | 752 ------------------ frameworks/C++/ffead-cpp/config.toml | 520 ------------ .../C++/ffead-cpp/ffead-cpp-apache.dockerfile | 7 - .../ffead-cpp/ffead-cpp-base-debug.dockerfile | 16 +- .../C++/ffead-cpp/ffead-cpp-base.dockerfile | 14 +- .../ffead-cpp/ffead-cpp-cinatra.dockerfile | 7 - .../ffead-cpp-crystal-h2o.dockerfile | 23 - .../ffead-cpp-crystal-http.dockerfile | 19 - .../C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile | 38 - .../C++/ffead-cpp/ffead-cpp-deps.dockerfile | 22 - .../C++/ffead-cpp/ffead-cpp-drogon.dockerfile | 7 - .../ffead-cpp-go-fasthttp.dockerfile | 19 - .../ffead-cpp/ffead-cpp-go-gnet.dockerfile | 19 - .../C++/ffead-cpp/ffead-cpp-h2o.dockerfile | 39 - .../ffead-cpp/ffead-cpp-java-base.dockerfile | 19 - .../ffead-cpp-java-firenio.dockerfile | 7 - .../ffead-cpp-java-rapidoid.dockerfile | 7 - .../ffead-cpp-java-wizzardo-http.dockerfile | 7 - .../ffead-cpp/ffead-cpp-julia-http.dockerfile | 27 - .../ffead-cpp/ffead-cpp-libreactor.dockerfile | 26 - .../ffead-cpp/ffead-cpp-lithium.dockerfile | 7 - .../ffead-cpp/ffead-cpp-mongo-raw.dockerfile | 7 - .../C++/ffead-cpp/ffead-cpp-mysql.dockerfile | 7 - .../C++/ffead-cpp/ffead-cpp-nginx.dockerfile | 7 - .../C++/ffead-cpp/ffead-cpp-p10-b.dockerfile | 12 - .../C++/ffead-cpp/ffead-cpp-p10.dockerfile | 12 - .../C++/ffead-cpp/ffead-cpp-p2-b.dockerfile | 12 - .../C++/ffead-cpp/ffead-cpp-p2.dockerfile | 12 - .../C++/ffead-cpp/ffead-cpp-p3-b.dockerfile | 12 - .../C++/ffead-cpp/ffead-cpp-p3.dockerfile | 12 - .../C++/ffead-cpp/ffead-cpp-p4-b.dockerfile | 12 - .../C++/ffead-cpp/ffead-cpp-p4.dockerfile | 12 - .../ffead-cpp-postgresql-async.dockerfile | 7 + ...-cpp-postgresql-pipelined-async.dockerfile | 7 + ...raw-async-clibpqb-pool-profiled.dockerfile | 7 - ...esql-raw-async-clibpqb-profiled.dockerfile | 7 - ...-async-clibpqb-twoconn-profiled.dockerfile | 12 - ...fead-cpp-postgresql-raw-async-m.dockerfile | 7 - ...resql-raw-async-pool-profiled-m.dockerfile | 7 - ...tgresql-raw-async-pool-profiled.dockerfile | 7 - ...postgresql-raw-async-profiled-m.dockerfile | 7 - ...p-postgresql-raw-async-profiled.dockerfile | 7 - ...l-raw-async-qw-clibpqb-profiled.dockerfile | 7 - ...ql-raw-async-qw-pool-profiled-m.dockerfile | 7 - ...ostgresql-raw-async-qw-profiled.dockerfile | 7 - .../ffead-cpp-postgresql-raw-async.dockerfile | 7 - ...postgresql-raw-clibpqb-profiled.dockerfile | 7 - ...ead-cpp-postgresql-raw-profiled.dockerfile | 7 - .../ffead-cpp-postgresql-raw.dockerfile | 7 - ...ffead-cpp-postgresql-wire-async.dockerfile | 7 + .../ffead-cpp-postgresql-wire.dockerfile | 7 + .../ffead-cpp/ffead-cpp-postgresql.dockerfile | 4 +- .../ffead-cpp/ffead-cpp-rust-actix.dockerfile | 7 - .../ffead-cpp/ffead-cpp-rust-base.dockerfile | 21 - .../ffead-cpp/ffead-cpp-rust-hyper.dockerfile | 7 - .../ffead-cpp-rust-rocket-base.dockerfile | 18 - .../ffead-cpp-rust-rocket.dockerfile | 7 - .../ffead-cpp-rust-thruster.dockerfile | 7 - .../ffead-cpp-seastar-base.dockerfile | 60 -- .../ffead-cpp/ffead-cpp-seastar.dockerfile | 5 - ...sync-clibpqb-pool-profiled-base.dockerfile | 88 -- ...raw-async-clibpqb-profiled-base.dockerfile | 88 -- ...ql-raw-async-pool-profiled-base.dockerfile | 88 -- ...cpp-sql-raw-async-profiled-base.dockerfile | 88 -- ...p-sql-raw-clibpqb-profiled-base.dockerfile | 88 -- ...ffead-cpp-sql-raw-profiled-base.dockerfile | 88 -- .../ffead-cpp/ffead-cpp-swift-nio.dockerfile | 30 - .../ffead-cpp-v-base-debug.dockerfile | 29 + .../C++/ffead-cpp/ffead-cpp-v-base.dockerfile | 26 +- ...ad-cpp-v-picov-postgresql-async.dockerfile | 7 + ...icov-postgresql-pipelined-async.dockerfile | 7 + ...p-v-picov-postgresql-wire-async.dockerfile | 7 + ...ead-cpp-v-picov-postgresql-wire.dockerfile | 7 + .../ffead-cpp-v-picov-postgresql.dockerfile | 7 + ...picov-raw-clibpqb-profiled-base.dockerfile | 106 --- ...pp-v-picov-raw-clibpqb-profiled.dockerfile | 7 - ...d-cpp-v-picov-raw-profiled-base.dockerfile | 106 --- .../ffead-cpp-v-picov-raw-profiled.dockerfile | 7 - .../ffead-cpp/ffead-cpp-v-picov.dockerfile | 7 - .../C++/ffead-cpp/ffead-cpp-v-vweb.dockerfile | 7 - frameworks/C++/ffead-cpp/ffead-cpp.dockerfile | 7 - .../ffead-cpp/install-mimalloc-snmalloc.sh | 19 - .../ffead-cpp/install_ffead-cpp-backends.sh | 126 --- .../install_ffead-cpp-dependencies.sh | 81 +- .../ffead-cpp/install_ffead-cpp-framework.sh | 181 +---- .../C++/ffead-cpp/install_ffead-cpp-httpd.sh | 91 --- .../C++/ffead-cpp/install_ffead-cpp-nginx.sh | 8 - .../install_ffead-cpp-sql-raw-profiled.sh | 49 +- ...tall_ffead-cpp-sql-raw-v-picov-profiled.sh | 82 +- .../C++/ffead-cpp/install_post_process.sh | 50 ++ frameworks/C++/ffead-cpp/run_ffead.sh | 98 ++- frameworks/C++/ffead-cpp/server.sh | 6 + .../sql-async-profiled-install-clang-dbg.sh | 23 - .../sql-async-profiled-install-clang.sh | 49 -- .../ffead-cpp/sql-async-profiled-install.sh | 28 +- .../ffead-cpp/sql-profiled-install-clang.sh | 48 -- .../C++/ffead-cpp/sql-profiled-install.sh | 25 +- frameworks/C++/ffead-cpp/sql-profiled-util.sh | 43 +- .../ffead-cpp/sql-v-picov-profiled-install.sh | 66 +- frameworks/C++/ffead-cpp/t1/CMakeLists.txt | 13 - .../C++/ffead-cpp/t1/config/sdormmongo.xml | 17 - .../C++/ffead-cpp/t1/config/sdormmysql.xml | 17 - .../ffead-cpp/t1/config/sdormpostgresql.xml | 17 - frameworks/C++/ffead-cpp/t1/include/TeBkUm.h | 91 --- .../C++/ffead-cpp/t1/include/TeBkUmWorld.h | 49 -- .../ffead-cpp/t1/sql-src/TeBkUmWorldmongo.cpp | 58 -- .../ffead-cpp/t1/sql-src/TeBkUmWorldmongo.h | 49 -- .../ffead-cpp/t1/sql-src/TeBkUmWorldsql.cpp | 49 -- .../C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.h | 44 - frameworks/C++/ffead-cpp/t1/src/TeBkUm.cpp | 302 ------- .../C++/ffead-cpp/t1/src/TeBkUmWorld.cpp | 58 -- .../ffead-cpp/t1/src/autotools/Makefile.am | 18 - frameworks/C++/ffead-cpp/t1/tpe/fortunes.tpe | 13 - frameworks/C++/ffead-cpp/t2/CMakeLists.txt | 13 - .../ffead-cpp/t2/config/cachememcached.xml | 15 - .../C++/ffead-cpp/t2/config/cacheredis.xml | 15 - frameworks/C++/ffead-cpp/t2/config/sdorm.xml | 17 - .../C++/ffead-cpp/t2/include/TeBkUmMgr.h | 120 --- frameworks/C++/ffead-cpp/t2/meson.build | 15 - frameworks/C++/ffead-cpp/t2/src/TeBkUmMgr.cpp | 427 ---------- frameworks/C++/ffead-cpp/t2/tpe/fortunes.tpe | 13 - frameworks/C++/ffead-cpp/t3/config/sdorm.xml | 1 + .../C++/ffead-cpp/t3/include/TeBkUmLpq.h | 66 +- frameworks/C++/ffead-cpp/t3/meson.build | 2 +- frameworks/C++/ffead-cpp/t3/sconscript | 29 + frameworks/C++/ffead-cpp/t3/src/TeBkUmLpq.cpp | 282 +++---- frameworks/C++/ffead-cpp/t3/tpe/fortunes.tpe | 6 +- frameworks/C++/ffead-cpp/t3/xmake.lua | 2 +- frameworks/C++/ffead-cpp/t4/config/sdorm.xml | 1 + .../C++/ffead-cpp/t4/include/TeBkUmLpqAsync.h | 81 +- frameworks/C++/ffead-cpp/t4/meson.build | 2 +- frameworks/C++/ffead-cpp/t4/sconscript | 29 + .../C++/ffead-cpp/t4/src/TeBkUmLpqAsync.cpp | 430 ++++------ frameworks/C++/ffead-cpp/t4/tpe/fortunes.tpe | 6 +- frameworks/C++/ffead-cpp/t4/xmake.lua | 2 +- frameworks/C++/ffead-cpp/t5/CMakeLists.txt | 14 - .../C++/ffead-cpp/t5/config/application.xml | 24 - .../ffead-cpp/t5/include/TeBkUmLpqQwAsync.h | 192 ----- .../C++/ffead-cpp/t5/src/TeBkUmLpqQwAsync.cpp | 715 ----------------- frameworks/C++/ffead-cpp/t5/tpe/fortunes.tpe | 13 - frameworks/C++/ffead-cpp/t5/xmake.lua | 12 - frameworks/C++/ffead-cpp/t6/CMakeLists.txt | 14 + .../{t2 => t6}/config/application.xml | 4 +- .../{t1 => t6}/config/cachememcached.xml | 2 +- .../{t1 => t6}/config/cachememory.xml | 2 +- .../{t1 => t6}/config/cacheredis.xml | 2 +- frameworks/C++/ffead-cpp/t6/config/sdorm.xml | 17 + .../C++/ffead-cpp/t6/include/TeBkUmFpg.h | 228 ++++++ .../C++/ffead-cpp/{t1 => t6}/meson.build | 4 +- frameworks/C++/ffead-cpp/t6/sconscript | 29 + frameworks/C++/ffead-cpp/t6/src/TeBkUmFpg.cpp | 602 ++++++++++++++ .../{t2 => t6}/src/autotools/Makefile.am | 8 +- frameworks/C++/ffead-cpp/t6/tpe/fortunes.tpe | 13 + frameworks/C++/ffead-cpp/{t1 => t6}/xmake.lua | 4 +- frameworks/C++/ffead-cpp/t7/CMakeLists.txt | 14 + .../{t1 => t7}/config/application.xml | 4 +- .../{t2 => t7}/config/cachememory.xml | 2 +- .../C++/ffead-cpp/{t5 => t7}/config/sdorm.xml | 2 + .../C++/ffead-cpp/t7/include/TeBkUmFpgAsync.h | 233 ++++++ .../C++/ffead-cpp/{t5 => t7}/meson.build | 4 +- frameworks/C++/ffead-cpp/t7/sconscript | 29 + .../C++/ffead-cpp/t7/src/TeBkUmFpgAsync.cpp | 664 ++++++++++++++++ .../{t5 => t7}/src/autotools/Makefile.am | 8 +- frameworks/C++/ffead-cpp/t7/tpe/fortunes.tpe | 13 + frameworks/C++/ffead-cpp/{t2 => t7}/xmake.lua | 4 +- 169 files changed, 2975 insertions(+), 7008 deletions(-) delete mode 100644 frameworks/C++/ffead-cpp/benchmark_config_c1.json delete mode 100644 frameworks/C++/ffead-cpp/benchmark_config_c2.json delete mode 100644 frameworks/C++/ffead-cpp/benchmark_config_c3.json delete mode 100644 frameworks/C++/ffead-cpp/benchmark_config_orig.json delete mode 100644 frameworks/C++/ffead-cpp/config.toml delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-apache.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-cinatra.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-crystal-h2o.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-crystal-http.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-deps.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-drogon.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-go-fasthttp.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-go-gnet.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-h2o.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-java-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-java-firenio.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-java-rapidoid.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-java-wizzardo-http.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-julia-http.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-libreactor.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-lithium.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-mongo-raw.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-nginx.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p10-b.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p10.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p2-b.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p2.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p3-b.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p3.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p4-b.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-p4.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-async.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-pipelined-async.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-pool-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-twoconn-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-m.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled-m.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled-m.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-clibpqb-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-pool-profiled-m.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-clibpqb-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire-async.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-rust-actix.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-rust-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-rust-hyper.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-rust-thruster.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-seastar-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-seastar.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-pool-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-clibpqb-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-swift-nio.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-base-debug.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-async.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-pipelined-async.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire-async.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire.dockerfile create mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled-base.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-picov.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp-v-vweb.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/ffead-cpp.dockerfile delete mode 100644 frameworks/C++/ffead-cpp/install-mimalloc-snmalloc.sh delete mode 100644 frameworks/C++/ffead-cpp/install_ffead-cpp-backends.sh delete mode 100644 frameworks/C++/ffead-cpp/install_ffead-cpp-httpd.sh delete mode 100644 frameworks/C++/ffead-cpp/install_ffead-cpp-nginx.sh create mode 100644 frameworks/C++/ffead-cpp/install_post_process.sh delete mode 100644 frameworks/C++/ffead-cpp/sql-async-profiled-install-clang-dbg.sh delete mode 100644 frameworks/C++/ffead-cpp/sql-async-profiled-install-clang.sh delete mode 100644 frameworks/C++/ffead-cpp/sql-profiled-install-clang.sh delete mode 100644 frameworks/C++/ffead-cpp/t1/CMakeLists.txt delete mode 100644 frameworks/C++/ffead-cpp/t1/config/sdormmongo.xml delete mode 100644 frameworks/C++/ffead-cpp/t1/config/sdormmysql.xml delete mode 100644 frameworks/C++/ffead-cpp/t1/config/sdormpostgresql.xml delete mode 100644 frameworks/C++/ffead-cpp/t1/include/TeBkUm.h delete mode 100644 frameworks/C++/ffead-cpp/t1/include/TeBkUmWorld.h delete mode 100644 frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.cpp delete mode 100644 frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.h delete mode 100644 frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.cpp delete mode 100644 frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.h delete mode 100644 frameworks/C++/ffead-cpp/t1/src/TeBkUm.cpp delete mode 100644 frameworks/C++/ffead-cpp/t1/src/TeBkUmWorld.cpp delete mode 100644 frameworks/C++/ffead-cpp/t1/src/autotools/Makefile.am delete mode 100644 frameworks/C++/ffead-cpp/t1/tpe/fortunes.tpe delete mode 100644 frameworks/C++/ffead-cpp/t2/CMakeLists.txt delete mode 100644 frameworks/C++/ffead-cpp/t2/config/cachememcached.xml delete mode 100644 frameworks/C++/ffead-cpp/t2/config/cacheredis.xml delete mode 100644 frameworks/C++/ffead-cpp/t2/config/sdorm.xml delete mode 100644 frameworks/C++/ffead-cpp/t2/include/TeBkUmMgr.h delete mode 100644 frameworks/C++/ffead-cpp/t2/meson.build delete mode 100644 frameworks/C++/ffead-cpp/t2/src/TeBkUmMgr.cpp delete mode 100644 frameworks/C++/ffead-cpp/t2/tpe/fortunes.tpe create mode 100644 frameworks/C++/ffead-cpp/t3/sconscript create mode 100644 frameworks/C++/ffead-cpp/t4/sconscript delete mode 100644 frameworks/C++/ffead-cpp/t5/CMakeLists.txt delete mode 100644 frameworks/C++/ffead-cpp/t5/config/application.xml delete mode 100644 frameworks/C++/ffead-cpp/t5/include/TeBkUmLpqQwAsync.h delete mode 100644 frameworks/C++/ffead-cpp/t5/src/TeBkUmLpqQwAsync.cpp delete mode 100644 frameworks/C++/ffead-cpp/t5/tpe/fortunes.tpe delete mode 100644 frameworks/C++/ffead-cpp/t5/xmake.lua create mode 100644 frameworks/C++/ffead-cpp/t6/CMakeLists.txt rename frameworks/C++/ffead-cpp/{t2 => t6}/config/application.xml (89%) rename frameworks/C++/ffead-cpp/{t1 => t6}/config/cachememcached.xml (88%) rename frameworks/C++/ffead-cpp/{t1 => t6}/config/cachememory.xml (69%) rename frameworks/C++/ffead-cpp/{t1 => t6}/config/cacheredis.xml (88%) create mode 100644 frameworks/C++/ffead-cpp/t6/config/sdorm.xml create mode 100644 frameworks/C++/ffead-cpp/t6/include/TeBkUmFpg.h rename frameworks/C++/ffead-cpp/{t1 => t6}/meson.build (89%) create mode 100644 frameworks/C++/ffead-cpp/t6/sconscript create mode 100644 frameworks/C++/ffead-cpp/t6/src/TeBkUmFpg.cpp rename frameworks/C++/ffead-cpp/{t2 => t6}/src/autotools/Makefile.am (67%) create mode 100644 frameworks/C++/ffead-cpp/t6/tpe/fortunes.tpe rename frameworks/C++/ffead-cpp/{t1 => t6}/xmake.lua (76%) create mode 100644 frameworks/C++/ffead-cpp/t7/CMakeLists.txt rename frameworks/C++/ffead-cpp/{t1 => t7}/config/application.xml (87%) rename frameworks/C++/ffead-cpp/{t2 => t7}/config/cachememory.xml (67%) rename frameworks/C++/ffead-cpp/{t5 => t7}/config/sdorm.xml (87%) create mode 100644 frameworks/C++/ffead-cpp/t7/include/TeBkUmFpgAsync.h rename frameworks/C++/ffead-cpp/{t5 => t7}/meson.build (89%) create mode 100644 frameworks/C++/ffead-cpp/t7/sconscript create mode 100644 frameworks/C++/ffead-cpp/t7/src/TeBkUmFpgAsync.cpp rename frameworks/C++/ffead-cpp/{t5 => t7}/src/autotools/Makefile.am (66%) create mode 100644 frameworks/C++/ffead-cpp/t7/tpe/fortunes.tpe rename frameworks/C++/ffead-cpp/{t2 => t7}/xmake.lua (76%) diff --git a/frameworks/C++/ffead-cpp/benchmark_config.json b/frameworks/C++/ffead-cpp/benchmark_config.json index 6ab98997f9d..1793d31baeb 100644 --- a/frameworks/C++/ffead-cpp/benchmark_config.json +++ b/frameworks/C++/ffead-cpp/benchmark_config.json @@ -1,35 +1,11 @@ { "framework": "ffead-cpp", "tests": [{ - "default": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "db_url": "/t1/d", - "query_url": "/t1/quer?queries=", - "fortune_url": "/t1/fortu", - "update_url": "/t1/updt?queries=", - "cached_query_url": "/t1/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "mongodb", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Full", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-mongo", - "notes": "mongodb redis", - "versus": "", - "tags": ["broken"] - }, - "v-picov": { + "v-picov-postgresql": { "json_url": "/t3/j", "plaintext_url": "/plaintext", "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", + "query_url": "/t3/quem?queries=", "fortune_url": "/t3/fortu", "update_url": "/t3/updt?queries=", "cached_query_url": "/t3/cached-wld?count=", @@ -44,16 +20,14 @@ "webserver": "picov", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [v]", - "notes": "", + "display_name": "ffead-cpp [v-picov-pg-sync]", + "notes": "picov sync", "versus": "", "tags": [] }, - "v-picov-raw-profiled": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", + "postgresql": { "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", + "query_url": "/t3/quem?queries=", "fortune_url": "/t3/fortu", "update_url": "/t3/updt?queries=", "cached_query_url": "/t3/cached-wld?count=", @@ -65,22 +39,19 @@ "language": "C++", "orm": "Raw", "platform": "None", - "webserver": "picov", + "webserver": "ffead-cpp", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [v-prof]", - "notes": "", + "display_name": "ffead-cpp [pg-sync]", + "notes": "sync", "versus": "", "tags": [] }, - "v-picov-raw-clibpqb-profiled": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "cached_query_url": "/t3/cached-wld?count=", + "v-picov-postgresql-wire": { + "db_url": "/t6/d", + "query_url": "/t6/quem?queries=", + "fortune_url": "/t6/fortu", + "update_url": "/t6/updm?queries=", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -92,37 +63,16 @@ "webserver": "picov", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [v-prof-b]", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "postgresql-raw-profiled": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-prof]", - "notes": "memory profiled", + "display_name": "ffead-cpp [v-picov-pg-wire]", + "notes": "picov sync wire", "versus": "", "tags": [] }, - "postgresql-raw-clibpqb-profiled": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", + "postgresql-wire": { + "db_url": "/t6/d", + "query_url": "/t6/quem?queries=", + "fortune_url": "/t6/fortu", + "update_url": "/t6/updm?queries=", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -134,12 +84,13 @@ "webserver": "ffead-cpp", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-prof-b]", - "notes": "memory libpq batch patch profiled", - "versus": "", - "tags": ["broken"] + "display_name": "ffead-cpp [pg-wire]", + "notes": "sync wire", + "versus": "" }, - "postgresql-raw-async-profiled": { + "v-picov-postgresql-async": { + "json_url": "/t4/j", + "plaintext_url": "/t4/plaint", "db_url": "/t4/d", "query_url": "/t4/quer?queries=", "fortune_url": "/t4/fortu", @@ -152,19 +103,20 @@ "language": "C++", "orm": "Raw", "platform": "None", - "webserver": "ffead-cpp", + "webserver": "picov", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-prof]", - "notes": "async memory profiled", + "display_name": "ffead-cpp [v-picov-pg-async]", + "notes": "picov async", "versus": "", "tags": [] }, - "postgresql-raw-async-pool-profiled": { + "postgresql-async": { "db_url": "/t4/d", "query_url": "/t4/quer?queries=", "fortune_url": "/t4/fortu", "update_url": "/t4/updt?queries=", + "cached_query_url": "/t4/cached-wld?count=", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -176,31 +128,11 @@ "webserver": "ffead-cpp", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-prof-pool]", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-pool-profiled-m": { - "query_url": "/t4/quem?queries=", - "update_url": "/t4/updm?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-prof-pool-m]", - "notes": "async memory profiled", - "versus": "", - "tags": [] + "display_name": "ffead-cpp [pg-async]", + "notes": "async", + "versus": "" }, - "postgresql-raw-async-clibpqb-profiled": { + "v-picov-postgresql-pipelined-async": { "db_url": "/t4/d", "query_url": "/t4/quer?queries=", "fortune_url": "/t4/fortu", @@ -213,15 +145,15 @@ "language": "C++", "orm": "Raw", "platform": "None", - "webserver": "ffead-cpp", + "webserver": "picov", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-prof-b]", - "notes": "async memory libpq batch patch profiled", + "display_name": "ffead-cpp [v-picov-pg-async-pipe]", + "notes": "picov async pipelined", "versus": "", - "tags": ["broken"] + "tags": [] }, - "postgresql-raw-async-clibpqb-pool-profiled": { + "postgresql-pipelined-async": { "db_url": "/t4/d", "query_url": "/t4/quer?queries=", "fortune_url": "/t4/fortu", @@ -237,16 +169,15 @@ "webserver": "ffead-cpp", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-prof-b-pool]", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": ["broken"] + "display_name": "ffead-cpp [pg-async-pipe]", + "notes": "async pipelined", + "versus": "" }, - "postgresql-raw-async-qw-profiled": { - "db_url": "/t5/d", - "query_url": "/t5/quer?queries=", - "fortune_url": "/t5/fortu", - "update_url": "/t5/updt?queries=", + "v-picov-postgresql-wire-async": { + "db_url": "/t7/d", + "query_url": "/t7/quer?queries=", + "fortune_url": "/t7/fortu", + "update_url": "/t7/updt?queries=", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -255,38 +186,19 @@ "language": "C++", "orm": "Raw", "platform": "None", - "webserver": "ffead-cpp", + "webserver": "picov", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-qw-prof]", - "notes": "async memory profiled", + "display_name": "ffead-cpp [v-picov-pg-wire-async]", + "notes": "picov async wire", "versus": "", "tags": [] }, - "postgresql-raw-async-qw-clibpqb-profiled": { - "db_url": "/t5/d", - "query_url": "/t5/quer?queries=", - "fortune_url": "/t5/fortu", - "update_url": "/t5/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-qw-prof-b]", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": ["broken"] - }, - "postgresql-raw-async-qw-pool-profiled-m": { - "query_url": "/t5/quem?queries=", - "update_url": "/t5/updm?queries=", + "postgresql-wire-async": { + "db_url": "/t7/d", + "query_url": "/t7/quer?queries=", + "fortune_url": "/t7/fortu", + "update_url": "/t7/updt?queries=", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -298,10 +210,9 @@ "webserver": "ffead-cpp", "os": "Linux", "database_os": "Linux", - "display_name": "ffead-cpp [pg-raw-async-qw-prof-pool-m]", - "notes": "async memory profiled", - "versus": "", - "tags": [] + "display_name": "ffead-cpp [pg-wire-async]", + "notes": "async wire", + "versus": "" } }] -} +} \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/benchmark_config_c1.json b/frameworks/C++/ffead-cpp/benchmark_config_c1.json deleted file mode 100644 index 595e6ecffb2..00000000000 --- a/frameworks/C++/ffead-cpp/benchmark_config_c1.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "framework": "ffead-cpp", - "tests": [{ - "v-picov": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "picov", - "os": "Linux", - "database_os": "Linux", - "display_name": "v", - "notes": "", - "versus": "", - "tags": [] - }, - "v-picov-raw-profiled": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "picov", - "os": "Linux", - "database_os": "Linux", - "display_name": "v-prof", - "notes": "", - "versus": "", - "tags": [] - }, - "v-picov-raw-clibpqb-profiled": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "picov", - "os": "Linux", - "database_os": "Linux", - "display_name": "v-prof-b", - "notes": "", - "versus": "", - "tags": [] - }, - "postgresql-raw": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw", - "notes": "memory", - "versus": "", - "tags": [] - }, - "postgresql-raw-profiled": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-prof", - "notes": "memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-clibpqb-profiled": { - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-prof-b", - "notes": "memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async", - "notes": "async memory", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-profiled": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-pool-profiled": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof-pool", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-clibpqb-profiled": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof-b", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-clibpqb-pool-profiled": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof-b-pool", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - } - }] -} \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/benchmark_config_c2.json b/frameworks/C++/ffead-cpp/benchmark_config_c2.json deleted file mode 100644 index 99f25d04e04..00000000000 --- a/frameworks/C++/ffead-cpp/benchmark_config_c2.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "framework": "ffead-cpp", - "tests": [{ - "postgresql-raw-async": { - "query_url": "/t4/quer?queries=", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async", - "notes": "async memory", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-profiled": { - "query_url": "/t4/quer?queries=", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-pool-profiled": { - "query_url": "/t4/quer?queries=", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-pool-prof", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-m": { - "query_url": "/t4/quem?queries=", - "update_url": "/t4/updm?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-m", - "notes": "async memory", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-profiled-m": { - "query_url": "/t4/quem?queries=", - "update_url": "/t4/updm?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof-m", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-pool-profiled-m": { - "query_url": "/t4/quem?queries=", - "update_url": "/t4/updm?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-pool-prof-m", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-clibpqb-profiled": { - "query_url": "/t4/quer?queries=", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof-b", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-clibpqb-pool-profiled": { - "query_url": "/t4/quer?queries=", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "pg-raw-async-prof-b-pool", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - } - }] -} \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/benchmark_config_c3.json b/frameworks/C++/ffead-cpp/benchmark_config_c3.json deleted file mode 100644 index 13b2f5ac25e..00000000000 --- a/frameworks/C++/ffead-cpp/benchmark_config_c3.json +++ /dev/null @@ -1,173 +0,0 @@ -{ - "framework": "ffead-cpp", - "tests": [{ - "p2": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p2", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "p3": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p3", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "p4": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p4", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "p10": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p10", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "p2-b": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p2-b", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "p3-b": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p3-b", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "p4-b": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p4-b", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "p10-b": { - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "p10-b", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - } - }] -} \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/benchmark_config_orig.json b/frameworks/C++/ffead-cpp/benchmark_config_orig.json deleted file mode 100644 index c742c8c1212..00000000000 --- a/frameworks/C++/ffead-cpp/benchmark_config_orig.json +++ /dev/null @@ -1,752 +0,0 @@ -{ - "framework": "ffead-cpp", - "tests": [{ - "default": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "db_url": "/t1/d", - "query_url": "/t1/quer?queries=", - "fortune_url": "/t1/fortu", - "update_url": "/t1/updt?queries=", - "cached_query_url": "/t1/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "mongodb", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Full", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-mongo", - "notes": "mongodb redis", - "versus": "", - "tags": [] - }, - "libreactor": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "libreactor", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-libreactor", - "notes": "", - "versus": "", - "tags": [] - }, - "crystal-http": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "crystal-http", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-crystal-http", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "d-hunt": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "hunt", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-d-hunt", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "go-gnet": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "gnet", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-go-gnet", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "rust-actix": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "actix", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-rust-actix", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "v-picov": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "cached_query_url": "/t3/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "picov", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-v-picov", - "notes": "", - "versus": "", - "tags": [] - }, - "v-picov-raw-profiled": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "cached_query_url": "/t3/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "picov", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-v-picov-raw-profiled", - "notes": "", - "versus": "", - "tags": [] - }, - "v-picov-raw-clibpqb-profiled": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "cached_query_url": "/t3/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "picov", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-v-picov-raw-clibpqb-profiled", - "notes": "", - "versus": "", - "tags": [] - }, - "java-firenio": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "firenio", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-java-firenio", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "postgresql": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "db_url": "/t1/d", - "query_url": "/t1/quer?queries=", - "fortune_url": "/t1/fortu", - "update_url": "/t1/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Full", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-postgresql", - "notes": "", - "versus": "", - "tags": [] - }, - "postgresql-raw": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "cached_query_url": "/t3/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-postgresql-raw", - "notes": "memory", - "versus": "", - "tags": [] - }, - "postgresql-raw-profiled": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "cached_query_url": "/t3/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-postgresql-raw-profiled", - "notes": "memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-clibpqb-profiled": { - "json_url": "/t3/j", - "plaintext_url": "/plaintext", - "db_url": "/t3/d", - "query_url": "/t3/quer?queries=", - "fortune_url": "/t3/fortu", - "update_url": "/t3/updt?queries=", - "cached_query_url": "/t3/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-postgresql-raw-clibpqb-profiled", - "notes": "memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async": { - "json_url": "/t4/j", - "plaintext_url": "/plaintext", - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "cached_query_url": "/t4/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-postgresql-raw-async", - "notes": "async memory", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-profiled": { - "json_url": "/t4/j", - "plaintext_url": "/plaintext", - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "cached_query_url": "/t4/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-postgresql-raw-async-profiled", - "notes": "async memory profiled", - "versus": "", - "tags": [] - }, - "postgresql-raw-async-clibpqb-profiled": { - "json_url": "/t4/j", - "plaintext_url": "/plaintext", - "db_url": "/t4/d", - "query_url": "/t4/quer?queries=", - "fortune_url": "/t4/fortu", - "update_url": "/t4/updt?queries=", - "cached_query_url": "/t4/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-postgresql-raw-async-clibpqb-profiled", - "notes": "async memory libpq batch patch profiled", - "versus": "", - "tags": [] - }, - "nginx": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Full", - "platform": "None", - "webserver": "nginx", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-nginx", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "seastar": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "seastar-http", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-seastar", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "apache": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Full", - "platform": "None", - "webserver": "apache", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-apache", - "notes": "apache mongo", - "versus": "", - "tags": ["broken"] - }, - "mongo-raw": { - "json_url": "/t2/j", - "plaintext_url": "/plaintext", - "db_url": "/t2/d", - "query_url": "/t2/quer?queries=", - "fortune_url": "/t2/fortu", - "update_url": "/t2/updt?queries=", - "cached_query_url": "/t2/cached-wld?count=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "mongodb", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Raw", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-mongo-raw", - "notes": "mongodb raw memory", - "versus": "", - "tags": ["broken"] - }, - "lithium": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "lithium", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-lithium", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "cinatra": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "cinatra", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-cinatra", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "drogon": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "drogon", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-drogon", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "h2o": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "h2o", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-h2o", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "crystal-h2o": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "h2o.cr", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-crystal-h2o", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "mysql": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "db_url": "/t1/d", - "query_url": "/t1/quer?queries=", - "fortune_url": "/t1/fortu", - "update_url": "/t1/updt?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "mysql", - "framework": "ffead-cpp", - "language": "C++", - "orm": "Full", - "platform": "None", - "webserver": "ffead-cpp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-mysql", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "go-fasthttp": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "fasthttp", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-go-fasthttp", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "julia-http": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "julia-http", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-julia-http", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "swift-nio": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "swift-nio", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-swift-nio", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "rust-hyper": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "hyper", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-rust-hyper", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "rust-thruster": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "thruster", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-rust-thruster", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "rust-rocket": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "rocket", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-rust-rocket", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "v-vweb": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "vweb", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-v-vweb", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "java-rapidoid": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "rapidoid", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-java-rapidoid", - "notes": "", - "versus": "", - "tags": ["broken"] - }, - "java-wizzardo-http": { - "json_url": "/t1/j", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "ffead-cpp", - "language": "C++", - "orm": "None", - "platform": "None", - "webserver": "wizzardo-http", - "os": "Linux", - "database_os": "Linux", - "display_name": "ffead-cpp-java-wizzardo-http", - "notes": "", - "versus": "", - "tags": ["broken"] - } - }] -} \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/config.toml b/frameworks/C++/ffead-cpp/config.toml deleted file mode 100644 index 8c3080fc318..00000000000 --- a/frameworks/C++/ffead-cpp/config.toml +++ /dev/null @@ -1,520 +0,0 @@ -[framework] -name = "ffead-cpp" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -urls.db = "/t1/d" -urls.query = "/t1/quer?queries=" -urls.update = "/t1/updt?queries=" -urls.fortune = "/t1/fortu" -approach = "Realistic" -classification = "Fullstack" -database = "mongodb" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[libreactor] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "libreactor" -versus = "" - -[crystal-http] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "crystal-http" -versus = "" - -[d-hunt] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "hunt" -versus = "" - -[go-gnet] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "gnet" -versus = "" - -[rust-actix] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "actix" -versus = "" - -[v-picov] -urls.plaintext = "/plaintext" -urls.json = "/t3/j" -urls.db = "/t3/d" -urls.query = "/t3/quer?queries=" -urls.update = "/t3/updt?queries=" -urls.fortune = "/t3/fortu" -urls.cached_query = "/t3/cached-wld?count=" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "picov" -versus = "" - -[v-picov-raw-profiled] -urls.plaintext = "/plaintext" -urls.json = "/t3/j" -urls.db = "/t3/d" -urls.query = "/t3/quer?queries=" -urls.update = "/t3/updt?queries=" -urls.fortune = "/t3/fortu" -urls.cached_query = "/t3/cached-wld?count=" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "picov" -versus = "" - -[v-picov-raw-clibpqb-profiled] -urls.plaintext = "/plaintext" -urls.json = "/t3/j" -urls.db = "/t3/d" -urls.query = "/t3/quer?queries=" -urls.update = "/t3/updt?queries=" -urls.fortune = "/t3/fortu" -urls.cached_query = "/t3/cached-wld?count=" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "picov" -versus = "" - -[java-firenio] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "firenio" -versus = "" - -[postgresql] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -urls.db = "/t1/d" -urls.query = "/t1/quer?queries=" -urls.update = "/t1/updt?queries=" -urls.fortune = "/t1/fortu" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[postgresql-raw] -urls.plaintext = "/plaintext" -urls.json = "/t3/j" -urls.db = "/t3/d" -urls.query = "/t3/quer?queries=" -urls.update = "/t3/updt?queries=" -urls.fortune = "/t3/fortu" -urls.cached_query = "/t3/cached-wld?count=" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[postgresql-raw-profiled] -urls.db = "/t3/d" -urls.query = "/t3/quer?queries=" -urls.update = "/t3/updt?queries=" -urls.fortune = "/t3/fortu" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[postgresql-raw-clibpqb-profiled] -urls.db = "/t3/d" -urls.query = "/t3/quer?queries=" -urls.update = "/t3/updt?queries=" -urls.fortune = "/t3/fortu" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[postgresql-raw-async] -urls.plaintext = "/plaintext" -urls.json = "/t4/j" -urls.db = "/t4/d" -urls.query = "/t4/quer?queries=" -urls.update = "/t4/bupdt?queries=" -urls.fortune = "/t4/fortu" -urls.cached_query = "/t4/cached-wld?count=" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[postgresql-raw-async-profiled] -urls.db = "/t4/d" -urls.query = "/t4/quer?queries=" -urls.update = "/t4/bupdt?queries=" -urls.fortune = "/t4/fortu" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[postgresql-raw-async-clibpqb-profiled] -urls.db = "/t4/d" -urls.query = "/t4/quer?queries=" -urls.update = "/t4/bupdt?queries=" -urls.fortune = "/t4/fortu" -approach = "Realistic" -classification = "Fullstack" -database = "postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[nginx] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "mongodb" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "None" -webserver = "nginx" -versus = "" - -[seastar] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "mongodb" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "None" -webserver = "seastar-http" -versus = "" - -[apache] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "None" -webserver = "apache" -versus = "" - -[mongo-raw] -urls.plaintext = "/plaintext" -urls.json = "/t2/j" -urls.db = "/t2/d" -urls.query = "/t2/quer?queries=" -urls.update = "/t2/updt?queries=" -urls.fortune = "/t2/fortu" -urls.cached_query = "/t2/cached-wld?count=" -approach = "Realistic" -classification = "Fullstack" -database = "mongodb" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[lithium] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "lithium" -versus = "" - -[cinatra] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "cinatra" -versus = "" - -[drogon] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "drogon" -versus = "" - -[h2o] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "h2o" -versus = "" - -[crystal-h2o] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "h2o.cr" -versus = "" - -[mysql] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -urls.db = "/t1/d" -urls.query = "/t1/quer?queries=" -urls.update = "/t1/updt?queries=" -urls.fortune = "/t1/fortu" -approach = "Realistic" -classification = "Fullstack" -database = "mysql" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "None" -webserver = "ffead-cpp" -versus = "" - -[go-fasthttp] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "fasthttp" -versus = "" - -[julia-http] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "julia-http" -versus = "" - -[swift-nio] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "swift-nio" -versus = "" - -[rust-hyper] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "hyper" -versus = "" - -[rust-thruster] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "thruster" -versus = "" - -[rust-rocket] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "rocket" -versus = "" - -[v-vweb] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "vweb" -versus = "" - -[java-rapidoid] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "rapidoid" -versus = "" - -[java-wizzardo-http] -urls.plaintext = "/plaintext" -urls.json = "/t1/j" -approach = "Realistic" -classification = "Fullstack" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "None" -platform = "None" -webserver = "wizzardo-http" -versus = "" \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-apache.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-apache.dockerfile deleted file mode 100644 index ab328ddba81..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-apache.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 apache mongo diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-base-debug.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-base-debug.dockerfile index 98ac8135ddf..3e574629d27 100644 --- a/frameworks/C++/ffead-cpp/ffead-cpp-base-debug.dockerfile +++ b/frameworks/C++/ffead-cpp/ffead-cpp-base-debug.dockerfile @@ -1,6 +1,6 @@ -FROM sumeetchhetri/ffead-cpp-deps:6.0 +FROM ubuntu:latest LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0-debug" +LABEL version="7.0-debug" LABEL description="Base ffead-cpp docker image with commit id - master" ENV IROOT=/installs @@ -10,18 +10,22 @@ ENV DEBIAN_FRONTEND noninteractive RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections #COPY t1/ /installs/t1/ -#COPY t3/ /installs/t3/ #COPY t2/ /installs/t2/ +#COPY t3/ /installs/t3/ #COPY t4/ /installs/t4/ #COPY t5/ /installs/t5/ +#COPY t6/ /installs/t6/ +#COPY t7/ /installs/t7/ WORKDIR ${IROOT} -COPY install_ffead-cpp-framework.sh install_ffead-cpp-httpd.sh install_ffead-cpp-nginx.sh server.sh ${IROOT}/ +COPY install_ffead-cpp-dependencies.sh install_ffead-cpp-framework.sh install_post_process.sh server.sh ${IROOT}/ RUN chmod 755 ${IROOT}/*.sh -RUN ./install_ffead-cpp-framework.sh && ./install_ffead-cpp-httpd.sh && ./install_ffead-cpp-nginx.sh && cd ${IROOT}/ffead-cpp-src && make clean && rm -rf CMakeFiles +RUN ./install_ffead-cpp-dependencies.sh +RUN ./install_ffead-cpp-framework.sh +RUN ./install_post_process.sh && cd ${IROOT}/ffead-cpp-src && ninja clean && rm -rf CMakeFiles CMakeCache.txt COPY run_ffead.sh / RUN chmod 755 /run_ffead.sh -RUN apt update -yqq && apt install -yqq gdb net-tools vim +RUN apt update -yqq && apt --fix-broken -yqq install && apt install -yqq gdb net-tools vim diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-base.dockerfile index 59fa01d648b..db7e4a60a99 100644 --- a/frameworks/C++/ffead-cpp/ffead-cpp-base.dockerfile +++ b/frameworks/C++/ffead-cpp/ffead-cpp-base.dockerfile @@ -1,6 +1,6 @@ -FROM sumeetchhetri/ffead-cpp-deps:6.0 +FROM ubuntu:latest LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" +LABEL version="7.0" LABEL description="Base ffead-cpp docker image with commit id - master" ENV IROOT=/installs @@ -10,16 +10,20 @@ ENV DEBIAN_FRONTEND noninteractive RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections #COPY t1/ /installs/t1/ -#COPY t3/ /installs/t3/ #COPY t2/ /installs/t2/ +#COPY t3/ /installs/t3/ #COPY t4/ /installs/t4/ #COPY t5/ /installs/t5/ +#COPY t6/ /installs/t6/ +#COPY t7/ /installs/t7/ WORKDIR ${IROOT} -COPY install_ffead-cpp-framework.sh install_ffead-cpp-httpd.sh install_ffead-cpp-nginx.sh server.sh ${IROOT}/ +COPY install_ffead-cpp-dependencies.sh install_ffead-cpp-framework.sh install_post_process.sh server.sh ${IROOT}/ RUN chmod 755 ${IROOT}/*.sh -RUN ./install_ffead-cpp-framework.sh && ./install_ffead-cpp-httpd.sh && ./install_ffead-cpp-nginx.sh && cd ${IROOT}/ffead-cpp-src && make clean && rm -rf CMakeFiles +RUN ./install_ffead-cpp-dependencies.sh +RUN ./install_ffead-cpp-framework.sh +RUN ./install_post_process.sh && cd ${IROOT}/ffead-cpp-src && ninja clean && rm -rf CMakeFiles CMakeCache.txt COPY run_ffead.sh / RUN chmod 755 /run_ffead.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-cinatra.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-cinatra.dockerfile deleted file mode 100644 index ccd26faecf8..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-cinatra.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 cinatra diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-crystal-h2o.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-crystal-h2o.dockerfile deleted file mode 100644 index a8cb9135554..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-crystal-h2o.dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -RUN apt-get update -y && apt-get install -yqq libh2o-evloop-dev libwslay-dev libyaml-0-2 libevent-dev libpcre3-dev \ - gcc wget git libssl-dev libuv1-dev ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/* -RUN wget -q https://github.com/crystal-lang/crystal/releases/download/0.26.1/crystal-0.26.1-1-linux-x86_64.tar.gz \ - && tar --strip-components=1 -xzf crystal-0.26.1-1-linux-x86_64.tar.gz -C /usr/ && rm -f *.tar.gz -WORKDIR ${IROOT}/lang-server-backends/crystal/h2o.cr -RUN shards install && gcc -shared -O3 lib/h2o/src/ext/h2o.c -I/usr/include -fPIC -o h2o.o \ - && CRYSTAL_PATH=lib:/usr/share/crystal/src crystal build --prelude=empty --no-debug --release -Dgc_none -Dfiber_none -Dexcept_none -Dhash_none -Dtime_none -Dregex_none -Dextreme h2o-evloop-ffead-cpp.cr --link-flags="-Wl,-s $PWD/h2o.o -DH2O_USE_LIBUV=0" -o h2o-evloop-ffead-cpp.out \ - && cp h2o-evloop-ffead-cpp.out $IROOT/ && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 crystal-h2o diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-crystal-http.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-crystal-http.dockerfile deleted file mode 100644 index 0872fee1299..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-crystal-http.dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -RUN curl -fsSL https://crystal-lang.org/install.sh | bash && rm -rf /var/lib/apt/lists/* -WORKDIR ${IROOT}/lang-server-backends/crystal/crystal -#COPY crystal-ffead-cpp.cr ${IROOT}/lang-server-backends/crystal/crystal/ -RUN crystal build --release --no-debug crystal-ffead-cpp.cr -o crystal-ffead-cpp.out && cp crystal-ffead-cpp.out $IROOT/ && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 crystal-http diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile deleted file mode 100644 index 9a606e3f0e8..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -ENV DEBIAN_FRONTEND noninteractive -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -ENV LDC_VERSION 1.24.0 -ENV LDC_PATH /usr/local/ldc - -RUN apt-get update && \ - apt-get install -y --no-install-recommends curl wget gcc ca-certificates xz-utils libxml2 make git zlib1g-dev && \ - rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -RUN set -ex && \ - wget -q https://github.com/ldc-developers/ldc/releases/download/v${LDC_VERSION}/ldc2-${LDC_VERSION}-linux-x86_64.tar.xz && \ - tar xf ldc2-${LDC_VERSION}-linux-x86_64.tar.xz && \ - mv ldc2-${LDC_VERSION}-linux-x86_64 ${LDC_PATH} && \ - rm -rf ldc2* - -ENV PATH="${LDC_PATH}/bin:${PATH}" -ENV LIBRARY_PATH="${LDC_PATH}/lib:${LIBRARY_PATH}" -ENV LD_LIBRARY_PATH="${LDC_PATH}/lib:/usr/local/lib:${LD_LIBRARY_PATH}" - -RUN chmod 755 -R $LDC_PATH - -WORKDIR ${IROOT}/lang-server-backends/d/hunt -RUN dub upgrade --verbose && dub build --build=release --arch=x86_64 --compiler=ldc2 -c=minihttp -f && cp hunt-minihttp ${IROOT}/ \ - && chmod +x ${IROOT}/hunt-minihttp && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 d-hunt diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-deps.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-deps.dockerfile deleted file mode 100644 index 9154224ae5d..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-deps.dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM ubuntu:20.04 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="ffead-cpp docker image with backend dependencies" - -ENV IROOT=/installs -ENV DEBUG=off - -ENV DEBIAN_FRONTEND noninteractive -RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - -RUN mkdir /installs - -WORKDIR ${IROOT} - -COPY install_ffead-cpp-dependencies.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/install_ffead-cpp-dependencies.sh -RUN ./install_ffead-cpp-dependencies.sh - -COPY install_ffead-cpp-backends.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/install_ffead-cpp-backends.sh -RUN ./install_ffead-cpp-backends.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-drogon.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-drogon.dockerfile deleted file mode 100644 index 06c6b9077b9..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-drogon.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 drogon diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-go-fasthttp.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-go-fasthttp.dockerfile deleted file mode 100644 index 6595c0cfcc0..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-go-fasthttp.dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -RUN wget -q https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.14.4.linux-amd64.tar.gz -ENV PATH=$PATH:/usr/local/go/bin -WORKDIR ${IROOT}/lang-server-backends/go/fasthttp -RUN make && cp fasthttp-ffead-cpp $IROOT/ && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 go-fasthttp diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-go-gnet.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-go-gnet.dockerfile deleted file mode 100644 index 6c84d28b90d..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-go-gnet.dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -RUN wget -q https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.14.4.linux-amd64.tar.gz -ENV PATH=$PATH:/usr/local/go/bin -WORKDIR ${IROOT}/lang-server-backends/go/gnet -RUN make && cp gnet-ffead-cpp $IROOT/ && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 go-gnet diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-h2o.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-h2o.dockerfile deleted file mode 100644 index b8047f0e770..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-h2o.dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -ENV DEBIAN_FRONTEND noninteractive -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -WORKDIR ${IROOT} -RUN apt-get update -y && apt-get install -y --no-install-recommends autoconf bison cmake curl file flex g++ git libnuma-dev libpq-dev \ - libssl-dev libtool libyajl-dev libz-dev make wget && rm -rf /var/lib/apt/lists/* - -ARG H2O_VERSION=v2.2.6 - -ARG H2O_BUILD_DIR=${IROOT}/h2o-build -ENV H2O_PREFIX /opt/h2o - -RUN mkdir -p "${H2O_BUILD_DIR}/build" && \ - cd "$H2O_BUILD_DIR" && \ - wget -qO - "https://github.com/h2o/h2o/archive/${H2O_VERSION}.tar.gz" | \ - tar xz --strip-components=1 && \ - cd build && \ - cmake -DCMAKE_INSTALL_PREFIX="$H2O_PREFIX" -DCMAKE_C_FLAGS="-flto -march=native" \ - -DCMAKE_AR=/usr/bin/gcc-ar -DCMAKE_RANLIB=/usr/bin/gcc-ranlib .. && \ - make -j "$(nproc)" install && \ - cd ../.. && \ - rm -rf "$H2O_BUILD_DIR" - -WORKDIR ${IROOT}/lang-server-backends/c/h2o -RUN chmod +x h2o.sh -#RUN ./h2o.sh && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 h2o diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-java-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-java-base.dockerfile deleted file mode 100644 index 2fc97ee7e56..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-java-base.dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="Base java docker image with master code" - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -RUN apt update -yqq && apt install -y --no-install-recommends default-jre maven gradle && rm -rf /var/lib/apt/lists/* -RUN cd ${IROOT}/lang-server-backends/java/firenio && mvn compile assembly:single -q && cp target/firenio-ffead-cpp-0.1-jar-with-dependencies.jar $IROOT/ -RUN cd ${IROOT}/lang-server-backends/java/rapidoid && mvn compile assembly:single -q && cp target/rapidoid-ffead-cpp-1.0-jar-with-dependencies.jar $IROOT/ -RUN cd ${IROOT}/lang-server-backends/java/wizzardo-http && gradle --refresh-dependencies clean fatJar -q && cp build/libs/wizzardo-ffead-cpp-all-1.0.jar $IROOT/ -RUN rm -rf ${IROOT}/lang-server-backends diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-java-firenio.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-java-firenio.dockerfile deleted file mode 100644 index f48f9cf06e1..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-java-firenio.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-java-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 java-firenio diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-java-rapidoid.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-java-rapidoid.dockerfile deleted file mode 100644 index 5d139a094da..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-java-rapidoid.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-java-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 java-rapidoid diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-java-wizzardo-http.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-java-wizzardo-http.dockerfile deleted file mode 100644 index b163375f97b..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-java-wizzardo-http.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-java-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 java-wizzardo-http diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-julia-http.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-julia-http.dockerfile deleted file mode 100644 index 816d558db9f..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-julia-http.dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -ENV DEBIAN_FRONTEND noninteractive -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -WORKDIR ${IROOT} -#RUN apt-get update -y && apt-get install -y --no-install-recommends julia -RUN wget --no-check-certificate -q https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.2-linux-x86_64.tar.gz -RUN tar -xzf julia-1.5.2-linux-x86_64.tar.gz -RUN mv julia-1.5.2 /opt/ -RUN rm -f julia-1.5.2-linux-x86_64.tar.gz -ENV PATH="/opt/julia-1.5.2/bin:${PATH}" - -RUN julia -e 'import Pkg; Pkg.update()' && \ - julia -e 'import Pkg; Pkg.add("HTTP")' && \ - julia -e 'import Pkg; Pkg.precompile()' - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 julia-http diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-libreactor.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-libreactor.dockerfile deleted file mode 100644 index 3e673716be2..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-libreactor.dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -WORKDIR ${IROOT} -RUN apt-get update -y && apt-get install -y --no-install-recommends build-essential libjansson-dev wget && rm -rf /var/lib/apt/lists/* -RUN wget -q https://github.com/fredrikwidlund/libdynamic/releases/download/v1.3.0/libdynamic-1.3.0.tar.gz \ - && tar fvxz libdynamic-1.3.0.tar.gz && cd libdynamic-1.3.0 && ./configure --prefix=/usr AR=gcc-ar NM=gcc-nm RANLIB=gcc-ranlib \ - && make install && rm -rf ${IROOT}/libdynamic-1.3.0 && rm -f ${IROOT}/libdynamic-1.3.0.tar.gz && \ - cd /installs && wget -q https://github.com/fredrikwidlund/libreactor/releases/download/v1.0.1/libreactor-1.0.1.tar.gz \ - && tar fvxz libreactor-1.0.1.tar.gz && cd libreactor-1.0.1 && ./configure --prefix=/usr AR=gcc-ar NM=gcc-nm RANLIB=gcc-ranlib \ - && make install && rm -rf ${IROOT}/libreactor-1.0.1 && rm -f ${IROOT}/libreactor-1.0.1.tar.gz - -WORKDIR ${IROOT}/lang-server-backends/c/libreactor -RUN make && cp libreactor-ffead-cpp $IROOT/ && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 libreactor diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-lithium.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-lithium.dockerfile deleted file mode 100644 index 851568e722a..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-lithium.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 lithium diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-mongo-raw.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-mongo-raw.dockerfile deleted file mode 100644 index 40f54d36d0c..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-mongo-raw.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 emb mongo-raw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile deleted file mode 100644 index 06894663fdb..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-mysql.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb mysql diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-nginx.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-nginx.dockerfile deleted file mode 100644 index 538cdc3a7d7..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-nginx.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 nginx mongo diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p10-b.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p10-b.dockerfile deleted file mode 100644 index 61c1b2c85d5..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p10-b.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=10" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=10" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p10.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p10.dockerfile deleted file mode 100644 index c048eb47454..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p10.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=10" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=10" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p2-b.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p2-b.dockerfile deleted file mode 100644 index 102e7cb7e65..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p2-b.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p2.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p2.dockerfile deleted file mode 100644 index b13b3db922f..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p2.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p3-b.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p3-b.dockerfile deleted file mode 100644 index 6cd23c2aff6..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p3-b.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=3" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=3" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p3.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p3.dockerfile deleted file mode 100644 index d0d00147e9b..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p3.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=3" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=3" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p4-b.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p4-b.dockerfile deleted file mode 100644 index e48281a19ed..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p4-b.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=4" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=4" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-p4.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-p4.dockerfile deleted file mode 100644 index be5e4c20121..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-p4.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=4" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=4" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-async.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-async.dockerfile new file mode 100644 index 00000000000..1582cc6b6b2 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-async.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql emb postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-pipelined-async.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-pipelined-async.dockerfile new file mode 100644 index 00000000000..d91123ccb99 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-pipelined-async.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql emb postgresql-raw-async memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-pool-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-pool-profiled.dockerfile deleted file mode 100644 index 3ceaeada632..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-pool-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-profiled.dockerfile deleted file mode 100644 index 9374d4f6192..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-twoconn-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-twoconn-profiled.dockerfile deleted file mode 100644 index b896f1f0c0b..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-twoconn-profiled.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/application.xml -RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/t4/config/app.prop -RUN sed -i 's|router="TeBkUmLpqQwAsyncRouter"|router="TeBkUmLpqQwAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/application.xml -RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/t5/config/app.prop - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-m.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-m.dockerfile deleted file mode 100644 index 6c7698853ed..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-m.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled-m.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled-m.dockerfile deleted file mode 100644 index 42fc768bac1..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled-m.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled.dockerfile deleted file mode 100644 index 42fc768bac1..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled-m.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled-m.dockerfile deleted file mode 100644 index 121a6bd8c3e..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled-m.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled.dockerfile deleted file mode 100644 index 121a6bd8c3e..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-clibpqb-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-clibpqb-profiled.dockerfile deleted file mode 100644 index 55fa0a0a4f2..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-clibpqb-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async-qw memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-pool-profiled-m.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-pool-profiled-m.dockerfile deleted file mode 100644 index 1c81c0d9e67..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-pool-profiled-m.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async-qw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-profiled.dockerfile deleted file mode 100644 index fc1de0736d1..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-qw-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-async-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async-qw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async.dockerfile deleted file mode 100644 index 6c7698853ed..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-clibpqb-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-clibpqb-profiled.dockerfile deleted file mode 100644 index 2e0021a921e..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-clibpqb-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-clibpqb-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-profiled.dockerfile deleted file mode 100644 index 477dce0c9e7..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-sql-raw-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw.dockerfile deleted file mode 100644 index 80116b803cd..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire-async.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire-async.dockerfile new file mode 100644 index 00000000000..756b456e465 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire-async.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql emb postgresql-wire-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire.dockerfile new file mode 100644 index 00000000000..f08edaa45a2 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql-wire.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql emb postgresql-wire memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile index 408d924d160..a15b8e62301 100644 --- a/frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile +++ b/frameworks/C++/ffead-cpp/ffead-cpp-postgresql.dockerfile @@ -1,7 +1,7 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 +FROM sumeetchhetri/ffead-cpp-base:7.0-te ENV IROOT=/installs WORKDIR / -CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql redis +CMD ./run_ffead.sh ffead-cpp-7.0-sql emb postgresql-raw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-rust-actix.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-rust-actix.dockerfile deleted file mode 100644 index dd166fa5476..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-rust-actix.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-rust-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 rust-actix diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-rust-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-rust-base.dockerfile deleted file mode 100644 index 176aa8a127e..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-rust-base.dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="Base rust docker image with ffead-cpp v4.0 - commit id - master" - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -RUN cd ${IROOT}/lang-server-backends/rust/actix-ffead-cpp && RUSTFLAGS="-C target-cpu=native" cargo build --release && cp target/release/actix-ffead-cpp $IROOT/ && rm -rf target && \ - cd ${IROOT}/lang-server-backends/rust/hyper-ffead-cpp && RUSTFLAGS="-C target-cpu=native" cargo build --release && cp target/release/hyper-ffead-cpp $IROOT/ && rm -rf target && \ - cd ${IROOT}/lang-server-backends/rust/thruster-ffead-cpp && RUSTFLAGS="-C target-cpu=native" cargo build --release && cp target/release/thruster-ffead-cpp $IROOT/ && rm -rf target && \ - rm -rf ${IROOT}/lang-server-backends && rm -rf /root/.rustup /root/.cargo diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-rust-hyper.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-rust-hyper.dockerfile deleted file mode 100644 index b7d777f909a..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-rust-hyper.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-rust-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 rust-hyper diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket-base.dockerfile deleted file mode 100644 index 3954d55e015..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket-base.dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="Base rust rocket docker image with ffead-cpp v6.0 - commit id - master" - -ENV IROOT=/installs - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -WORKDIR ${IROOT}/lang-server-backends/rust/rocket-ffead-cpp/ -ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustup default nightly && cargo update && cargo build --release && cp target/release/rocket-ffead-cpp $IROOT/ && rm -rf ${IROOT}/lang-server-backends diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket.dockerfile deleted file mode 100644 index a8afa36bd3c..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-rust-rocket-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 rust-rocket diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-rust-thruster.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-rust-thruster.dockerfile deleted file mode 100644 index 5c12723cb60..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-rust-thruster.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-rust-base:latest - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 rust-thruster diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-seastar-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-seastar-base.dockerfile deleted file mode 100644 index eae969b7a60..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-seastar-base.dockerfile +++ /dev/null @@ -1,60 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -#seastar needs ubuntu 20 and boost >= 1.66 -WORKDIR ${IROOT} - -ENV DEBIAN_FRONTEND noninteractive - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libt1.so /usr/local/lib/libt1.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libt3.so /usr/local/lib/libt3.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libt2.so /usr/local/lib/libt2.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libt4.so /usr/local/lib/libt4.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libt5.so /usr/local/lib/libt5.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -ENV FFEAD_CPP_PATH=${IROOT}/ffead-cpp-6.0 -ENV LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/lib:$LD_LIBRARY_PATH - -#seastar need hwloc 2 -RUN cd /tmp && wget -q https://github.com/open-mpi/hwloc/releases/download/hwloc-2.1.0/hwloc-2.1.0.tar.gz && \ - tar xvf hwloc-2.1.0.tar.gz && cd hwloc-2.1.0 && ./configure --prefix=/usr/local/ && make install -RUN rm -rf /tmp/hwloc-2.1.0 - -RUN apt update -y && apt install -y pkg-config liblzma-dev libunistring-dev libudev-dev bridge-utils \ - net-tools iproute2 kmod sudo qemu-kvm libvirt-clients libvirt-daemon-system - -RUN sudo adduser $(whoami) libvirt -RUN sudo adduser $(whoami) kvm -RUN sudo adduser $(whoami) libvirt-qemu -RUN sudo adduser $(whoami) libvirt-dnsmasq -#RUN sudo chown $(whoami) /dev/kvm -#RUN sudo chmod 777 /dev/kvm - -#seastar needs gcc-10 -RUN git clone https://github.com/sumeetchhetri/seastar && cd seastar && git checkout for_ffead -RUN cd seastar && chmod +x *.sh && apt update -y && ./install-dependencies.sh && apt remove -y libfmt-dev && \ - ./configure.py --mode=release --cook fmt && ./configure.py --mode=release --prefix=/usr/local -RUN cd seastar && ninja -C build/release install && cp build/release/_cooking/installed/lib/libfmt.a /usr/local/lib/ && \ - cp -rf build/release/_cooking/installed/include/fmt /usr/local/include/ && cp apps/lib/stop_signal.hh /${IROOT}/lang-server-backends/c++/seastar && \ - cd ${IROOT} && rm -rf ${IROOT}/seastar && mkdir -p ${IROOT}/seastar/build/release/_cooking/installed/lib/ && \ - cp /usr/local/lib/libfmt.a ${IROOT}/seastar/build/release/_cooking/installed/lib/ - -WORKDIR ${IROOT}/lang-server-backends/c++/seastar - -#RUN g++ -g SeastarFfeadCpp.cpp -I/home/mavuser/ffead-cpp-6.0/include/ -I/usr/include/libmongoc-1.0 \ -# -I/usr/include/libbson-1.0 -I. -I/usr/local/include $(pkg-config --libs --cflags --static seastar) -lffead-framework \ -# -lffead-modules -o ffead-cpp-seastar - -RUN g++ SeastarFfeadCpp.cpp -O3 -I. $(pkg-config --libs --cflags --static seastar) -lffead-framework -o ffead-cpp-seastar - -RUN chmod +x run.sh - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 seastar - diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-seastar.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-seastar.dockerfile deleted file mode 100644 index 7b60874ce4f..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-seastar.dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-seastar:6.0 - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 seastar diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base.dockerfile deleted file mode 100644 index 7f3cf59bd6e..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base.dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh batch clang async pool - -COPY sql-async-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-async-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-async-profiled-install-clang.sh batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-profiled-base.dockerfile deleted file mode 100644 index 38c674d7d35..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-profiled-base.dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh batch clang async - -COPY sql-async-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-async-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-async-profiled-install-clang.sh batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-pool-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-pool-profiled-base.dockerfile deleted file mode 100644 index 12ca1856a56..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-pool-profiled-base.dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh nobatch noclang async pool - -COPY sql-async-profiled-install.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-async-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-async-profiled-install.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-profiled-base.dockerfile deleted file mode 100644 index ac0b19e9cf7..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-profiled-base.dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh nobatch noclang async - -COPY sql-async-profiled-install.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-async-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-async-profiled-install.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-clibpqb-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-clibpqb-profiled-base.dockerfile deleted file mode 100644 index 95521f8aeb3..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-clibpqb-profiled-base.dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh batch clang noasync - -COPY sql-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-profiled-install-clang.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-profiled-base.dockerfile deleted file mode 100644 index 384f1defd39..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-profiled-base.dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh nobatch noclang noasync - -COPY sql-profiled-install.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-profiled-install.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-swift-nio.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-swift-nio.dockerfile deleted file mode 100644 index b1916e4eefe..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-swift-nio.dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -ENV DEBIAN_FRONTEND noninteractive -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ - ldconfig - -WORKDIR ${IROOT} -RUN apt-get update -y && apt-get install -y --no-install-recommends clang libicu-dev libpython2.7-dev libtinfo5 libncurses5 libz3-dev \ - && rm -rf /var/lib/apt/lists/* - -RUN wget -q https://swift.org/builds/swift-6.0-release/ubuntu2004/swift-6.0-RELEASE/swift-6.0-RELEASE-ubuntu20.04.tar.gz -RUN tar -xzf swift-6.0-RELEASE-ubuntu20.04.tar.gz -RUN mv swift-6.0-RELEASE-ubuntu20.04 /opt/ && rm -f swift-6.0-RELEASE-ubuntu20.04.tar.gz -RUN ln -s /opt/swift-6.0-RELEASE-ubuntu20.04 /opt/swift - -ENV PATH=/opt/swift/usr/bin:${PATH} - -WORKDIR ${IROOT}/lang-server-backends/swift/swift-nio/app -RUN swift build --enable-test-discovery -c release -Xlinker "-L/usr/local/lib" -Xlinker "-lffead-framework" \ - && mv .build/release/app ${IROOT}/ && chmod +x ${IROOT}/app && rm -rf ${IROOT}/lang-server-backends - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 swift-nio diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-base-debug.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-base-debug.dockerfile new file mode 100644 index 00000000000..93dcea01656 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-v-base-debug.dockerfile @@ -0,0 +1,29 @@ +FROM sumeetchhetri/ffead-cpp-base:7.0-te-debug +LABEL maintainer="Sumeet Chhetri" +LABEL version="7.0-debug" +LABEL description="Base v docker image with ffead-cpp v7.0 commit id - master" + +ENV IROOT=/installs + +RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libt3* /usr/local/lib/libt4* /usr/local/lib/libt6* /usr/local/lib/libt7* \ + /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libinter.so /usr/local/lib/libinter.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libdinter.so /usr/local/lib/libdinter.so && \ + ldconfig + +RUN apt update -yqq && apt -yqq --fix-broken install && apt install -y git make && rm -rf /var/lib/apt/lists/* +#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlang has slowed down tremendously +#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink + +#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic +RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cp ${IROOT}/lang-server-backends/v/pico.v/picoev.v v/vlib/picoev/picoev.v && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip + +WORKDIR ${IROOT}/lang-server-backends/v/vweb +#COPY vweb.v ${IROOT}/lang-server-backends/v/vweb/ +#RUN chmod +x *.sh && ./build.sh && cp vweb $IROOT/ + +WORKDIR ${IROOT}/lang-server-backends/v/pico.v +#COPY main.v ${IROOT}/lang-server-backends/v/pico.v/ +RUN chmod +x *.sh && ./build-debug.sh && cp main $IROOT/main && cp main $IROOT/main_async diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-base.dockerfile index c1666a4dd30..d156d08bda4 100644 --- a/frameworks/C++/ffead-cpp/ffead-cpp-v-base.dockerfile +++ b/frameworks/C++/ffead-cpp/ffead-cpp-v-base.dockerfile @@ -1,24 +1,24 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 +FROM sumeetchhetri/ffead-cpp-base:7.0-te LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="Base v docker image with ffead-cpp v4.0 commit id - master" +LABEL version="7.0" +LABEL description="Base v docker image with ffead-cpp v7.0 commit id - master" ENV IROOT=/installs -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libt3.so /usr/local/lib/libt3.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \ +RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libt3* /usr/local/lib/libt4* /usr/local/lib/libt6* /usr/local/lib/libt7* \ + /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libinter.so /usr/local/lib/libinter.so && \ + ln -s ${IROOT}/ffead-cpp-7.0-sql/lib/libdinter.so /usr/local/lib/libdinter.so && \ ldconfig -RUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/* -#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlnag has slowed down tremendously +RUN apt update -yqq && apt -yqq --fix-broken install && apt install -y git make && rm -rf /var/lib/apt/lists/* +#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlang has slowed down tremendously #RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink #For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic -RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip +RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cp ${IROOT}/lang-server-backends/v/pico.v/picoev.v v/vlib/picoev/picoev.v && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip WORKDIR ${IROOT}/lang-server-backends/v/vweb #COPY vweb.v ${IROOT}/lang-server-backends/v/vweb/ @@ -26,4 +26,4 @@ WORKDIR ${IROOT}/lang-server-backends/v/vweb WORKDIR ${IROOT}/lang-server-backends/v/pico.v #COPY main.v ${IROOT}/lang-server-backends/v/pico.v/ -RUN chmod +x *.sh && ./build.sh && cp main $IROOT/ && rm -rf ${IROOT}/lang-server-backends +RUN chmod +x *.sh && ./build.sh && cp main $IROOT/main && cp main $IROOT/main_async diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-async.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-async.dockerfile new file mode 100644 index 00000000000..483af932fdd --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-async.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-v-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql v-picov postgresql-raw-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-pipelined-async.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-pipelined-async.dockerfile new file mode 100644 index 00000000000..3c982efdb96 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-pipelined-async.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-v-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql v-picov postgresql-raw-async memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire-async.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire-async.dockerfile new file mode 100644 index 00000000000..d048772be38 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire-async.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-v-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql v-picov postgresql-wire-async memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire.dockerfile new file mode 100644 index 00000000000..8b674a4a450 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql-wire.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-v-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql v-picov postgresql-wire memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql.dockerfile new file mode 100644 index 00000000000..4087f2cfdb0 --- /dev/null +++ b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-postgresql.dockerfile @@ -0,0 +1,7 @@ +FROM sumeetchhetri/ffead-cpp-v-base:7.0-te + +ENV IROOT=/installs + +WORKDIR / + +CMD ./run_ffead.sh ffead-cpp-7.0-sql v-picov postgresql-raw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled-base.dockerfile deleted file mode 100644 index 9e43f773ea9..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled-base.dockerfile +++ /dev/null @@ -1,106 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -RUN sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' $IROOT/ffead-cpp-src/web/t3/config/application.xml - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh batch clang noasync - -COPY sql-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-profiled-install-clang.sh nocleanup - -RUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/* -#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlang has slowed down tremendously -#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink - -#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic -RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ldconfig - -COPY sql-v-picov-profiled-install.sh install_ffead-cpp-sql-raw-v-picov-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-v-picov-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-v-picov-profiled.sh -RUN ./sql-v-picov-profiled-install.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled.dockerfile deleted file mode 100644 index 277e7c91850..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-v-picov-raw-clibpqb-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql v-picov postgresql-raw memory batch diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled-base.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled-base.dockerfile deleted file mode 100644 index c9e47e8dcab..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled-base.dockerfile +++ /dev/null @@ -1,106 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 -LABEL maintainer="Sumeet Chhetri" -LABEL version="6.0" -LABEL description="SQL Raw Base ffead-cpp docker image with commit id - master" - -WORKDIR /tmp -RUN mkdir postgresql - -COPY postgresql/* /tmp/postgresql/ - -#POSTGRESQL -WORKDIR /tmp/postgresql/ - -# prepare PostgreSQL APT repository -RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release - -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list - -ENV PG_VERSION 13 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV DEBIAN_FRONTEND noninteractive - -# install postgresql on database machine -RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 && rm -rf /var/lib/apt/lists/* - -# Make sure all the configuration files in main belong to postgres -RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf -RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf - -RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main - -RUN mkdir /ssd -RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql -RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql -RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf - -RUN chown -Rf postgres:postgres /var/run/postgresql -RUN chmod 2777 /var/run/postgresql -RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf -RUN chown postgres:postgres create-postgres* -RUN chown -Rf postgres:postgres /ssd - -ENV PGDATA=/ssd/postgresql - -USER postgres - -# We have to wait for postgres to start before we can use the cli -RUN service postgresql start && \ - until psql -c "\q"; do sleep 1; done && \ - psql < create-postgres-database.sql && \ - psql -a hello_world < create-postgres.sql && \ - service postgresql stop -#POSTGRESQL - -USER root - -#WRK -WORKDIR /tmp/wrk -RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \ - curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1 -ENV LDFLAGS="-O3 -march=native -flto" -ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS" -RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)" -RUN cp wrk /usr/local/bin - -ENV name name -ENV server_host server_host -ENV levels levels -ENV duration duration -ENV max_concurrency max_concurrency -ENV max_threads max_threads -ENV pipeline pipeline -ENV accept accept -#WRK - -WORKDIR ${IROOT} - -RUN sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' $IROOT/ffead-cpp-src/web/t3/config/application.xml - -COPY sql-profiled-util.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-util.sh -RUN ./sql-profiled-util.sh nobatch noclang noasync - -COPY sql-profiled-install.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh -RUN ./sql-profiled-install.sh nocleanup - -RUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/* -#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlang has slowed down tremendously -#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink - -#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic -RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip - -RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \ - ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \ - ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \ - ldconfig - -COPY sql-v-picov-profiled-install.sh install_ffead-cpp-sql-raw-v-picov-profiled.sh ${IROOT}/ -RUN chmod 755 ${IROOT}/sql-v-picov-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-v-picov-profiled.sh -RUN ./sql-v-picov-profiled-install.sh diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled.dockerfile deleted file mode 100644 index 9db68366eb5..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-v-picov-raw-profiled-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0-sql v-picov postgresql-raw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-picov.dockerfile deleted file mode 100644 index 1286bd5dff4..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-v-picov.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-v-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 v-picov postgresql-raw memory diff --git a/frameworks/C++/ffead-cpp/ffead-cpp-v-vweb.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp-v-vweb.dockerfile deleted file mode 100644 index 8514209f8ed..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp-v-vweb.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-v-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 v-vweb diff --git a/frameworks/C++/ffead-cpp/ffead-cpp.dockerfile b/frameworks/C++/ffead-cpp/ffead-cpp.dockerfile deleted file mode 100644 index a1d1cd9435c..00000000000 --- a/frameworks/C++/ffead-cpp/ffead-cpp.dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM sumeetchhetri/ffead-cpp-base:6.0 - -ENV IROOT=/installs - -WORKDIR / - -CMD ./run_ffead.sh ffead-cpp-6.0 emb mongo redis diff --git a/frameworks/C++/ffead-cpp/install-mimalloc-snmalloc.sh b/frameworks/C++/ffead-cpp/install-mimalloc-snmalloc.sh deleted file mode 100644 index 6cf29b3f509..00000000000 --- a/frameworks/C++/ffead-cpp/install-mimalloc-snmalloc.sh +++ /dev/null @@ -1,19 +0,0 @@ -apt install -y clang-format-9 ninja-build - -wget -q https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz -tar xf mimalloc-2.0.2.tar.gz -cd mimalloc-2.0.2 -mkdir -p out/release -cmake ../.. -DCMAKE_BUILD_TYPE=Release -make && make install -cd $IROOT -rm -rf mimalloc-2.0.2 - -wget -q https://github.com/microsoft/snmalloc/archive/0.5.3.tar.gz -tar xf snmalloc-0.5.3.tar.gz -cd snmalloc-0.5.3 -mkdir build -cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -ninja -cd $IROOT -rm -rf snmalloc-0.5.3 \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/install_ffead-cpp-backends.sh b/frameworks/C++/ffead-cpp/install_ffead-cpp-backends.sh deleted file mode 100644 index b53f7de99d6..00000000000 --- a/frameworks/C++/ffead-cpp/install_ffead-cpp-backends.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash - -cd $IROOT - -CURR_TYPE="lithium" -if [ "$CURR_TYPE" = "lithium" ] -then - SRV_TYPE=SRV_LITHIUM - apt install --no-install-recommends -y libboost-all-dev -fi - -CURR_TYPE="cinatra" -if [ "$CURR_TYPE" = "cinatra" ] -then - cd $IROOT - apt install --no-install-recommends -y libboost-all-dev - SRV_TYPE=SRV_CINATRA - CINATRA_INC="-DCINATRA_INCLUDES=${IROOT}/cinatra/include" - git clone https://github.com/sumeetchhetri/cinatra.git - cd cinatra - rm -rf .git -fi - -CURR_TYPE="drogon" -if [ "$CURR_TYPE" = "drogon" ] -then - cd $IROOT - apt install --no-install-recommends -y libjsoncpp-dev uuid-dev - apt remove -y libsqlite3-dev - SRV_TYPE=SRV_DROGON - git clone --recurse-submodules https://github.com/sumeetchhetri/drogon - cd drogon - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CTL=off -DBUILD_EXAMPLES=off -DBUILD_ORM=off .. - make -j4 install - cd $IROOT - rm -rf drogon -fi - -CURR_TYPE="nghttp2" -if [ "$CURR_TYPE" = "nghttp2" ] -then - apt install --no-install-recommends -y libjansson-dev libc-ares-dev libboost-all-dev - cd $IROOT - wget -q https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.gz - tar xf nghttp2-1.42.0.tar.gz - cd nghttp2-1.42.0 - cmake -DENABLE_ASIO_LIB=on -GNinja . - ninja install - cd $IROOT - rm -rf nghttp2-1.42.0 nghttp2-1.42.0.tar.gz -fi - -CURR_TYPE="mongols" -if [ "$CURR_TYPE" = "mongols" ] -then - cd $IROOT - wget -q https://github.com/webcpp/mongols/archive/release-1.8.4.12.tar.gz - tar xf release-1.8.4.12.tar.gz - cd mongols-release-1.8.4.12/ - make clean && make -j4 && make install && ldconfig - cp -rf inc/mongols/lib/* /usr/local/include/ - cd $IROOT - rm -rf mongols-release-1.8.4.12/ release-1.8.4.12.tar.gz -fi - -CURR_TYPE="uv-cpp" -if [ "$CURR_TYPE" = "uv-cpp" ] -then - apt install --no-install-recommends -y libuv1-dev - cd $IROOT - git clone https://github.com/sumeetchhetri/uv-cpp - cd uv-cpp - cmake . - make -j4 install - cd $IROOT - rm -rf uv-cpp -fi - -CURR_TYPE="CppServer" -if [ "$CURR_TYPE" = "CppServer" ] -then - apt install --no-install-recommends -y python3 python3-pip - pip3 install gil - cd $IROOT - git clone https://github.com/chronoxor/CppServer - cd CppServer - gil update - #cd $IROOT/CppServer/modules/CppCommon/modules/fmt && git checkout b9ab5c8836bbffbe0a877f64d6faef8fbf4fd394 -b works - cd $IROOT/CppServer/build - ./unix.sh - cp $IROOT/CppServer/bin/libcppserver.a /usr/local/lib/ - cp -rf $IROOT/CppServer/modules/asio/asio/include/* /usr/local/include/ - cp -rf $IROOT/CppServer/modules/CppCommon/include/* /usr/local/include/ - cp -rf $IROOT/CppServer/include/* /usr/local/include/ - cp $IROOT/CppServer/temp/modules/libasio.a /usr/local/lib/ - cp $IROOT/CppServer/temp/modules/CppCommon/libcppcommon.a /usr/local/lib/ - cp $IROOT/CppServer/temp/modules/CppCommon/modules/libfmt.a /usr/local/lib/ - cd $IROOT - rm -rf CppServer -fi - -CURR_TYPE="lsquic-no" -if [ "$CURR_TYPE" = "lsquic" ] -then - apt install --no-install-recommends -y libunwind-dev golang libevent-dev - cd $IROOT - git clone https://boringssl.googlesource.com/boringssl - cd boringssl - git checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1 - sed -i "s/-Werror//g" CMakeLists.txt - cmake -DCMAKE_BUILD_TYPE=Release . && make -j4 - cd $IROOT - git clone https://github.com/litespeedtech/lsquic.git - cd lsquic - git submodule init - git submodule update - cmake -DBORINGSSL_DIR=${IROOT}/boringssl . && make install -j4 - cd $IROOT - rm -rf lsquic boringssl - apt remove -y golang - apt autoremove -y -fi - -rm -rf /var/lib/apt/lists/* diff --git a/frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh b/frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh index 0febbd33230..a2b54522062 100644 --- a/frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh +++ b/frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh @@ -2,8 +2,8 @@ apt update -yqq && apt install --no-install-recommends -yqq autoconf-archive unzip uuid-dev odbc-postgresql unixodbc unixodbc-dev \ apache2 apache2-dev libapr1-dev libaprutil1-dev memcached libmemcached-dev redis-server libssl-dev \ - zlib1g-dev cmake make clang-format-9 ninja-build libcurl4-openssl-dev git libpq-dev \ - wget build-essential pkg-config libpcre3-dev curl libgtk2.0-dev libgdk-pixbuf2.0-dev bison flex libreadline-dev + zlib1g-dev cmake make clang-format ninja-build libcurl4-openssl-dev git libpq-dev libpugixml-dev\ + wget build-essential pkg-config libpcre3-dev curl libgtk2.0-dev libgdk-pixbuf2.0-dev bison flex libreadline-dev apt-get install --reinstall ca-certificates cd $IROOT @@ -27,53 +27,78 @@ service redis-server stop cd $IROOT git clone https://github.com/efficient/libcuckoo.git cd libcuckoo -git checkout 8785773896d74f72b6224e59d37f5f8c3c1e022a -b works +git checkout ea8c36c65bf9cf83aaf6b0db971248c6ae3686cf -b works cmake -DCMAKE_INSTALL_PREFIX=/usr . make install cd $IROOT rm -rf libcuckoo -wget -q https://downloads.mysql.com/archives/get/p/10/file/mysql-connector-odbc_8.0.21-1ubuntu20.04_amd64.deb -dpkg -i mysql-connector-odbc_8.0.21-1ubuntu20.04_amd64.deb -wget -q https://downloads.mysql.com/archives/get/p/10/file/mysql-connector-odbc-setup_8.0.21-1ubuntu20.04_amd64.deb -dpkg -i mysql-connector-odbc-setup_8.0.21-1ubuntu20.04_amd64.deb +wget -q https://mirror.csclub.uwaterloo.ca/mysql/Downloads/Connector-ODBC/8.0/mysql-connector-odbc_8.0.29-1ubuntu21.10_amd64.deb +dpkg -i mysql-connector-odbc_8.0.29-1ubuntu21.10_amd64.deb +wget -q https://mirror.csclub.uwaterloo.ca/mysql/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-setup_8.0.29-1ubuntu21.10_amd64.deb +dpkg -i mysql-connector-odbc-setup_8.0.29-1ubuntu21.10_amd64.deb rm -f *.deb -wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.4.2/mongo-c-driver-1.4.2.tar.gz -tar xf mongo-c-driver-1.4.2.tar.gz -rm -f mongo-c-driver-1.4.2.tar.gz -cd mongo-c-driver-1.4.2/ && \ - ./configure --disable-automatic-init-and-cleanup && \ - make && make install +#wget -q https://github.com/mongodb/mongo-c-driver/releases/download/1.4.2/mongo-c-driver-1.4.2.tar.gz +#tar xf mongo-c-driver-1.4.2.tar.gz +#rm -f mongo-c-driver-1.4.2.tar.gz +#cd mongo-c-driver-1.4.2/ && \ +# ./configure --disable-automatic-init-and-cleanup && \ +# make && make install +#cd $IROOT +#rm -rf mongo-c-driver-1.4.2 +MONGO_VERSION=1.26.2 +wget "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/$MONGO_VERSION.tar.gz" --output-document="mongo-c-driver-$MONGO_VERSION.tar.gz" +tar xf "mongo-c-driver-$MONGO_VERSION.tar.gz" +rm -f "mongo-c-driver-$MONGO_VERSION.tar.gz" +cd mongo-c-driver-$MONGO_VERSION/ && mkdir _build && cmake -S . -B _build \ +-D ENABLE_EXTRA_ALIGNMENT=OFF \ +-D ENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -D ENABLE_TESTS=OFF -D ENABLE_EXAMPLES=OFF \ +-D CMAKE_BUILD_TYPE=RelWithDebInfo \ +-D BUILD_VERSION="$MONGO_VERSION" \ +-D ENABLE_SSL=OFF \ +-D ENABLE_SASL=OFF \ +-D ENABLE_MONGOC=ON && cmake --build _build --config RelWithDebInfo --parallel && cmake --install _build cd $IROOT -rm -rf mongo-c-driver-1.4.2 +rm -rf "mongo-c-driver-$MONGO_VERSION" -wget -q https://github.com/redis/hiredis/archive/v1.0.0.tar.gz -tar xf v1.0.0.tar.gz -rm -f v1.0.0.tar.gz -cd hiredis-1.0.0/ +wget -q https://github.com/redis/hiredis/archive/v1.0.2.tar.gz +tar xf v1.0.2.tar.gz +rm -f v1.0.2.tar.gz +cd hiredis-1.0.2/ cmake . && make install cd $IROOT -rm -rf hiredis-1.0.0 +rm -rf hiredis-1.0.2 + +wget -q https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.10.tar.gz +tar xf 1.3.10.tar.gz +rm -f 1.3.10.tar.gz +cd redis-plus-plus-1.3.10/ +mkdir build +cd build +cmake -DREDIS_PLUS_PLUS_CXX_STANDARD=17 .. && make && make install +cd $IROOT +rm -rf redis-plus-plus-1.3.10 cd $IROOT -wget -q https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz -tar xf v2.0.2.tar.gz -rm -f v2.0.2.tar.gz -cd mimalloc-2.0.2 +wget -q https://github.com/microsoft/mimalloc/archive/v2.1.2.tar.gz +tar xf v2.1.2.tar.gz +rm -f v2.1.2.tar.gz +cd mimalloc-2.1.2 mkdir -p out/release cd out/release cmake ../.. -DCMAKE_BUILD_TYPE=Release make && make install cd $IROOT -rm -rf mimalloc-2.0.2 +rm -rf mimalloc-2.1.2 -wget -q https://github.com/microsoft/snmalloc/archive/0.5.3.tar.gz -tar xf 0.5.3.tar.gz -rm -f 0.5.3.tar.gz -cd snmalloc-0.5.3 +wget -q https://github.com/microsoft/snmalloc/archive/0.6.2.tar.gz +tar xf 0.6.2.tar.gz +rm -f 0.6.2.tar.gz +cd snmalloc-0.6.2 mkdir build cd build cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release ninja cd $IROOT +rm -rf snmalloc-0.6.2 diff --git a/frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh b/frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh index 929dea3ea9f..ef2a6884659 100644 --- a/frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh +++ b/frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh @@ -1,35 +1,42 @@ #!/bin/bash -apt update -yqq && apt install --no-install-recommends -yqq rapidjson-dev libpugixml-dev - -#From https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/C%2B%2B/ulib/setup_json.sh +#Set the number of threads -------- MAX_THREADS=$(( 3 * `nproc` / 2 )) WRIT_THREADS=$(( $MAX_THREADS / 3 )) SERV_THREADS=$(( $MAX_THREADS - $WRIT_THREADS )) -git checkout 92c3a9e3d5ec1de4a909fe688d649d7f31e050c0 -b 6.0 -#git clone https://github.com/sumeetchhetri/ffead-cpp +git clone https://github.com/sumeetchhetri/ffead-cpp +#git checkout 92c3a9e3d5ec1de4a909fe688d649d7f31e050c0 -b 6.0 cd ffead-cpp rm -rf .git cd .. mv ffead-cpp ffead-cpp-src mv ffead-cpp-src/lang-server-backends ${IROOT}/ +cd /tmp +git clone https://github.com/Tencent/rapidjson +cp -rf rapidjson/include/rapidjson /usr/include/ +rm -rf rapidjson + cd $IROOT/ffead-cpp-src/ chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh #rm -rf web/t1 -#rm -rf web/t3 #rm -rf web/t2 +#rm -rf web/t3 #rm -rf web/t4 #rm -rf web/t5 +#rm -rf web/t6 +#rm -rf web/t7 mv ${IROOT}/server.sh script/ #mv ${IROOT}/t1 web/ -#mv ${IROOT}/t3 web/ #mv ${IROOT}/t2 web/ +#mv ${IROOT}/t3 web/ #mv ${IROOT}/t4 web/ #mv ${IROOT}/t5 web/ +#mv ${IROOT}/t6 web/ +#mv ${IROOT}/t7 web/ sed -i 's|THRD_PSIZ=6|THRD_PSIZ='${SERV_THREADS}'|g' resources/server.prop sed -i 's|W_THRD_PSIZ=2|W_THRD_PSIZ='${WRIT_THREADS}'|g' resources/server.prop sed -i 's|ENABLE_CRS=true|ENABLE_CRS=false|g' resources/server.prop @@ -48,165 +55,55 @@ sed -i 's|ENABLE_JOBS=true|ENABLE_JOBS=false|g' resources/server.prop sed -i 's|LOGGING_ENABLED=true|LOGGING_ENABLED=false|g' resources/server.prop sed -i 's|EVH_SINGLE=true|EVH_SINGLE=false|g' resources/server.prop -rm -rf web/default web/oauthApp web/flexApp web/markers web/te-benchmark web/peer-server +rm -rf web/default web/oauthApp web/flexApp web/markers web/te-benchmark web/peer-server web/t1 web/t2 -sed -i 's|localhost|tfb-database|g' web/t1/config/sdormmongo.xml -sed -i 's|localhost|tfb-database|g' web/t1/config/sdormmysql.xml -sed -i 's|localhost|tfb-database|g' web/t1/config/sdormpostgresql.xml sed -i 's|localhost|tfb-database|g' web/t3/config/sdorm.xml -sed -i 's|localhost|tfb-database|g' web/t2/config/sdorm.xml sed -i 's|localhost|tfb-database|g' web/t4/config/sdorm.xml sed -i 's|localhost|tfb-database|g' web/t5/config/sdorm.xml -sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbcinst.ini -sed -i 's|127.0.0.1|tfb-database|g' resources/sample-odbc.ini +sed -i 's|localhost|tfb-database|g' web/t6/config/sdorm.xml +sed -i 's|localhost|tfb-database|g' web/t7/config/sdorm.xml sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/default)||g' CMakeLists.txt sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/flexApp)||g' CMakeLists.txt sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/oauthApp)||g' CMakeLists.txt sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/markers)||g' CMakeLists.txt sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark)||g' CMakeLists.txt sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/peer-server)||g' CMakeLists.txt +sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t1)||g' CMakeLists.txt +sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t2)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/default/libdefault${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/flexApp/libflexApp${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/oauthApp/liboauthApp${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/markers/libmarkers${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/te-benchmark/libte-benchmark${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/peer-server/libpeer-server${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt +sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t1/libt1${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt +sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t2/libt2{LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt +sed -i 's|install(DIRECTORY DESTINATION "${PROJECT_NAME}-bin/web/default")||g' CMakeLists.txt +sed -i 's|install(DIRECTORY DESTINATION "${PROJECT_NAME}-bin/web/flexApp")||g' CMakeLists.txt +sed -i 's|install(DIRECTORY DESTINATION "${PROJECT_NAME}-bin/web/oauthApp")||g' CMakeLists.txt +sed -i 's|install(DIRECTORY DESTINATION "${PROJECT_NAME}-bin/web/markers")||g' CMakeLists.txt +sed -i 's|install(DIRECTORY DESTINATION "${PROJECT_NAME}-bin/web/peer-server")||g' CMakeLists.txt +sed -i 's|install(DIRECTORY DESTINATION "${PROJECT_NAME}-bin/web/te-benchmark")||g' CMakeLists.txt +sed -i 's|install(DIRECTORY DESTINATION "${PROJECT_NAME}-bin/web/t1")||g' CMakeLists.txt +sed -i 's|install(DIRECTORY ${PROJECT_SOURCE_DIR}/web/default/ DESTINATION ${PROJECT_NAME}-bin/web/default)||g' CMakeLists.txt +sed -i 's|install(DIRECTORY ${PROJECT_SOURCE_DIR}/web/flexApp/ DESTINATION ${PROJECT_NAME}-bin/web/flexApp)||g' CMakeLists.txt +sed -i 's|install(DIRECTORY ${PROJECT_SOURCE_DIR}/web/oauthApp/ DESTINATION ${PROJECT_NAME}-bin/web/oauthApp)||g' CMakeLists.txt +sed -i 's|install(DIRECTORY ${PROJECT_SOURCE_DIR}/web/markers/ DESTINATION ${PROJECT_NAME}-bin/web/markers)||g' CMakeLists.txt +sed -i 's|install(DIRECTORY ${PROJECT_SOURCE_DIR}/web/peer-server/ DESTINATION ${PROJECT_NAME}-bin/web/peer-server)||g' CMakeLists.txt +sed -i 's|install(DIRECTORY ${PROJECT_SOURCE_DIR}/web/te-benchmark/ DESTINATION ${PROJECT_NAME}-bin/web/te-benchmark)||g' CMakeLists.txt +sed -i 's|install(DIRECTORY ${PROJECT_SOURCE_DIR}/web/t1/ DESTINATION ${PROJECT_NAME}-bin/web/t1)||g' CMakeLists.txt sed -i 's|web/default/src/autotools/Makefile||g' configure.ac sed -i 's|web/flexApp/src/autotools/Makefile||g' configure.ac sed -i 's|web/oauthApp/src/autotools/Makefile||g' configure.ac sed -i 's|web/markers/src/autotools/Makefile||g' configure.ac sed -i 's|web/te-benchmark/src/autotools/Makefile||g' configure.ac sed -i 's|web/peer-server/src/autotools/Makefile||g' configure.ac +sed -i 's|web/t1/src/autotools/Makefile||g' configure.ac +sed -i 's|web/t2/src/autotools/Makefile||g' configure.ac #./autogen.sh #./configure --enable-debug=no --enable-apachemod=yes --enable-nginxmod=yes --enable-mod_sdormmongo=yes --enable-mod_sdormsql=yes --enable-mod_rediscache=yes --enable-mod_memcached=yes CPPFLAGS="$CPPFLAGS -I${IROOT}/include/libmongoc-1.0 -I${IROOT}/include/libbson-1.0 -I${IROOT}/include/" LDFLAGS="$LDFLAGS -L${IROOT} -L${IROOT}/lib" -cmake -DSRV_ALL=on -DCINATRA_INCLUDES=${IROOT}/cinatra/include -DMOD_APACHE=on -DMOD_NGINX=on -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=on -DDEBUG=${DEBUG} -DWITH_RAPIDJSON=on -DWITH_PUGIXML=on . - -cp resources/sample-odbcinst.ini ${IROOT}/odbcinst.ini -cp resources/sample-odbc.ini ${IROOT}/odbc.ini +cmake -DSRV_EMB=on -DMOD_APACHE=off -DMOD_NGINX=off -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=off -DDEBUG=${DEBUG} -DWITH_RAPIDJSON=on -DWITH_PUGIXML=on -GNinja . -#Start building for mongodb as the World model is different for SQL use case cd ${IROOT}/ffead-cpp-src/ -cp -f web/t1/sql-src/TeBkUmWorldmongo.h web/t1/include/TeBkUmWorld.h -cp -f web/t1/sql-src/TeBkUmWorldmongo.cpp web/t1/src/TeBkUmWorld.cpp -make install -j${MAX_THREADS} - -rm -f /usr/local/lib/libffead-* -rm -f /usr/local/lib/libt1.so* -rm -f /usr/local/lib/libt2.so* -rm -f /usr/local/lib/libt3.so* -rm -f /usr/local/lib/libt4.so* -rm -f /usr/local/lib/libt5.so* -rm -f /usr/local/lib/libinter.so -rm -f /usr/local/lib/libdinter.so - -if [ ! -d "ffead-cpp-6.0-bin" ] -then - exit 1 -fi - -cd ffead-cpp-6.0-bin -#cache related dockerfiles will add the cache.xml accordingly whenever needed -chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh -./server.sh & -COUNTER=0 -while [ ! -f lib/libinter.so ] -do - sleep 1 - COUNTER=$((COUNTER+1)) - if [ "$COUNTER" = 120 ] - then - cat logs/jobs.log - echo "ffead-cpp exiting exiting due to failure...." - exit 1 - fi -done -COUNTER=0 -while [ ! -f lib/libdinter.so ] -do - sleep 1 - COUNTER=$((COUNTER+1)) - if [ "$COUNTER" = 120 ] - then - cat logs/jobs.log - echo "ffead-cpp exiting exiting due to failure....ddlib" - exit 1 - fi -done -echo "ffead-cpp start successful" -sleep 5 -cd tests && rm -f test.csv && cp ${IROOT}/ffead-cpp-src/tests/test-te.csv test.csv && chmod +x *.sh && ./runTests.sh -echo "ffead-cpp normal shutdown" -pkill ffead-cpp - -cd ${IROOT}/ffead-cpp-src/ -cp -rf ffead-cpp-6.0-bin ${IROOT}/ffead-cpp-6.0 -rm -rf ffead-cpp-6.0-bin -mv ${IROOT}/nginxfc ${IROOT}/nginx-ffead-mongo - -cd ${IROOT}/ffead-cpp-6.0 - -chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh -chmod 755 *.sh -rm -f *.cntrl -rm -f tmp/*.sess -#Done building for mongodb - - -#Start building for sql as the World model is different for mongodb use case -cd ${IROOT}/ffead-cpp-src/ -cp -f web/t1/sql-src/TeBkUmWorldsql.h web/t1/include/TeBkUmWorld.h -cp -f web/t1/sql-src/TeBkUmWorldsql.cpp web/t1/src/TeBkUmWorld.cpp -make install -j${MAX_THREADS} - -if [ ! -d "ffead-cpp-6.0-bin" ] -then - exit 1 -fi - -cd ffead-cpp-6.0-bin -#cache related dockerfiles will add the cache.xml accordingly whenever needed -chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh -./server.sh & -COUNTER=0 -while [ ! -f lib/libinter.so ] -do - sleep 1 - COUNTER=$((COUNTER+1)) - if [ "$COUNTER" = 120 ] - then - cat logs/jobs.log - echo "ffead-cpp exiting exiting due to failure...." - exit 1 - fi -done -COUNTER=0 -while [ ! -f lib/libdinter.so ] -do - sleep 1 - COUNTER=$((COUNTER+1)) - if [ "$COUNTER" = 120 ] - then - cat logs/jobs.log - echo "ffead-cpp exiting exiting due to failure....ddlib" - exit 1 - fi -done -echo "ffead-cpp start successful" -sleep 5 -cd tests && rm -f test.csv && cp ${IROOT}/ffead-cpp-src/tests/test-te.csv test.csv && chmod +x *.sh && ./runTests.sh -echo "ffead-cpp normal shutdown" -pkill ffead-cpp - -cd ${IROOT}/ffead-cpp-src/ -cp -rf ffead-cpp-6.0-bin ${IROOT}/ffead-cpp-6.0-sql -rm -rf ffead-cpp-6.0-bin -mv ${IROOT}/nginxfc ${IROOT}/nginx-ffead-sql - -cd ${IROOT}/ffead-cpp-6.0-sql - -chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh -chmod 755 *.sh -rm -f *.cntrl -rm -f tmp/*.sess -#Done building for sql +ninja install diff --git a/frameworks/C++/ffead-cpp/install_ffead-cpp-httpd.sh b/frameworks/C++/ffead-cpp/install_ffead-cpp-httpd.sh deleted file mode 100644 index bdc0372815c..00000000000 --- a/frameworks/C++/ffead-cpp/install_ffead-cpp-httpd.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -cd $IROOT - -#chown -R www-data:www-data ffead-cpp-6.0 - -#wget -q https://archive.apache.org/dist/httpd/httpd-2.4.25.tar.gz -#wget -q https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz -#wget -q https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz -#rm -rf ${IROOT}/httpd-2.4.25 -#rm -rf ${IROOT}/apr-1.5.2 -#rm -rf ${IROOT}/apr-util-1.5.4 -#tar xf httpd-2.4.25.tar.gz -#tar xf apr-1.5.2.tar.gz -#tar xf apr-util-1.5.4.tar.gz -#mv -f apr-1.5.2 httpd-2.4.25/srclib/apr -#mv -f apr-util-1.5.4 httpd-2.4.25/srclib/apr-util -#cd ${IROOT}/httpd-2.4.25 -#rm -rf ${IROOT}/httpd -#mkdir ${IROOT}/httpd -#./configure --prefix=${IROOT}/httpd --enable-mods-shared=all --with-included-apr -#make -#make install -#cd ${IROOT} - -sed -i 's|#define PACKAGE_BUGREPORT "sumeet.chhetri@gmail.com"| |g' ${IROOT}/ffead-cpp-6.0/include/AppDefines.h -sed -i 's|#define PACKAGE_NAME "ffead-cpp"| |g' ${IROOT}/ffead-cpp-6.0/include/AppDefines.h -sed -i 's|#define PACKAGE_STRING "ffead-cpp 6.0"| |g' ${IROOT}/ffead-cpp-6.0/include/AppDefines.h -sed -i 's|#define PACKAGE_TARNAME "ffead-cpp"| |g' ${IROOT}/ffead-cpp-6.0/include/AppDefines.h -sed -i 's|#define PACKAGE_VERSION "6.0"| |g' ${IROOT}/ffead-cpp-6.0/include/AppDefines.h - -FFEADROOT=${IROOT}/ffead-cpp-6.0 -ETROOT=${FFEADROOT//\//\\/} -EIROOT=${IROOT//\//\\/} - -sed -i 's|Include ports.conf|#Include ports.conf|g' /etc/apache2/apache2.conf -#echo 'Include /etc/apache2/sites-enabled/ffead-site.conf' >> /etc/apache2/apache2.conf - -bash -c 'cat <> /etc/apache2/envvars -export FFEAD_CPP_PATH='"${FFEADROOT}"' -export LD_LIBRARY_PATH='"${FFEADROOT}"'/lib:'"${IROOT}"':'"${IROOT}"'/lib:/usr/local/lib:$LD_LIBRARY_PATH/ -export ODBCINI='"$IROOT"'/odbc.ini -export ODBCSYSINI='"$IROOT"' -EOL' - -#bash -c 'cat > /etc/apache2/mods-enabled/mpm_event.conf < -# AsyncRequestWorkerFactor 2 -# ThreadsPerChild 64 -# ServerLimit 100 -# StartServers 20 -# MinSpareThreads 100 -# MaxSpareThreads 200 -# ListenBacklog 4096 -# -#EOL' - -bash -c 'cat > /etc/apache2/mods-enabled/mpm_worker.conf < - ServerLimit 250 - StartServers 10 - MinSpareThreads 75 - MaxSpareThreads 250 - ThreadLimit 64 - ThreadsPerChild 32 - MaxRequestWorkers 8000 - MaxConnectionsPerChild 10000 - -EOL' - -mv /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/ffead-site.conf -bash -c 'cat > /etc/apache2/sites-enabled/ffead-site.conf < - DocumentRoot '"${FFEADROOT}"'/web - SetHandler ffead_cpp_module - - Options FollowSymLinks - AllowOverride None - Require all denied - - - Options -Indexes +FollowSymLinks +MultiViews - AllowOverride All - Require all granted - - -EOL' - diff --git a/frameworks/C++/ffead-cpp/install_ffead-cpp-nginx.sh b/frameworks/C++/ffead-cpp/install_ffead-cpp-nginx.sh deleted file mode 100644 index 6922d4bc131..00000000000 --- a/frameworks/C++/ffead-cpp/install_ffead-cpp-nginx.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cd $IROOT - -cp ${IROOT}/ffead-cpp-src/modules/nginx_mod_ffeadcpp/nginx.conf ${IROOT}/nginx-ffead-mongo/conf/ -sed -i 's|FFEAD_PATH|'${IROOT}/ffead-cpp-6.0'|g' ${IROOT}/nginx-ffead-mongo/conf/nginx.conf -cp ${IROOT}/ffead-cpp-src/modules/nginx_mod_ffeadcpp/nginx.conf ${IROOT}/nginx-ffead-sql/conf/ -sed -i 's|FFEAD_PATH|'${IROOT}/ffead-cpp-6.0-sql'|g' ${IROOT}/nginx-ffead-sql/conf/nginx.conf diff --git a/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-profiled.sh b/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-profiled.sh index fc8c80d0bd3..721e5a7727f 100644 --- a/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-profiled.sh +++ b/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-profiled.sh @@ -9,6 +9,12 @@ then elif [ "$1" = "async-qw" ] then APP_CTXT="t5" +elif [ "$1" = "wire" ] +then + APP_CTXT="t6" +elif [ "$1" = "async-wire" ] +then + APP_CTXT="t7" fi cp $IROOT/ffead-cpp-sql-raw/server.sh /server_orig.sh @@ -43,7 +49,7 @@ do fi done echo "ffead-cpp start successful" -sleep 5 +sleep 20 #cd tests && chmod +x *.sh && ./runTests.sh #echo "ffead-cpp normal shutdown" #cd - @@ -57,40 +63,45 @@ service postgresql start sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' resources/server.prop #sed -i 's|LOGGING_ENABLED=false|LOGGING_ENABLED=true|g' resources/server.prop -if [ "$1" = "async" ] -then - sed -i 's|REQUEST_HANDLER=RequestReaderHandler|REQUEST_HANDLER=RequestHandler2|g' resources/server.prop -fi - +sed -i 's|REQUEST_HANDLER=RequestReaderHandler|REQUEST_HANDLER=RequestHandler2|g' resources/server.prop if [ "$1" = "async-qw" ] then - sed -i 's|REQUEST_HANDLER=RequestReaderHandler|REQUEST_HANDLER=RequestHandler2|g' resources/server.prop sed -i 's|QUEUED_WRITES=false|QUEUED_WRITES=true|g' resources/server.prop fi nohup bash -c "./server.sh > ffead.log &" -sleep 10 +sleep 30 echo "ffead-cpp with sql-raw support launched" -wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/plaintext" -wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/j" +if [ "$1" != "async-qw" ] +then + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/plaintext" + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/j" +fi wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/fortu" wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/d" +if [ "$1" = "async" ] || [ "$1" = "async-qw" ] +then + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/quem?queries=20" +else + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/que_?queries=20" +fi wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/quer?queries=20" +if [ "$1" = "async" ] || [ "$1" = "async-qw" ] +then + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/updm?queries=20" +fi wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/quem?queries=20" -wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/que_?queries=20" + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/upd_?queries=20" wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/updt?queries=20" -wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/updm?queries=20" -wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/${APP_CTXT}/upd_?queries=20" echo "normal shutdown" rm -f serv.ctrl diff --git a/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-v-picov-profiled.sh b/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-v-picov-profiled.sh index ea98b9e1712..ced00121cb5 100644 --- a/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-v-picov-profiled.sh +++ b/frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-v-picov-profiled.sh @@ -1,35 +1,83 @@ #!/bin/bash -export FFEAD_CPP_PATH=${IROOT}/ffead-cpp-6.0-sql +export FFEAD_CPP_PATH=${IROOT}/ffead-cpp-7.0-sql export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/lib:$LD_LIBRARY_PATH cd $IROOT/lang-server-backends/v/pico.v -cp -f ${FFEAD_CPP_PATH}/web/t3/config/cachememory.xml ${FFEAD_CPP_PATH}/web/t3/config/cache.xml -sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${FFEAD_CPP_PATH}/web/t3/config/application.xml -sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' ${FFEAD_CPP_PATH}/resources/server.prop -#sed -i 's|LOGGING_ENABLED=false|LOGGING_ENABLED=true|g' ${FFEAD_CPP_PATH}/resources/server.prop -nohup bash -c "./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 > ffead.log &" -sleep 10 +APP=t3 +if [ "$1" = "async" ] +then + APP=t4 + cp -f ${FFEAD_CPP_PATH}/web/t4/config/cachememory.xml ${FFEAD_CPP_PATH}/web/t4/config/cache.xml + sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' ${FFEAD_CPP_PATH}/resources/server.prop + nohup bash -c "./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=true > ffead.log &" +elif [ "$1" = "async-pool" ] +then + APP=t4 + cp -f ${FFEAD_CPP_PATH}/web/t4/config/cachememory.xml ${FFEAD_CPP_PATH}/web/t4/config/cache.xml + sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' ${FFEAD_CPP_PATH}/resources/server.prop + sed -i 's|"TeBkUmLpqAsyncRouter"|"TeBkUmLpqAsyncRouterPooled"|g' ${FFEAD_CPP_PATH}/web/t4/config/application.xml + sed -i 's|TeBkUmLpqAsyncRouter|TeBkUmLpqAsyncRouterPooled|g' ${FFEAD_CPP_PATH}/web/t4/config/cachememory.xml + nohup bash -c "./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=true > ffead.log &" +if [ "$1" = "wire" ] +then + APP=t6 + cp -f ${FFEAD_CPP_PATH}/web/t6/config/cachememory.xml ${FFEAD_CPP_PATH}/web/t6/config/cache.xml + sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' ${FFEAD_CPP_PATH}/resources/server.prop + nohup bash -c "./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=true > ffead.log &" +elif [ "$1" = "async-wire" ] +then + APP=t7 + cp -f ${FFEAD_CPP_PATH}/web/t7/config/cachememory.xml ${FFEAD_CPP_PATH}/web/t7/config/cache.xml + sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' ${FFEAD_CPP_PATH}/resources/server.prop + nohup bash -c "./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=true > ffead.log &" +else + cp -f ${FFEAD_CPP_PATH}/web/t3/config/cachememory.xml ${FFEAD_CPP_PATH}/web/t3/config/cache.xml + sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${FFEAD_CPP_PATH}/web/t3/config/application.xml + sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' ${FFEAD_CPP_PATH}/resources/server.prop + nohup bash -c "./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=false > ffead.log &" +fi + + +sleep 30 echo "ffead-cpp-v-picov with sql-raw support launched" -wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ +if [ "$1" = "async" ] || [ "$1" = "async-pool" ] +then + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/$APP/plaint" +else + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/plaintext" +fi + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/t3/j" -wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/t3/fortu" + -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/$APP/j" wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/t3/d" + -H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/$APP/fortu" wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/t3/quer?queries=20" + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/d" wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/t3/que_?queries=20" + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/quer?queries=20" +if [ "$1" = "async" ] || [ "$1" = "async-pool" ] +then + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/quem?queries=20" +else + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/que_?queries=20" +fi wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/t3/updt?queries=20" + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/updt?queries=20" wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/t3/upd_?queries=20" + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/upd_?queries=20" wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ - -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/t3/cached-wld?count=20" + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/cached-wld?count=20" +if [ "$1" = "async" ] || [ "$1" = "async-pool" ] +then + wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \ + -H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/$APP/updm?queries=20" +fi echo "normal shutdown" pkill main diff --git a/frameworks/C++/ffead-cpp/install_post_process.sh b/frameworks/C++/ffead-cpp/install_post_process.sh new file mode 100644 index 00000000000..53f6e9a7f09 --- /dev/null +++ b/frameworks/C++/ffead-cpp/install_post_process.sh @@ -0,0 +1,50 @@ +cd ${IROOT}/ffead-cpp-src/ +if [ ! -d "ffead-cpp-7.0-bin" ] +then + exit 1 +fi + +cd ffead-cpp-7.0-bin +#cache related dockerfiles will add the cache.xml accordingly whenever needed +chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh +./server.sh & +COUNTER=0 +while [ ! -f lib/libinter.so ] +do + sleep 1 + COUNTER=$((COUNTER+1)) + if [ "$COUNTER" = 120 ] + then + cat logs/jobs.log + echo "ffead-cpp exiting exiting due to failure...." + exit 1 + fi +done +COUNTER=0 +while [ ! -f lib/libdinter.so ] +do + sleep 1 + COUNTER=$((COUNTER+1)) + if [ "$COUNTER" = 120 ] + then + cat logs/jobs.log + echo "ffead-cpp exiting exiting due to failure....ddlib" + exit 1 + fi +done +echo "ffead-cpp start successful" +sleep 20 +cd tests && rm -f test.csv && cp ${IROOT}/ffead-cpp-src/tests/test-te.csv test.csv && chmod +x *.sh && ./runTests.sh +echo "ffead-cpp normal shutdown" +pkill ffead-cpp + +cd ${IROOT}/ffead-cpp-src/ +cp -rf ffead-cpp-7.0-bin ${IROOT}/ffead-cpp-7.0-sql +rm -rf ffead-cpp-7.0-bin + +cd ${IROOT}/ffead-cpp-7.0-sql + +chmod 755 *.sh resources/*.sh rtdcf/autotools/*.sh +chmod 755 *.sh +rm -f *.cntrl +rm -f tmp/*.sess \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/run_ffead.sh b/frameworks/C++/ffead-cpp/run_ffead.sh index d58ced3f444..cd15bff21d5 100644 --- a/frameworks/C++/ffead-cpp/run_ffead.sh +++ b/frameworks/C++/ffead-cpp/run_ffead.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash rm -f /usr/local/lib/libffead-* rm -f /usr/local/lib/libt1.so* @@ -6,6 +6,8 @@ rm -f /usr/local/lib/libt2.so* rm -f /usr/local/lib/libt3.so* rm -f /usr/local/lib/libt4.so* rm -f /usr/local/lib/libt5.so* +rm -f /usr/local/lib/libt6.so* +rm -f /usr/local/lib/libt7.so* rm -f /usr/local/lib/libinter.so rm -f /usr/local/lib/libdinter.so @@ -16,12 +18,18 @@ ln -s ${FFEAD_CPP_PATH}/lib/libt2.so /usr/local/lib/libt2.so ln -s ${FFEAD_CPP_PATH}/lib/libt3.so /usr/local/lib/libt3.so ln -s ${FFEAD_CPP_PATH}/lib/libt4.so /usr/local/lib/libt4.so ln -s ${FFEAD_CPP_PATH}/lib/libt5.so /usr/local/lib/libt5.so +ln -s ${FFEAD_CPP_PATH}/lib/libt4.so /usr/local/lib/libt6.so +ln -s ${FFEAD_CPP_PATH}/lib/libt5.so /usr/local/lib/libt7.so ln -s ${FFEAD_CPP_PATH}/lib/libffead-modules.so /usr/local/lib/libffead-modules.so ln -s ${FFEAD_CPP_PATH}/lib/libffead-framework.so /usr/local/lib/libffead-framework.so ln -s ${FFEAD_CPP_PATH}/lib/libinter.so /usr/local/lib/libinter.so ln -s ${FFEAD_CPP_PATH}/lib/libdinter.so /usr/local/lib/libdinter.so ldconfig +echo never > /sys/kernel/mm/transparent_hugepage/enabled +echo 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' >> /etc/rc.local +sysctl vm.overcommit_memory=1 + if [ "$2" = "nginx" ] then if [ "$3" = "mysql" ] || [ "$3" = "postgresql" ] @@ -36,13 +44,14 @@ export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/l export ODBCINI=${IROOT}/odbc.ini export ODBCSYSINI=${IROOT} export LD_PRELOAD=/usr/local/lib/libmimalloc.so -#export LD_PRELOAD=$IROOT/snmalloc-0.5.3/build/libsnmallocshim.so +#export LD_PRELOAD=$IROOT/snmalloc-0.6.0/build/libsnmallocshim.so cd $FFEAD_CPP_PATH #use below settings only for debugging #echo '/tmp/core.%h.%e.%t' > /proc/sys/kernel/core_pattern #ulimit -c unlimited +ulimit -l unlimited service redis-server stop service apache2 stop @@ -51,40 +60,52 @@ service memcached stop if [ "$3" = "mongo" ] then WEB_DIR=$FFEAD_CPP_PATH/web/t1 - rm -rf web/t2 web/t3 web/t4 web/t5 + rm -rf web/t2 web/t3 web/t4 web/t5 web/t6 web/t7 cp -f ${WEB_DIR}/config/sdormmongo.xml ${WEB_DIR}/config/sdorm.xml elif [ "$3" = "mongo-raw" ] then WEB_DIR=$FFEAD_CPP_PATH/web/t2 - rm -rf web/t1 web/t3 web/t4 web/t5 + rm -rf web/t1 web/t3 web/t4 web/t5 web/t6 web/t7 elif [ "$3" = "mysql" ] then WEB_DIR=$FFEAD_CPP_PATH/web/t1 - rm -rf web/t2 web/t3 web/t4 web/t5 + rm -rf web/t2 web/t3 web/t4 web/t5 web/t6 web/t7 cp -f ${WEB_DIR}/config/sdormmysql.xml ${WEB_DIR}/config/sdorm.xml elif [ "$3" = "postgresql" ] then WEB_DIR=$FFEAD_CPP_PATH/web/t1 - rm -rf web/t2 web/t3 web/t4 web/t5 + rm -rf web/t2 web/t3 web/t4 web/t5 web/t6 web/t7 cp -f web/t1/config/sdormpostgresql.xml web/t1/config/sdorm.xml elif [ "$3" = "postgresql-raw" ] then WEB_DIR=$FFEAD_CPP_PATH/web/t3 - rm -rf web/t1 web/t2 web/t4 web/t5 + rm -rf web/t1 web/t2 web/t4 web/t5 web/t6 web/t7 sed -i 's|true|false|g' ${WEB_DIR}/config/sdorm.xml elif [ "$3" = "postgresql-raw-async" ] then WEB_DIR=$FFEAD_CPP_PATH/web/t4 - rm -rf web/t1 web/t2 web/t3 web/t5 + rm -rf web/t1 web/t2 web/t3 web/t5 web/t6 web/t7 sed -i 's|false|true|g' ${WEB_DIR}/config/sdorm.xml +elif [ "$3" = "postgresql-wire" ] +then + WEB_DIR=$FFEAD_CPP_PATH/web/t6 + rm -rf web/t1 web/t2 web/t3 web/t4 web/t5 web/t7 + sed -i 's|true|false|g' ${WEB_DIR}/config/sdorm.xml + sed -i 's|false|true|g' ${WEB_DIR}/config/sdorm.xml +elif [ "$3" = "postgresql-wire-async" ] +then + WEB_DIR=$FFEAD_CPP_PATH/web/t7 + rm -rf web/t1 web/t2 web/t3 web/t4 web/t5 web/t6 + sed -i 's|false|true|g' ${WEB_DIR}/config/sdorm.xml + sed -i 's|false|true|g' ${WEB_DIR}/config/sdorm.xml elif [ "$3" = "postgresql-raw-async-qw" ] then WEB_DIR=$FFEAD_CPP_PATH/web/t5 - rm -rf web/t1 web/t2 web/t3 web/t4 + rm -rf web/t1 web/t2 web/t3 web/t4 web/t6 web/t7 sed -i 's|false|true|g' ${WEB_DIR}/config/sdorm.xml else WEB_DIR=$FFEAD_CPP_PATH/web/t1 - rm -rf web/t2 web/t3 web/t4 web/t5 + rm -rf web/t2 web/t3 web/t4 web/t5 web/t6 web/t7 fi if [ "$5" = "batch" ] @@ -107,6 +128,17 @@ then cp -f ${WEB_DIR}/config/cachememcached.xml ${WEB_DIR}/config/cache.xml fi fi +if [ "$6" = "pool" ] +then + if [[ $3 == *"-async"* ]]; then + sed -i 's|"TeBkUmLpqAsyncRouter"|"TeBkUmLpqAsyncRouterPooled"|g' ${WEB_DIR}/config/application.xml + sed -i 's|TeBkUmLpqAsyncRouter|TeBkUmLpqAsyncRouterPooled|g' ${WEB_DIR}/config/cache.xml + if [ "$3" = "postgresql-raw-async-qw" ] + then + sed -i 's|"TeBkUmLpqQwAsyncRouter"|"TeBkUmLpqQwAsyncRouterPooled"|g' ${WEB_DIR}/config/application.xml + fi + fi +fi rm -f rtdcf/*.d rtdcf/*.o rm -f *.cntrl @@ -119,6 +151,8 @@ chmod 700 resources/*.sh chmod 700 tests/* chmod 700 rtdcf/* +sed -i 's|localhost|tfb-database|g' ${WEB_DIR}/config/sdorm.xml + if [ "$2" = "apache" ] then sed -i 's|30|3|g' ${WEB_DIR}/config/sdorm.xml @@ -131,13 +165,14 @@ fi if [ "$2" = "emb" ] then - sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' resources/server.prop + sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' $FFEAD_CPP_PATH/resources/server.prop sed -i 's|REQUEST_HANDLER=RequestReaderHandler|REQUEST_HANDLER=RequestHandler2|g' $FFEAD_CPP_PATH/resources/server.prop + sed -i 's|LAZY_HEADER_PARSE=false|LAZY_HEADER_PARSE=true|g' $FFEAD_CPP_PATH/resources/server.prop if [ "$3" = "postgresql-raw-async-qw" ] then sed -i 's|QUEUED_WRITES=false|QUEUED_WRITES=true|g' $FFEAD_CPP_PATH/resources/server.prop fi - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./ffead-cpp $FFEAD_CPP_PATH & done elif [ "$2" = "lithium" ] @@ -153,8 +188,8 @@ elif [ "$2" = "apache" ] then if [ "$3" = "mysql" ] || [ "$3" = "postgresql" ] then - sed -i 's|/installs/ffead-cpp-6.0|'/installs/ffead-cpp-6.0-sql'|g' /etc/apache2/apache2.conf - sed -i 's|/installs/ffead-cpp-6.0|'/installs/ffead-cpp-6.0-sql'|g' /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/ffead-site.conf + sed -i 's|/installs/ffead-cpp-7.0|'/installs/ffead-cpp-7.0-sql'|g' /etc/apache2/apache2.conf + sed -i 's|/installs/ffead-cpp-7.0|'/installs/ffead-cpp-7.0-sql'|g' /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/ffead-site.conf fi apachectl -D FOREGROUND elif [ "$2" = "nginx" ] @@ -177,18 +212,18 @@ then elif [ "$2" = "crystal-http" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./crystal-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "crystal-h2o" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./h2o-evloop-ffead-cpp.out --ffead-cpp-dir=$FFEAD_CPP_PATH --to=8080 & done elif [ "$2" = "julia-http" ] then - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do julia ${IROOT}/lang-server-backends/julia/http.jl/server.jl $FFEAD_CPP_PATH done elif [ "$2" = "swift-nio" ] @@ -226,17 +261,36 @@ then elif [ "$2" = "v-vweb" ] then cd ${IROOT} - for i in $(seq 0 $(($(nproc --all)-1))); do + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do taskset -c $i ./vweb --server_dir=$FFEAD_CPP_PATH --server_port=8080 & done elif [ "$2" = "v-picov" ] then cd ${IROOT} - sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${WEB_DIR}/config/application.xml sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' $FFEAD_CPP_PATH/resources/server.prop - for i in $(seq 0 $(($(nproc --all)-1))); do - taskset -c $i ./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 & - done + if [[ $3 == *"-async"* ]] + then + rm -f ${WEB_DIR}/config/cache.xml + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do + if [ "$6" = "pool" ] + then + if [ -f "main_async_pool" ] + then + taskset -c $i ./main_async_pool --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=true & + else + taskset -c $i ./main_async --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=true & + fi + else + taskset -c $i ./main_async --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=true & + fi + done + else + sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${WEB_DIR}/config/application.xml + sed -i 's|"TeBkUmFpgRouter"|"TeBkUmFpgRouterPicoV"|g' ${WEB_DIR}/config/application.xml + for i in $(seq 0 $(($(taskset 1 getconf _NPROCESSORS_ONLN)-1))); do + taskset -c $i ./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 --is_async=false & + done + fi elif [ "$2" = "java-firenio" ] then cd ${IROOT} diff --git a/frameworks/C++/ffead-cpp/server.sh b/frameworks/C++/ffead-cpp/server.sh index 56ac5e2a5e1..da796bbe563 100644 --- a/frameworks/C++/ffead-cpp/server.sh +++ b/frameworks/C++/ffead-cpp/server.sh @@ -22,9 +22,15 @@ if [ ! -d tmp ]; then mkdir tmp fi chmod 700 $FFEAD_CPP_PATH/ffead-cpp +if [ -d $FFEAD_CPP_PATH/ffead-cpp-lithium ]; then chmod 700 $FFEAD_CPP_PATH/ffead-cpp-lithium +fi +if [ -d $FFEAD_CPP_PATH/ffead-cpp-cinatra ]; then chmod 700 $FFEAD_CPP_PATH/ffead-cpp-cinatra +fi +if [ -d $FFEAD_CPP_PATH/ffead-cpp-drogon ]; then chmod 700 $FFEAD_CPP_PATH/ffead-cpp-drogon +fi chmod 700 $FFEAD_CPP_PATH/resources/*.sh chmod 700 $FFEAD_CPP_PATH/tests/* chmod 700 $FFEAD_CPP_PATH/rtdcf/* diff --git a/frameworks/C++/ffead-cpp/sql-async-profiled-install-clang-dbg.sh b/frameworks/C++/ffead-cpp/sql-async-profiled-install-clang-dbg.sh deleted file mode 100644 index b296128b523..00000000000 --- a/frameworks/C++/ffead-cpp/sql-async-profiled-install-clang-dbg.sh +++ /dev/null @@ -1,23 +0,0 @@ -cd $IROOT/ffead-cpp-src/ - -rm -rf build -mkdir build -cd build -CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -DSRV_EMB=on -DMOD_REDIS=on -DDEBUG=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw - -#Start postgresql -service postgresql stop -#For profiling/benchmarking - -cd $IROOT/ -sed -i 's|cmake |CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh -#sed -i 's|-fprofile-instr-generate=/tmp/cprof.prof|-fprofile-instr-generate=/tmp/cprofdi.prof|g' $IROOT/ffead-cpp-sql-raw/rtdcf/CMakeLists.txt.template -apt update -yqq && apt install -yqq vim gdb net-tools telnet iputils-ping -./install_ffead-cpp-sql-raw-profiled.sh async -./install_ffead-cpp-sql-raw-profiled.sh async-qw - -#mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-6.0-sql -#sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t4/config/sdorm.xml -#sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t5/config/sdorm.xml - diff --git a/frameworks/C++/ffead-cpp/sql-async-profiled-install-clang.sh b/frameworks/C++/ffead-cpp/sql-async-profiled-install-clang.sh deleted file mode 100644 index 2c7b6a12423..00000000000 --- a/frameworks/C++/ffead-cpp/sql-async-profiled-install-clang.sh +++ /dev/null @@ -1,49 +0,0 @@ -cd $IROOT/ffead-cpp-src/ - -rm -rf build -mkdir build -cd build -CC=/usr/bin/clang CXX=/usr/bin/clang++ CXXFLAGS="-march=native -flto -fprofile-instr-generate=/tmp/cprof.prof" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw - -#Start postgresql -service postgresql stop -#For profiling/benchmarking - -cd $IROOT/ -sed -i 's|cmake |CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh -#sed -i 's|-fprofile-instr-generate=/tmp/cprof.prof|-fprofile-instr-generate=/tmp/cprofdi.prof|g' $IROOT/ffead-cpp-sql-raw/rtdcf/CMakeLists.txt.template -./install_ffead-cpp-sql-raw-profiled.sh async -./install_ffead-cpp-sql-raw-profiled.sh async-qw -rm -rf $IROOT/ffead-cpp-sql-raw - -cd $IROOT/ffead-cpp-src -rm -rf build -mkdir build -cd build -llvm-profdata-10 merge -output=/tmp/cprof.pgo /tmp/cprof.prof -#llvm-profdata-10 merge -output=/tmp/cprofdi.pgo /tmp/cprofdi.prof -ls -ltr /tmp/cprof* -CC=/usr/bin/clang CXX=/usr/bin/clang++ CXXFLAGS="-march=native -flto -fprofile-instr-use=/tmp/cprof.pgo" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw - -#Start postgresql -service postgresql stop -#For profiling/benchmarking - -cd $IROOT/ -sed -i 's|cmake |CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh -#sed -i 's|-fprofile-instr-use=/tmp/cprof.pgo|-fprofile-instr-use=/tmp/cprofdi.pgo|g' $IROOT/ffead-cpp-sql-raw/rtdcf/CMakeLists.txt.template -./install_ffead-cpp-sql-raw-profiled.sh async -./install_ffead-cpp-sql-raw-profiled.sh async-qw -mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-6.0-sql - -sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t4/config/sdorm.xml -sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t5/config/sdorm.xml - -apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release -apt autoremove -yqq -rm -rf /ssd/postgresql -rm -rf /tmp/postgresql -rm -rf /tmp/wrk /usr/local/bin/wrk - diff --git a/frameworks/C++/ffead-cpp/sql-async-profiled-install.sh b/frameworks/C++/ffead-cpp/sql-async-profiled-install.sh index 49c3a38ffee..cc25f8a6c69 100644 --- a/frameworks/C++/ffead-cpp/sql-async-profiled-install.sh +++ b/frameworks/C++/ffead-cpp/sql-async-profiled-install.sh @@ -3,8 +3,8 @@ cd $IROOT/ffead-cpp-src/ rm -rf build mkdir build cd build -CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-generate" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw +CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-generate" cmake -DSRV_EMB=on -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=on -DWITH_RAPIDJSON=on -DWITH_PUGIXML=on -GNinja ${BUILD_EXT_OPTS} .. +ninja install && mv $IROOT/ffead-cpp-src/ffead-cpp-7.0-bin $IROOT/ffead-cpp-sql-raw #Start postgresql service postgresql stop @@ -12,16 +12,15 @@ service postgresql stop cd $IROOT/ #sed -i 's|cmake |cmake -DCMAKE_EXE_LINKER_FLAGS="-fprofile-dir=/tmp/profile-data -fprofile-generate" -DCMAKE_CXX_FLAGS="-march=native -fprofile-dir=/tmp/profile-data -fprofile-generate" |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh -./install_ffead-cpp-sql-raw-profiled.sh async -./install_ffead-cpp-sql-raw-profiled.sh async-qw +./install_ffead-cpp-sql-raw-profiled.sh ${2} rm -rf $IROOT/ffead-cpp-sql-raw cd $IROOT/ffead-cpp-src rm -rf build mkdir build cd build -CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-use=/tmp/profile-data -fprofile-correction" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw +CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-use=/tmp/profile-data -fprofile-correction" cmake -DSRV_EMB=on -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=on -DWITH_RAPIDJSON=on -DWITH_PUGIXML=on -GNinja ${BUILD_EXT_OPTS} .. +ninja install && mv $IROOT/ffead-cpp-src/ffead-cpp-7.0-bin $IROOT/ffead-cpp-sql-raw #Start postgresql service postgresql stop @@ -29,16 +28,9 @@ service postgresql stop cd $IROOT/ #sed -i 's|cmake |CXXFLAGS="-march=native -fprofile-dir=/tmp/profile-data -fprofile-use -fprofile-correction" cmake |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh -./install_ffead-cpp-sql-raw-profiled.sh async -./install_ffead-cpp-sql-raw-profiled.sh async-qw -mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-6.0-sql - -sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t4/config/sdorm.xml -sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t5/config/sdorm.xml - -apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release -apt autoremove -yqq -rm -rf /ssd/postgresql -rm -rf /tmp/postgresql -rm -rf /tmp/wrk /usr/local/bin/wrk +./install_ffead-cpp-sql-raw-profiled.sh ${2} +mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-7.0${1} +sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-7.0${1}/web/t4/config/sdorm.xml +sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-7.0${1}/web/t5/config/sdorm.xml +sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-7.0${1}/web/t7/config/sdorm.xml diff --git a/frameworks/C++/ffead-cpp/sql-profiled-install-clang.sh b/frameworks/C++/ffead-cpp/sql-profiled-install-clang.sh deleted file mode 100644 index 791c36ae4f5..00000000000 --- a/frameworks/C++/ffead-cpp/sql-profiled-install-clang.sh +++ /dev/null @@ -1,48 +0,0 @@ -cd $IROOT/ffead-cpp-src/ - -rm -rf build -mkdir build -cd build -CC=/usr/bin/clang CXX=/usr/bin/clang++ CXXFLAGS="-march=native -flto -fprofile-instr-generate=/tmp/cprof.prof" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw - -#Start postgresql -service postgresql stop -#For profiling/benchmarking - -cd $IROOT/ -sed -i 's|cmake |CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh -#sed -i 's|-fprofile-instr-generate=/tmp/cprof.prof|-fprofile-instr-generate=/tmp/cprofdi.prof|g' $IROOT/ffead-cpp-sql-raw/rtdcf/CMakeLists.txt.template -./install_ffead-cpp-sql-raw-profiled.sh -rm -rf $IROOT/ffead-cpp-sql-raw - -cd $IROOT/ffead-cpp-src -rm -rf build -mkdir build -cd build -llvm-profdata-10 merge -output=/tmp/cprof.pgo /tmp/cprof.prof -#llvm-profdata-10 merge -output=/tmp/cprofdi.pgo /tmp/cprofdi.prof -ls -ltr /tmp/cprof* -CC=/usr/bin/clang CXX=/usr/bin/clang++ CXXFLAGS="-march=native -flto -fprofile-instr-use=/tmp/cprof.pgo" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw - -#Start postgresql -service postgresql stop -#For profiling/benchmarking - -cd $IROOT/ -sed -i 's|cmake |CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh -#sed -i 's|-fprofile-instr-use=/tmp/cprof.pgo|-fprofile-instr-use=/tmp/cprofdi.pgo|g' $IROOT/ffead-cpp-sql-raw/rtdcf/CMakeLists.txt.template -./install_ffead-cpp-sql-raw-profiled.sh -mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-6.0-sql - -sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t3/config/sdorm.xml - -if [ "$#" = 0 ] -then - apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release - apt autoremove -yqq - rm -rf /ssd/postgresql - rm -rf /tmp/postgresql - rm -rf /tmp/wrk /usr/local/bin/wrk -fi diff --git a/frameworks/C++/ffead-cpp/sql-profiled-install.sh b/frameworks/C++/ffead-cpp/sql-profiled-install.sh index c9f84d71b9f..0c55733641a 100644 --- a/frameworks/C++/ffead-cpp/sql-profiled-install.sh +++ b/frameworks/C++/ffead-cpp/sql-profiled-install.sh @@ -1,10 +1,12 @@ cd $IROOT/ffead-cpp-src/ +rm -rf $IROOT/ffead-cpp-sql-raw + rm -rf build mkdir build cd build -CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-generate" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw +CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-generate" cmake -DSRV_EMB=on -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=off -DWITH_RAPIDJSON=on -DWITH_PUGIXML=on -GNinja ${BUILD_EXT_OPTS} .. +ninja install && mv $IROOT/ffead-cpp-src/ffead-cpp-7.0-bin $IROOT/ffead-cpp-sql-raw #Start postgresql service postgresql stop @@ -19,8 +21,8 @@ cd $IROOT/ffead-cpp-src rm -rf build mkdir build cd build -CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-use=/tmp/profile-data -fprofile-correction" cmake -DSRV_EMB=on -DMOD_REDIS=on .. -make install && mv $IROOT/ffead-cpp-src/ffead-cpp-6.0-bin $IROOT/ffead-cpp-sql-raw +CXXFLAGS="-march=native -flto -fprofile-dir=/tmp/profile-data -fprofile-use=/tmp/profile-data -fprofile-correction" cmake -DSRV_EMB=on -DMOD_MEMCACHED=on -DMOD_REDIS=on -DMOD_SDORM_MONGO=off -DWITH_RAPIDJSON=on -DWITH_PUGIXML=on -GNinja ${BUILD_EXT_OPTS} .. +ninja install && mv $IROOT/ffead-cpp-src/ffead-cpp-7.0-bin $IROOT/ffead-cpp-sql-raw #Start postgresql service postgresql stop @@ -29,15 +31,6 @@ service postgresql stop cd $IROOT/ #sed -i 's|cmake |CXXFLAGS="-march=native -fprofile-dir=/tmp/profile-data -fprofile-use -fprofile-correction" cmake |g' $IROOT/ffead-cpp-sql-raw/resources/rundyn-automake.sh ./install_ffead-cpp-sql-raw-profiled.sh -mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-6.0-sql - -sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t3/config/sdorm.xml - -if [ "$#" = 0 ] -then - apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release - apt autoremove -yqq - rm -rf /ssd/postgresql - rm -rf /tmp/postgresql - rm -rf /tmp/wrk /usr/local/bin/wrk -fi +mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-7.0${1} + +sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-7.0${1}/web/t3/config/sdorm.xml diff --git a/frameworks/C++/ffead-cpp/sql-profiled-util.sh b/frameworks/C++/ffead-cpp/sql-profiled-util.sh index df72da3e655..fed50662be4 100644 --- a/frameworks/C++/ffead-cpp/sql-profiled-util.sh +++ b/frameworks/C++/ffead-cpp/sql-profiled-util.sh @@ -1,8 +1,8 @@ mkdir /tmp/profile-data -rm -rf $IROOT/ffead-cpp-6.0-sql +rm -rf $IROOT/ffead-cpp-7.0-sql -if [ "$1" = "batch-old" ] +if [ "$1" = "batch-experimental-unused" ] then apt remove -yqq libpq-dev apt autoremove -yqq @@ -26,7 +26,7 @@ then cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h libpq-fe.h /usr/include fi -if [ "$1" = "batch" ] +if [ "$1" = "batch-old-commit-unused" ] then apt remove -yqq libpq-dev apt autoremove -yqq @@ -49,7 +49,6 @@ then fi cd $IROOT/ffead-cpp-src/ -rm -rf $IROOT/ffead-cpp-sql-raw rm -rf CMakeCache.txt CMakeFiles rm -rf web/t1 web/t2 @@ -62,20 +61,52 @@ if [ "$3" = "async" ] then sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t3)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t3/libt3${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t6)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t6/libt6${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t7)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t7/libt7${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/t4/config/sdorm.xml sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/t5/config/sdorm.xml - rm -rf web/t3 + rm -rf web/t3 web/t6 web/t7 if [ "$4" = "pool" ] then sed -i 's|"TeBkUmLpqAsyncRouter"|"TeBkUmLpqAsyncRouterPooled"|g' $IROOT/ffead-cpp-src/web/t4/config/application.xml sed -i 's|TeBkUmLpqAsyncRouter|TeBkUmLpqAsyncRouterPooled|g' $IROOT/ffead-cpp-src/web/t4/config/cachememory.xml sed -i 's|"TeBkUmLpqQwAsyncRouter"|"TeBkUmLpqQwAsyncRouterPooled"|g' $IROOT/ffead-cpp-src/web/t5/config/application.xml fi +elif [ "$3" = "wire" ] +then + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t3)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t3/libt3${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t4)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t4/libt4${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t5)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t5/libt5${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t7)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t7/libt7${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/t6/config/sdorm.xml + rm -rf web/t3 web/t4 web/t5 web/t7 +elif [ "$3" = "async-wire" ] +then + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t3)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t3/libt3${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t4)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t4/libt4${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t5)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t5/libt5${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t6)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t6/libt6${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/t7/config/sdorm.xml + rm -rf web/t3 web/t4 web/t5 web/t6 else sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t4)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t4/libt4${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t5)||g' CMakeLists.txt sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t5/libt5${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t6)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t6/libt6${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt + sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/t7)||g' CMakeLists.txt + sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/t7/libt7${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/t3/config/sdorm.xml - rm -rf web/t4 web/t5 + rm -rf web/t4 web/t5 web/t6 web/t7 fi \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/sql-v-picov-profiled-install.sh b/frameworks/C++/ffead-cpp/sql-v-picov-profiled-install.sh index 28390d04749..0510b9c110b 100644 --- a/frameworks/C++/ffead-cpp/sql-v-picov-profiled-install.sh +++ b/frameworks/C++/ffead-cpp/sql-v-picov-profiled-install.sh @@ -1,31 +1,63 @@ -export FFEAD_CPP_PATH=${IROOT}/ffead-cpp-6.0-sql +export FFEAD_CPP_PATH=${IROOT}/ffead-cpp-7.0-sql export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/lib:$LD_LIBRARY_PATH -sed -i 's|tfb-database|localhost|g' ${FFEAD_CPP_PATH}/web/t3/config/sdorm.xml -sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${FFEAD_CPP_PATH}/web/t3/config/application.xml +if [ "$1" = "async" ] +then + rm -rf $FFEAD_CPP_PATH/web/t1 $FFEAD_CPP_PATH/web/t2 $FFEAD_CPP_PATH/web/t3 $FFEAD_CPP_PATH/web/t5 $FFEAD_CPP_PATH/web/t6 $FFEAD_CPP_PATH/web/t7 + sed -i 's|false|true|g' $FFEAD_CPP_PATH/web/t4/config/sdorm.xml + sed -i 's|tfb-database|localhost|g' $FFEAD_CPP_PATH/web/t4/config/sdorm.xml +elif [ "$1" = "async-pool" ] +then + rm -rf $FFEAD_CPP_PATH/web/t1 $FFEAD_CPP_PATH/web/t2 $FFEAD_CPP_PATH/web/t3 $FFEAD_CPP_PATH/web/t4 $FFEAD_CPP_PATH/web/t6 $FFEAD_CPP_PATH/web/t7 + sed -i 's|false|true|g' $FFEAD_CPP_PATH/web/t5/config/sdorm.xml + sed -i 's|tfb-database|localhost|g' $FFEAD_CPP_PATH/web/t5/config/sdorm.xml +elif [ "$1" = "wire" ] +then + rm -rf $FFEAD_CPP_PATH/web/t1 $FFEAD_CPP_PATH/web/t2 $FFEAD_CPP_PATH/web/t3 $FFEAD_CPP_PATH/web/t4 $FFEAD_CPP_PATH/web/t5 $FFEAD_CPP_PATH/web/t7 + sed -i 's|false|true|g' $FFEAD_CPP_PATH/web/t6/config/sdorm.xml + sed -i 's|tfb-database|localhost|g' $FFEAD_CPP_PATH/web/t6/config/sdorm.xml + sed -i 's|false|true|g' $FFEAD_CPP_PATH/web/t6/config/sdorm.xml +elif [ "$1" = "async-wire" ] +then + rm -rf $FFEAD_CPP_PATH/web/t1 $FFEAD_CPP_PATH/web/t2 $FFEAD_CPP_PATH/web/t3 $FFEAD_CPP_PATH/web/t4 $FFEAD_CPP_PATH/web/t5 $FFEAD_CPP_PATH/web/t6 + sed -i 's|false|true|g' $FFEAD_CPP_PATH/web/t7/config/sdorm.xml + sed -i 's|tfb-database|localhost|g' $FFEAD_CPP_PATH/web/t7/config/sdorm.xml + sed -i 's|false|true|g' $FFEAD_CPP_PATH/web/t7/config/sdorm.xml +else + rm -rf $FFEAD_CPP_PATH/web/t1 $FFEAD_CPP_PATH/web/t2 $FFEAD_CPP_PATH/web/t4 $FFEAD_CPP_PATH/web/t5 $FFEAD_CPP_PATH/web/t6 $FFEAD_CPP_PATH/web/t7 + sed -i 's|tfb-database|localhost|g' ${FFEAD_CPP_PATH}/web/t3/config/sdorm.xml + sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${FFEAD_CPP_PATH}/web/t3/config/application.xml +fi + cd $IROOT/lang-server-backends/v/pico.v -v -prod -cflags '-std=gnu11 -Wall -O3 -march=native -mtune=native -no-pie -flto -fprofile-dir=/tmp/profile-data -fprofile-generate -lgcov --coverage' main.v +v -enable-globals -prod -cflags '-std=gnu11 -Wall -O3 -march=native -mtune=native -no-pie -flto -fprofile-dir=/tmp/profile-data -fprofile-generate -lgcov --coverage' main.v #Start postgresql service postgresql start #For profiling/benchmarking cd $IROOT/ -./install_ffead-cpp-sql-raw-v-picov-profiled.sh +./install_ffead-cpp-sql-raw-v-picov-profiled.sh "$1" cd $IROOT/lang-server-backends/v/pico.v -v -prod -cflags '-std=gnu11 -Wall -O3 -march=native -mtune=native -no-pie -flto -fprofile-dir=/tmp/profile-data -fprofile-use=/tmp/profile-data -fprofile-correction -lgcov --coverage' main.v +v -enable-globals -prod -cflags '-std=gnu11 -Wall -O3 -march=native -mtune=native -no-pie -flto -fprofile-dir=/tmp/profile-data -fprofile-use=/tmp/profile-data -fprofile-correction -lgcov --coverage' main.v cd $IROOT/ -./install_ffead-cpp-sql-raw-v-picov-profiled.sh - -mv $IROOT/lang-server-backends/v/pico.v/main $IROOT/ - -sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/t3/config/sdorm.xml - -apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release -apt autoremove -yqq -rm -rf /ssd/postgresql -rm -rf /tmp/postgresql -rm -rf /tmp/wrk /usr/local/bin/wrk +./install_ffead-cpp-sql-raw-v-picov-profiled.sh "$1" + +if [ "$1" = "async" ] || [ "$1" = "async-wire" ] +then + sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-7.0-sql/web/t4/config/sdorm.xml + mv $IROOT/lang-server-backends/v/pico.v/main $IROOT/main_async +elif [ "$1" = "async-pool" ] +then + sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-7.0-sql/web/t4/config/sdorm.xml + mv $IROOT/lang-server-backends/v/pico.v/main $IROOT/main_async_pool +else + sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-7.0-sql/web/t3/config/sdorm.xml + mv $IROOT/lang-server-backends/v/pico.v/main $IROOT/ +fi + +apt remove -yqq postgresql-${PG_VERSION} postgresql-contrib-${PG_VERSION} gnupg lsb-release && apt autoremove -yqq +rm -rf /ssd/postgresql && rm -rf /tmp/postgresql && rm -rf /tmp/wrk /usr/local/bin/wrk diff --git a/frameworks/C++/ffead-cpp/t1/CMakeLists.txt b/frameworks/C++/ffead-cpp/t1/CMakeLists.txt deleted file mode 100644 index 1d964b54eea..00000000000 --- a/frameworks/C++/ffead-cpp/t1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ - -file(GLOB sources - "include/*.h" - "src/*.cpp" -) - -include_directories("${CMAKE_SOURCE_DIR}/web/t1/include") -if(BUILD_STATIC_LIBS OR EMSCRIPTEN) - add_library(t1 STATIC ${sources}) -else() - add_library(t1 ${sources}) -endif() -target_link_libraries(t1 ffead-modules ffead-framework ${HAVE_CURLLIB} ${HAVE_SSLLIB} ${HAVE_MEMCACHEDLIB} ${HAVE_ODBCLIB} ${HAVE_MONGOCLIB} ${HAVE_BSONLIB} ${HAVE_ZLIB} ${HAVE_CRYPTOLIB}) diff --git a/frameworks/C++/ffead-cpp/t1/config/sdormmongo.xml b/frameworks/C++/ffead-cpp/t1/config/sdormmongo.xml deleted file mode 100644 index e49cad726d0..00000000000 --- a/frameworks/C++/ffead-cpp/t1/config/sdormmongo.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - localhost - 27017 - hello_world - 10000 - - - 30 - MongoDB-DSN - mongo - - - diff --git a/frameworks/C++/ffead-cpp/t1/config/sdormmysql.xml b/frameworks/C++/ffead-cpp/t1/config/sdormmysql.xml deleted file mode 100644 index 0c8e55f28d6..00000000000 --- a/frameworks/C++/ffead-cpp/t1/config/sdormmysql.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - MySQL-DSN - benchmarkdbuser - benchmarkdbpass - - - 30 - MySQL-DSN - sql - MySQLMyISAMDialect - - - diff --git a/frameworks/C++/ffead-cpp/t1/config/sdormpostgresql.xml b/frameworks/C++/ffead-cpp/t1/config/sdormpostgresql.xml deleted file mode 100644 index 15595ae2ebf..00000000000 --- a/frameworks/C++/ffead-cpp/t1/config/sdormpostgresql.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - PostgreSQL-DSN - benchmarkdbuser - benchmarkdbpass - - - 30 - PostgreSQL-DSN - sql - PostgresDialect - - - diff --git a/frameworks/C++/ffead-cpp/t1/include/TeBkUm.h b/frameworks/C++/ffead-cpp/t1/include/TeBkUm.h deleted file mode 100644 index fe078f31a83..00000000000 --- a/frameworks/C++/ffead-cpp/t1/include/TeBkUm.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUm.h - * - * Created on: 03-Feb-2020 - * Author: sumeetc - */ - -#ifndef WEB_t1_INCLUDE_TeBkUm_H_ -#define WEB_t1_INCLUDE_TeBkUm_H_ -#include "TemplateHandler.h" -#include "vector" -#include "DataSourceManager.h" -#include -#include -#include "CryptoHandler.h" -#include "vector" -#include "CastUtil.h" -#include -#include "CacheManager.h" -#include "HttpRequest.h" -#include "HttpResponse.h" -#include "JSONSerialize.h" -#include "string" -#include "TeBkUmWorld.h" -#include "yuarel.h" -#include "Router.h" - -#pragma @Entity -#pragma @Table name="fortune" -class TeBkUmFortune { - #pragma @Id dbf="id" - int id; - #pragma @Column dbf="message" - std::string message; -public: - TeBkUmFortune(); - virtual ~TeBkUmFortune(); - int getId() const; - void setId(int id); - const std::string& getMessage() const; - void setMessage(const std::string& message); - bool operator < (const TeBkUmFortune& other) const; -}; - -class TeBkUmMessage { - std::string message; -public: - virtual ~TeBkUmMessage(); - const std::string& getMessage() const; - void setMessage(const std::string& message); -}; - -class TeBkUmRouter : public Router { - static const std::string HELLO_WORLD; - static std::string WORLD; - - static TemplatePtr tmplFunc; - - static Ser m_ser; - static Ser w_ser; - static SerCont wcont_ser; - - bool strToNum(const char* str, int len, int& ret); - void db(TeBkUmWorld&); - void queries(const char*, int, std::vector&); - void updates(const char*, int, std::vector&); - void cachedWorlds(const char*, int, std::vector&); - void getContext(HttpRequest* request, Context* context); -public: - TeBkUmRouter(); - virtual ~TeBkUmRouter(); - void updateCache(); - bool route(HttpRequest* req, HttpResponse* res, BaseSocket* sif); -}; - -#endif /* WEB_t1_INCLUDE_TeBkUm_H_ */ diff --git a/frameworks/C++/ffead-cpp/t1/include/TeBkUmWorld.h b/frameworks/C++/ffead-cpp/t1/include/TeBkUmWorld.h deleted file mode 100644 index 68d4e31f331..00000000000 --- a/frameworks/C++/ffead-cpp/t1/include/TeBkUmWorld.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmWorld.h - * - * Created on: 11-Mar-2015 - * Author: sumeetc - */ - -#ifndef TeBkUmWORLD_H_ -#define TeBkUmWORLD_H_ -#include "string" - - -#pragma @Entity -#pragma @Table name="world" -class TeBkUmWorld { - #pragma @Id dbf="_id" - int id; - #pragma @Column dbf="randomNumber" - int randomNumber; - #pragma @IgnoreSer - #pragma @Column dbf="id" - int anotherId; -public: - TeBkUmWorld(); - virtual ~TeBkUmWorld(); - int getId() const; - void setId(int id); - int getRandomNumber() const; - void setRandomNumber(int randomNumber); - int getAnotherId() const; - void setAnotherId(int anotherId); -}; - -#endif /* TeBkUmWORLD_H_ */ diff --git a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.cpp b/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.cpp deleted file mode 100644 index d11d3816ed4..00000000000 --- a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmWorld.cpp - * - * Created on: 11-Mar-2015 - * Author: sumeetc - */ - -#include "TeBkUmWorld.h" - -int TeBkUmWorld::getId() const { - return id; -} - -void TeBkUmWorld::setId(int id) { - this->id = id; -} - -int TeBkUmWorld::getRandomNumber() const { - return randomNumber; -} - -void TeBkUmWorld::setRandomNumber(int randomNumber) { - this->randomNumber = randomNumber; -} - -TeBkUmWorld::TeBkUmWorld() { - id = 0; - randomNumber = 0; - anotherId = 0; -} - -TeBkUmWorld::~TeBkUmWorld() { - // TODO Auto-generated destructor stub -} - -int TeBkUmWorld::getAnotherId() const { - return anotherId; -} - -void TeBkUmWorld::setAnotherId(int anotherId) { - this->anotherId = anotherId; -} - diff --git a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.h b/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.h deleted file mode 100644 index 68d4e31f331..00000000000 --- a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldmongo.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmWorld.h - * - * Created on: 11-Mar-2015 - * Author: sumeetc - */ - -#ifndef TeBkUmWORLD_H_ -#define TeBkUmWORLD_H_ -#include "string" - - -#pragma @Entity -#pragma @Table name="world" -class TeBkUmWorld { - #pragma @Id dbf="_id" - int id; - #pragma @Column dbf="randomNumber" - int randomNumber; - #pragma @IgnoreSer - #pragma @Column dbf="id" - int anotherId; -public: - TeBkUmWorld(); - virtual ~TeBkUmWorld(); - int getId() const; - void setId(int id); - int getRandomNumber() const; - void setRandomNumber(int randomNumber); - int getAnotherId() const; - void setAnotherId(int anotherId); -}; - -#endif /* TeBkUmWORLD_H_ */ diff --git a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.cpp b/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.cpp deleted file mode 100644 index 53de8d9b75f..00000000000 --- a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmWorld.cpp - * - * Created on: 11-Mar-2015 - * Author: sumeetc - */ - -#include "TeBkUmWorld.h" - -int TeBkUmWorld::getId() const { - return id; -} - -void TeBkUmWorld::setId(int id) { - this->id = id; -} - -int TeBkUmWorld::getRandomNumber() const { - return randomNumber; -} - -void TeBkUmWorld::setRandomNumber(int randomNumber) { - this->randomNumber = randomNumber; -} - -TeBkUmWorld::TeBkUmWorld() { - id = 0; - randomNumber = 0; -} - -TeBkUmWorld::~TeBkUmWorld() { - // TODO Auto-generated destructor stub -} - diff --git a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.h b/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.h deleted file mode 100644 index 4df56954935..00000000000 --- a/frameworks/C++/ffead-cpp/t1/sql-src/TeBkUmWorldsql.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmWorld.h - * - * Created on: 11-Mar-2015 - * Author: sumeetc - */ - -#ifndef TeBkUmWORLD_H_ -#define TeBkUmWORLD_H_ -#include "string" - - -#pragma @Entity -#pragma @Table name="world" -class TeBkUmWorld { - #pragma @Id dbf="id" - int id; - #pragma @Column dbf="randomNumber" - int randomNumber; -public: - TeBkUmWorld(); - virtual ~TeBkUmWorld(); - int getId() const; - void setId(int id); - int getRandomNumber() const; - void setRandomNumber(int randomNumber); -}; - -#endif /* TeBkUmWORLD_H_ */ diff --git a/frameworks/C++/ffead-cpp/t1/src/TeBkUm.cpp b/frameworks/C++/ffead-cpp/t1/src/TeBkUm.cpp deleted file mode 100644 index 78b781a89b8..00000000000 --- a/frameworks/C++/ffead-cpp/t1/src/TeBkUm.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmUm.cpp - * - * Created on: 03-Feb-2020 - * Author: sumeetc - */ -#include "TeBkUm.h" - -int TeBkUmFortune::getId() const { - return id; -} - -void TeBkUmFortune::setId(int id) { - this->id = id; -} - -const std::string& TeBkUmFortune::getMessage() const { - return message; -} - -void TeBkUmFortune::setMessage(const std::string& message) { - this->message = message; -} - -TeBkUmFortune::TeBkUmFortune() { - id = 0; -} - -TeBkUmFortune::~TeBkUmFortune() { -} - -bool TeBkUmFortune::operator < (const TeBkUmFortune& other) const { - return message.compare(other.message)<0; -} - -TeBkUmMessage::~TeBkUmMessage() { -} - -const std::string& TeBkUmMessage::getMessage() const { - return message; -} - -void TeBkUmMessage::setMessage(const std::string& message) { - this->message = message; -} - -const std::string TeBkUmRouter::HELLO_WORLD = "Hello, World!"; -std::string TeBkUmRouter::WORLD = "world"; - -void TeBkUmRouter::db(TeBkUmWorld& w) { - DataSourceInterface* sqli = DataSourceManager::getImpl(); - int rid = rand() % 10000 + 1; - GenericObject id; - id << rid; - try { - w = sqli->get(id); - DataSourceManager::cleanImpl(sqli); - } catch(const std::exception& e) { - DataSourceManager::cleanImpl(sqli); - throw e; - } -} - -void TeBkUmRouter::queries(const char* q, int ql, std::vector& wlst) { - int queryCount = 0; - strToNum(q, ql, queryCount); - if(queryCount<1)queryCount=1; - else if(queryCount>500)queryCount=500; - - DataSourceInterface* sqli = DataSourceManager::getImpl(); - - try { - sqli->startSession(&WORLD); - for (int c = 0; c < queryCount; ++c) { - int rid = rand() % 10000 + 1; - GenericObject id; - id << rid; - TeBkUmWorld w = sqli->get(id); - wlst.push_back(w); - } - sqli->endSession(); - DataSourceManager::cleanImpl(sqli); - } catch(const std::exception& e) { - DataSourceManager::cleanImpl(sqli); - throw e; - } -} - -void TeBkUmRouter::updates(const char* q, int ql, std::vector& wlst) { - int queryCount = 0; - strToNum(q, ql, queryCount); - if(queryCount<1)queryCount=1; - else if(queryCount>500)queryCount=500; - - DataSourceInterface* sqli = DataSourceManager::getImpl(); - - try { - sqli->startSession(&WORLD); - for (int c = 0; c < queryCount; ++c) { - int rid = rand() % 10000 + 1; - GenericObject id; - id << rid; - TeBkUmWorld w = sqli->get(id); - int newRandomNumber = rand() % 10000 + 1; - if(w.getRandomNumber() == newRandomNumber) { - newRandomNumber += 1; - if(newRandomNumber>=10000) { - newRandomNumber = 1; - } - } - w.setRandomNumber(newRandomNumber); - wlst.push_back(w); - } - - sqli->startTransaction(); - sqli->bulkUpdate(wlst); - sqli->commit(); - - sqli->endSession(); - DataSourceManager::cleanImpl(sqli); - } catch(const std::exception& e) { - DataSourceManager::cleanImpl(sqli); - throw e; - } -} - -void TeBkUmRouter::updateCache() { - CacheInterface* cchi = CacheManager::getImpl(); - DataSourceInterface* sqli = DataSourceManager::getImpl(); - - try { - sqli->startSession(&WORLD); - std::vector wlist = sqli->getAll(); - sqli->endSession(); - for (int c = 0; c < (int)wlist.size(); ++c) { - TeBkUmWorld& w = wlist.at(c); - cchi->setO(CastUtil::fromNumber(w.getId()), w); - } - DataSourceManager::cleanImpl(sqli); - CacheManager::cleanImpl(cchi); - CacheManager::triggerAppInitCompletion(); - } catch(const std::exception& e) { - DataSourceManager::cleanImpl(sqli); - CacheManager::cleanImpl(cchi); - throw e; - } -} - -void TeBkUmRouter::cachedWorlds(const char* q, int ql, std::vector& wlst) { - int queryCount = 0; - strToNum(q, ql, queryCount); - if(queryCount<1)queryCount=1; - else if(queryCount>500)queryCount=500; - - CacheInterface* cchi = CacheManager::getImpl(); - - try { - std::vector keys; - for (int c = 0; c < queryCount; ++c) { - int rid = rand() % 10000 + 1; - keys.push_back(CastUtil::fromNumber(rid)); - } - - cchi->mgetO(keys, wlst); - CacheManager::cleanImpl(cchi); - } catch(const std::exception& e) { - CacheManager::cleanImpl(cchi); - throw e; - } -} - -void TeBkUmRouter::getContext(HttpRequest* request, Context* context) { - DataSourceInterface* sqli = DataSourceManager::getImpl(); - - try { - std::vector flstT = sqli->getAll(); - std::vector* flst = new std::vector; - flst->swap(flstT); - - for(int i=0;i<(int)flst->size();i++) - { - std::string nm = flst->at(i).getMessage(); - CryptoHandler::sanitizeHtml(nm); - flst->at(i).setMessage(nm); - } - - TeBkUmFortune nf; - nf.setId(0); - nf.setMessage("Additional fortune added at request time."); - flst->push_back(nf); - std::sort (flst->begin(), flst->end()); - - context->insert(std::pair("fortunes", flst)); - - DataSourceManager::cleanImpl(sqli); - } catch(...) { - DataSourceManager::cleanImpl(sqli); - throw; - } -} - -//https://stackoverflow.com/questions/9631225/convert-strings-specified-by-length-not-nul-terminated-to-int-float -bool TeBkUmRouter::strToNum(const char* str, int len, int& ret) { - ret = 0; - for(int i = 0; i < len; ++i) - { - if(!isdigit(str[i])) return false; - ret = ret * 10 + (str[i] - '0'); - } - return true; -} - -bool TeBkUmRouter::route(HttpRequest* req, HttpResponse* res, BaseSocket* sif) { - std::string_view path = req->getPath(); - if(StringUtil::endsWith(path, "/plaint")) { - res->setContent(HELLO_WORLD); - res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_PLAIN); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/j")) { - TeBkUmMessage msg; - msg.setMessage(HELLO_WORLD); - JSONSerialize::serializeObject(&msg, m_ser, res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/d")) { - TeBkUmWorld msg; - db(msg); - JSONSerialize::serializeObject(&msg, w_ser, res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/quer")) { - struct yuarel_param params[1]; - yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - std::vector msg; - queries(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/fortu")) { - Context ctx; - getContext(req, &ctx); - - if(tmplFunc!=NULL) - { - fcpstream str; - tmplFunc(&ctx, str); - res->setContent(str.str()); - res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } - } else if(StringUtil::endsWith(path, "/updt")) { - struct yuarel_param params[1]; - yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - std::vector msg; - updates(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/cached-wld")) { - struct yuarel_param params[1]; - yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - std::vector msg; - cachedWorlds(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else { - res->setHTTPResponseStatus(HTTPResponseStatus::NotFound); - } - res->setDone(true); - return true; -} - -TemplatePtr TeBkUmRouter::tmplFunc; -Ser TeBkUmRouter::m_ser; -Ser TeBkUmRouter::w_ser; -SerCont TeBkUmRouter::wcont_ser; - -TeBkUmRouter::TeBkUmRouter() { - tmplFunc = TemplateUtil::getTemplateFunc("t1", "tpe/fortunes.tpe"); - m_ser = Serializer::getSerFuncForObject("t1", "TeBkUmMessage"); - w_ser = Serializer::getSerFuncForObject("t1", "TeBkUmWorld"); - wcont_ser = Serializer::getSerFuncForObjectCont("t1", "TeBkUmWorld", "std::vector"); -} - -TeBkUmRouter::~TeBkUmRouter() { -} diff --git a/frameworks/C++/ffead-cpp/t1/src/TeBkUmWorld.cpp b/frameworks/C++/ffead-cpp/t1/src/TeBkUmWorld.cpp deleted file mode 100644 index d11d3816ed4..00000000000 --- a/frameworks/C++/ffead-cpp/t1/src/TeBkUmWorld.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmWorld.cpp - * - * Created on: 11-Mar-2015 - * Author: sumeetc - */ - -#include "TeBkUmWorld.h" - -int TeBkUmWorld::getId() const { - return id; -} - -void TeBkUmWorld::setId(int id) { - this->id = id; -} - -int TeBkUmWorld::getRandomNumber() const { - return randomNumber; -} - -void TeBkUmWorld::setRandomNumber(int randomNumber) { - this->randomNumber = randomNumber; -} - -TeBkUmWorld::TeBkUmWorld() { - id = 0; - randomNumber = 0; - anotherId = 0; -} - -TeBkUmWorld::~TeBkUmWorld() { - // TODO Auto-generated destructor stub -} - -int TeBkUmWorld::getAnotherId() const { - return anotherId; -} - -void TeBkUmWorld::setAnotherId(int anotherId) { - this->anotherId = anotherId; -} - diff --git a/frameworks/C++/ffead-cpp/t1/src/autotools/Makefile.am b/frameworks/C++/ffead-cpp/t1/src/autotools/Makefile.am deleted file mode 100644 index f80da1e9e23..00000000000 --- a/frameworks/C++/ffead-cpp/t1/src/autotools/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -AM_CPPFLAGS=-I"../../../../include" -I"../../include" - -packageIdentifier=${PACKAGE_NAME}-${PACKAGE_VERSION}-bin -distdir=${PACKAGE_NAME}-${PACKAGE_VERSION}-src -fprefix=../../../../${packageIdentifier} -prefix=${abs_builddir} - -lib_LTLIBRARIES = libt1.la -libt1_la_SOURCES = ../TeBkUmWorld.cpp \ - ../TeBkUm.cpp - -libt1_la_LDFLAGS = -no-undefined -libt1_la_LIBADD = -L"${fprefix}/lib" -lffead-modules -lffead-framework - -#dist_noinst_SCRIPTS = autogen.sh \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/t1/tpe/fortunes.tpe b/frameworks/C++/ffead-cpp/t1/tpe/fortunes.tpe deleted file mode 100644 index 50de7ef062c..00000000000 --- a/frameworks/C++/ffead-cpp/t1/tpe/fortunes.tpe +++ /dev/null @@ -1,13 +0,0 @@ -#declare std::vector fortunes# - - -Fortunes - - - -#for(int i=0;i<(int)fortunes.size();i++)# - -#rof# -
idmessage
${fortunes.at(i).getId()}${fortunes.at(i).getMessage()}
- - \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/t2/CMakeLists.txt b/frameworks/C++/ffead-cpp/t2/CMakeLists.txt deleted file mode 100644 index 426c84baaf9..00000000000 --- a/frameworks/C++/ffead-cpp/t2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ - -file(GLOB sources - "include/*.h" - "src/*.cpp" -) - -include_directories("${CMAKE_SOURCE_DIR}/web/t2/include") -if(BUILD_STATIC_LIBS OR EMSCRIPTEN) - add_library(t2 STATIC ${sources}) -else() - add_library(t2 ${sources}) -endif() -target_link_libraries(t2 ffead-modules ffead-framework ${HAVE_PQLIB} ${HAVE_CURLLIB} ${HAVE_SSLLIB} ${HAVE_MEMCACHEDLIB} ${HAVE_ODBCLIB} ${HAVE_MONGOCLIB} ${HAVE_BSONLIB} ${HAVE_ZLIB} ${HAVE_CRYPTOLIB}) diff --git a/frameworks/C++/ffead-cpp/t2/config/cachememcached.xml b/frameworks/C++/ffead-cpp/t2/config/cachememcached.xml deleted file mode 100644 index c42df4f67ca..00000000000 --- a/frameworks/C++/ffead-cpp/t2/config/cachememcached.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - localhost - 11211 - - - TeBkUmMgrRouter.updateCache - 10 - 3600 - Memcached-Cached - memcached - - \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/t2/config/cacheredis.xml b/frameworks/C++/ffead-cpp/t2/config/cacheredis.xml deleted file mode 100644 index f802a2e9b63..00000000000 --- a/frameworks/C++/ffead-cpp/t2/config/cacheredis.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - localhost - 6379 - - - TeBkUmMgrRouter.updateCache - 10 - 3600 - Redis-Cached - redis - - \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/t2/config/sdorm.xml b/frameworks/C++/ffead-cpp/t2/config/sdorm.xml deleted file mode 100644 index 5094fe150df..00000000000 --- a/frameworks/C++/ffead-cpp/t2/config/sdorm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - localhost - 27017 - hello_world - 10000 - - - 30 - MongoDB-DSN - mongo-raw - - - diff --git a/frameworks/C++/ffead-cpp/t2/include/TeBkUmMgr.h b/frameworks/C++/ffead-cpp/t2/include/TeBkUmMgr.h deleted file mode 100644 index fb4c5573eae..00000000000 --- a/frameworks/C++/ffead-cpp/t2/include/TeBkUmMgr.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmMgr.h - * - * Created on: 03-Feb-2020 - * Author: sumeetc - */ - -#ifndef WEB_t1_INCLUDE_TeBkUmMgr_H_ -#define WEB_t1_INCLUDE_TeBkUmMgr_H_ -#include "TemplateHandler.h" -#include "vector" -#ifndef OS_MINGW -#include -#include -#endif -#include "DataSourceManager.h" -#include -#include -#include "CryptoHandler.h" -#include "vector" -#include "CastUtil.h" -#include -#include "CacheManager.h" -#include "HttpRequest.h" -#include "HttpResponse.h" -#include "JSONSerialize.h" -#include "string" -#include "yuarel.h" -#include "Router.h" - -class TeBkUmMgrWorld { - int id; - int randomNumber; -public: - TeBkUmMgrWorld(int id); - TeBkUmMgrWorld(int id, int randomNumber); - TeBkUmMgrWorld(); - virtual ~TeBkUmMgrWorld(); - int getId() const; - void setId(int id); - int getRandomNumber() const; - void setRandomNumber(int randomNumber); -}; - -class TeBkUmMgrFortune { - int id; - std::string message; -public: - TeBkUmMgrFortune(); - virtual ~TeBkUmMgrFortune(); - int getId() const; - void setId(int id); - const std::string& getMessage() const; - void setMessage(const std::string& message); - bool operator < (const TeBkUmMgrFortune& other) const; -}; - -class TeBkUmMgrMessage { - std::string message; -public: - virtual ~TeBkUmMgrMessage(); - const std::string& getMessage() const; - void setMessage(const std::string& message); -}; - -class TeBkUmMgrRouter : public Router { - static const std::string HELLO_WORLD; - static std::string WORLD; - static std::string FORTUNE; - - static TemplatePtr tmplFunc; - - static Ser m_ser; - static Ser w_ser; - static SerCont wcont_ser; - - bool strToNum(const char* str, int len, int& ret); - - void db(TeBkUmMgrWorld&); - void queries(const char*, int, std::vector&); -#ifdef INC_SDORM_MONGO - static void dbUtil(void* ctx, int rn, std::vector& data); -#endif - - void updates(const char*, int, std::vector&); - - void cachedWorlds(const char*, int, std::vector&); -#ifdef INC_SDORM_MONGO - static void updateCacheUtil(void* ctx, int rn, std::vector& data); -#endif - - void getContext(HttpRequest* request, Context* context); -#ifdef INC_SDORM_MONGO - static void getContextUtil(void* ctx, int rn, std::vector& data); - MongoDBRawDataSourceImpl* sqli; - MongoDBRawDataSourceImpl* getDb(); -#endif -public: - TeBkUmMgrRouter(); - virtual ~TeBkUmMgrRouter(); - void updateCache(); - bool route(HttpRequest* req, HttpResponse* res, BaseSocket* sif); -}; - -#endif /* WEB_t1_INCLUDE_TeBkUmMgr_H_ */ diff --git a/frameworks/C++/ffead-cpp/t2/meson.build b/frameworks/C++/ffead-cpp/t2/meson.build deleted file mode 100644 index c75757e4320..00000000000 --- a/frameworks/C++/ffead-cpp/t2/meson.build +++ /dev/null @@ -1,15 +0,0 @@ - -module_includes = ['/usr/local/include','../../src/modules/common','../../src/modules/cache','../../src/modules/cache/memory','../../src/modules/cache/redis', - '../../src/modules/cache/memcached','../../src/modules/client-util','../../src/modules/http','../../src/modules/http/http11','../../src/modules/http/http20', - '../../src/modules/ioc','../../src/modules/jobs','../../src/modules/reflection','../../src/modules/sdorm','../../src/modules/sdorm/sql','../../src/modules/sdorm/sql/libpq', - '../../src/modules/client-util/ssl','../../src/modules/sdorm/mongo','../../src/modules/sdorm/mongo/raw','../../src/modules/search','../../src/modules/serialization', - '../../src/modules/serialization/xml','../../src/modules/serialization/json','../../src/modules/server-util','../../src/modules/ssl','../../src/modules/threads', - '../../src/framework','include'] -module_includes += global_includes -module_libs = [global_libs, libbson, libmongoc] - -c = run_command(meson_grabber, 'src/') -module_sources = c.stdout().strip().split('\n') - -shared_library('t2', module_sources, include_directories: module_includes, dependencies: module_libs, link_with: [libffeadmodules, libffeadframework], - install: true, install_dir: bin_dir+'/lib') \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/t2/src/TeBkUmMgr.cpp b/frameworks/C++/ffead-cpp/t2/src/TeBkUmMgr.cpp deleted file mode 100644 index ab1e83d36a8..00000000000 --- a/frameworks/C++/ffead-cpp/t2/src/TeBkUmMgr.cpp +++ /dev/null @@ -1,427 +0,0 @@ -/* - Copyright 2009-2020, Sumeet Chhetri - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -/* - * TeBkUmMgrUm.cpp - * - * Created on: 03-Feb-2020 - * Author: sumeetc - */ -#include "TeBkUmMgr.h" - -int TeBkUmMgrWorld::getId() const { - return id; -} - -void TeBkUmMgrWorld::setId(int id) { - this->id = id; -} - -int TeBkUmMgrWorld::getRandomNumber() const { - return randomNumber; -} - -void TeBkUmMgrWorld::setRandomNumber(int randomNumber) { - this->randomNumber = randomNumber; -} - -TeBkUmMgrWorld::TeBkUmMgrWorld(int id) { - this->id = id; - randomNumber = 0; -} - -TeBkUmMgrWorld::TeBkUmMgrWorld(int id, int randomNumber) { - this->id = id; - this->randomNumber = randomNumber; -} - -TeBkUmMgrWorld::TeBkUmMgrWorld() { - id = 0; - randomNumber = 0; -} - -TeBkUmMgrWorld::~TeBkUmMgrWorld() { -} - -int TeBkUmMgrFortune::getId() const { - return id; -} - -void TeBkUmMgrFortune::setId(int id) { - this->id = id; -} - -const std::string& TeBkUmMgrFortune::getMessage() const { - return message; -} - -void TeBkUmMgrFortune::setMessage(const std::string& message) { - this->message = message; -} - -TeBkUmMgrFortune::TeBkUmMgrFortune() { - id = 0; -} - -TeBkUmMgrFortune::~TeBkUmMgrFortune() { -} - -bool TeBkUmMgrFortune::operator < (const TeBkUmMgrFortune& other) const { - return message.compare(other.message)<0; -} - -TeBkUmMgrMessage::~TeBkUmMgrMessage() { -} - -const std::string& TeBkUmMgrMessage::getMessage() const { - return message; -} - -void TeBkUmMgrMessage::setMessage(const std::string& message) { - this->message = message; -} - -const std::string TeBkUmMgrRouter::HELLO_WORLD = "Hello, World!"; -std::string TeBkUmMgrRouter::WORLD = "world"; -std::string TeBkUmMgrRouter::FORTUNE = "fortune"; - -void TeBkUmMgrRouter::db(TeBkUmMgrWorld& w) { -#ifdef INC_SDORM_MONGO - MongoDBRawDataSourceImpl* sqli = getDb(); - int rid = rand() % 10000 + 1; - try { - bson_t q = BSON_INITIALIZER; - bson_append_int32(&q, "_id", 3, rid); - sqli->begin(WORLD); - sqli->executeQuery(&q, &w, &TeBkUmMgrRouter::dbUtil); - sqli->end(); - bson_destroy(&q); - } catch(const std::exception& e) { - throw e; - } -#endif -} -#ifdef INC_SDORM_MONGO -void TeBkUmMgrRouter::dbUtil(void* ctx, int rn, std::vector& data) { - TeBkUmMgrWorld* w = (TeBkUmMgrWorld*)ctx; - for(int i=0;i<(int)data.size();i++) { - if(data.at(i).n=="_id") { - w->setId((int)data.at(i).d); - if(w->getId()<=0) { - w->setId((int)data.at(i).l); - } - } - if(data.at(i).n=="randomNumber") { - w->setRandomNumber((int)data.at(i).d); - if(w->getRandomNumber()==0) { - w->setRandomNumber((int)data.at(i).l); - } - } - } -} -#endif - -void TeBkUmMgrRouter::queries(const char* q, int ql, std::vector& wlst) { - int queryCount = 0; - strToNum(q, ql, queryCount); - if(queryCount<1)queryCount=1; - else if(queryCount>500)queryCount=500; -#ifdef INC_SDORM_MONGO - MongoDBRawDataSourceImpl* sqli = getDb(); - - try { - TeBkUmMgrWorld w; - sqli->begin(WORLD); - for (int c = 0; c < queryCount; ++c) { - int rid = rand() % 10000 + 1; - bson_t q = BSON_INITIALIZER; - bson_append_int32(&q, "_id", 3, rid); - sqli->executeQuery(&q, &w, &TeBkUmMgrRouter::dbUtil); - bson_destroy(&q); - wlst.push_back(w); - } - sqli->end(); - } catch(const std::exception& e) { - throw e; - } -#endif -} - -void TeBkUmMgrRouter::updates(const char* q, int ql, std::vector& wlst) { - int queryCount = 0; - strToNum(q, ql, queryCount); - if(queryCount<1)queryCount=1; - else if(queryCount>500)queryCount=500; -#ifdef INC_SDORM_MONGO - MongoDBRawDataSourceImpl* sqli = getDb(); - - try { - sqli->startBulk(WORLD); - for (int c = 0; c < queryCount; ++c) { - int rid = rand() % 10000 + 1; - bson_t q; - bson_init(&q); - bson_append_int32(&q, "_id", 3, rid); - TeBkUmMgrWorld w; - sqli->executeQuery(&q, &w, &TeBkUmMgrRouter::dbUtil); - int newRandomNumber = rand() % 10000 + 1; - if(w.getRandomNumber() == newRandomNumber) { - newRandomNumber += 1; - if(newRandomNumber>=10000) { - newRandomNumber = 1; - } - } - w.setRandomNumber(newRandomNumber); - bson_t du; - bson_t d; - bson_init(&du); - bson_append_document_begin(&du, "$set", 4, &d); - //bson_append_int32(&d, "_id", 3, w.getId()); - bson_append_int32(&d, "randomNumber", 12, w.getRandomNumber()); - bson_append_document_end(&du, &d); - sqli->addBulk(&q, &du); - /*char* str = bson_as_json(&du, NULL); - printf("%s\n", str); - bson_free(str);*/ - bson_destroy(&du); - bson_destroy(&q); - wlst.push_back(w); - } - sqli->endBulk(); - } catch(const std::exception& e) { - throw e; - } -#endif -} - -void TeBkUmMgrRouter::updateCache() { -#ifdef INC_SDORM_MONGO - CacheInterface* cchi = CacheManager::getImpl(); - MongoDBRawDataSourceImpl* sqli = getDb(); - - try { - std::vector wlist; - sqli->begin(WORLD); - sqli->executeQuery(NULL, &wlist, &TeBkUmMgrRouter::updateCacheUtil); - sqli->end(); - - for (int c = 0; c < (int)wlist.size(); ++c) { - TeBkUmMgrWorld& w = wlist.at(c); - char str[12]; - sprintf(str, "%d;%d", w.getId(), w.getRandomNumber()); - cchi->setRaw(w.getId(), str); - } - CacheManager::cleanImpl(cchi); - CacheManager::triggerAppInitCompletion(); - } catch(const std::exception& e) { - CacheManager::cleanImpl(cchi); - throw e; - } -#endif -} -#ifdef INC_SDORM_MONGO -void TeBkUmMgrRouter::updateCacheUtil(void* ctx, int rn, std::vector& data) { - std::vector* wlist = (std::vector*)ctx; - TeBkUmMgrWorld w; - for(int i=0;i<(int)data.size();i++) { - if(data.at(i).n=="_id") { - w.setId((int)data.at(i).d); - if(w.getId()<=0) { - w.setId((int)data.at(i).l); - } - } - if(data.at(i).n=="randomNumber") { - w.setRandomNumber((int)data.at(i).d); - if(w.getRandomNumber()<=0) { - w.setRandomNumber((int)data.at(i).l); - } - } - } - wlist->push_back(w); -} -#endif - -void TeBkUmMgrRouter::cachedWorlds(const char* q, int ql, std::vector& wlst) { - int queryCount = 0; - strToNum(q, ql, queryCount); - if(queryCount<1)queryCount=1; - else if(queryCount>500)queryCount=500; - - CacheInterface* cchi = CacheManager::getImpl(); - try { - std::vector keys; - for (int c = 0; c < queryCount; ++c) { - int rid = rand() % 10000 + 1; - keys.emplace_back(rid); - } - std::vector values; - cchi->getValues(keys, values); - for (int c = 0; c < queryCount; ++c) { - std::string& v = values.at(c); - size_t fn = v.find(";"); - int tmp = 0; - CommonUtils::fastStrToNum(v.substr(0, fn).c_str(), fn, tmp); - int tmp1 = 0; - CommonUtils::fastStrToNum(v.substr(fn+1).c_str(), v.length()-fn-1, tmp1); - wlst.emplace_back(tmp, tmp1); - } - CacheManager::cleanImpl(cchi); - } catch(const std::exception& e) { - CacheManager::cleanImpl(cchi); - throw e; - } -} - -void TeBkUmMgrRouter::getContext(HttpRequest* request, Context* context) { -#ifdef INC_SDORM_MONGO - MongoDBRawDataSourceImpl* sqli = getDb(); - - try { - std::vector* flst = new std::vector; - sqli->begin(FORTUNE); - sqli->executeQuery(NULL, flst, &TeBkUmMgrRouter::getContextUtil); - sqli->end(); - - TeBkUmMgrFortune nf; - nf.setId(0); - nf.setMessage("Additional fortune added at request time."); - flst->push_back(nf); - std::sort (flst->begin(), flst->end()); - - context->emplace("fortunes", flst); - } catch(...) { - throw; - } -#endif -} -#ifdef INC_SDORM_MONGO -void TeBkUmMgrRouter::getContextUtil(void* ctx, int rn, std::vector& data) { - std::vector* flst = (std::vector*)ctx; - TeBkUmMgrFortune w; - for(int i=0;i<(int)data.size();i++) { - if(data.at(i).n=="_id") { - w.setId((int)data.at(i).d); - if(w.getId()<=0) { - w.setId((int)data.at(i).l); - } - } - if(data.at(i).n=="message") { - std::string nm = data.at(i).s; - CryptoHandler::sanitizeHtml(nm); - w.setMessage(nm); - } - } - flst->push_back(w); -} -#endif - -//https://stackoverflow.com/questions/9631225/convert-strings-specified-by-length-not-nul-terminated-to-int-float -bool TeBkUmMgrRouter::strToNum(const char* str, int len, int& ret) { - ret = 0; - for(int i = 0; i < len; ++i) - { - if(!isdigit(str[i])) return false; - ret = ret * 10 + (str[i] - '0'); - } - return true; -} - -bool TeBkUmMgrRouter::route(HttpRequest* req, HttpResponse* res, BaseSocket* sif) { - std::string_view path = req->getPath(); - if(StringUtil::endsWith(path, "/plaint")) { - res->setContent(HELLO_WORLD); - res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_PLAIN); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/j")) { - TeBkUmMgrMessage msg; - msg.setMessage(HELLO_WORLD); - JSONSerialize::serializeObject(&msg, m_ser, res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/d")) { - TeBkUmMgrWorld msg; - db(msg); - JSONSerialize::serializeObject(&msg, w_ser, res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/quer")) { - struct yuarel_param params[1]; - yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - std::vector msg; - queries(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/fortu")) { - Context ctx; - getContext(req, &ctx); - - if(tmplFunc!=NULL) - { - fcpstream str; - tmplFunc(&ctx, str); - res->setContent(str.str()); - res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } - } else if(StringUtil::endsWith(path, "/updt")) { - struct yuarel_param params[1]; - yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - std::vector msg; - updates(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else if(StringUtil::endsWith(path, "/cached-wld")) { - struct yuarel_param params[1]; - yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - std::vector msg; - cachedWorlds(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - res->setHTTPResponseStatus(HTTPResponseStatus::Ok); - } else { - res->setHTTPResponseStatus(HTTPResponseStatus::NotFound); - } - res->setDone(true); - return true; -} - -TemplatePtr TeBkUmMgrRouter::tmplFunc; -Ser TeBkUmMgrRouter::m_ser; -Ser TeBkUmMgrRouter::w_ser; -SerCont TeBkUmMgrRouter::wcont_ser; - -TeBkUmMgrRouter::TeBkUmMgrRouter() { -#ifdef INC_SDORM_MONGO - sqli = NULL; -#endif - tmplFunc = TemplateUtil::getTemplateFunc("t2", "tpe/fortunes.tpe"); - m_ser = Serializer::getSerFuncForObject("t2", "TeBkUmMgrMessage"); - w_ser = Serializer::getSerFuncForObject("t2", "TeBkUmMgrWorld"); - wcont_ser = Serializer::getSerFuncForObjectCont("t2", "TeBkUmMgrWorld", "std::vector"); -} - -TeBkUmMgrRouter::~TeBkUmMgrRouter() { -} - -#ifdef INC_SDORM_MONGO -MongoDBRawDataSourceImpl* TeBkUmMgrRouter::getDb() { - if(sqli==NULL) { - sqli = static_cast(DataSourceManager::getRawImpl("MongoDB-DSN", "t2")); - } - return sqli; -} -#endif diff --git a/frameworks/C++/ffead-cpp/t2/tpe/fortunes.tpe b/frameworks/C++/ffead-cpp/t2/tpe/fortunes.tpe deleted file mode 100644 index 437458dd3f6..00000000000 --- a/frameworks/C++/ffead-cpp/t2/tpe/fortunes.tpe +++ /dev/null @@ -1,13 +0,0 @@ -#declare std::vector fortunes# - - -Fortunes - - - -#for(int i=0;i<(int)fortunes.size();i++)# - -#rof# -
idmessage
${fortunes.at(i).getId()}${fortunes.at(i).getMessage()}
- - \ No newline at end of file diff --git a/frameworks/C++/ffead-cpp/t3/config/sdorm.xml b/frameworks/C++/ffead-cpp/t3/config/sdorm.xml index b3fc8041457..22e7e81cf9f 100644 --- a/frameworks/C++/ffead-cpp/t3/config/sdorm.xml +++ b/frameworks/C++/ffead-cpp/t3/config/sdorm.xml @@ -10,6 +10,7 @@ PostgreSQL-DSN sql-raw-pq false + false diff --git a/frameworks/C++/ffead-cpp/t3/include/TeBkUmLpq.h b/frameworks/C++/ffead-cpp/t3/include/TeBkUmLpq.h index 071810cd4bc..6a69ab45a94 100644 --- a/frameworks/C++/ffead-cpp/t3/include/TeBkUmLpq.h +++ b/frameworks/C++/ffead-cpp/t3/include/TeBkUmLpq.h @@ -48,6 +48,8 @@ class TeBkUmLpqWorld { int id; int randomNumber; + static TemplateJson tJ; + static TemplateJson tJc; public: TeBkUmLpqWorld(int id); TeBkUmLpqWorld(int id, int randomNumber); @@ -55,9 +57,35 @@ class TeBkUmLpqWorld { virtual ~TeBkUmLpqWorld(); int getId() const; void setId(int id); + void set(int id, int randomNumber); int getRandomNumber() const; void setRandomNumber(int randomNumber); bool operator < (const TeBkUmLpqWorld& other) const; + static void tmplJson(int id, int randomNumber, std::string* ou) { + size_t il = ou->length(); + ou->append(tJ.t); + std::string ids = std::to_string(id); + ou->insert(il+tJ.tpos.at(0), ids); + ou->insert(il+tJ.tpos.at(1)+ids.length(), std::to_string(randomNumber)); + } + void tmplJson(std::string* ou) { + size_t il = ou->length(); + ou->append(tJ.t); + std::string ids = std::to_string(id); + ou->insert(il+tJ.tpos.at(0), ids); + ou->insert(il+tJ.tpos.at(1)+ids.length(), std::to_string(randomNumber)); + } + static void tmplJson(std::vector& vec, std::string* ou) { + for(auto el: vec) { + size_t il = ou->length(); + ou->append(tJc.t); + std::string ids = std::to_string(el.id); + ou->insert(il+tJc.tpos.at(0), ids); + ou->insert(il+tJc.tpos.at(1)+ids.length(), std::to_string(el.randomNumber)); + } + ou->insert(0, "["); + ou->at(ou->length()-1) = ']'; + } #ifdef HAVE_RAPID_JSON void toJson(rapidjson::Writer& w) { w.StartObject(); @@ -94,23 +122,33 @@ class TeBkUmLpqFortune { bool allocd; TeBkUmLpqFortune(int id); TeBkUmLpqFortune(int id, std::string message); - TeBkUmLpqFortune(); + TeBkUmLpqFortune(int id, const uint8_t * buf, size_t len); virtual ~TeBkUmLpqFortune(); int getId() const; void setId(int id); bool operator < (const TeBkUmLpqFortune& other) const; + TeBkUmLpqFortune() { + allocd = false; + id = 0; + } }; class TeBkUmLpqRouterPicoV; class TeBkUmLpqMessage { std::string message; + static TemplateJson tJ; public: TeBkUmLpqMessage(); TeBkUmLpqMessage(std::string message); virtual ~TeBkUmLpqMessage(); const std::string& getMessage() const; void setMessage(const std::string& message); + void tmplJson(std::string* ou) { + size_t il = ou->length(); + ou->append(tJ.t); + ou->insert(il+tJ.tpos.at(0), message); + } #ifdef HAVE_RAPID_JSON void toJson(rapidjson::Writer& w) { w.StartObject(); @@ -121,6 +159,24 @@ class TeBkUmLpqMessage { #endif }; +#pragma @IgnoreSer +#pragma @IgnoreRef +class ReqData { +public: + std::string h; +#ifdef HAVE_RAPID_JSON + rapidjson::StringBuffer sb; + rapidjson::Writer wr; +#endif + void reset() { + h.clear(); +#ifdef HAVE_RAPID_JSON + sb.Clear(); + wr.Reset(sb); +#endif + } +}; + class TeBkUmLpqRouter : public Router { static const std::string HELLO_WORLD; static const std::string WORLD; @@ -141,10 +197,12 @@ class TeBkUmLpqRouter : public Router { void updates(const char*, int, std::vector&); void updatesMulti(const char*, int, std::vector&); void cachedWorlds(const char*, int, std::vector&); - void handleTemplate(HttpRequest* req, HttpResponse* res, BaseSocket* sif); + void handleTemplate(HttpRequest* req, HttpResponse* res, Writer* sif); std::string& getUpdQuery(int count); + std::string& getMultiQuery(int count); std::unordered_map _qC; + std::unordered_map _mqC; LibpqDataSourceImpl* sqli; LibpqDataSourceImpl* getDb(); @@ -153,7 +211,7 @@ class TeBkUmLpqRouter : public Router { TeBkUmLpqRouter(); virtual ~TeBkUmLpqRouter(); void updateCache(); - bool route(HttpRequest* req, HttpResponse* res, BaseSocket* sif); + bool route(HttpRequest* req, HttpResponse* res, Writer* sif); }; class TeBkUmLpqRouterPicoV : public TeBkUmLpqRouter { @@ -161,7 +219,7 @@ class TeBkUmLpqRouterPicoV : public TeBkUmLpqRouter { public: TeBkUmLpqRouterPicoV(); virtual ~TeBkUmLpqRouterPicoV(); - bool route(HttpRequest* req, HttpResponse* res, BaseSocket* sif); + bool route(HttpRequest* req, HttpResponse* res, Writer* sif); }; #endif /* WEB_t1_INCLUDE_TeBkUmLpq_H_ */ diff --git a/frameworks/C++/ffead-cpp/t3/meson.build b/frameworks/C++/ffead-cpp/t3/meson.build index bc3c93e6170..75d803ab2b8 100644 --- a/frameworks/C++/ffead-cpp/t3/meson.build +++ b/frameworks/C++/ffead-cpp/t3/meson.build @@ -4,7 +4,7 @@ module_includes = ['/usr/local/include','../../src/modules/common','../../src/mo '../../src/modules/ioc','../../src/modules/jobs','../../src/modules/reflection','../../src/modules/sdorm','../../src/modules/sdorm/sql','../../src/modules/sdorm/sql/libpq', '../../src/modules/client-util/ssl','../../src/modules/sdorm/mongo','../../src/modules/sdorm/mongo/raw','../../src/modules/search','../../src/modules/serialization', '../../src/modules/serialization/xml','../../src/modules/serialization/json','../../src/modules/server-util','../../src/modules/ssl','../../src/modules/threads', - '../../src/framework','include'] + '../../src/framework','../../src/modules/sdorm/scylla/raw','include'] module_includes += global_includes module_libs = [global_libs] diff --git a/frameworks/C++/ffead-cpp/t3/sconscript b/frameworks/C++/ffead-cpp/t3/sconscript new file mode 100644 index 00000000000..f72a6e52aaa --- /dev/null +++ b/frameworks/C++/ffead-cpp/t3/sconscript @@ -0,0 +1,29 @@ +import os + +Import('env') + +# copy parent environment so our alterations don't affect it +env = env.Clone() + +# add src dirs to include path +env.Append(CPPPATH=['../../src/framework']) +for root, dirnames, filenames in os.walk('../../src/modules'): + filenames = [f for f in filenames if not f[0] == '.'] + dirnames[:] = [d for d in dirnames if not d[0] == '.'] + for dirname in dirnames: + dirPath = os.path.join(root,dirname) + if env['PLATFORM'] != 'mingw' and 'wepoll' in dirPath: + continue + #print('adding src dir to path: %s' % dirPath) + env.Append(CPPPATH=[dirPath]) + +matches = [] +env.Append(CPPPATH=['include']) +matches.append(Glob("src/*.cpp")) + +# debug output +#print('framework env CPPPATH:') +#print(env['CPPPATH']) + +# build a shared library +env.SharedLibrary('../../bin/t3', matches, LIBS=['ffead-modules', 'ffead-framework', 'pq'], LIBPATH='../../bin/') diff --git a/frameworks/C++/ffead-cpp/t3/src/TeBkUmLpq.cpp b/frameworks/C++/ffead-cpp/t3/src/TeBkUmLpq.cpp index ee49e138af9..1fd85076fd5 100644 --- a/frameworks/C++/ffead-cpp/t3/src/TeBkUmLpq.cpp +++ b/frameworks/C++/ffead-cpp/t3/src/TeBkUmLpq.cpp @@ -22,6 +22,10 @@ #include "TeBkUmLpq.h" +//This is template based json serialization approach +TemplateJson TeBkUmLpqWorld::tJ = TemplateJson("{\"id\":,\"randomNumber\":}", {6,22}); +TemplateJson TeBkUmLpqWorld::tJc = TemplateJson("{\"id\":,\"randomNumber\":},", {6,22}); + int TeBkUmLpqWorld::getId() const { return id; } @@ -30,6 +34,11 @@ void TeBkUmLpqWorld::setId(int id) { this->id = id; } +void TeBkUmLpqWorld::set(int id, int randomNumber) { + this->id = id; + this->randomNumber = randomNumber; +} + int TeBkUmLpqWorld::getRandomNumber() const { return randomNumber; } @@ -80,9 +89,9 @@ TeBkUmLpqFortune::TeBkUmLpqFortune(int id, std::string message) { allocd = false; } -TeBkUmLpqFortune::TeBkUmLpqFortune() { - id = 0; - allocd = false; +TeBkUmLpqFortune::TeBkUmLpqFortune(int id, const uint8_t * buf, size_t len) { + this->id = id; + this->message = CryptoHandler::sanitizeHtmlFast(buf, len, this->message_i, this->allocd); } TeBkUmLpqFortune::~TeBkUmLpqFortune() { @@ -95,6 +104,8 @@ bool TeBkUmLpqFortune::operator < (const TeBkUmLpqFortune& other) const { return message.compare(other.message)<0; } +TemplateJson TeBkUmLpqMessage::tJ = TemplateJson("{\"message\":\"\"}", {12}); + TeBkUmLpqMessage::TeBkUmLpqMessage() { } @@ -126,13 +137,9 @@ void TeBkUmLpqRouter::db(TeBkUmLpqWorld& w) { LibpqQuery q; q.withParamInt4(rid); #ifdef HAVE_LIBPQ - q.withSelectQuery(WORLD_ONE_QUERY).withContext(&w).withCb0([](void* ctx, PGresult* res) { - TeBkUmLpqWorld* w = (TeBkUmLpqWorld*)ctx; - int cols = PQnfields(res); - for (int j = 0; j < cols; ++j) { - if(j==0)w->setId(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - else w->setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - } + q.withSelectQuery(WORLD_ONE_QUERY).withContext(&w).withCb0([](void** ctx, PGresult* res) { + TeBkUmLpqWorld* w = (TeBkUmLpqWorld*)ctx[0]; + w->set(ntohl(*((uint32_t *) PQgetvalue(res, 0, 0))), ntohl(*((uint32_t *) PQgetvalue(res, 0, 1)))); }); #endif sqli->executeQuery(&q); @@ -140,55 +147,54 @@ void TeBkUmLpqRouter::db(TeBkUmLpqWorld& w) { void TeBkUmLpqRouter::queries(const char* q, int ql, std::vector& wlst) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); - wlst.reserve(queryCount); LibpqDataSourceImpl* sqli = getDb(); - for (int c = 0; c < queryCount; ++c) { int rid = CommonUtils::fastrand(g_seed) % 10000 + 1; LibpqQuery q; q.withParamInt4(rid); #ifdef HAVE_LIBPQ - q.withSelectQuery(WORLD_ONE_QUERY).withContext(&wlst).withCb0([](void* ctx, PGresult* res) { - std::vector* wlst = (std::vector*)ctx; - int cols = PQnfields(res); - for (int j = 0; j < cols; ++j) { - if(j==0) wlst->emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - else wlst->back().setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - } + q.withSelectQuery(WORLD_ONE_QUERY).withContext(&wlst).withCb0([](void** ctx, PGresult* res) { + std::vector* wlst = (std::vector*)ctx[0]; + wlst->emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, 0))), ntohl(*((uint32_t *) PQgetvalue(res, 0, 1)))); }); #endif sqli->executeQuery(&q); } } -void TeBkUmLpqRouter::queriesMulti(const char* q, int ql, std::vector& wlst) { - int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); - queryCount = std::max(1, std::min(queryCount, 500)); - - wlst.reserve(queryCount); - - LibpqDataSourceImpl* sqli = getDb(); - - UpdQrData updt; - updt.wlist = &wlst; - updt.status = true; +std::string& TeBkUmLpqRouter::getMultiQuery(int count) { + std::unordered_map::iterator it = _mqC.find(count); + if(it!=_mqC.end()) { + return it->second; + } std::stringstream ss; - for (int c = 0; c < queryCount; ++c) { + for (int c = 0; c < count; ++c) { int rid = CommonUtils::fastrand(g_seed) % 10000 + 1; ss << "select id, randomnumber from world where id = " << rid << ";"; } + _mqC[count] = std::move(ss.str()); + return _mqC[count]; +} + +void TeBkUmLpqRouter::queriesMulti(const char* q, int ql, std::vector& wlst) { + int queryCount = 0; + CommonUtils::naiveStrToNum(q, ql, queryCount); + queryCount = std::max(1, std::min(queryCount, 500)); + wlst.reserve(queryCount); + + LibpqDataSourceImpl* sqli = getDb(); + std::string& query = getMultiQuery(queryCount); LibpqQuery qu; - qu.withSelectQuery(ss.str()).withContext(&wlst).withCb5([](void* ctx, int rn, int cn, char * d, int l) { - std::vector* wlst = (std::vector*)ctx; + qu.withSelectQuery(query).withMulti(queryCount).withContext(&wlst).withCb5([](void** ctx, int rn, int cn, char * d, int l) { + std::vector* wlst = (std::vector*)ctx[0]; int tmp = 0; - CommonUtils::fastStrToNum(d, l, tmp); + CommonUtils::naiveStrToNum(d, l, tmp); if(cn==0) { wlst->emplace_back(tmp); } else { @@ -228,42 +234,25 @@ std::string& TeBkUmLpqRouter::getUpdQuery(int count) { void TeBkUmLpqRouter::updates(const char* q, int ql, std::vector& wlst) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); wlst.reserve(queryCount); LibpqDataSourceImpl* sqli = getDb(); - std::string& query = getUpdQuery(queryCount); for (int c = 0; c < queryCount; ++c) { int rid = CommonUtils::fastrand(g_seed) % 10000 + 1; - wlst.emplace_back(); - TeBkUmLpqWorld& w = wlst.back(); - LibpqQuery q; q.withParamInt4(rid); #ifdef HAVE_LIBPQ - q.withSelectQuery(WORLD_ONE_QUERY).withContext(&w).withCb0([](void* ctx, PGresult* res) { - TeBkUmLpqWorld* w = (TeBkUmLpqWorld*)ctx; - int cols = PQnfields(res); - for (int j = 0; j < cols; ++j) { - if(j==0)w->setId(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - else w->setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - } + q.withSelectQuery(WORLD_ONE_QUERY).withContext(&wlst).withCb0([](void** ctx, PGresult* res) { + std::vector* wlst = (std::vector*)ctx[0]; + wlst->emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, 0))), CommonUtils::fastrand(g_seed) % 10000 + 1); }); #endif sqli->executeQuery(&q); - - int newRandomNumber = CommonUtils::fastrand(g_seed) % 10000 + 1; - if(w.getRandomNumber() == newRandomNumber) { - newRandomNumber += 1; - if(newRandomNumber>=10000) { - newRandomNumber = 1; - } - } - w.setRandomNumber(newRandomNumber); } LibpqQuery qu; @@ -284,7 +273,7 @@ void TeBkUmLpqRouter::updates(const char* q, int ql, std::vector void TeBkUmLpqRouter::updatesMulti(const char* q, int ql, std::vector& wlst) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); wlst.reserve(queryCount); @@ -307,10 +296,10 @@ void TeBkUmLpqRouter::updatesMulti(const char* q, int ql, std::vectorwlist->emplace_back(tmp); } else { @@ -323,13 +312,13 @@ void TeBkUmLpqRouter::updatesMulti(const char* q, int ql, std::vectorss << "when "; + updt->ss << " when "; updt->ss << w.getId(); updt->ss << " then "; updt->ss << newRandomNumber; } - }).withFinalCb([](void* ctx, bool status, std::vector* results, const std::string& q, int counter) { - UpdQrData* updt = (UpdQrData*)ctx; + }).withFinalCb([](void** ctx, bool status, std::vector* results, const std::string& q, int counter) { + UpdQrData* updt = (UpdQrData*)ctx[0]; updt->status = status; }); #endif @@ -339,7 +328,7 @@ void TeBkUmLpqRouter::updatesMulti(const char* q, int ql, std::vectorexecuteUpdateMultiQuery(&qu); } void TeBkUmLpqRouter::updateCache() { CacheInterface* cchi = CacheManager::getImpl(); LibpqDataSourceImpl* sqli = getDb(); - std::vector wlst; LibpqQuery q; - q.withSelectQuery(WORLD_ALL_QUERY, false).withContext(&wlst).withCb6([](void* ctx, int row, int col, char* value) { - std::vector* wlst = (std::vector*)ctx; + q.withSelectQuery(WORLD_ALL_QUERY, false).withContext(&wlst).withCb6([](void** ctx, int row, int col, char* value) { + std::vector* wlst = (std::vector*)ctx[0]; if(col==0) { wlst->emplace_back(ntohl(*((uint32_t *) value))); } else { @@ -381,7 +369,7 @@ void TeBkUmLpqRouter::updateCache() { void TeBkUmLpqRouter::cachedWorlds(const char* q, int ql, std::vector& wlst) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); wlst.reserve(queryCount); @@ -398,117 +386,99 @@ void TeBkUmLpqRouter::cachedWorlds(const char* q, int ql, std::vector flst; + std::vector flst; LibpqQuery q; #ifdef HAVE_LIBPQ - q.withSelectQuery(FORTUNE_ALL_QUERY).withContext(&flst).withCb0([](void* ctx, PGresult* res) { - std::list* flst = (std::list*)ctx; - int cols = PQnfields(res); + q.withSelectQuery(FORTUNE_ALL_QUERY).withContext(&flst).withCb0([](void** ctx, PGresult* res) { + std::vector* flst = (std::vector*)ctx[0]; int rows = PQntuples(res); + flst->reserve((size_t)rows+1); for(int i=0; iemplace_back(ntohl(*((uint32_t *) PQgetvalue(res, i, j)))); - } else { - TeBkUmLpqFortune& w = flst->back(); - w.message = CryptoHandler::sanitizeHtmlFast((const uint8_t *)PQgetvalue(res, i, j), (size_t)PQgetlength(res, i, j), w.message_i, w.allocd); - } - } + flst->push_back(new TeBkUmLpqFortune(ntohl(*((uint32_t *) PQgetvalue(res, i, 0))), (const uint8_t *)PQgetvalue(res, i, 1), (size_t)PQgetlength(res, i, 1))); } }); #endif sqli->executeQuery(&q); - flst.emplace_back(0, "Additional fortune added at request time."); - flst.sort(); + flst.push_back(new TeBkUmLpqFortune(0, "Additional fortune added at request time.")); + std::sort(flst.begin(), flst.end(), [](const TeBkUmLpqFortune* a, const TeBkUmLpqFortune* b) { + return a->message < b->message; + }); ctx.emplace("fortunes", &flst); - fcpstream str; - tmplFunc(&ctx, str); - std::string out = str.str(); - std::string h; - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_HTML, req->getHttpVers(), req->isClose(), out.length()); - sif->writeDirect(h, out); + tmplFunc(&ctx, res->getContent()); + res->sendHtml(sif); + for(int k=0;k<(int)flst.size();k++) { + delete flst.at(k); + } } //Do not use this class with non-embedded servers as it needs access to the underlying socket //and writes the response directly to the socket, use TeBkUmLpqRouterPicoV for all lang-server implementations -bool TeBkUmLpqRouter::route(HttpRequest* req, HttpResponse* res, BaseSocket* sif) { - std::string h; +bool TeBkUmLpqRouter::route(HttpRequest* req, HttpResponse* res, Writer* sif) { if(StringUtil::endsWith(req->getPath(), "/plaint")) { - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_PLAIN, (int)HELLO_WORLD.length()); - sif->writeDirect(h, HELLO_WORLD); + res->setContent(HELLO_WORLD).sendText(sif); } else if(StringUtil::endsWith(req->getPath(), "/j")) { - TeBkUmLpqMessage msg; - msg.setMessage(HELLO_WORLD); - JSONSerialize::serializeObject(&msg, m_ser, res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - sif->writeDirect(h, res->getContent()); + TeBkUmLpqMessage msg(HELLO_WORLD); + msg.tmplJson(res->getContentP()); + res->sendJson(sif); } else if(StringUtil::endsWith(req->getPath(), "/d")) { TeBkUmLpqWorld msg; db(msg); - JSONSerialize::serializeObject(&msg, w_ser, res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose()); - sif->writeDirect(h, res->getContent()); - } else if(StringUtil::endsWith(req->getPath(), "/que_")) { + msg.tmplJson(res->getContentP()); + res->sendJson(sif); + } else if(StringUtil::endsWith(req->getPath(), "/quer")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; queries(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose()); - sif->writeDirect(h, res->getContent()); - } else if(StringUtil::endsWith(req->getPath(), "/quer")) { + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); + res->sendJson(sif); + } else if(StringUtil::endsWith(req->getPath(), "/quem")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; queriesMulti(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose()); - sif->writeDirect(h, res->getContent()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); + res->sendJson(sif); } else if(StringUtil::endsWith(req->getPath(), "/fortu")) { handleTemplate(req, res, sif); - } else if(StringUtil::endsWith(req->getPath(), "/upd_")) { + } else if(StringUtil::endsWith(req->getPath(), "/updt")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; updates(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose()); - sif->writeDirect(h, res->getContent()); - } else if(StringUtil::endsWith(req->getPath(), "/updt")) { + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); + res->sendJson(sif); + } else if(StringUtil::endsWith(req->getPath(), "/updm")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; updatesMulti(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose()); - sif->writeDirect(h, res->getContent()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); + res->sendJson(sif); } else if(StringUtil::endsWith(req->getPath(), "/cached-wld")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; cachedWorlds(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose()); - sif->writeDirect(h, res->getContent()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); + res->sendJson(sif); } else { - res->httpStatus(HTTPResponseStatus::NotFound).generateHeadResponse(h, req->getHttpVers(), true); - sif->writeDirect(h); + res->sendStatus(HTTPResponseStatus::NotFound, sif); } return false; } @@ -546,87 +516,83 @@ void TeBkUmLpqRouterPicoV::handleTemplate(HttpResponse* res) { LibpqDataSourceImpl* sqli = getDb(); Context ctx; - std::list flst; + std::vector flst; LibpqQuery q; #ifdef HAVE_LIBPQ - q.withSelectQuery(FORTUNE_ALL_QUERY).withContext(&flst).withCb0([](void* ctx, PGresult* res) { - std::list* flst = (std::list*)ctx; - int cols = PQnfields(res); + q.withSelectQuery(FORTUNE_ALL_QUERY).withContext(&flst).withCb0([](void** ctx, PGresult* res) { + std::vector* flst = (std::vector*)ctx[0]; int rows = PQntuples(res); + flst->reserve((size_t)rows+1); for(int i=0; iemplace_back(ntohl(*((uint32_t *) PQgetvalue(res, i, j)))); - } else { - TeBkUmLpqFortune& w = flst->back(); - w.message = CryptoHandler::sanitizeHtmlFast((const uint8_t *)PQgetvalue(res, i, j), (size_t)PQgetlength(res, i, j), w.message_i, w.allocd); - } - } + flst->push_back(new TeBkUmLpqFortune(ntohl(*((uint32_t *) PQgetvalue(res, i, 0))), (const uint8_t *)PQgetvalue(res, i, 1), (size_t)PQgetlength(res, i, 1))); } }); #endif sqli->executeQuery(&q); - flst.emplace_back(0, "Additional fortune added at request time."); - flst.sort(); + flst.push_back(new TeBkUmLpqFortune(0, "Additional fortune added at request time.")); + std::sort(flst.begin(), flst.end(), [](const TeBkUmLpqFortune* a, const TeBkUmLpqFortune* b) { + return a->message < b->message; + }); ctx.emplace("fortunes", &flst); - fcpstream str; - tmplFunc(&ctx, str); - res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML).setContent(str.str()); + tmplFunc(&ctx, res->getContent()); + for(int k=0;k<(int)flst.size();k++) { + delete flst.at(k); + } + res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML); } -bool TeBkUmLpqRouterPicoV::route(HttpRequest *req, HttpResponse *res, BaseSocket *sif) { +bool TeBkUmLpqRouterPicoV::route(HttpRequest *req, HttpResponse *res, Writer *sif) { if(StringUtil::endsWith(req->getPath(), "/plaint")) { res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_TEXT_PLAIN).setContent(HELLO_WORLD); } else if(StringUtil::endsWith(req->getPath(), "/j")) { - TeBkUmLpqMessage msg; - msg.setMessage(HELLO_WORLD); - JSONSerialize::serializeObject(&msg, m_ser, res->getContentP()); + TeBkUmLpqMessage msg(HELLO_WORLD); + msg.tmplJson(res->getContentP()); res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); } else if(StringUtil::endsWith(req->getPath(), "/d")) { TeBkUmLpqWorld msg; db(msg); - JSONSerialize::serializeObject(&msg, w_ser, res->getContentP()); + msg.tmplJson(res->getContentP()); res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - } else if(StringUtil::endsWith(req->getPath(), "/que_")) { + } else if(StringUtil::endsWith(req->getPath(), "/quer")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; queries(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - } else if(StringUtil::endsWith(req->getPath(), "/quer")) { + } else if(StringUtil::endsWith(req->getPath(), "/quem")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; queriesMulti(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); } else if(StringUtil::endsWith(req->getPath(), "/fortu")) { handleTemplate(res); - } else if(StringUtil::endsWith(req->getPath(), "/upd_")) { + } else if(StringUtil::endsWith(req->getPath(), "/updt")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; updates(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - } else if(StringUtil::endsWith(req->getPath(), "/updt")) { + } else if(StringUtil::endsWith(req->getPath(), "/updm")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; updatesMulti(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); } else if(StringUtil::endsWith(req->getPath(), "/cached-wld")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector msg; cachedWorlds(params[0].val, params[0].val_len, msg); - JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP()); + TeBkUmLpqWorld::tmplJson(msg, res->getContentP()); res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON); } else { res->httpStatus(HTTPResponseStatus::NotFound); diff --git a/frameworks/C++/ffead-cpp/t3/tpe/fortunes.tpe b/frameworks/C++/ffead-cpp/t3/tpe/fortunes.tpe index caa6cc8a7c4..5a4dcab41cb 100644 --- a/frameworks/C++/ffead-cpp/t3/tpe/fortunes.tpe +++ b/frameworks/C++/ffead-cpp/t3/tpe/fortunes.tpe @@ -1,12 +1,12 @@ -#declareref std::list* fortunes# +#declareref std::vector* fortunes# Fortunes -#for(std::list::iterator it=fortunes->begin(); it != fortunes->end(); ++it)# - +#for(std::vector::iterator it=fortunes->begin(); it != fortunes->end(); ++it)# + #rof#
idmessage
${(*it).getId()}${(*it).message}
$_S{(*it)->getId()}${(*it)->message}
diff --git a/frameworks/C++/ffead-cpp/t3/xmake.lua b/frameworks/C++/ffead-cpp/t3/xmake.lua index fe8222e185c..bf4da2aa700 100644 --- a/frameworks/C++/ffead-cpp/t3/xmake.lua +++ b/frameworks/C++/ffead-cpp/t3/xmake.lua @@ -1,6 +1,6 @@ add_includedirs("include/") -local bindir = "$(projectdir)/ffead-cpp-6.0-bin" +local bindir = "$(projectdir)/ffead-cpp-7.0-bin" target("t3") set_languages("c++17") diff --git a/frameworks/C++/ffead-cpp/t4/config/sdorm.xml b/frameworks/C++/ffead-cpp/t4/config/sdorm.xml index 9acb7fb92a2..78914e1df1c 100644 --- a/frameworks/C++/ffead-cpp/t4/config/sdorm.xml +++ b/frameworks/C++/ffead-cpp/t4/config/sdorm.xml @@ -10,6 +10,7 @@ PostgreSQL-DSN sql-raw-pq true + false diff --git a/frameworks/C++/ffead-cpp/t4/include/TeBkUmLpqAsync.h b/frameworks/C++/ffead-cpp/t4/include/TeBkUmLpqAsync.h index a69a68f83ea..84c74c8b974 100644 --- a/frameworks/C++/ffead-cpp/t4/include/TeBkUmLpqAsync.h +++ b/frameworks/C++/ffead-cpp/t4/include/TeBkUmLpqAsync.h @@ -24,6 +24,7 @@ #define WEB_t1_INCLUDE_TeBkUmLpqAsync_H_ #include "TemplateHandler.h" #include "vector" +#include "unordered_map" #ifndef OS_MINGW #include #include @@ -50,6 +51,8 @@ class TeBkUmLpqAsyncWorld; class TeBkUmLpqAsyncWorld { int id; int randomNumber; + static TemplateJson tJ; + static TemplateJson tJc; public: TeBkUmLpqAsyncWorld(); TeBkUmLpqAsyncWorld(int id); @@ -59,6 +62,31 @@ class TeBkUmLpqAsyncWorld { void setId(int id); int getRandomNumber() const; void setRandomNumber(int randomNumber); + static void tmplJson(int id, int randomNumber, std::string* ou) { + size_t il = ou->length(); + ou->append(tJ.t); + std::string ids = std::to_string(id); + ou->insert(il+tJ.tpos.at(0), ids); + ou->insert(il+tJ.tpos.at(1)+ids.length(), std::to_string(randomNumber)); + } + void tmplJson(std::string* ou) { + size_t il = ou->length(); + ou->append(tJ.t); + std::string ids = std::to_string(id); + ou->insert(il+tJ.tpos.at(0), ids); + ou->insert(il+tJ.tpos.at(1)+ids.length(), std::to_string(randomNumber)); + } + static void tmplJson(std::vector& vec, std::string* ou) { + for(auto el: vec) { + size_t il = ou->length(); + ou->append(tJc.t); + std::string ids = std::to_string(el.id); + ou->insert(il+tJc.tpos.at(0), ids); + ou->insert(il+tJc.tpos.at(1)+ids.length(), std::to_string(el.randomNumber)); + } + ou->insert(0, "["); + ou->at(ou->length()-1) = ']'; + } #ifdef HAVE_RAPID_JSON void toJson(rapidjson::Writer& w) { w.StartObject(); @@ -88,21 +116,31 @@ class TeBkUmLpqAsyncFortune { bool allocd; TeBkUmLpqAsyncFortune(int id); TeBkUmLpqAsyncFortune(int id, std::string message); - TeBkUmLpqAsyncFortune(); + TeBkUmLpqAsyncFortune(int id, const uint8_t * buf, size_t len); virtual ~TeBkUmLpqAsyncFortune(); int getId() const; void setId(int id); bool operator < (const TeBkUmLpqAsyncFortune& other) const; + TeBkUmLpqAsyncFortune() { + allocd = false; + id = 0; + } }; class TeBkUmLpqAsyncMessage { std::string message; + static TemplateJson tJ; public: TeBkUmLpqAsyncMessage(); TeBkUmLpqAsyncMessage(std::string message); virtual ~TeBkUmLpqAsyncMessage(); const std::string& getMessage() const; void setMessage(const std::string& message); + void tmplJson(std::string* ou) { + size_t il = ou->length(); + ou->append(tJ.t); + ou->insert(il+tJ.tpos.at(0), message); + } #ifdef HAVE_RAPID_JSON void toJson(rapidjson::Writer& w) { w.StartObject(); @@ -113,35 +151,12 @@ class TeBkUmLpqAsyncMessage { #endif }; -struct AsyncDbReq { - float httpVers; - bool conn_clos; - BaseSocket* sif; - TeBkUmLpqAsyncWorld w; -}; - -struct AsyncQueriesReq { - float httpVers; - bool conn_clos; - BaseSocket* sif; - std::vector vec; -}; - struct AsyncUpdatesReq { - float httpVers; - bool conn_clos; - BaseSocket* sif; + Writer* sif; LibpqDataSourceImpl* sqli; std::vector vec; }; -struct AsyncFortuneReq { - float httpVers; - bool conn_clos; - BaseSocket* sif; - std::list flst; -}; - struct AsyncCacheReq { CacheInterface* cchi; std::vector vec; @@ -161,18 +176,21 @@ class TeBkUmLpqAsyncRouter : public Router { static Ser w_ser; static SerCont wcont_ser; - static std::string& getUpdQuery(int count); - void dbAsync(BaseSocket* sif); - void queriesAsync(const char* q, int ql, BaseSocket* sif); + void dbAsync(Writer* sif); + void queriesAsync(const char* q, int ql, Writer* sif); void updatesAsync(const char* q, int ql, AsyncUpdatesReq* req); void updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* req); void cachedWorlds(const char*, int, std::vector&); - void fortunes(BaseSocket* sif); + void fortunes(Writer* sif); - void queriesMultiAsync(const char*, int, BaseSocket* sif); + void queriesMultiAsync(const char*, int, Writer* sif); void updatesMulti(const char*, int, AsyncUpdatesReq*); + static std::string& getUpdQuery(int count); + static std::string& getMultiQuery(int count); + static std::unordered_map _qC; + static std::unordered_map _mqC; LibpqDataSourceImpl* sqli; protected: virtual LibpqDataSourceImpl* getDb(int max = 0); @@ -195,7 +213,8 @@ class TeBkUmLpqAsyncRouter : public Router { return std::map(); } /* END */ - bool route(HttpRequest* req, HttpResponse* res, BaseSocket* sif); + bool route(HttpRequest* req, HttpResponse* res, Writer* sif); + void routeAsync(HttpRequest* req, HttpResponse* res, Writer* sif); }; class TeBkUmLpqAsyncRouterPooled : public TeBkUmLpqAsyncRouter { diff --git a/frameworks/C++/ffead-cpp/t4/meson.build b/frameworks/C++/ffead-cpp/t4/meson.build index 06ad398c21c..7fe6fe88687 100644 --- a/frameworks/C++/ffead-cpp/t4/meson.build +++ b/frameworks/C++/ffead-cpp/t4/meson.build @@ -4,7 +4,7 @@ module_includes = ['/usr/local/include','../../src/modules/common','../../src/mo '../../src/modules/ioc','../../src/modules/jobs','../../src/modules/reflection','../../src/modules/sdorm','../../src/modules/sdorm/sql','../../src/modules/sdorm/sql/libpq', '../../src/modules/client-util/ssl','../../src/modules/sdorm/mongo','../../src/modules/sdorm/mongo/raw','../../src/modules/search','../../src/modules/serialization', '../../src/modules/serialization/xml','../../src/modules/serialization/json','../../src/modules/server-util','../../src/modules/ssl','../../src/modules/threads', - '../../src/framework','include'] + '../../src/framework','../../src/modules/sdorm/scylla/raw','include'] module_includes += global_includes module_libs = [global_libs] diff --git a/frameworks/C++/ffead-cpp/t4/sconscript b/frameworks/C++/ffead-cpp/t4/sconscript new file mode 100644 index 00000000000..b57e97073ba --- /dev/null +++ b/frameworks/C++/ffead-cpp/t4/sconscript @@ -0,0 +1,29 @@ +import os + +Import('env') + +# copy parent environment so our alterations don't affect it +env = env.Clone() + +# add src dirs to include path +env.Append(CPPPATH=['../../src/framework']) +for root, dirnames, filenames in os.walk('../../src/modules'): + filenames = [f for f in filenames if not f[0] == '.'] + dirnames[:] = [d for d in dirnames if not d[0] == '.'] + for dirname in dirnames: + dirPath = os.path.join(root,dirname) + if env['PLATFORM'] != 'mingw' and 'wepoll' in dirPath: + continue + #print('adding src dir to path: %s' % dirPath) + env.Append(CPPPATH=[dirPath]) + +matches = [] +env.Append(CPPPATH=['include']) +matches.append(Glob("src/*.cpp")) + +# debug output +#print('framework env CPPPATH:') +#print(env['CPPPATH']) + +# build a shared library +env.SharedLibrary('../../bin/t4', matches, LIBS=['ffead-modules', 'ffead-framework', 'pq'], LIBPATH='../../bin/') diff --git a/frameworks/C++/ffead-cpp/t4/src/TeBkUmLpqAsync.cpp b/frameworks/C++/ffead-cpp/t4/src/TeBkUmLpqAsync.cpp index 66e01ae0c4b..9425b62ccb8 100644 --- a/frameworks/C++/ffead-cpp/t4/src/TeBkUmLpqAsync.cpp +++ b/frameworks/C++/ffead-cpp/t4/src/TeBkUmLpqAsync.cpp @@ -14,7 +14,7 @@ limitations under the License. */ /* - * TeBkUmLpqAsyncUm.cpp + * TeBkUmLpqAsync.cpp * * Created on: 03-Feb-2020 * Author: sumeetc @@ -22,6 +22,10 @@ #include "TeBkUmLpqAsync.h" +//This is template based json serialization approach +TemplateJson TeBkUmLpqAsyncWorld::tJ = TemplateJson("{\"id\":,\"randomNumber\":}", {6,22}); +TemplateJson TeBkUmLpqAsyncWorld::tJc = TemplateJson("{\"id\":,\"randomNumber\":},", {6,22}); + int TeBkUmLpqAsyncWorld::getId() const { return id; } @@ -76,9 +80,9 @@ TeBkUmLpqAsyncFortune::TeBkUmLpqAsyncFortune(int id, std::string message) { allocd = false; } -TeBkUmLpqAsyncFortune::TeBkUmLpqAsyncFortune() { - id = 0; - allocd = false; +TeBkUmLpqAsyncFortune::TeBkUmLpqAsyncFortune(int id, const uint8_t * buf, size_t len) { + this->id = id; + this->message = CryptoHandler::sanitizeHtmlFast(buf, len, this->message_i, this->allocd); } TeBkUmLpqAsyncFortune::~TeBkUmLpqAsyncFortune() { @@ -91,6 +95,8 @@ bool TeBkUmLpqAsyncFortune::operator < (const TeBkUmLpqAsyncFortune& other) cons return message.compare(other.message)<0; } +TemplateJson TeBkUmLpqAsyncMessage::tJ = TemplateJson("{\"message\":\"\"}", {12}); + TeBkUmLpqAsyncMessage::TeBkUmLpqAsyncMessage() { } @@ -115,47 +121,31 @@ const std::string TeBkUmLpqAsyncRouter::WORLD_ONE_QUERY = "select id,randomnumbe const std::string TeBkUmLpqAsyncRouter::WORLD_ALL_QUERY = "select id,randomnumber from world"; const std::string TeBkUmLpqAsyncRouter::FORTUNE_ALL_QUERY = "select id,message from fortune"; std::unordered_map TeBkUmLpqAsyncRouter::_qC; +std::unordered_map TeBkUmLpqAsyncRouter::_mqC; int TeBkUmLpqAsyncRouter::g_seed = 0; -void TeBkUmLpqAsyncRouter::dbAsync(BaseSocket* sif) { +void TeBkUmLpqAsyncRouter::dbAsync(Writer* sif) { LibpqDataSourceImpl* sqli = getDb(5); int rid = CommonUtils::fastrand(g_seed) % 10000 + 1; LibpqAsyncReq* areq = sqli->getAsyncRequest(); LibpqQuery* q = areq->getQuery(); q->withParamInt4(rid); #ifdef HAVE_LIBPQ - q->withSelectQuery(WORLD_ONE_QUERY).withContext(sif).withCb0([](void* ctx, PGresult* res) { - BaseSocket* sif = (BaseSocket*)ctx; - - TeBkUmLpqAsyncWorld wo; - int cols = PQnfields(res); - for (int j = 0; j < cols; ++j) { - if(j==0)wo.setId(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - else wo.setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - } - - HttpResponse r; - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - wo.toJson(w); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObject(&wo, w_ser, r.getContentP()); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - sif->writeDirect(h, r.getContent()); -#endif + q->withSelectQuery(WORLD_ONE_QUERY).withContext(sif).withCb0([](void** ctx, PGresult* res) { + Writer* sif = (Writer*)ctx[0]; + AsyncReqData* reqdt = (AsyncReqData*)sif->getData(); + TeBkUmLpqAsyncWorld w(ntohl(*((uint32_t *) PQgetvalue(res, 0, 0))), ntohl(*((uint32_t *) PQgetvalue(res, 0, 1)))); + w.tmplJson(reqdt->r.getContentP()); + reqdt->r.sendJson(sif); sif->unUse(); }); #endif sqli->postAsync(areq); } -void TeBkUmLpqAsyncRouter::queriesAsync(const char* q, int ql, BaseSocket* sif) { +void TeBkUmLpqAsyncRouter::queriesAsync(const char* q, int ql, Writer* sif) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); LibpqDataSourceImpl* sqli = getDb(3); @@ -167,120 +157,105 @@ void TeBkUmLpqAsyncRouter::queriesAsync(const char* q, int ql, BaseSocket* sif) q->withSelectQuery(WORLD_ONE_QUERY); } #ifdef HAVE_LIBPQ - areq->withFinalCb(sif, [](void* ctx, bool status, std::vector* results, const std::string& q, int counter) { - BaseSocket* sif = (BaseSocket*)ctx; + areq->withContext(sif).withFinalCb([](void** ctx, bool status, std::vector* results, const std::string& q, int counter) { + Writer* sif = (Writer*)ctx[0]; std::vector vec; vec.reserve((int)results->size()); for (int i = 0; i < (int)results->size(); ++i) { PGresult* res = results->at(i); - int cols = PQnfields(res); - for (int j = 0; j < cols; ++j) { - if(j==0) vec.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - else vec.back().setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); - } + vec.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, 0))), ntohl(*((uint32_t *) PQgetvalue(res, 0, 1)))); } - HttpResponse r; - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - TeBkUmLpqAsyncWorld::toJson(vec, w); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObjectCont(&vec, wcont_ser, "vector", r.getContentP()); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false); - sif->writeDirect(h, r.getContent()); -#endif + AsyncReqData* reqdt = (AsyncReqData*)sif->getData(); + TeBkUmLpqAsyncWorld::tmplJson(vec, reqdt->r.getContentP()); + reqdt->r.sendJson(sif); sif->unUse(); }); #endif sqli->postAsync(areq); } -void TeBkUmLpqAsyncRouter::queriesMultiAsync(const char* q, int ql, BaseSocket* sif) { - int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); - queryCount = std::max(1, std::min(queryCount, 500)); - - LibpqDataSourceImpl* sqli = getDb(3); +std::string& TeBkUmLpqAsyncRouter::getMultiQuery(int count) { + std::unordered_map::iterator it = _mqC.find(count); + if(it!=_mqC.end()) { + return it->second; + } std::stringstream ss; - for (int c = 0; c < queryCount; ++c) { + for (int c = 0; c < count; ++c) { int rid = CommonUtils::fastrand(g_seed) % 10000 + 1; ss << "select id, randomnumber from world where id = " << rid << ";"; } + _mqC[count] = std::move(ss.str()); + return _mqC[count]; +} + +void TeBkUmLpqAsyncRouter::queriesMultiAsync(const char* q, int ql, Writer* sif) { + int queryCount = 0; + CommonUtils::naiveStrToNum(q, ql, queryCount); + queryCount = std::max(1, std::min(queryCount, 500)); + + LibpqDataSourceImpl* sqli = getDb(3); + + std::string& query = getMultiQuery(queryCount); + LibpqAsyncReq* areq = sqli->getAsyncRequest(); LibpqQuery* qu = areq->getQuery(); - qu->withSelectQuery(ss.str()).withMulti(); + qu->withSelectQuery(query).withMulti(queryCount); #ifdef HAVE_LIBPQ - areq->withFinalCb(sif, [](void* ctx, bool status, std::vector* results, const std::string& q, int counter) { - BaseSocket* sif = (BaseSocket*)ctx; + areq->withContext(sif).withFinalCb([](void** ctx,bool status, std::vector* results, const std::string& q, int counter) { + Writer* sif = (Writer*)ctx[0]; std::vector vec; vec.reserve((int)results->size()); for (int i = 0; i < (int)results->size(); ++i) { PGresult* res = results->at(i); - int cols = PQnfields(res); - for (int j = 0; j < cols; ++j) { - int tmp = 0; - CommonUtils::fastStrToNum(PQgetvalue(res, 0, j), PQgetlength(res, 0, j), tmp); - if(j==0) vec.emplace_back(tmp); - else vec.back().setRandomNumber(tmp); - } + int id = 0, rd = 0; + CommonUtils::naiveStrToNum(PQgetvalue(res, 0, 0), PQgetlength(res, 0, 0), id); + CommonUtils::naiveStrToNum(PQgetvalue(res, 0, 1), PQgetlength(res, 0, 1), rd); + vec.emplace_back(id, rd); } - HttpResponse r; - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - TeBkUmLpqAsyncWorld::toJson(vec, w); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObjectCont(&vec, wcont_ser, "vector", r.getContentP()); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false); - sif->writeDirect(h, r.getContent()); -#endif + AsyncReqData* reqdt = (AsyncReqData*)sif->getData(); + TeBkUmLpqAsyncWorld::tmplJson(vec, reqdt->r.getContentP()); + reqdt->r.sendJson(sif); sif->unUse(); }); #endif - sqli->postAsync(areq, queryCount); + sqli->postAsync(areq); } void TeBkUmLpqAsyncRouter::updatesMulti(const char* q, int ql, AsyncUpdatesReq* req) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); req->vec.reserve(queryCount); req->sqli = getDb(3); - std::stringstream ss; - for (int c = 0; c < queryCount; ++c) { - int rid = CommonUtils::fastrand(g_seed) % 10000 + 1; - ss << "select id, randomnumber from world where id = " << rid << ";"; - } + std::string& query = getMultiQuery(queryCount); //req->ss << "begin;";//NEVER USE - this creates a deadlock issue (like, DETAIL: Process 16 waits for ShareLock on transaction 995; blocked by process 19.) LibpqAsyncReq* areq = req->sqli->getAsyncRequest(); LibpqQuery* qu = areq->getQuery(); - qu->withSelectQuery(ss.str()).withMulti(); + qu->withSelectQuery(query).withMulti(queryCount); #ifdef HAVE_LIBPQ - areq->withFinalCb(req, [](void* ctx, bool status, std::vector* results, const std::string& q, int counter) { - AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx; + areq->withContext(req).withFinalCb([](void** ctx,bool status, std::vector* results, const std::string& q, int counter) { + AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx[0]; if(status) { int queryCount = (int)results->size(); std::stringstream ss; for (int i = 0; i < queryCount; ++i) { PGresult* res = results->at(i); - int cols = PQnfields(res); + int id = 0, rd = CommonUtils::fastrand(g_seed) % 10000 + 1; + CommonUtils::naiveStrToNum(PQgetvalue(res, 0, 0), PQgetlength(res, 0, 0), id); + req->vec.emplace_back(id, rd); + ss << "begin;update world set randomnumber = " << rd << " where id = " << id << ";commit;"; + /*int cols = PQnfields(res); for (int j = 0; j < cols; ++j) { int tmp = 0; - CommonUtils::fastStrToNum(PQgetvalue(res, 0, j), PQgetlength(res, 0, j), tmp); + CommonUtils::naiveStrToNum(PQgetvalue(res, 0, j), PQgetlength(res, 0, j), tmp); if(j==0) req->vec.emplace_back(tmp); else { TeBkUmLpqAsyncWorld& w = req->vec.back(); @@ -294,43 +269,31 @@ void TeBkUmLpqAsyncRouter::updatesMulti(const char* q, int ql, AsyncUpdatesReq* w.setRandomNumber(newRandomNumber); ss << "begin;update world set randomnumber = " << newRandomNumber << " where id = " << w.getId() << ";commit;"; } - } + }*/ } LibpqAsyncReq* areq = req->sqli->getAsyncRequest(); LibpqQuery* qu = areq->getQuery(); - qu->withUpdateQuery(ss.str()).withMulti(); + qu->withUpdateQuery(ss.str()).withMulti(queryCount*3); - areq->withFinalCb(req, [](void* ctx, bool status, std::vector* results, const std::string& q, int counter) { - AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx; + areq->withContext(req).withFinalCb([](void** ctx,bool status, std::vector* results, const std::string& q, int counter) { + AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx[0]; if(status) { - HttpResponse r; - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - TeBkUmLpqAsyncWorld::toJson(req->vec, w); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - req->sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP()); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false); - req->sif->writeDirect(h, r.getContent()); -#endif + AsyncReqData* reqdt = (AsyncReqData*)req->sif->getData(); + TeBkUmLpqAsyncWorld::tmplJson(req->vec, reqdt->r.getContentP()); + reqdt->r.sendJson(req->sif); } else { HttpResponse r; - std::string h; - r.httpStatus(HTTPResponseStatus::InternalServerError).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, true); - req->sif->writeDirect(h); + r.sendStatus(HTTPResponseStatus::InternalServerError, req->sif); } req->sif->unUse(); delete req; }); - req->sqli->postAsync(areq, queryCount*3); + req->sqli->postAsync(areq); } }); #endif - req->sqli->postAsync(areq, queryCount); + req->sqli->postAsync(areq); } std::string& TeBkUmLpqAsyncRouter::getUpdQuery(int count) { @@ -362,7 +325,7 @@ std::string& TeBkUmLpqAsyncRouter::getUpdQuery(int count) { } void TeBkUmLpqAsyncRouter::updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* req) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); req->vec.reserve(queryCount); @@ -376,8 +339,8 @@ void TeBkUmLpqAsyncRouter::updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* q->withSelectQuery(WORLD_ONE_QUERY); } #ifdef HAVE_LIBPQ - areq->withFinalCb(req, [](void* ctx, bool status, std::vector* results, const std::string& query, int counter) { - AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx; + areq->withContext(req).withFinalCb([](void** ctx,bool status, std::vector* results, const std::string& query, int counter) { + AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx[0]; int queryCount = (int)results->size(); @@ -388,7 +351,12 @@ void TeBkUmLpqAsyncRouter::updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* for (int i = 0; i < queryCount; ++i) { PGresult* res = results->at(i); - int cols = PQnfields(res); + int id = ntohl(*((uint32_t *) PQgetvalue(res, 0, 0))); + int rd = CommonUtils::fastrand(g_seed) % 10000 + 1; + req->vec.emplace_back(id, rd); + q->withParamInt4(id); + q->withParamInt4(rd); + /*int cols = PQnfields(res); for (int j = 0; j < cols; ++j) { if(j==0) req->vec.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); else { @@ -405,34 +373,22 @@ void TeBkUmLpqAsyncRouter::updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* q->withParamInt4(w.getId()); q->withParamInt4(w.getRandomNumber()); } - } + }*/ } for(auto w: req->vec) { q->withParamInt4(w.getId()); } req->sqli->commitAsync(areq); - areq->withFinalCb(req, [](void* ctx, bool status, std::vector* results, const std::string& query, int counter) { - AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx; + areq->withContext(req).withFinalCb([](void** ctx,bool status, std::vector* results, const std::string& query, int counter) { + AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx[0]; if(status) { - HttpResponse r; - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - TeBkUmLpqAsyncWorld::toJson(req->vec, w); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - req->sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP()); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false); - req->sif->writeDirect(h, r.getContent()); -#endif + AsyncReqData* reqdt = (AsyncReqData*)req->sif->getData(); + TeBkUmLpqAsyncWorld::tmplJson(req->vec, reqdt->r.getContentP()); + reqdt->r.sendJson(req->sif); } else { HttpResponse r; - std::string h; - r.httpStatus(HTTPResponseStatus::InternalServerError).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, true); - req->sif->writeDirect(h); + r.sendStatus(HTTPResponseStatus::InternalServerError, req->sif); } req->sif->unUse(); delete req; @@ -445,7 +401,7 @@ void TeBkUmLpqAsyncRouter::updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* void TeBkUmLpqAsyncRouter::updatesAsync(const char* q, int ql, AsyncUpdatesReq* req) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); req->vec.reserve(queryCount); @@ -460,13 +416,25 @@ void TeBkUmLpqAsyncRouter::updatesAsync(const char* q, int ql, AsyncUpdatesReq* qu->withSelectQuery(WORLD_ONE_QUERY); } #ifdef HAVE_LIBPQ - areq->withFinalCb(req, [](void* ctx, bool status, std::vector* results, const std::string& query, int counter) { - AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx; + areq->withContext(req).withFinalCb([](void** ctx,bool status, std::vector* results, const std::string& query, int counter) { + AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx[0]; LibpqAsyncReq* areq = req->sqli->getAsyncRequest(); for (int i = 0; i < (int)results->size(); ++i) { PGresult* res = results->at(i); - int cols = PQnfields(res); + int id = ntohl(*((uint32_t *) PQgetvalue(res, 0, 0))); + int rd = CommonUtils::fastrand(g_seed) % 10000 + 1; + req->vec.emplace_back(id, rd); + + std::stringstream ss; + ss << "update world set randomnumber = " << rd << " where id = " << id; + + req->sqli->beginAsync(areq); + LibpqQuery* q = areq->getQuery(); + q->withUpdateQuery(ss.str(), false); + req->sqli->commitAsync(areq); + + /*int cols = PQnfields(res); for (int j = 0; j < cols; ++j) { if(j==0) req->vec.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j)))); else { @@ -489,30 +457,17 @@ void TeBkUmLpqAsyncRouter::updatesAsync(const char* q, int ql, AsyncUpdatesReq* q->withUpdateQuery(ss.str(), false); req->sqli->commitAsync(areq); } - } + }*/ } - areq->withFinalCb(req, [](void* ctx, bool status, std::vector* results, const std::string& query, int counter) { - AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx; + areq->withContext(req).withFinalCb([](void** ctx,bool status, std::vector* results, const std::string& query, int counter) { + AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx[0]; + AsyncReqData* reqdt = (AsyncReqData*)req->sif->getData(); if(status) { - HttpResponse r; - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - TeBkUmLpqAsyncWorld::toJson(req->vec, w); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - req->sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP()); - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false); - req->sif->writeDirect(h, r.getContent()); -#endif + TeBkUmLpqAsyncWorld::tmplJson(req->vec, reqdt->r.getContentP()); + reqdt->r.sendJson(req->sif); } else { - HttpResponse r; - std::string h; - r.httpStatus(HTTPResponseStatus::InternalServerError).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, true); - req->sif->writeDirect(h); + reqdt->r.sendStatus(HTTPResponseStatus::InternalServerError, req->sif); } req->sif->unUse(); delete req; @@ -531,8 +486,8 @@ void TeBkUmLpqAsyncRouter::updateCache() { LibpqAsyncReq* areq = sqli->getAsyncRequest(); LibpqQuery* q = areq->getQuery(); - q->withSelectQuery(WORLD_ALL_QUERY).withContext(req).withCb3([](void* ctx, bool endofdata, int row, int col, char* value) { - AsyncCacheReq* req = (AsyncCacheReq*)ctx; + q->withSelectQuery(WORLD_ALL_QUERY).withContext(req).withCb3([](void** ctx,bool endofdata, int row, int col, char* value) { + AsyncCacheReq* req = (AsyncCacheReq*)ctx[0]; if(col==0) { req->vec.emplace_back(ntohl(*((uint32_t *) value))); } else { @@ -560,7 +515,7 @@ void TeBkUmLpqAsyncRouter::updateCache() { } void TeBkUmLpqAsyncRouter::cachedWorlds(const char* q, int ql, std::vector& wlst) { int queryCount = 0; - CommonUtils::fastStrToNum(q, ql, queryCount); + CommonUtils::naiveStrToNum(q, ql, queryCount); queryCount = std::max(1, std::min(queryCount, 500)); wlst.reserve(queryCount); @@ -577,154 +532,107 @@ void TeBkUmLpqAsyncRouter::cachedWorlds(const char* q, int ql, std::vectorgetAsyncRequest(); LibpqQuery* q = areq->getQuery(); #ifdef HAVE_LIBPQ - q->withSelectQuery(FORTUNE_ALL_QUERY).withContext(sif).withCb0([](void* ctx, PGresult* res) { - BaseSocket* sif = (BaseSocket*)ctx; - - std::list flst; - int cols = PQnfields(res); + q->withSelectQuery(FORTUNE_ALL_QUERY).withContext(sif).withCb0([](void** ctx,PGresult* res) { + Writer* sif = (Writer*)ctx[0]; + std::vector flst; int rows = PQntuples(res); + flst.reserve((size_t)rows+1); for(int i=0; imessage < b->message; + }); context.emplace("fortunes", &flst); - fcpstream str; - tmplFunc(&context, str); - std::string out = str.str(); - HttpResponse r; - std::string h; - r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_HTML, 1.1, false, (int)out.length()); - sif->writeDirect(h, out); + AsyncReqData* dbreq = (AsyncReqData*)sif->getData(); + tmplFunc(&context, dbreq->r.getContent()); + dbreq->r.sendHtml(sif); sif->unUse(); + for(int k=0;k<(int)flst.size();k++) { + delete flst.at(k); + } }); #endif sqli->postAsync(areq); } -bool TeBkUmLpqAsyncRouter::route(HttpRequest* req, HttpResponse* res, BaseSocket* sif) { +void TeBkUmLpqAsyncRouter::routeAsync(HttpRequest* req, HttpResponse* res, Writer* sif) { + AsyncReqData* dbreq = (AsyncReqData*)sif->getData(); + dbreq->reset(); + route(req, &dbreq->r, sif); +} + +bool TeBkUmLpqAsyncRouter::route(HttpRequest* req, HttpResponse* res, Writer* sif) { sif->use(); if(StringUtil::endsWith(req->getPath(), "/plaint")) { - std::string h; - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_PLAIN, (int)HELLO_WORLD.length()); - sif->writeDirect(h, HELLO_WORLD); + AsyncReqData* dbreq = (AsyncReqData*)sif->getData(); + res->setContent(HELLO_WORLD).sendText(sif); sif->unUse(); } else if(StringUtil::endsWith(req->getPath(), "/j")) { - TeBkUmLpqAsyncMessage msg; - msg.setMessage(HELLO_WORLD); - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - msg.toJson(w); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObject(&msg, m_ser, res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON); - sif->writeDirect(h, res->getContent()); -#endif + TeBkUmLpqAsyncMessage msg(HELLO_WORLD); + AsyncReqData* dbreq = (AsyncReqData*)sif->getData(); + msg.tmplJson(dbreq->r.getContentP()); + dbreq->r.sendJson(sif); sif->unUse(); } else if(StringUtil::endsWith(req->getPath(), "/d")) { - /*AsyncDbReq* ar = new AsyncDbReq; - ar->sif = sif; - ar->httpVers = req->getHttpVers(); - ar->conn_clos = req->isClose();*/ dbAsync(sif); } else if(StringUtil::endsWith(req->getPath(), "/quer")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - /*AsyncQueriesReq* ar = new AsyncQueriesReq; - ar->sif = sif; - ar->httpVers = req->getHttpVers(); - ar->conn_clos = req->isClose();*/ queriesAsync(params[0].val, params[0].val_len, sif); } else if(StringUtil::endsWith(req->getPath(), "/quem")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); - /*AsyncQueriesReq* ar = new AsyncQueriesReq; - ar->sif = sif; - ar->httpVers = req->getHttpVers(); - ar->conn_clos = req->isClose();*/ queriesMultiAsync(params[0].val, params[0].val_len, sif); - } else if(StringUtil::endsWith(req->getPath(), "/updm")) { + } else if(StringUtil::endsWith(req->getPath(), "/updt")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); AsyncUpdatesReq* ar = new AsyncUpdatesReq; ar->sif = sif; - ar->httpVers = req->getHttpVers(); - ar->conn_clos = req->isClose(); - updatesMulti(params[0].val, params[0].val_len, ar); - } else if(StringUtil::endsWith(req->getPath(), "/fortu")) { - /*AsyncFortuneReq* ar = new AsyncFortuneReq; - ar->sif = sif; - ar->httpVers = req->getHttpVers(); - ar->conn_clos = req->isClose();*/ - fortunes(sif); - } else if(StringUtil::endsWith(req->getPath(), "/bupdt") || StringUtil::endsWith(req->getPath(), "/updt")) { + updatesAsyncb(params[0].val, params[0].val_len, ar); + } else if(StringUtil::endsWith(req->getPath(), "/upd_")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); AsyncUpdatesReq* ar = new AsyncUpdatesReq; ar->sif = sif; - ar->httpVers = req->getHttpVers(); - ar->conn_clos = req->isClose(); - updatesAsyncb(params[0].val, params[0].val_len, ar); - } else if(StringUtil::endsWith(req->getPath(), "/upd_")) { + updatesAsync(params[0].val, params[0].val_len, ar); + } else if(StringUtil::endsWith(req->getPath(), "/updm")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); AsyncUpdatesReq* ar = new AsyncUpdatesReq; ar->sif = sif; - ar->httpVers = req->getHttpVers(); - ar->conn_clos = req->isClose(); - updatesAsync(params[0].val, params[0].val_len, ar); + updatesMulti(params[0].val, params[0].val_len, ar); + } else if(StringUtil::endsWith(req->getPath(), "/fortu")) { + fortunes(sif); } else if(StringUtil::endsWith(req->getPath(), "/cached-wld")) { struct yuarel_param params[1]; yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1); std::vector vec; cachedWorlds(params[0].val, params[0].val_len, vec); - std::string h; -#ifdef HAVE_RAPID_JSON - rapidjson::StringBuffer s; - rapidjson::Writer w(s); - TeBkUmLpqAsyncWorld::toJson(vec, w); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false, s.GetSize()); - sif->writeDirect(h, s.GetString(), s.GetSize()); -#else - JSONSerialize::serializeObjectCont(&vec, wcont_ser, "vector", res->getContentP()); - res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false); - sif->writeDirect(h, res->getContent()); -#endif + AsyncReqData* dbreq = (AsyncReqData*)sif->getData(); + TeBkUmLpqAsyncWorld::tmplJson(vec, dbreq->r.getContentP()); + dbreq->r.sendJson(sif); sif->unUse(); } else { - std::string h; - res->httpStatus(HTTPResponseStatus::NotFound).generateHeadResponse(h, req->getHttpVers(), true); - sif->writeDirect(h); + res->sendStatus(HTTPResponseStatus::NotFound, sif); sif->unUse(); } return false; @@ -736,6 +644,13 @@ Ser TeBkUmLpqAsyncRouter::w_ser; SerCont TeBkUmLpqAsyncRouter::wcont_ser; TeBkUmLpqAsyncRouter::TeBkUmLpqAsyncRouter() { + Writer::registerWriterEventCallback([](Writer* bs, int type) { + if(type==1) { + bs->setData(new AsyncReqData, [](void* data) { + delete (AsyncReqData*)data; + }); + } + }); sqli = NULL; tmplFunc = TemplateUtil::getTemplateFunc("t4", "tpe/fortunes.tpe"); m_ser = Serializer::getSerFuncForObject("t4", "TeBkUmLpqAsyncMessage"); @@ -778,6 +693,13 @@ LibpqDataSourceImpl* TeBkUmLpqAsyncRouterPooled::getDb(int max) { } TeBkUmLpqAsyncRouterPooled::TeBkUmLpqAsyncRouterPooled() { + Writer::registerWriterEventCallback([](Writer* bs, int type) { + if(type==1) { + bs->setData(new AsyncReqData, [](void* data) { + delete (AsyncReqData*)data; + }); + } + }); maxconns = 7; propMap props = ConfigurationData::getAppProperties(); if(props.size()>0) { diff --git a/frameworks/C++/ffead-cpp/t4/tpe/fortunes.tpe b/frameworks/C++/ffead-cpp/t4/tpe/fortunes.tpe index e27f925a123..7b8669d8097 100644 --- a/frameworks/C++/ffead-cpp/t4/tpe/fortunes.tpe +++ b/frameworks/C++/ffead-cpp/t4/tpe/fortunes.tpe @@ -1,12 +1,12 @@ -#declareref std::list* fortunes# +#declareref std::vector* fortunes# Fortunes -#for(std::list::iterator it=fortunes->begin(); it != fortunes->end(); ++it)# - +#for(std::vector::iterator it=fortunes->begin(); it != fortunes->end(); ++it)# + #rof#
idmessage
${(*it).getId()}${(*it).message}
$_S{(*it)->getId()}${(*it)->message}
diff --git a/frameworks/C++/ffead-cpp/t4/xmake.lua b/frameworks/C++/ffead-cpp/t4/xmake.lua index dfb0e6e31bb..7e9cb028b5a 100644 --- a/frameworks/C++/ffead-cpp/t4/xmake.lua +++ b/frameworks/C++/ffead-cpp/t4/xmake.lua @@ -1,6 +1,6 @@ add_includedirs("include/") -local bindir = "$(projectdir)/ffead-cpp-6.0-bin" +local bindir = "$(projectdir)/ffead-cpp-7.0-bin" target("t4") set_languages("c++17") diff --git a/frameworks/C++/ffead-cpp/t5/CMakeLists.txt b/frameworks/C++/ffead-cpp/t5/CMakeLists.txt deleted file mode 100644 index d3ff10be264..00000000000 --- a/frameworks/C++/ffead-cpp/t5/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ - -file(GLOB sources - "include/*.h" - "src/*.cpp" -) - -include_directories("${CMAKE_SOURCE_DIR}/web/t5/include") -if(BUILD_STATIC_LIBS OR EMSCRIPTEN) - add_library(t5 STATIC ${sources}) -else() - add_library(t5 ${sources}) -endif() -set_property(TARGET t5 PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(t5 ffead-modules ffead-framework ${HAVE_PQLIB} ${HAVE_CURLLIB} ${HAVE_SSLLIB} ${HAVE_MEMCACHEDLIB} ${HAVE_ODBCLIB} ${HAVE_MONGOCLIB} ${HAVE_BSONLIB} ${HAVE_ZLIB} ${HAVE_CRYPTOLIB}) diff --git a/frameworks/C++/ffead-cpp/t5/config/application.xml b/frameworks/C++/ffead-cpp/t5/config/application.xml deleted file mode 100644 index de988542967..00000000000 --- a/frameworks/C++/ffead-cpp/t5/config/application.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - * - GET, POST, HEAD, PUT, DELETE - content-type, origin - content-type, origin - true - 1023 - - - - - - - - - -