Browse Source

Remove unmaintained silicon framework (#9100)

Silicon hasn't been updated in 4 years and is currently failing.
https://github.com/matt-42/silicon
Petrik de Heus 1 năm trước cách đây
mục cha
commit
eab0c17490

+ 0 - 19
frameworks/C++/silicon/CMakeLists.txt

@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(silicon)
-
-include_directories(/include $ENV{MICROHTTPD_HOME}/include)
-
-link_directories(/lib $ENV{MICROHTTPD_HOME}/lib)
-
-add_definitions(-std=c++14 -ftemplate-depth=1024 -DNDEBUG -O3)
-
-add_executable(silicon_tpc_mysql techempower_microhttpd.cc)
-target_link_libraries(silicon_tpc_mysql microhttpd mysqlclient)
-
-add_executable(silicon_epoll_mysql techempower_microhttpd.cc)
-set_target_properties(silicon_epoll_mysql PROPERTIES COMPILE_FLAGS "-DTFB_USE_EPOLL")
-target_link_libraries(silicon_epoll_mysql microhttpd mysqlclient)
-
-add_executable(silicon_lwan_mysql techempower_lwan.cc)
-target_link_libraries(silicon_lwan_mysql mysqlclient lwan ubsan curl z pthread dl luajit-5.1)

+ 0 - 8
frameworks/C++/silicon/README.md

@@ -1,8 +0,0 @@
-# C++/silicon Benchmarking test
-
-Silicon is a C++ web framework located at https://github.com/matt-42/silicon
-
-### Note
-
-The `silicon-epoll-mysql` and `silicon-lwan-mysql` tests are currently not working. They have been removed from the `benchmark_config.json` file but the implementations still exist. You can see the old `benchmark_config.json` [here](https://github.com/TechEmpower/FrameworkBenchmarks/blob/5d44d57cbb5cbc209a2d6aeb23010b466c055200/frameworks/C%2B%2B/silicon/benchmark_config.json).
-

+ 0 - 28
frameworks/C++/silicon/benchmark_config.json

@@ -1,28 +0,0 @@
-{
-  "framework": "silicon",
-  "tests": [{
-    "default": {
-      "json_url"       : "/json",
-      "db_url"         : "/db",
-      "query_url"      : "/queries?queries=",
-      "fortune_url"    : "/fortunes",
-      "update_url"     : "/updates?queries=",
-      "plaintext_url"  : "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "MySQL",
-      "framework": "silicon",
-      "language": "C++",
-      "flavor": "None",
-      "orm": "Full",
-      "platform": "None",
-      "webserver": "microhttpd",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "silicon-tpc-mysql",
-      "notes": "",
-      "versus": "silicon"
-    }
-  }]
-}

+ 0 - 47
frameworks/C++/silicon/build/symbols.hh

@@ -1,47 +0,0 @@
-// Generated by iod_generate_symbols.
-#include <iod/symbol.hh>
-#ifndef IOD_SYMBOL_db
-#define IOD_SYMBOL_db
-    iod_define_symbol(db)
-#endif
-
-#ifndef IOD_SYMBOL_fortunes
-#define IOD_SYMBOL_fortunes
-    iod_define_symbol(fortunes)
-#endif
-
-#ifndef IOD_SYMBOL_id
-#define IOD_SYMBOL_id
-    iod_define_symbol(id)
-#endif
-
-#ifndef IOD_SYMBOL_json
-#define IOD_SYMBOL_json
-    iod_define_symbol(json)
-#endif
-
-#ifndef IOD_SYMBOL_message
-#define IOD_SYMBOL_message
-    iod_define_symbol(message)
-#endif
-
-#ifndef IOD_SYMBOL_plaintext
-#define IOD_SYMBOL_plaintext
-    iod_define_symbol(plaintext)
-#endif
-
-#ifndef IOD_SYMBOL_queries
-#define IOD_SYMBOL_queries
-    iod_define_symbol(queries)
-#endif
-
-#ifndef IOD_SYMBOL_randomNumber
-#define IOD_SYMBOL_randomNumber
-    iod_define_symbol(randomNumber)
-#endif
-
-#ifndef IOD_SYMBOL_updates
-#define IOD_SYMBOL_updates
-    iod_define_symbol(updates)
-#endif
-

+ 0 - 102
frameworks/C++/silicon/build/techempower.hh

@@ -1,102 +0,0 @@
-#include <unistd.h>
-#include <iostream>
-#include <silicon/api.hh>
-#include <silicon/middleware_factories.hh>
-#include <silicon/middlewares/mysql_connection.hh>
-#include <silicon/middlewares/mysql_orm.hh>
-#include "symbols.hh"
-
-using namespace s;
-using namespace sl;
-
-typedef decltype(D(_id(_auto_increment, _primary_key) = int(),
-                   _randomNumber = int())) random_number;
-
-typedef decltype(D(_id(_auto_increment, _primary_key) = int(),
-                   _message = std::string())) fortune;
-
-typedef mysql_orm_factory<random_number> rn_orm_factory;
-typedef mysql_orm<random_number> rn_orm;
-
-typedef mysql_orm_factory<fortune> fortune_orm_factory;
-typedef mysql_orm<fortune> fortune_orm;
-
-
-std::string escape_html_entities(std::string& data)
-{
-    std::string buffer;
-    buffer.reserve(data.size());
-    for(size_t pos = 0; pos != data.size(); ++pos) {
-        switch(data[pos]) {
-            case '&':  buffer.append("&amp;");       break;
-            case '\"': buffer.append("&quot;");      break;
-            case '\'': buffer.append("&apos;");      break;
-            case '<':  buffer.append("&lt;");        break;
-            case '>':  buffer.append("&gt;");        break;
-            default:   buffer.append(&data[pos], 1); break;
-        }
-    }
-    return std::move(buffer);
-}
-
-auto techempower_api = http_api(
-
-  GET / _plaintext = [] () { return response(_content_type = string_ref("text/plain"),
-                                       _body = string_ref("Hello, World!")); },
-
-  GET / _json = [] () { return response(_content_type = string_ref("application/json"),
-                                  _body = D(_message = "Hello, World!")); },
-                        
-  GET / _db = [] (rn_orm& orm) {
-    random_number r;
-    orm.find_by_id(1245, r);
-    return response(_content_type = "application/json",
-                    _body = r);
-  },
-
-  GET / _queries * get_parameters(_queries = optional(std::string("1"))) = [] (auto param, rn_orm& orm) {
-    int N = atoi(param.queries.c_str());
-    N = std::max(1, std::min(N, 500));
-
-    std::vector<random_number> qs(N);
-    for (int i = 0; i < N; i++)
-      orm.find_by_id(1 + rand() % 9999, qs[i]);
-    return response(_content_type = "application/json",
-                    _body = std::move(qs));
-  },
-
-  GET / _updates * get_parameters(_queries = optional(std::string("1"))) = [] (auto param, rn_orm& orm) {
-    int N = atoi(param.queries.c_str());
-    N = std::max(1, std::min(N, 500));
-
-    std::vector<random_number> qs(N);
-    for (int i = 0; i < N; i++)
-    {
-      orm.find_by_id(1 + rand() % 9999, qs[i]);
-      qs[i].randomNumber = 1 + rand() % 9999;
-      orm.update(qs[i]);
-    }
-    return response(_content_type = "application/json",
-                    _body = std::move(qs));
-  },
-  
-  GET / _fortunes = [] (fortune_orm& orm) {
-    std::vector<fortune> table;
-    orm.forall([&] (fortune& f) { table.push_back(f); });
-    table.push_back(fortune(0, "Additional fortune added at request time."));
-
-    std::sort(table.begin(), table.end(),
-              [] (const fortune& a, const fortune& b) { return a.message < b.message; });
-
-    std::stringstream ss;
-
-    ss << "<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>";
-    for(auto& f : table)
-      ss << "<tr><td>" << f.id << "</td><td>" << escape_html_entities(f.message) << "</td></tr>";
-    ss << "</table></body></html>";
-
-    return response(_content_type = "text/html; charset=utf-8",
-                    _body = ss.str());
-  }
-  
-  );

+ 0 - 41
frameworks/C++/silicon/build/techempower_lwan.cc

@@ -1,41 +0,0 @@
-#include <silicon/backends/lwan.hh>
-
-#include "techempower.hh"
-
-using namespace s;
-using namespace sl;
-
-int main(int argc, char* argv[])
-{
-  if (argc != 3)
-  {
-    std::cerr << "Usage: " << argv[0] << " mysql_host port" << std::endl;
-    return 1;
-  }
-
-  auto techempower_middlewares = middleware_factories(
-    mysql_connection_factory(argv[1], "benchmarkdbuser", "benchmarkdbpass", "hello_world"),
-    fortune_orm_factory("Fortune"),
-    rn_orm_factory("World")
-    );
-  
-  try
-  {
-
-    // Write the pid.
-    std::ofstream pidfile(argv[3]);
-    pidfile << getpid() << std::endl;
-    pidfile.close();
-
-    // Start the server.
-    sl::lwan_json_serve(techempower_api, techempower_middlewares, atoi(argv[2]));
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-  catch (sl::error::error& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-}

+ 0 - 48
frameworks/C++/silicon/build/techempower_microhttpd.cc

@@ -1,48 +0,0 @@
-#include <silicon/backends/mhd.hh>
-
-#include "techempower.hh"
-
-using namespace s;
-using namespace sl;
-
-int main(int argc, char* argv[])
-{
-
-  if (argc != 4)
-  {
-    std::cerr << "Usage: " << argv[0] << " mysql_host port nthreads" << std::endl;
-    return 1;
-  }
-
-  auto techempower_middlewares = middleware_factories(
-    mysql_connection_factory(argv[1], "benchmarkdbuser", "benchmarkdbpass", "hello_world"),
-    fortune_orm_factory("Fortune"),
-    rn_orm_factory("World")
-    );
-  
-  try
-  {
-    // Write the pid.
-    std::ofstream pidfile(argv[3]);
-    pidfile << getpid() << std::endl;
-    pidfile.close();
-
-    // Start the server.
-    sl::mhd_json_serve(techempower_api, techempower_middlewares, atoi(argv[2]), _blocking
-#ifdef TFB_USE_EPOLL
-                       , _linux_epoll, _nthreads = atoi(argv[3])
-#else
-                       , _one_thread_per_connection
-#endif
-      );
-    
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-  catch (sl::error::error& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-}

+ 0 - 19
frameworks/C++/silicon/config.toml

@@ -1,19 +0,0 @@
-[framework]
-name = "silicon"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/updates?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Micro"
-database = "MySQL"
-database_os = "Linux"
-os = "Linux"
-orm = "Full"
-platform = "None"
-webserver = "microhttpd"
-versus = "silicon"

+ 0 - 39
frameworks/C++/silicon/silicon.dockerfile

@@ -1,39 +0,0 @@
-FROM buildpack-deps:xenial
-
-RUN apt-get update -yqq && apt-get install -yqq software-properties-common cmake apt-transport-https
-
-RUN add-apt-repository -s "deb http://apt.llvm.org/`lsb_release -cs`/ llvm-toolchain-`lsb_release -cs`-3.9 main"
-RUN wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add -
-RUN apt-get update -yqq
-RUN apt-get install -yqq clang-3.9 lldb-3.9
-
-ENV MICROHTTPD_VERSION=0.9.39
-ENV MICROHTTPD=/libmicrohttpd
-ENV MICROHTTPD_HOME=$MICROHTTPD-$VERSION
-
-RUN wget http://mirror.ibcp.fr/pub/gnu/libmicrohttpd/libmicrohttpd-$MICROHTTPD_VERSION.tar.gz
-RUN tar xf libmicrohttpd-$MICROHTTPD_VERSION.tar.gz
-RUN cd libmicrohttpd-$MICROHTTPD_VERSION && \
-    ./configure --prefix=$MICROHTTPD_HOME && \
-    make install
-
-ENV PATH=${MICROHTTPD_HOME}/bin:${PATH}
-
-RUN apt-get install -yqq libboost-dev cmake
-
-ENV SILICON=/silicon
-
-COPY ./ ./
-
-RUN git clone https://github.com/matt-42/silicon.git && \
-    cd silicon && \
-    git checkout ecaf04887c9dbbf0f457afab1f487268f6aeffab && \
-    CC=clang-3.9 CXX=clang++-3.9 ./install.sh /
-
-RUN cd build && \
-    cmake .. -DCMAKE_CXX_COMPILER=clang++-3.9 && \
-    make silicon_tpc_mysql
-
-EXPOSE 8080
-
-CMD /build/silicon_tpc_mysql tfb-database 8080 $(nproc)