This directory contains all of the unmaintained, abandoned and obsolete docker configurations for some of OpenCog's older projects. The instructions below are a snapshot of the instructions, as they used to be, circa 2015, and so may feel anachronistic. The goal was to explain... How to get started with using docker to deploy production servers, as well as for development. ... and so on.
Some of the notable containers include:
-
opencog/cogserver
-- An empty CogServer container. -
opencog/opencog-dev
-- All supported OpenCog components. -
opencog/opencog-dev:cli
: This depends on theopencog/atomspace:latest
image. It installs all supported opencog repos and tools, includingas-moses
. -
opencog/opencog-dev:ide
: To be used for developing using IDEs. QtCreator is installed. -
opencog/opencog-jupyter
: Above, plus a Jupyter notebook.
All of the containers above are "empty", in that they contain no data, and thus, they don't "do anything".
- Common Initial Setup
- Running Production Servers
- Steps for OpenCog development
- Steps for RelEx development RelEx is deprecated/obsolete.
- Steps for opencog-to-minecraft development Minecraft is obsolete.
The following sub-sections describe the steps required to configure docker on your OS, regardless of which project you are working on.
-
Follow the instructions here for setting up docker.
-
Pull images that are used for opencog development by running
./docker-build.sh -a
-
Build images using
./docker-build.sh [OPTIONS]
.- For language learning work, use the
-l
option. - If you want to update your images add
-u
option. For example, for opencog development, use-ctu
options. Unless there are some base OS changes, or changes to ocpkg/octool, you don't have to updateopencog/opencog-deps
image. - To list the available options, use
-h
- For opencog development use
-bct
option - For NLP related work use
-r
option - For opencog-to-minecraft use
-bcte
option
- For language learning work, use the
-
The following is required only if you want to use
docker-compose
setup that is described below. You only need to do this once, or repeat it when updating.sudo apt install docker-compose
-
Run docker using whichever setup you are accustomed to. If you want to use
docker-compose
, follow the steps below, as per your type of development. Thedocker-compose
setup enables you to persist changes you make on the opencog repos, from within the container, to your host OS, even when you choose to remove the containers.
-
Follow the instruction here for setting docker,
-
Start the docker virtual machine using 'Docker Quickstart Terminal' as described in the linked web-page from the previous step,
-
Pull images that are used for opencog development by running
./docker-build.sh -a
-
Build images using
./docker-build.sh [OPTIONS]
- If you want to update your images add
-u
option. For example, for opencog development, use-ctu
options. Unless there are some base OS changes, or changes to ocpkg/octool, you don't have to updateopencog/opencog-deps
image. - To list the available options, use
-h
- For opencog development use
-bct
option - For NLP related work add
-r
option
- If you want to update your images add
-
In the script
windows-run.sh
found in the same directory as this README, Replace$HOME/path/to/
in the export command to the appropriate absolute path on your windows machine. Note that you don't have to clone each repository or add all the paths, just those you need. Since you will be using the MINGW environment that was setup by the first step, use UNIX path naming format. -
Run
./windows-run.sh
.
Several different server containers are provided. The most important of these are:
- The atomspace container, which contains the core atomspace that everyone needs. It does not contain any of the more experimental repos, nor any of the older, deprecated or abandoned projects.
- The development container, which contains everything, including development tools, and most (but not all!) of the experimental repos, and some of the deprecated repos that are still in use.
For UNIX-like systems only, if you choose to use docker-compose
-
Specify a directory for storing ccache's compiler outputs on your host OS
mkdir -p $HOME/path/to/where/you/want/to/save/ccache/output export CCACHE_DIR=$HOME/path/to/where/you/want/to/save/ccache/output`
Specifying this means, making a clean build of source code after removing a container will be faster. If you don't want to do this, then comment out the
- $CCACHE_DIR:/home/opencog/.ccache
incommon.yml
file -
Add these lines to
~/.bashrc
at $HOME of your host OS and runsource ~/.bashrc
.export ETC_LOCALTIME=$(readlink /etc/localtime) export OPENCOG_SOURCE_DIR=$HOME/path/to/opencog export ATOMSPACE_SOURCE_DIR=$HOME/path/to/atomspace export COGUTIL_SOURCE_DIR=$HOME/path/to/cogutil export OC2MC_SOURCE_DIR=$HOME/path/to/opencog-to-minecraft
Optionally, if you are using
moses
add to~/.bashrc
,export MOSES_SOURCE_DIR=$HOME/path/to/moses
and uncomment- $MOSES_SOURCE_DIR:/moses
line in the docker-compose.yml file. -
For starting the containers using docker-compose run either of the following commands,
- If you want to map container ports to host run
docker-compose run --service-ports dev
- If you don't want to map ports to host run
docker-compose run dev
- If you want to map container ports to host run
-
The container has opencog installed, but if you want to install cogutil, atomspace, or opencog due to some change you made in the source code found on your host,
cd
into the mount directory inside the container and then run/tmp/octool -bi
-
For using opencog shells follow instruction here
-
Have fun hacking
-
Exit container
RelEx is deprecated/obsolete. It builds and works just fine, and is perfectly usable. However, it is no longer maintained, and is not recommended for any future development. See the (commented out) instructions in this README for details.
RelEx is deprecated/obsolete.
- For configuring RelEx in the cogserver run
- start the cogserver, telnet into it and access the scheme shell.
(use-modules (opencog nlp) (opencog nlp chatbot) (opencog nlp relex2logic))
(set-relex-server-host)
(nlp-parse "you know what this is.")
For UNIX like systems only, and if you choose to use docker-compose
-
Add these lines to
~/.bashrc
at $HOME of your PC and runsource ~/.bashrc
.export RELEX_SOURCE_DIR=$HOME/path/to/relex
-
For starting the containers run either of the following commands,
- If you want to map container ports to host run
docker-compose -f relex.yml run --service-ports relex
- If you don't want to map ports to host run
docker-compose -f relex.yml run relex
For some reason, the Jupyter container no longer builds. There is some bug with setting up the python environment. If you know how to use python, please fix this (these) config bugs (and remove this error message when done.)
- Build the image which has python and guile kernels installed with the following command.
./docker-build -j
This would build/pull necessary docker images.
-
Add this lines to
./.bashrc
to point to your preferred notebooks save directoryexport OPENCOG_NOTEBOOKS=$HOME/path/to/opencog_notebooks
-
For starting jupyter notebook run the following command.
docker-compose -f opencog-jupyter.yml run --service-ports notes
-
Go to
0.0.0.0:8888/tree/notebooks
to interact with your notebooks.
The minecraft code is currently bit-rotted, and will not build. See the (commented out) instructions in this README for details.
For UNIX like systems only, and if you choose to use docker-compose
-
Add these lines to
~/.bashrc
at $HOME of your PC and runsource ~/.bashrc
.export ETC_LOCALTIME=$(readlink /etc/localtime) export OPENCOG_SOURCE_DIR=$HOME/path/to/opencog export ATOMSPACE_SOURCE_DIR=$HOME/path/to/atomspace export COGUTIL_SOURCE_DIR=$HOME/path/to/cogutil export OC2MC_SOURCE_DIR=$HOME/path/to/opencog-to-minecraft
-
To start the Minecraft server and access a configured development environment run
docker-compose -f minecraft.yml run oc2mc
. The server.properties file is found inminecraft/data
in the same folder as this README. The file is auto-generated so on changing the entries, restart the server by runningdocker restart minecraft-server
. -
Run
tmux
inside the container for working with multiple windows/panes. If you create multiple panes you can use your mouse as an alternative to switch between panes. -
Open a separate terminal, on your host, run
docker attach minecraft-server
. This gives you access to the server's console that is used for configuration. -
Except PYTHONPATH setting step, which isn't needed because it is already configured inside the container, follow the steps described here
The perception code is currently bit-rotted, and will not build. See the (commented out) instructions in this README for details.
WIP and only for use with systems with gpus, for now
-
Install nvidia docker plugin by following instruction here.
-
Build openog/perception image by running
docker build -t opencog/perception perception/
from this directory. -
For usage of the built image see here.
docker images
docker rmi <image-hex>
docker ps -a
docker rm <image-name>
-
Both
tmux
andbyobu
are installed, so you can use either for multiple windows/panes. -
On exiting the opencog container, postgres & relex will still be running in the background. So when running
docker-compose run ...
it will auto-link to them, provided you haven't removed the containers or shutdown your machine. -
For more on docker-compose refer to https://docs.docker.com/compose/
-
Update docker-compose configuration for minimizing steps to start developing
-
Add more images to github workflow for automated publishing