ソースを参照

Remove unmaintained Octopus framework (#9109)

The last commit was 6 years ago and according to the about
"..this project is no longer actively maintained".
https://github.com/LuaMobile/octopus
Petrik de Heus 1 年間 前
コミット
a4ac3866e4

+ 0 - 35
frameworks/Lua/octopus/README.md

@@ -1,35 +0,0 @@
-# Octopus (Nginx + LuaJIT)  Benchmark Test
-
-The test lua app is inside [app](app) directory.
-The configuration is in [config.lua](config.lua).
-Clones, compiles and runs nginx with ngx_lua module, see [openresty.org](http://openresty.org).
-Prerequisites: ```libssl-dev gcc g++ build-essential```.
-Requires [git](https://git-scm.com).
-Requires postgresql hostname specified as IP address, if not possible then add resolver conf to [config.lua](config.lua).
-The Octopus benchmark is using its ORM, and no raw queries.
-
-
-## Test URLs
-### Plaintext URL
-
-http://localhost:8080/plaintext
-
-### JSON Encoding 
-
-http://localhost:8080/json
-
-### Single Row Random Query
-
-http://localhost:8080/db
-
-### Multiple Row Query Test
-
-http://localhost:8080/queries?queries=2
-
-### Fortune URL
-
-http://localhost:8080/fortunes
-
-### DB Updates URL
-
-http://localhost:8080/update?queries=2

+ 0 - 16
frameworks/Lua/octopus/app/config.lua

@@ -1,16 +0,0 @@
-local config = {} -- extension configuration
-
-config.locations = {
-	{name = "/plaintext", script = "PlaintextController.lua"},
-	{name = "/json", script = "JsonSerializationController.lua"},
-	{name = "/db", script = "SingleQueryController.lua"},
-	{name = "/queries", script = "MultipleQueriesController.lua"},
-	{name = "/fortunes", script = "FortunesController.lua"},
-	{name = "/update", script = "UpdateController.lua"},
-}
-
-config.types = {
-	"types.lua"
-}
-
-return config -- return extension configuration

+ 0 - 34
frameworks/Lua/octopus/app/src/FortunesController.lua

@@ -1,34 +0,0 @@
-local json = require "json"
-local database = require "database"
-local exit = require "exit"
-
-local template = require'template'
-template.caching(false)
--- Compile template, disable cache, enable plain text view to skip filesystem loading
-local view = template.compile([[<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>{% for _,f in ipairs(fortunes) do %}<tr><td>{{ f.id }}</td><td>{{ f.message }}</td></tr>{% end %}</table></body></html>]], nil, true)
-
-
-local function process (db)
-	local fortunes = db:find({Fortune = {}})
-	table.insert(fortunes, {id = 0, message = "Additional fortune added at request time."})
-	table.sort(fortunes, function(a, b)
-		return a.message < b.message
-	end)
-    return fortunes
-end
-
-
-local status, db = pcall(database.connect)
-if not status then exit(db) end
-
-local status, res = pcall(process, db)
-db:close()
-
-if status then
-	local html = view({fortunes = res})
-	ngx.header.content_type = 'text/html; charset=utf-8'
-	ngx.header.content_length = #html
-	ngx.print(html)
-else
-	exit(res)
-end

+ 0 - 4
frameworks/Lua/octopus/app/src/JsonSerializationController.lua

@@ -1,4 +0,0 @@
-local json = require "json"
-
-ngx.header.content_type = 'application/json'
-ngx.print(json.encode({message = "Hello, World!"}))

+ 0 - 36
frameworks/Lua/octopus/app/src/MultipleQueriesController.lua

@@ -1,36 +0,0 @@
-local json = require "json"
-local database = require "database"
-local param = require "param"
-local exit = require "exit"
-
-
-local function process (db)
-	local op = db:operators()
-	
-	local num_queries = tonumber(param.queries) or 1
-	if num_queries < 1 then 
-		num_queries = 1 
-	elseif num_queries > 500 then
-		num_queries = 500
-	end
-	
-	local worlds = {}
-	for i=1, num_queries do
-		worlds[#worlds + 1] = db:findOne({World = {id = op.equal(math.random(1,10000))}})
-	end
-	return worlds
-end
-
-
-local status, db = pcall(database.connect)
-if not status then exit(db) end
-
-local status, res = pcall(process, db)
-db:close()
-
-if status then
-	ngx.header.content_type = 'application/json'
-	ngx.print(json.encode(res))
-else
-	exit(res)
-end

+ 0 - 2
frameworks/Lua/octopus/app/src/PlaintextController.lua

@@ -1,2 +0,0 @@
-ngx.header.content_type = 'text/plain'
-ngx.print("Hello, World!")

+ 0 - 24
frameworks/Lua/octopus/app/src/SingleQueryController.lua

@@ -1,24 +0,0 @@
-local json = require "json"
-local database = require "database"
-local exit = require "exit"
-
-
-local function process (db)
-	local op = db:operators()
-	
-	return db:findOne({World = {id = op.equal(math.random(1,10000))}})
-end
-
-
-local status, db = pcall(database.connect)
-if not status then exit(db) end
-
-local status, res = pcall(process, db)
-db:close()
-
-if status then
-	ngx.header.content_type = 'application/json'
-	ngx.print(json.encode(res))
-else
-	exit(res)
-end

+ 0 - 39
frameworks/Lua/octopus/app/src/UpdateController.lua

@@ -1,39 +0,0 @@
-local json = require "json"
-local database = require "database"
-local param = require "param"
-local exit = require "exit"
-
-
-local function process (db)
-	local op = db:operators()
-	
-	local num_queries = tonumber(param.queries) or 1
-	if num_queries < 1 then 
-		num_queries = 1 
-	elseif num_queries > 500 then
-		num_queries = 500
-	end
-	
-	local worlds = {}
-	for i=1, num_queries do
-		local world = db:findOne({World = {id = op.equal(math.random(1,10000))}})
-		world.randomNumber = math.random(1,10000)
-		db:update({World = world})
-		worlds[#worlds + 1] = world
-	end
-	return worlds
-end
-
-
-local status, db = pcall(database.connect)
-if not status then exit(db) end
-
-local status, res = pcall(process, db)
-db:close()
-
-if status then
-	ngx.header.content_type = 'application/json'
-	ngx.print(json.encode(res))
-else
-	exit(res)
-end

+ 0 - 12
frameworks/Lua/octopus/app/src/types.lua

@@ -1,12 +0,0 @@
-return {
-
-	World = {
-		-- id field is implicitly defined by the ORM
-		randomNumber = "integer",
-	},
-
-	Fortune = {
-		-- id field is implicitly defined by the ORM
-		message = "string",
-	},
-}

+ 0 - 28
frameworks/Lua/octopus/benchmark_config.json

@@ -1,28 +0,0 @@
-{
-  "framework": "octopus",
-  "tests": [{
-    "default": {
-      "plaintext_url": "/plaintext",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/update?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MySQL",
-      "framework": "Octopus",
-      "language": "Lua",
-      "orm": "Full",
-      "platform": "OpenResty",
-      "webserver": "nginx",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "Octopus",
-      "notes": "",
-      "versus": "openresty",
-      "tags": ["broken"]
-    }
-  }]
-}

+ 0 - 39
frameworks/Lua/octopus/config.lua

@@ -1,39 +0,0 @@
-return {
-	extensions = {
-		{octopusExtensionsDir, "core"}, 
-		{octopusExtensionsDir, "baseline"}, 
-		{octopusExtensionsDir, "orm"}, 
-		{octopusExtensionsDir, "app"},
-	},
-	
-	octopusExtensionsDir = octopusExtensionsDir,
-	octopusHostDir = octopusHostDir,
-	port = 8080,
-	securePort = 38080,
-	luaCodeCache = "on",
-	serverName = "tfb-server",
-	errorLog = "error_log logs/error.log;",
-	accessLog = "access_log logs/access.log;",
-	includeDrop = [[#include drop.conf;]],
-	maxBodySize = "50k",
-	minifyJavaScript = false,
-	minifyCommand = [[java -jar ../yuicompressor-2.4.8.jar %s -o %s]],
-	
-	databaseConnection = {
-		rdbms       =   "mysql",
-		host        =   "DBHOSTNAME",
-		port        =   3306, 
-		database    =   "hello_world",
-		user        =   "benchmarkdbuser",
-		password    =   "benchmarkdbpass",
-		compact     =   false
-	},
-
-	globalParameters = {
-		octopusHostDir = octopusHostDir,
-		sourceCtxPath = "",
-		requireSecurity = false,
-		sessionTimeout = 3600,
-		usePreparedStatement = false,
-	},
-}

+ 0 - 19
frameworks/Lua/octopus/config.toml

@@ -1,19 +0,0 @@
-[framework]
-name = "octopus"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/update?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Fullstack"
-database = "MySQL"
-database_os = "Linux"
-os = "Linux"
-orm = "Full"
-platform = "OpenResty"
-webserver = "nginx"
-versus = "openresty"

+ 0 - 56
frameworks/Lua/octopus/octopus.dockerfile

@@ -1,56 +0,0 @@
-FROM buildpack-deps:xenial
-
-ENV LUA_VERSION="5.1"
-ENV LUA_MICRO="5"
-
-RUN apt-get update -yqq && apt-get install -yqq unzip
-
-RUN wget https://github.com/LuaDist/lua/archive/$LUA_VERSION.$LUA_MICRO.tar.gz
-RUN tar xf $LUA_VERSION.$LUA_MICRO.tar.gz
-
-ENV LUA_HOME=/lua-$LUA_VERSION.$LUA_MICRO
-
-RUN cd $LUA_HOME && \
-    cp src/luaconf.h.orig src/luaconf.h && \
-    make linux && \
-    cd src && \
-    mkdir ../bin ../include ../lib && \
-    install -p -m 0755 lua luac ../bin && \
-    install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../include && \
-    install -p -m 0644 liblua.a ../lib
-
-ENV LUA=/lua${LUA_VERSION}.${LUA_MICRO}
-ENV PATH=${LUA_HOME}/bin:${PATH}
-ENV LUA_PATH="./?.lua;./?.lc;$LUA_HOME/share/lua/5.1/?/init.lua;$LUA_HOME/share/lua/5.1/?.lua;$LUA_HOME/lib/lua/5.1/?/init.lua;$LUA_HOME/lib/lua/5.1/?.lua"
-ENV LUA_CPATH="./?.lua;./?.lc;$LUA_HOME/share/lua/5.1/?/init.so;$LUA_HOME/share/lua/5.1/?.so;$LUA_HOME/lib/lua/5.1/?/init.so;$LUA_HOME/lib/lua/5.1/?.so"
-
-WORKDIR /octo
-
-RUN git clone https://github.com/cyberz-eu/octopus.git
-
-WORKDIR /octo/octopus
-# Dec 8th, 2017
-RUN git checkout 44c7e7ecdfd9e95703e73df85815c0cca4b441e8
-
-WORKDIR /octo
-
-ADD ./ /octo
-
-RUN cp -avr app octopus/extensions
-RUN cp -vf config.lua octopus/extensions
-
-WORKDIR /octo/octopus/bin/unix
-
-RUN chmod +x *.sh
-
-RUN sed -i 's|wget|wget -q|g' server.sh
-RUN sed -i 's|-c nginx.conf|-c nginx.conf -g "daemon off;"|g' server.sh
-
-RUN ./server.sh install
-RUN ./server.sh build
-
-EXPOSE 8080
-
-CMD export DBIP=`getent hosts tfb-database | awk '{ print $1 }'` && \
-    sed -i "s|DBHOSTNAME|$DBIP|g" /octo/octopus/extensions/build/src/types.lua && \
-    ./server.sh start