Giter Club home page Giter Club logo

cogserver's Introduction

OpenCog CogServer

CircleCI

The OpenCog CogServer is a network scheme & python command-line server for the OpenCog AtomSpace (hyper-)graph database. It allows network users to run arbitrary python and scheme code on the server, and access the AtomSpace over the network. The cogserver also provides a pseudo-JSON interface, as well as a high-speed data transfer format that is used for building network-distributed AtomSpaces. The CogServer is a part of the OpenCog project.

Overview

The CogServer provides a network command-line console and a WebSocket server. The network console server provides a fast, efficient telnet interface, giving access to Scheme (guile), Python and JSON command-lines. These can be used by multiple users at the same time, all obtaining access to the same AtomSpace. This is also shared by the WebSocket interface, so that all users see the same data, irrespective of the network connection.

This capability is useful in several different ways:

  • General maintenance on long-running OpenCog or AtomSpace processes (e.g. robot control, large batch-job processing or long-running data-mining servers.) This includes running ad-hoc commands, monitoring status, and poking around and performing general maintenance on long-running servers.

  • Network command line. Ordinary Python does not allow multiple users to access it at the same time. With the CogServer, multiple Python users can use it simultaneously. As to scheme/guile, whereas there is an ice-9 REPL server, the CogServer is an order of magnitude faster, lower latency/higher throughput, and infinitely more stable; its free of lockups, hangs and crashes. It's fast.

  • WebSocket API. All interfaces are accessible through websockets. The only difference is that prompts are not sent. For example, the python API is available at ws://localhost:18080/py. At this time, encryption is not supported, so wss:// URL's will not work. See the websocket example for more.

  • JSON-style interface. This is useful for creating JavaScript-powered visualizers and user interfaces. Suitable for people who are more comfortable working with JSON. This API is available at ws://localhost:18080/json.

  • Bulk data transfer. The base "s-expression" encoding of Atoms and (Truth)Values is UTF-8 text string format. It's human-readable, easy and efficient. It does not require fiddling with complex binary formats or protocols or the use of protocol libraries or API's. (We're looking at you, HTTP, REST, ZeroMQ, ProtoBuff and friends. You are all very sophisticated, yes, but are hard to use. And sometimes painfully slow.)

  • Network-distributed processing. The StorageNode API provides a uniform data transfer API to local disk, 3rd-party databases and network. The CogServer implements this API, thus allowing multiple AtomSpaces distributed on the network to share data.

  • Proxy Agents. The proxy infrastructure has been replaced by a more general, more flexible, more powerful and configurable proxying system. See the main AtomSpace git repo, in the opencog/persist/proxy directory.

  • The stats command provides a top-like command for viewing who is connected to the Cogserver, and what they are doing. Type help stats for more info.

For more info, please consult the CogServer wiki page.

Version

This is version 3.2.0. The code is stable, it's been used in production settings for a decade. There are no known bugs. There are some planned features; see below.

Using

There are three ways to start the cogserver: from a bash shell prompt (as a stand-alone process), from the guile command line, or from the python command line.

  • From bash, just start the process: $ build/opencog/cogserver/server/cogserver

  • From guile: (use-modules (opencog cogserver)) (start-cogserver)

  • From python: import opencog.cogserver and then ??? start_cogserver() ??? (where's the documentation for this?) (At this time, there is no currently active python maintainer. Help wanted.)

Once started, one can obtain a shell by saying rlwrap telnet localhost 17001, and then py, scm or json to obtain python, scheme or json shells. This can be done as many times as desired; all shells share the same AtomSpace, and the system is fully multi-threaded/thread-safe. The status of all network connections is displayed by stats. For more info, type help py, help scm, help json and help stats.

The rlwrap utility simply adds arrow-key support, so that up-arrow provides a command history, and left-right arrow allows in-place editing. Note that telnet does not provide any password protection! It is fully networked, so you can telnet from other hosts. The default port number 17001 can be changed; see the documentation.

The socket protocol used is 'trivial'. Thus, besides telnet, one can also use netcat, or access the socket directly, with ordinary socket connect, open and read/write calls.

WebSocket programmers will find it convenient to use their own favorite tools to access the json API. A very simple example can be found in the WebSocket Example directory.

Building and Running

The CogServer is built exactly the same way that all other OpenCog components are built:

clone https://github.com/opencog/cogserver
cd cogserver
mkdir build
cd build
cmake ..
make -j

For additional information on dependencies and general hand-holding with the build, see the building Opencog wiki.

Prerequisites

To build and run the CogServer, you need to install the AtomSpace first.

AtomSpace

OpenCog AtomSpace database http://github.com/opencog/atomspace It uses exactly the same build procedure as this package. Be sure to sudo make install at the end.

The WebSockets server needs the OpenSSL devel environment to be installed.

OpenSSL

OpenSSL On Debian/Ubuntu, sudo apt install libssl-dev

Unit tests

To build and run the unit tests, just say

    make test

from the ./build directory.

Architecture

See also these README's:

TODO

There are two major open ToDo items for the CogServer. These are:

  • Distributed computing. How to build a distributed computing fabric for AtomSpace data? The read-thru and write-thru proxies provide basic building blocks for distributed computing: they can forward I/O traffic to other servers. See the proxy/README for details. There are no automation tools for configuring these into a large complex network. There is a project for this in the AtomSpace Agents git repo. It is currently abandoned (due to lack of interest).

  • Security. Right now, anyone who has network access can attach to the CogServer, and do anything. There are three different ways to do 'anything':

    • The top-level CogServer shell allows arbitrary loadable modules to be loaded.
    • The python and scheme shells allow the execution of arbitrary python and scheme code, including system calls. This includes file writes.
    • The sexpr and json shells are "controlled", in that they do NOT allow access to system calls. However, they do allow arbitrary changes to the made to the AtomSpace, including insertion and deletion of Atoms. The GroundedPredicateNode allows for the arbitrary execution of arbitrary scheme and python code.

It's not clear how to introduce security into this model, other than to only open network connections to trusted, authorized users. Presumably, there are several off-the-shelf solutions for controlling network access, but no one has picked a good one. Obviously, exporting the CogServer socket via SSH is a good way of controlling access to who can use it. But SSH proxying is very low-level, and not admin-friendly. Nor particularly user-friendly, either: the user can't just login into some website and ask for access.

cogserver's People

Contributors

alex-van-der-peet avatar amebel avatar chenesan avatar dagiopia avatar edajade avatar eddiemonroe avatar ferrouswheel avatar githart avatar glicerico avatar hedayat avatar inflector avatar keyvan-m-sadeghi avatar leungmanhin avatar linas avatar misgeatgit avatar ngeiswei avatar noskill avatar pennachin avatar roman-khimov avatar rtreutlein avatar ruiting avatar shujingke avatar stellarspot avatar tnick avatar trent-waddington avatar vsbogd avatar wenwei-dev avatar williampma avatar yantrabuddhi avatar zariuq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cogserver's Issues

python printing is broken

Printing to the python shell is broken. This got broken by pull request opencog/opencog#2311, the refactoring of the network code is not yet complete.

Tor reproduce: telnetto the cogserver, enter the python shell, and execute any python code -- nothing is printed.

CogServer does not error on module load failure

If you launch the CogServer and it cannot load a module because it has not been installed or is not present in the module search path, there is no error. It only prints some log entries at WARN level.

To duplicate, put a module in the MODULES section of a config file. Then remove the module from the install directory.

encounter missing install target

try to build cogserver follow the procedures written in readme.md:
scrooge@scrooge-X455LD:~/cogserver/build$ cmake ..
-- Build type: Release
-- CogUtil found.
-- AtomSpace found.
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- program_options
-- regex
-- serialization
-- system
-- thread
-- chrono
-- atomic
-- Boost version 105800 found.
-- Guile (2.2.3 >= 2.2.2) was found.
-- Python 3.5.2 interpreter found.
-- Python 3.5.2 libraries found.
-- Cython ( 0.23.5 >= 0.23.0) found.
-- Python destination dir found: /usr/local/lib/python3.5/dist-packages
-- Python install dir: /usr/local/lib/python3.5/dist-packages/opencog
-- Using nosetests executable /usr/bin/nosetests3
-- Found Intel TBB

-- Found ZeroMQ library: /usr/lib/x86_64-linux-gnu/libzmq.so
-- Detected ZeroMQ version number: 4.1.4
-- ZeroMQ was found.
-- Valgrind Prefix:
-- Could NOT find VALGRIND (missing: VALGRIND_INCLUDE_DIR VALGRIND_PROGRAM)
-- VALGRIND missing: needed for thread debugging.
CMake Error at opencog/cogserver/server/CMakeLists.txt:57 (INSTALL):
install TARGETS given target "network" which does not exist in this
directory.

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)

Building for Ubuntu 16.04.6 LTS

The following components will be built:

CogServer - CogServer network and job server.
Cython bindings - Cython (python) bindings.
Python tests - Python bindings nose tests.
Unit tests - Unit tests.

The following components WILL NOT be built:

Doxygen - Code documentation.

-- Configuring incomplete, errors occurred!
See also "/home/scrooge/cogserver/build/CMakeFiles/CMakeOutput.log".
See also "/home/scrooge/cogserver/build/CMakeFiles/CMakeError.log".

ShellUTest fails because of NumberNode formatting change

I tried to run ShellUTest locally and it looks like it fails because trailing zeroes are absent in NumberNode format. At least I don't see them in failure message but see them in example from code of the unit test. And size difference is exactly 7 symbols:

/home/vital/projects/opencog/cogserver-build/tests/shell/../../../cogserver/tests/shell/ShellUTest.cxxtest:76: Error: Expected (281 <= reso.size()), found (281 > 274)
Error: Create rep 29 of 30 in thread 16 failed
	Got: 274 >>>opencog> Entering scheme shell; use ^D or a single . on a line by itself to exit.
guile> (EvaluationLink
   (PredicateNode "visible face")
   (ListLink
      (NumberNode "26039")
   )
)

guile> 
guile> <<<

make check fails trying to find PyIncludeWrapper.h

This was previously reported at #24

As of commit a932b22 this is still a problem. make check aborts like this:

...
[ 88%] Building CXX object tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o
cd /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython && /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/c++  -DCONFDIR=\"/gnu/store/90b5vm87vlwar6w8g3hcmmm9i4md5md5-cogserver-0-2.a932b22/etc\" -DDATADIR=\"/gnu/store/90b5vm87vlwar6w8g3hcmmm9i4md5md5-cogserver-0-2.a932b22/share/opencog\" -DGUILE_SITE_DIR=\"/gnu/store/90b5vm87vlwar6w8g3hcmmm9i4md5md5-cogserver-0-2.a932b22/share/guile/site/2.2/\" -DHAVE_ATOMSPACE -DHAVE_COGUTIL -DHAVE_GUILE -DHAVE_GUILE2 -DHAVE_GUILE_2_2 -DPROJECT_BINARY_DIR=\"/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build\" -DPROJECT_SOURCE_DIR=\"/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source\" -I/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/include/guile/2.2 -I/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source -I/gnu/store/f5g4av3mwn7zr81yqr1gn9hpb5d2c4m4-boost-1.70.0/include -I/gnu/store/ifsrj0bbpvq3rayq86nr778y3f50li0n-cogutil-2.0.3-1.b07b41b/include -I/gnu/store/xs9biw1wpwjjp42v5806s1jrzhk76h4c-atomspace-5.0.3-1.86c848d/include -I/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build -I/gnu/store/x5fj048bvqpafb07dpidy36fj7l3qfnx-python-minimal-3.7.4/include/python3.7m -I/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source/tests/cython  -Wall -fPIC -Wno-variadic-macros -fopenmp -std=gnu++11 -O2 -g -DNDEBUG   -o CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o -c /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython/PyEvalUTest.cpp
In file included from /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython/../../../source/tests/cython/PyEvalUTest.cxxtest:6:0,
                 from /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython/PyEvalUTest.cpp:24:
/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source/opencog/cogserver/modules/python/PyMindAgent.h:13:10: fatal error: opencog/cython/PyIncludeWrapper.h: No such file or directory
 #include <opencog/cython/PyIncludeWrapper.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [tests/cython/CMakeFiles/PyEvalUTest.dir/build.make:70: tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o] Error 1
make[3]: Leaving directory '/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build'
make[2]: *** [CMakeFiles/Makefile2:856: tests/cython/CMakeFiles/PyEvalUTest.dir/all] Error 2
make[2]: Leaving directory '/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:129: CMakeFiles/tests.dir/rule] Error 2
make[1]: Leaving directory '/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build'
make: *** [Makefile:202: tests] Error 2

Test suite failed, dumping logs.
command "make" "tests" failed with status 2

I'm building in an isolated environment using GNU Guix. The environment contains atomspace, boost, cogutil, gmp, Guile 2.2, cxxtest, Python 3, and pkg-config (in addition to the GCC 7 toolchain).

Python 3 is checked for during the configure phase. I would not include it in the environment if it was possible to configure without it.

python shell handling is broken.

See comments in pull request opencog/atomspace#838

At this time, starting the cogserver, and then telnet localhost 17001, entering the python shell, and entering this:

for i in range(10) :
    print "foo", i

produces no output in either the shell or the cogserver (see also issue #2 -- currently prints go to the cogserver; once fixed, prints should go to the shell.) There are also various inconsistencies: running the python shell stand-alone gives this:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> 

after hitting carriage return 3 times. Doing the same in the telnet terminal gives this:

$ telnet localhost 17001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
opencog> py
Entering python shell; use ^D or a single . on a line by itself to exit.
py> 
... 
... 
py> 
py> 
... 
... 
... 
... 
... 
... 
py> 
... 
... 
... 
... 
py> 
... 

There are also inconsistencies in what python considers to be "legal syntax". For example, the following code, when entered at the python shell, is invalid syntax:

def fun(x):
    y = x + 1

    print "foo", y
    return y

fun(1)
print "bar"

it generates this error:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def fun(x):
...     y = x + 1
... 
>>>     print "foo", y
  File "<stdin>", line 1
    print "foo", y
    ^
IndentationError: unexpected indent
>>> 

however, copying that code to a file, say f.py and running it as $ python f.py does not produce any error:

$ python f.py
foo 2
bar
$

running the above code at the telnet prompt does nothing.

I'm not sure quite how to resolve this ... if python itself is not self-consistent with what it considers to be valid syntax, I'm not sure how how to emulate that .. at any rate, the telnet shell is clearly broken.

test failed

After building cogserver, I try to write python code with import opencog.cogserver but failed with missing module named "cogserver", then I try running make test under the build folder of cogserver, then I get this:
Listening on port 17333
.
Failed 1 and Skipped 0 of 5 tests
Success rate: 80%

67% tests passed, 2 tests failed out of 6

Total Test time (real) = 182.90 sec

The following tests FAILED:
3 - PythonModuleUTest (SEGFAULT)
6 - ShellUTest (Failed)
Errors while running CTest
CMakeFiles/test.dir/build.make:57: recipe for target 'CMakeFiles/test' failed
make[3]: *** [CMakeFiles/test] Error 8
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/test.dir/all' failed
make[2]: *** [CMakeFiles/test.dir/all] Error 2
CMakeFiles/Makefile2:106: recipe for target 'CMakeFiles/test.dir/rule' failed
make[1]: *** [CMakeFiles/test.dir/rule] Error 2
Makefile:197: recipe for target 'test' failed
make: *** [test] Error 2

during the test session:
[2019-11-17 01:23:55:930] [DEBUG] Cannot create unknown request "loadpy"
In PythonModuleUTest::testLoadExceptionAgent:
/home/scrooge/cogserver/build/tests/cython/../../../tests/cython/PythonModuleUTest.cxxtest:78: Error: Assertion failed: loadpyRequest != __null

Start 4: PyEvalUTest

4/6 Test #4: PyEvalUTest ...................... Passed 0.25 sec
Start 5: CythonServer
5/6 Test #5: CythonServer ..................... Passed 1.25 sec
Start 6: ShellUTest
6/6 Test #6: ShellUTest .......................***Failed 179.50 sec
Running cxxtest tests (5 tests)opencog> Entering scheme shell; use ^D or a single . on a line by itself to exit.

Cogserver unclean shutdown

Something about the cogserver shutdown sequence frequently leads to the error message on shutdown:

corrupted size vs. prev_size
Aborted

This happens some time after main() has exited, and has something to do with the thread shutdown. This often makes the unit tests for https://github.com/opencog/atomspace-cog/ fail.

Split up cogserver into three parts.

The cogserver is mashup of three unrelated concepts; it would probably work better if it was detangled into those components more cleanly. It is:

  • A network shell server. Like telnet, but different.
  • A command shell. Like bash, but different. With "pluggable modules" (e.g. PythonModule)
  • A cooperative-multi-tasking framework, for the cooperative scheduling of "MindAgents".

These three are currently in somewhat questionable state of repair, and it might even be very wise to re-imagine the architecture/design from the ground-up.

  • The multi-tasking ("Agents") framework is lame, and is little more than a REPL loop. The dream of the multi-tasking framework was to somehow manage tasks and set priorities for them (allocating CPU resources), but forcing all agents to be cooperative multi-taskers causes well-known issues (MS Windows3.1 and Apple OS9 from late 1980's illustrated the possibilities and the limitations very clearly.)

  • The command-shell is kind of goofy, like somebody's school project. It expects new commands to be implemented as dynamically loaded shared libraries, with a very strict API about what is and is not allowed, which makes it very hard to create high-quality modules. Giving the command shell a minimalist design would simplify it, make it work better/less awkwardly.

  • The network server is the most debugged and mostly quite stable. I would have recommended discarding it, replacing it with some other open-source project, except I once searched the internet for a drop-in replacement, and (surprisingly) found none. Maybe the world needs a generic shell-server!? Biggest problem with the network server is it provides zero authentication, zero security. (it's not obvious how to rip it out and replace it by ssh, for example)

I can kind-of see why all three components are interesting, but given the limitations, they need to be reimagined from the ground-up.

ShellUTest errors sometimes with Debug build

I get sporadic failures with ShellUTest, but have only noticed them with a Debug build.

Compiler is standard for Ubuntu 16.04 gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

Maybe related to opencog/opencog#2542 ? Though a cause was found and fixed in that issue.

The output is:

Start  5: ShellUTest
*** Error in `/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest': corrupted size vs. prev_size: 0x00007f7b38000a60 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f7b5db067e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7e9dc)[0x7f7b5db0d9dc]
/lib/x86_64-linux-gnu/libc.so.6(+0x81cde)[0x7f7b5db10cde]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f7b5db13184]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_doallocate+0x55)[0x7f7b5dafc1d5]
/lib/x86_64-linux-gnu/libc.so.6(_IO_doallocbuf+0x34)[0x7f7b5db0a594]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_underflow+0x1fc)[0x7f7b5db0969c]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_uflow+0xe)[0x7f7b5db0a60e]
/lib/x86_64-linux-gnu/libc.so.6(_IO_getline_info+0xaa)[0x7f7b5dafdc6a]
/lib/x86_64-linux-gnu/libc.so.6(fgets+0xad)[0x7f7b5dafcb7d]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_Z8cmd_execB5cxx11PKc+0x100)[0x4200a4]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_Z11gargleblastii+0x9f)[0x4201e3]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_ZNSt12_Bind_simpleIFPFviiEiiEE9_M_invokeIILm0ELm1EEEEvSt12_Index_tupleIIXspT_EEE+0x5a)[0x42faea]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_ZNSt12_Bind_simpleIFPFviiEiiEEclEv+0x1d)[0x42f945]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_ZNSt6thread5_ImplISt12_Bind_simpleIFPFviiEiiEEE6_M_runEv+0x1c)[0x42f842]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb8c80)[0x7f7b5e344c80]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f7b5de606ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f7b5db9641d]
======= Memory map: ========
<snip>

CythonServer test fails libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb

CythonServer test fails because libtruthvalue.so uses EvaluationLink::do_evaluation method but doesn't depend on libexecution.so. See opencog/atomspace@5b1642d

5/6 Test #5: CythonServer .....................***Failed    0.32 sec
Failure: ImportError (/usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb) ... ERROR

======================================================================
ERROR: Failure: ImportError (/usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 417, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/ws/cogserver/tests/cython/server/test_agent_finder.py", line 3, in <module>
    from opencog.agent_finder import find_subclasses
ImportError: /usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb

----------------------------------------------------------------------
Ran 1 test in 0.013s

FAILED (errors=1)

Cogserver and attention circular dependencies?

Trying to build cogserver, I get these errors:

In file included from /home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:47:0:
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:104:3: error: ‘AVCHSigl’ does not name a type
   AVCHSigl* _avchange_signal;
   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:107:3: error: ‘AVCHSigl’ does not name a type
   AVCHSigl* _add_af_signal;
   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:110:3: error: ‘AVCHSigl’ does not name a type
   AVCHSigl* _remove_af_signal;
   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:134:24: error: ‘AttentionValuePtr’ has not been declared
   Json::Value avToJSON(AttentionValuePtr av);
                        ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:160:30: error: ‘AttentionValuePtr’ does not name a type
                        const AttentionValuePtr& av_old,
                              ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:161:30: error: ‘AttentionValuePtr’ does not name a type
                        const AttentionValuePtr& av_new);
                              ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:166:26: error: ‘AttentionValuePtr’ does not name a type
                    const AttentionValuePtr& av_old,
                          ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:167:26: error: ‘AttentionValuePtr’ does not name a type
                    const AttentionValuePtr& av_new);
                          ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:169:29: error: ‘AttentionValuePtr’ does not name a type
                       const AttentionValuePtr& av_old,
                             ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:170:29: error: ‘AttentionValuePtr’ does not name a type
                       const AttentionValuePtr& av_new);
                             ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc: In member function ‘void opencog::AtomSpacePublisherModule::enableSignals()’:
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:122:1: error: ‘ttentionValuePtr’ was not declared in this scope
 ttentionValuePtr& av_old,
 ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:122:19: error: ‘av_old’ was not declared in this scope
 ttentionValuePtr& av_old,
                   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:123:48: error: expected primary-expression before ‘const’
                                                const AttentionValuePtr& av_new)
                                                ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:132:47: error: qualified-id in declaration before ‘(’ token
 void AtomSpacePublisherModule::TVChangedSignal(const Handle& h,
                                               ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:339:1: error: expected ‘}’ at end of input
 }
 ^

It looks to me the errors involve unrecognized types that are defined in the attention package--AttentionValuePtr and AVCHSigl

error: ‘AttentionValuePtr’ does not name a type

But cogserver is a prerequisite for the attention package--attention can't be built unless cogserver is already built

  attention/build$ cmake ..
  . . .
  CMake Error at CMakeLists.txt:180 (MESSAGE):
  CogServer missing: it is needed!

Is there a circular dependency here?

Python cogserver AWOL

Looking in the directory opencog/cython I see cogserver.pxd and cogserver.pyx (and two other pyx files) but I cannot find anything that says start_cogserver() or anything similar. Apparently, this code was somehow lost or cut during reorganization. I did a deep dive into ancient history, but could not locate it... !!??

"make tests" fails to build PyEvalUTest

I'm packaging cogserver for GNU Guix and found that make tests fails to build PyEvalUTest. Note that I'm building in an environment that only contains Python, but not Cython.

It seems to me that the tests for Python functionality ought to be disabled when the Python bindings have not been built.

Here's the tail of the build log:

[ 88%] Building CXX object tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o
cd /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython && /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/c++  -DCONFDIR=\"/gnu/store/16c6l18g5yilphb1rnyc3nwijf1azf6w-cogserver-0-1.c8ad85f/etc\" -DDATADIR=\"/gnu/store/16c6l18g5yilphb1rnyc3nwijf1azf6w-cogserver-0-1.c8ad85f/share/opencog\" -DGUILE_SITE_DIR=\"/gnu/store/16c6l18g5yilphb1rnyc3nwijf1azf6w-cogserver-0-1.c8ad85f/share/guile/site/2.2/\" -DHAVE_ATOMSPACE -DHAVE_COGUTIL -DHAVE_GUILE -DHAVE_GUILE2 -DHAVE_GUILE_2_2 -DPROJECT_BINARY_DIR=\"/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build\" -DPROJECT_SOURCE_DIR=\"/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source\" -I/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/include/guile/2.2 -I/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source -I/gnu/store/f5g4av3mwn7zr81yqr1gn9hpb5d2c4m4-boost-1.70.0/include -I/gnu/store/ifsrj0bbpvq3rayq86nr778y3f50li0n-cogutil-2.0.3-1.b07b41b/include -I/gnu/store/d4mbj5yqszdg9rxf6h12jyvyn0hgx3m5-atomspace-5.0.3-1.ed1d316/include -I/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build -I/gnu/store/x5fj048bvqpafb07dpidy36fj7l3qfnx-python-minimal-3.7.4/include/python3.7m -I/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source/tests/cython  -Wall -fPIC -Wno-variadic-macros -fopenmp -std=gnu++11 -O2 -g -DNDEBUG   -o CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o -c /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython/PyEvalUTest.cpp
In file included from /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython/../../../source/tests/cython/PyEvalUTest.cxxtest:6:0,
                 from /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython/PyEvalUTest.cpp:24:
/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source/opencog/cogserver/modules/python/PyMindAgent.h:13:10: fatal error: opencog/cython/PyIncludeWrapper.h: No such file or directory
 #include <opencog/cython/PyIncludeWrapper.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [tests/cython/CMakeFiles/PyEvalUTest.dir/build.make:70: tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o] Error 1
make[3]: Leaving directory '/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build'
make[2]: *** [CMakeFiles/Makefile2:856: tests/cython/CMakeFiles/PyEvalUTest.dir/all] Error 2
make[2]: Leaving directory '/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:129: CMakeFiles/tests.dir/rule] Error 2
make[1]: Leaving directory '/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build'
make: *** [Makefile:202: tests] Error 2

Test suite failed, dumping logs.
command "make" "tests" failed with status 2

ShellUTest fails

ShellUTest probably after formatting changes in opencog/atomspace.

One of the cases:

guile> <<<
/ws/cogserver/build/tests/shell/../../../tests/shell/ShellUTest.cxxtest:76: Error: Expected (274 <= reso.size()), found (274 > 265)
Error: Create rep 29 of 30 in thread 11 failed
	Got: 265 >>>opencog> Entering scheme shell; use ^D or a single . on a line by itself to exit.
guile> (EvaluationLink
  (PredicateNode "visible face")
  (ListLink
    (NumberNode "21039")))

Complete test log:
shellutest.20200615.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.