Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to build and deploy a D-thinker system from TC2
04-04-2013, 10:57 PM (This post was last modified: 02-08-2016 11:31 AM by lingu.)
Post: #1
How to build and deploy a D-thinker system from TC2
You can set up a D-thinker system with the TC2 software release. Usually, you can rely on instructions in http://d-thinker.org/doc/configuration-manual.html to build a thinker. In rare cases, the instructions there can be slightly outdated. If you always want to get the latest information and updates, you are welcomed to join the development of TC2.

This thread is kept as a record and may not be updated frequently.

------------------

The following instructions assume you can access the TC2 code tree using cod. If you have not been able to access it, send a request to the D-thinker team together with a public key for authentication. The request should include at least your name and your contact information. When the request is approved, we will send you a username for accessing the code tree.

A D-thinker system comprises one or many nodes, and each node can be a server, a normal PC, or a virtual machine. One node is designated as the portal of D-thinker. The portal is the computer that executes the commands to start a D-thinker program and create tasks. Other nodes run tasks created by the portal. The default setup allows you to install everything (portal programs, D-thinker components) on one node, and, consequently, the node is a portal and it runs tasks. You can change the configuration to expand the system to as many nodes as you like. The largest setting we tested has 1024 virtual machines or 160 physical servers.

1. Set up Cod so that you can obtain the TC2 software.

2. Get TC2 system components.
Code:
cod clone tc2

Suppose the ground directory (sometimes specified by the environment variable GROUND_DIR) is ~/forest, the cod command will create and store relevant files in ~/forest/tc2/tc2. Note that we use the 'rc' branch, not the master branch, to store the up-to-date tested code.

Change the work directory to the tc2 code tree, e.g.,
Code:
cd ~/forest/tc2/tc2

3. Build and deploy the portal: Build D-thinker software from the current tc2 code tree, and deploy the D-thinker software to a node serving as the portal..
Code:
release/bin/deploy <Portal IP>

This will build and install the d-thinker components in ~/think on the portal whose IP is specified by <Portal IP>. After installation, the deploy utility conducts a few tests to verify the correctness of the system.

If you would like to install D-thinker software in a specific directory other than ~/think, you can use the --base <base_dir> option to change the installation location, as shown in the following example which installs the D-thinker software in ~/voltaire on the computer with IP 10.0.1.200.
Code:
release/bin/deploy --base voltaire 10.0.1.200

4. Login to HOST and configure L0.
Code:
cd ~/think/bin

Edit set-env.sh to match the system configuration (e.g., path to the directory for d-thinker executables).

Add path ~/think/bin to the PATH environment variable.

5. Set up environment variables.

Code:
. ~/think/bin/set-env.sh

Note that it is necessary to use '.' to run set-env.sh. Otherwise the environment may not be correctly set up in the current shell environment.

6. Set up the public/private key pair in your environment so that you can ssh to the VPC's hosts as user l0 without using a password. Usually you just need to add your public key to the file ~/.ssh/authorized_keys on the VPC hosts. Make sure the private key used is ~/d-thinker/conf/key on the portal and its access mode is 600. Refer to standard SSH documentation for more information on configuring password-less authentications.

As an example, the following commands configure the keys in the simplest form on a single server <VPC>.
Code:
cp ~/.ssh/id_rsa ~/thinker/conf/key
chmod 600 ~/thinker/conf/key
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

In particular systems, the commands for configuration of keys can be different than the above ones.

7. Now you can run a program in the D-thinker. For example, l0sys contains the compiled Alphabet program, alphabet.i0 in the directory release/app/alphabet. You can use the following command to run the Alphabet program in the maze:
Code:
am run -n 1 ~/thinker/app/alphabet/alphabet.i0

After the Alphabet program exits, it should print a list of letters in the English alphabet. This means the maze is set up and at work. You can run other compiled D-CISC programs in this maze.

Have fun!

-----
20160208/gl: Specify this installation uses TC2.
20150822/gl: Phrase the info about instructions so that we know the instructions on the d-thinker.org may not be the latest.
Quote this message in a reply
10-11-2014, 04:08 PM
Post: #2
RE: How to build and deploy a D-thinker system
(04-04-2013 10:57 PM)lingu Wrote:  1. Set up Cod so that you can obtain the TC2 software.
in this step, I think we'd better tell users how to configure SSH by giving a link to http://tab.d-thinker.org/showthread.php?tid=2433
Quote this message in a reply
10-11-2014, 04:21 PM
Post: #3
RE: How to build and deploy a D-thinker system
(04-04-2013 10:57 PM)lingu Wrote:  3. Build and deploy the portal: Build D-thinker software from the current tc2 code tree, and deploy the D-thinker software to a node serving as the portal..
Code:
release/bin/deploy <Portal IP>

This will build and install the d-thinker components in ~/think on the portal whose IP is specified by <Portal IP>. After installation, the deploy utility conducts a few tests to verify the correctness of the system.

If you would like to install D-thinker software in a specific directory other than ~/think, you can use the --base <base_dir> option to change the installation location, as shown in the following example which installs the D-thinker software in ~/voltaire on the computer with IP 10.0.1.200.
Code:
release/bin/deploy --base voltaire 10.0.1.200
I am following this instruction to install TC2 to a remote VM. The installation is done on my desktop. When the installation went to step 3, I got the error that it's unable to cod clone tc2 and libi0 to /tmp, which was solved according to http://ada.zettadom.com:500/viewthread.p...http://ada.zettadom.com:500/viewthread.php?tid=1829&extr . After that, I got another error:
"
make: *** [vpc] Error 1
Finish building L0 in directory /home/qiyu/forest/tc2/tc2/release.
"
and the installation stopped there. The make command is from release/bin/build-d-thinker, invoked by release/bin/distribute-to.sh, which in turns invoked by release/bin/deploy. And also no Makefile in release/bin. Is it the cause of the problem ?
Quote this message in a reply
10-12-2014, 09:17 PM
Post: #4
RE: How to build and deploy a D-thinker system
(10-11-2014 04:21 PM)DaY Wrote:  After that, I got another error:
"
make: *** [vpc] Error 1
Finish building L0 in directory /home/qiyu/forest/tc2/tc2/release.
"
and the installation stopped there. The make command is from release/bin/build-d-thinker, invoked by release/bin/distribute-to.sh, which in turns invoked by release/bin/deploy. And also no Makefile in release/bin. Is it the cause of the problem ?
After some more investigation, I found the Makefile used by build-d-thinker is in release folder. And details of the make error is in log file 2.log in release folder:
"
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
"
Then I referred to step 2 of section 2.编译和安装指令 in tc2系统安装指令步骤, and installed the missing libraries. Finally the problem was solved.
Quote this message in a reply
10-13-2014, 04:12 PM
Post: #5
RE: How to build and deploy a D-thinker system
When the installation to an amazon VM went to tests/quiz stagement of the basic setup, it stucked at "null.sh => null.c". Then I CTRL_C and logged into the VM, did step 5 "Set up environment variables", ran
Code:
am run -n 1 null.c.bin
, and the execution stuck at "Start to run the program with 1 VPCs".
The VM's configuration is: 2 vCPUs E5-2670 v2 2.5 GHz, 4 GiB memory, and 10 GiB Magnetic Disk.
Quote this message in a reply
10-14-2014, 11:03 AM
Post: #6
RE: How to build and deploy a D-thinker system
I think
Lingu Wrote:5. Set up environment variables.
. ~/think/bin/set-env.sh
should be
Code:
. ~/think/conf/set-env.sh
Quote this message in a reply
10-14-2014, 12:00 PM
Post: #7
RE: How to build and deploy a D-thinker system
(10-13-2014 04:12 PM)DaY Wrote:  When the installation to an amazon VM went to tests/quiz stagement of the basic setup, it stucked at "null.sh => null.c". Then I CTRL_C and logged into the VM, did step 5 "Set up environment variables", ran
Code:
am run -n 1 null.c.bin
, and the execution stuck at "Start to run the program with 1 VPCs".
The VM's configuration is: vCPUs E5-2670 v2 2.5 GHz, 4 GiB memory, and 10 GiB Magnetic Disk.
Finally, I found we access the amazon VM by an Internet IP, which is also used for TC2's conf. But within the VM, only the intranet IP is accessible(ping/ssh). After reconfiguring TC2 with the intranet IP, it passed the correctness test.
So I sugesst adding a --portal IP option to the deploy program in case that we access the portal through IP:Port whose IP is different from that of the portal's NIC.
Quote this message in a reply
10-14-2014, 01:13 PM
Post: #8
RE: How to build and deploy a D-thinker system
I haven't find a way to install TC2 system widely with current deploy program, because if we want to install it in a share place like /usr/local/bin, sudo is necessary to make the base dir and write files to it. or we can put a soft link of the base dir in a share place.
Quote this message in a reply
10-21-2014, 03:15 PM (This post was last modified: 10-21-2014 03:17 PM by harryxiyou.)
Post: #9
RE: How to build and deploy a D-thinker system
I cannot clone tc2 source codes even though I config my ~/.ssh/config file as follows.

harryxiyou@common_vm ~ $ cat ~/.ssh/config
Host codb3.datathinking.org
Port 13122
User gito
IdentityFile ~/.ssh/id_rsa.pub

It asked me for password like following.

harryxiyou@common_vm ~/forest $ cod.py clone tc2
The Ground is the directory where all the code trees reside.
The code tree will be cloned in the current Ground: /lhome/harryxiyou/forest
Cloning into tc2...
gito@codb3.datathinking.org's password:

Maybe, someone can help me to add my public key into tc2 git server to access tc2 git tree, thanks.
Find all posts by this user
Quote this message in a reply
10-21-2014, 04:26 PM
Post: #10
RE: How to build and deploy a D-thinker system
in your ssh config file, IdentityFile should be the prive key(probably ~/.ssh/id_rsa) instead of ~/.ssh/id_rsa.pub
Quote this message in a reply
Post Reply 


Forum Jump: