running your own cyber-dojo server

set up your server and install the cyber-dojo script

  • On Linux
  • On a Mac (use Docker-Toolbox to create a Linux+docker Virtual Machine and open a Docker-Quickstart-Terminal)
  • On Windows (use Docker-Toolbox to create a Linux+docker Virtual Machine and open a Docker-Quickstart-Terminal)



bring up your cyber-dojo server

If you want to install all the language+testFrameworks (takes ~15 mins the first time),
in a terminal, type:
./cyber-dojo up

If you want to install only the more common language+testFrameworks (C, C++, C#, Java, Javascript, Python),
in a terminal, type:
URL=https://raw.githubusercontent.com/cyber-dojo/start-points-languages/master/languages_list_common ./cyber-dojo start-point create common --list=${URL} ./cyber-dojo up --languages=common

Put your cyber-dojo server's IP address into your browser. That's it.


bring down your cyber-dojo server

In a terminal, type:
./cyber-dojo down


11 comments:


  1. I'm having trouble getting a cyber-dojo server running on my Ubuntu machine.

    I ran it the first time and it took a few minutes downloading some things (unfortunately I did not keep the log from this) but it failed with a networking issue. Then I fixed the networking issue and now it fails with the following log.

    I modified the cyber-dojo script to add a sh -x option for more verbosity and this is what I'm seeing:

    + dirname ./cyber-dojo
    + cd .
    + pwd
    + readonly my_dir=/home/bakelly/CyberDojo
    + readonly cyber_dojo_commander=cyberdojo/commander
    + hash docker
    + [ up = --debug ]
    + [ up = update ]
    + delegate_to_commander up
    + [ up = up ]
    + set_env_file_volumes
    + local web_env=/home/bakelly/CyberDojo/web.env
    + [ -f /home/bakelly/CyberDojo/web.env ]
    + local nginx_env=/home/bakelly/CyberDojo/nginx.env
    + [ -f /home/bakelly/CyberDojo/nginx.env ]
    + local grafana_env=/home/bakelly/CyberDojo/grafana.env
    + [ -f /home/bakelly/CyberDojo/grafana.env ]
    + local zipper_env=/home/bakelly/CyberDojo/zipper.env
    + [ -f /home/bakelly/CyberDojo/zipper.env ]
    + [ up = start-point ]
    + docker run --init --rm --user=root --env CYBER_DOJO_SH_ROOT=/home/bakelly/CyberDojo --env CYBER_DOJO_ENV_ROOT=/tmp/app --volume=/var/run/docker.sock:/var/run/docker.sock cyberdojo/commander /app/cyber-dojo.rb up
    Creating start-point exercises from https://github.com/cyber-dojo/start-points-exercises.git
    https://github.com/cyber-dojo/start-points-exercises.git
    docker exec c80de63384f372790a6273de8d12ffda224aaea91d2173e3f572bf9aa192f5a1 sh -c 'cd /data/0_start-points-exercises.git && git pull --depth=1 origin master &> /dev/null' failed!?
    + exit_fail
    + [ != ]
    + exit 1

    Any advice?

    ReplyDelete
  2. For the record, I tried doing a:
    cyber-dojo update
    followed by:
    ./cyber-dojo start-point create common --list=https://raw.githubusercontent.com/cyber-dojo/start-points-languages/master/languages_list_common

    And the update passed (took about 2 minutes to run) but the create died with:
    FAILED...
    /data/start_point_type.json: is missing


    Adding in the -x to the sh command reveals:
    + curl --output /dev/null --silent --head --fail https://raw.githubusercontent.com/cyber-dojo/start-points-languages/master/languages_list_common
    + docker run --init --rm --user=root --env CYBER_DOJO_SH_ROOT=/home/bakelly/CyberDojo --env CYBER_DOJO_ENV_ROOT=/tmp/app --volume=/var/run/docker.sock:/var/run/docker.sock cyberdojo/commander /app/cyber-dojo.rb start-point create common --list=https://raw.githubusercontent.com/cyber-dojo/start-points-languages/master/languages_list_common
    FAILED...

    ReplyDelete
    Replies
    1. I would try stopping the server [cyber-dojo down] then deleting all start-point volumes.
      [cyber-dojo start-point ls] to see their names, then
      [cyber-dojo start-point rm NAME] for each of the names.
      Then try again.

      Delete
  3. When I run the start-point ls I get:

    cyber-dojo start-point ls
    + dirname ./cyber-dojo
    + cd .
    + pwd
    + readonly my_dir=/home/bakelly/CyberDojo
    + readonly cyber_dojo_commander=cyberdojo/commander
    + hash docker
    + [ start-point = --debug ]
    + [ start-point = update ]
    + delegate_to_commander start-point ls
    + [ start-point = up ]
    + [ start-point = start-point ]
    + [ ls = create ]
    + docker run --init --rm --user=root --env CYBER_DOJO_SH_ROOT=/home/bakelly/CyberDojo --env CYBER_DOJO_ENV_ROOT=/tmp/app --volume=/var/run/docker.sock:/var/run/docker.sock cyberdojo/commander /app/cyber-dojo.rb start-point ls
    cat: can't open '/data/start_point_type.json': No such file or directory
    /usr/lib/ruby/gems/2.5.0/gems/json-2.1.0/lib/json/common.rb:156:in `parse': 765: unexpected token at '' (JSON::ParserError)
    from /usr/lib/ruby/gems/2.5.0/gems/json-2.1.0/lib/json/common.rb:156:in `parse'
    from /app/cyber-dojo.rb:121:in `cyber_dojo_data_manifest'
    from /app/cyber-dojo.rb:125:in `cyber_dojo_type'
    from /app/cyber-dojo-start-point-ls.rb:36:in `block in cyber_dojo_start_point_ls'
    from /app/cyber-dojo-start-point-ls.rb:36:in `map'
    from /app/cyber-dojo-start-point-ls.rb:36:in `cyber_dojo_start_point_ls'
    from /app/cyber-dojo-start-point.rb:36:in `cyber_dojo_start_point'
    from /app/cyber-dojo.rb:201:in `'
    + exit_fail
    + [ != ]
    + exit 1


    It always seems to be looking for this /data/start_point_type.json file and cant't find it.

    ReplyDelete
    Replies
    1. Hmmm. We have a chicken/egg situation here. We need to drop down to docker itself.
      If you run [docker volume ls] you will get the names of the volumes. Now instead of doing [cyber-dojo start-point rm NAME] do [docker volume rm NAME]

      Delete
    2. Good news and bad news. I have the server up and running, but no languages are displayed in the sessions boxes.

      Now I have cyberdojo up running and I can pull the main page up in the browser.

      Unfortunately, The languages/frameworks seem to not be populated. When I click on "Create New Session" both list-boxes are empty. I do notice that "Create Custom Session" is populated with some languages (Java, Python, C++ (though not with gtest :-(, and a few others). How do I get the rest of the languages listed and working?

      So close I can taste it :-)
      Advise to fix this?

      Delete
    3. Just for a little more background when I run cyber-dojo up I do get this output:

      checking images in start-point [languages] all exist...
      checking images in start-point [custom] all exist...
      >>checking cyberdojofoundation/csharp_nunit:latest
      >>exists cyberdojofoundation/csharp_nunit:latest
      >>checking cyberdojofoundation/gcc_assert:latest
      >>exists cyberdojofoundation/gcc_assert:latest
      >>checking cyberdojofoundation/gpp_assert:latest
      >>exists cyberdojofoundation/gpp_assert:latest
      >>checking cyberdojofoundation/java_junit:latest
      >>exists cyberdojofoundation/java_junit:latest
      >>checking cyberdojofoundation/python_unittest:latest
      >>exists cyberdojofoundation/python_unittest:latest
      >>checking cyberdojofoundation/ruby_test_unit:latest
      >>exists cyberdojofoundation/ruby_test_unit:latest

      but the boxes are still empty when I pull up "Create New Session" in the browser

      Delete
    4. The problem now is that you need to recreate the languages start-point.
      Notice that the output does not say it is creating a languages start-point.
      So I think you need these three commands, which should force cyber-dojo to recreate the languages start-point.

      cyber-dojo down
      cyber-dojo start-point rm languages
      cyber-dojo up


      Of course, if you don't want a full set of default languages, then you can create a smaller selection, as I think you were trying originally.

      Delete
    5. Okay - I now have the language list working but there's no exercise listed in the listbox on the right. And when I select a language and click okay I get an exception thrown.

      So far every problem I've run into has been related to my firewall or docker. So if you can just give me the cyber-dojo command to re-download the exercises, I think I'll be fine.

      Delete
    6. Nevermind - I figured it out. I hate working with corporate firewalls.

      Cyberdojo is up and running. You guys rock!

      My company has already donated to the charity you guys support, but I'm totally going to get them to do another donation because it is worth it!

      Thank you so much for the technology and the support :-)

      Delete
    7. Woohoo. Glad you're up and running. Have fun :-)

      Delete