Docker container

I already built on Ubuntu :stuck_out_tongue: and am trying to help debug Davidā€™s script so you can too :slight_smile:

1 Like

I will stick with windows for now; Iā€™ve got Visual Studio 2013 C++ up and running and I am transitioning from C# procedural syntax to C++ procedural syntaxā€¦ any ideas with the error?

That error - it seems self explanatory - the system canā€™t create the required interface.
You may need to manually create a 2nd loopback interface or alias like 127.0.0.2, or something like that. I saw that in TFM over at Github but donā€™t remember the exact location as I read dozens of pages over there in the past 48 hours.

I was replying to @janitor! I initially tried building on Windows (before Iā€™d even heard of Docker) but gave up when I hit problems as Iā€™m transitioning completely away from Windows.

Sorry I canā€™t help. Hopefully someone will jump in!

But thatā€™s a different procedure.

A way to fix docker script on this page (continuing from the make step where it didnā€™t work for me):

  • Reboot the VM to reset environment variables and go to $HOME/MaidSafe

    cd $HOME/MaidSafe

  • Run cmake using correct env parameters (thereā€™s no space between - and DMAKE in -DCMAKE_CXX...):

    cmake -H$HOME/MaidSafe -Bbuild_maidsafe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/lib/llvm-3.4/bin/clang+ -DCMAKE_C_COMPILER=clang

  • Build MaidSafe:

    cd build_maidsafe
    make

I havenā€™t finished building (itā€™s still running which is why I canā€™t check), so it may still fail somewhere later.

Couple of tips:

  • the easiest and least troublesome way is to use the install procedure from Github (which is not Docker-based)
  • for normal x64 systems, 2 GB of RAM is recommended (my own reco), although you may be fine with less

I had errors towards the very end of make (around 93%; I think because of insufficient RAM) using a modified (as per above notes) procedure above and 1 GB of RAM, but because the official install procedure from Github is used daily by others, I decided to use more RAM and an easier approach. Docker-based MaidSafe is still interesting, but Iā€™ll revisit it later, maybe in testnet3 or beta.

How I built Maidsafe using Docker on Ubuntu 14.04 (including Network Controller)

Install Docker: Get Docker | Docker Docs


Pull the image: sudo docker pull dirvine/maidsafe


Copy the IMAGE ID from running: sudo docker images


To run a container interactively in the foreground: sudo docker run -t -i IMAGE ID /bin/bash

To run a container daemonized in the background: sudo docker run -d IMAGE ID /bin/bash


You are now running as root@CONTAINER ID inside the Maidsafe container


Building Maidsafe ā†’


cd /root/MaidSafe/buildgcc


cmake ā€¦/


make


Finished!


To leave the container: exit


To get back into the container:

1/ sudo docker start CONTAINER ID

2/ sudo docker attach CONTAINER ID


This includes vim with NERDtree, YCM, tagslist etc. for easy programming. All libs are checked out to next and the image has a read only ssh key to pull any updates from the codebase. This allows people to see and check any binaries we release against known source code. We may also instigate deterministic builds, but this should prove a good and easy setup to test our code has not been tampered with or otherwise corrupted.

We will also release fully configured farmer builds in these containers as well as installer versions. The docker container allows process separation for any people concerned about this aspect.


TestNetwork Example: Local Network Setup

cd /root/MaidSafe/buildgcc

make local_network_controller

./local_network_controller

You should now see something similar to:

MaidSafe Local Network Controller 0.8.100: Main Options


Running: docker - will list all commands

Docker Command line reference: http://docs.docker.com/reference/commandline/cli/


Pro Tip: To Stop/ Remove all containers:

docker stop (docker ps -a -q) docker rm (docker ps -a -q)


To remove the image: docker rmi IMAGE ID


5 Likes

Hi David,

I have built ā€˜local_network_controllerā€™ and can see all the goodies in buildgcc

Iā€™m guessing thereā€™s a build order or batch file for a test setup?

I built vault_manager and vault without breaking anything so far.

Thanks

No it hasnā€™t which is why I challenged the ā€œIā€™ve done itā€ post by HB :smile:

And youā€™re a little bit lucky because that what you quoted wasnā€™t in the docs until just this week.
Unfortunately even now itā€™s still not clear (I asked for more clarity, they added that line, but itā€™s still not clear unless you already know what needs to be done).
Hereā€™s what you need to do assuming you used the default location to build.
cd $HOME/MaidSafe/build_maidsafe; make local_network_controller

Then you can run local_network_controller.
It doesnā€™t seem to do much, though. If your port isnā€™t open to the Internet I think it doesnā€™t do anything and as far as I can tell thereā€™s no info on what to do with it, how to use the GUI, etc. Thatā€™s why I said Iā€™ll wait couple of weeks.
Feel free to open issues on Githubā€¦

EDIT: fixed build directory path, 'build_dir->build_midsafe`

No such directory on Ubuntu

I didnā€™t have access to my setup so I put build_dir thinking you may be able to figure it out. Thatā€™s the location where you built MaidSafe.
Now I have access to my setup and hereā€™s where it is on my system:
$HOME/MaidSafe/build_maidsafe/

No problems Iā€™ve successfully built the local network, just need to work out how to do some testing now.

This will allow you to run a mini network locally @Ross can help you there, but if you give su a few days it will be even simpler :slight_smile:

Thatā€™s great news, Iā€™ve made the following so farā€¦if it breaks, Iā€™ll fire up another container :slight_smile:

vault
vault_manager
local_drive
local_network_controller
udp_server
udp_client
signing_tool
rudp_performance_tool
routing_node
routing_key_helper

1 Like

Cheers @chrisfostertv We made some really big changes two weeks ago in a mad rush to get a testnet example for a google hangout. We bypassed every Qa rule we had and broke the testnet. So we have stepped back and are making the Qa process way more rigid with some pretty large investments. @BenMS was telling me there will be over 80 automated builds on a commit now for pushing so this will hammer our code and make sure we do not do that again. I have also set up another 20odd CI machines remotely waiting for a push to master and we are incorporating jenkins/gerrit for test and review.

With the new devs starting now we need to be super skilled at this process, but its looking pretty strong and will allow us to keep creative. I suspect this week and next will bed this all in place. Then you will see some pretty managed and fast releases of hopefully many examples and mini projects for folk to work on. @Viv has is team starting to look at this now with some devs in India doing language APIā€™s for the codebase. It should allow us to start bringing out apps very quickly as well as the portable apps that @happybeing mentioned.

Should be a great few weeks though with a lot of change and the background work will be manic as ever with a much more managed front end. rUDP is looking pretty amazing now, so I expect to see a lot of testnet activity again. It has been a completely frantic two weeks for sure with all the back end workload being enough to swamp a tam 10 times the size of us. We now look to be in a terrific shape though.

There should be a much simpler dev environment soon as well which will make is a one click affair to get started and get apps coded.

8 Likes

You can start up your own small network by following these instructions > http://maidsafe.net/maidsafe-examples/en/001_network_setup/local_network_setup.html
I just noticed this needs updated as the options have changed slightly - as David said it has been a mad few weeks :wink: I think you will still be able to follow it and start a local testnet - if not shout. In itself (without a visualiser session and testnet) just now this might seem a little underwhelming. You can build and run tests like network_test_nfs or network_test_api. Or if you want to assist with general testing you can run Experimental tests that report to http://dash.maidsafe.net/index.php?project=MaidSafe like Exper< project > e.g. ExperCommon from your build folder.

3 Likes

With Ubuntu 14.04 ā€˜make local_network_controllerā€™ builds a bunch of targets, but does not provide a menu like in the MSVC / XCode screenshots.

Just goes back to command prompt and so not sure how to interact with with the setup part.

Run
./local_network_controller

1 Like

Ahh thatā€™s why you have a beard :slight_smile:

Will update my Docker example for others

Thanks

1 Like

From my comment yesterday: