dotnwat / lua-rados Goto Github PK
View Code? Open in Web Editor NEWRADOS bindings for Lua
Home Page: http://noahdesu.github.com/lua-rados/
RADOS bindings for Lua
Home Page: http://noahdesu.github.com/lua-rados/
I had lua5.1 and 5.2 installed on my machine and we should make it a point to indicate what version of lua to be using with this project. I noticed you were using 5.1 a long time ago, but I left 5.2 sitting on my system. After I followed N's following instructions:
1. autoreconf -I m4 -ivf
2. ./configure && make
3. sudo apt-get install luarocks
4. sudo luarocks install busted
5. eval `luarocks path`
6. export LUA_CPATH="$PWD/.libs/?.so;$LUA_CPATH"
7. export CEPH_CONF=/path/to/ceph.conf
8. busted test.lua
to build and test lua-rados. I had errors when I would try to run step 8. I then removed lua5.2 and started at step 3 and then I was able to get the test to run.
I think this just needs to have the dependencies recorded in a weak table to prevent GC if Lua side references disappear.
Lua doesn't know how large the bufferlist heap data is, so if you create a ton of bufferlists with lots of data then Lua will get OOM killed. The first thing we should do is explicitly delete the bufferlists when they are not needed in the success case. This doesn't help for when there is an error and a longjmp, but it should help the common case. For the error we may be able to tune the GC step size.
Hi , noahwatkins:
Thinks for your reply ,but I still got some errors when using luarocks to install lua-rados :
[root@ceph-ca1 ~]# /usr/local/openresty/luajit/bin/luarocks install https://raw.github.com/noahdesu/lua-rados/master/rockspecs/lua-rados-0.0.1-1.rockspec
./bootstrap.sh && LUA=/usr/local/openresty/luajit//bin/luajit CPPFLAGS=-I/usr/local/openresty/luajit/include/luajit-2.1 ./configure --prefix=/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1 --libdir=/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1/lib --datadir=/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1/lua && make clean && make
autoreconf: Entering directory `.'
......
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lua-rados.rockspec
config.status: executing depfiles commands
config.status: executing libtool commands
test -z "rados.la" || rm -f rados.la
rm -f ./so_locations
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
CXX rados_la-lua_rados.lo
In file included from /usr/include/c++/4.8.2/type_traits:35:0,
from /usr/include/rados/buffer.h:46,
from /usr/include/rados/librados.hpp:12,
from lua_rados.cc:14:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the
^
…..
In file included from /usr/include/rados/librados.hpp:11:0,
from lua_rados.cc:14:
/usr/include/rados/memory.h:7:14: error: 'std::shared_ptr' has not been declared
using std::shared_ptr;
^
make: *** [rados_la-lua_rados.lo] Error 1
Error: Build error: Failed building.
And then I add -std=c++11 or -std=gnu++11 to run manually like this:
./bootstrap.sh && LUA=/usr/local/openresty/luajit//bin/luajit CPPFLAGS=-I/usr/local/openresty/luajit/include/luajit-2.1 ./configure --prefix=/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1 --libdir=/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1/lib --datadir=/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1/lua -std=c++11 -std=gnu++11
compile and make install Successful
but I still con't use lua-rados in openresty, some errors like that:
2017/03/17 03:12:36 [error] 26777#0: *10 lua entry thread aborted: runtime error: error loading module 'rados' from file '/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1/lib/rados.so':
/usr/local/openresty/luajit/lib/luarocks/rocks/lua-rados/0.0.1-1/lib/rados.so: undefined symbol: luaopen_rados
stack traceback:
coroutine 0:
[C]: in function 'require'
content_by_lua(nginx.conf:71):3: in function <content_by_lua(nginx.conf:71):1>, client: 192.168.33.22, server: localhost, request: "GET /api HTTP/1.1", host: "172.26.101.93"
2017/03/17 03:12:36 [debug] 26777#0: *10 lua request cleanup: forcible=0
my env:
centos 7
nginx version: openresty/1.11.2.2
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
LuaJIT 2.1.0-beta2 -- Copyright (C) 2005-2016 Mike Pall. http://luajit.org/
On ubuntu 16.04, when do luarocks install https://raw.github.com/noahdesu/lua-rados/master/rockspecs/lua-rados-0.0.1-1.rockspec
, there is a compiler error as below:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
When compiling against Ceph master commit eb81cc44effdadf84215a31f7cb8d51e4eb41211, I get the following error:
config.status: creating Makefile
config.status: creating lua-rados.rockspec
config.status: executing depfiles commands
config.status: executing libtool commands
CXX rados_la-lua_rados.lo
In file included from /usr/include/rados/librados.hpp:12:0,
from lua_rados.cc:14:
/usr/include/rados/buffer.h:50:32: fatal error: include/buffer_fwd.h: No such file or directory
#include "include/buffer_fwd.h"
^
compilation terminated.
make: *** [rados_la-lua_rados.lo] Error 1
This was working last week... I think it's related to this change. Not sure if they committed something bad or if you need to change something in the Lua-RADOS bindings.
Try these Docker images using:
mkdir testing; cd testing
vim Dockerfile
<paste Dockerfile>
docker build -t test-dockerfile .
This Dockerfile fails:
FROM ivotron/cephdev-build:latest
MAINTAINER Michael Sevilla <[email protected]>
# install ceph master branch
RUN wget -q -O- 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc' | sudo apt-key add - && \
echo deb http://gitbuilder.ceph.com/ceph-deb-$(lsb_release -sc)-x86_64-basic/ref/master $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list && \
DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --force-yes git wget ceph librados-dev lua5.1 liblua5.1-dev luarocks libssl-dev dh-autoreconf && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# get the code and build
RUN luarocks install busted && \
luarocks install luasec OPENSSL_LIBDIR=/lib/x86_64-linux-gnu/ && \
git clone https://github.com/noahdesu/lua-rados.git && \
git clone https://github.com/noahdesu/cls-lua-client.git && \
cd lua-rados && \
autoreconf -I m4 -ivf && \
./configure CPPFLAGS="-std=c++11" && \
make
This Dockerfile succeeds:
FROM ceph/base:infernalis
MAINTAINER Michael Sevilla <[email protected]>
# install ceph infernalis branch
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --force-yes git wget ceph librados-dev lua5.1 liblua5.1-dev luarocks libssl-dev dh-autoreconf && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# get the code and build
RUN luarocks install busted && \
luarocks install luasec OPENSSL_LIBDIR=/lib/x86_64-linux-gnu/ && \
git clone https://github.com/noahdesu/lua-rados.git && \
git clone https://github.com/noahdesu/cls-lua-client.git && \
cd lua-rados && \
autoreconf -I m4 -ivf && \
./configure CPPFLAGS="-std=c++11" && \
make
Hi, did you have a test for lua-rados‘ qps ? I test it's qps just only 7-9
handler takes string buffer and length, but we don't enforce that length is >= 0 and <= size of buffer. should check and then use luaL_argerror(..).
Very important
Expand test suite to make sure we are handling expected error cases correctly.
I tried stat()
on a non-existing object and I got a segfault. Do I have any way to check the existence of an object with this binding?
I saw you had update lua-raods to 0.0.0-2 , and I installed 0.0.2-1 successful without errors but no find rados.so in the lib dir , why ?
lua-rados-0.0.2-1.err.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.