Git Product home page Git Product logo

starter's Introduction

Build Status

cyber-dojo yin/yang logo

cyberdojo/starter docker image

  • A docker-containerized micro-service for cyber-dojo.
  • Holds the start-point files used when setting up a practice session.

API:

  • All methods receive their named arguments in a json hash.
  • All methods return a json hash.
    • If the method completes, a key equals the method's name.
    • If the method raises an exception, a key equals "exception".

GET sha

Returns the git commit sha used to create the docker image.

  • parameters, none
  {}
  • returns the sha, eg
  { "sha": "b28b3e13c0778fe409a50d23628f631f87920ce5" }

GET language_start_points

  • parameters, none
  {}
  • returns two arrays; the language-test-framework display_names and the exercises names for the starter service's currently installed languages start-point, eg
  { "language_start_points": {
      "languages": [
        "C (gcc), assert",
        "C#, NUnit",
        "C++ (g++), assert",
        "Python, py.test",
        "Python, unittest"
      ],
      "exercises": [
        "Bowling_Game",
        "Fizz_Buzz",
        "Leap_Years",
        "Tiny_Maze"
      ]
    }
  }

GET language_manifest

  • parameters, display_name and exercise_name from a previous call to the language_start_points method above, eg
  {  "display_name": "C#, NUnit",
     "exercise_name": "Fizz_Buzz"
  }
  • returns, the manifest for the given display_name and the exercise instructions text for the given exercise_name, eg
  { "language_manifest": {
       "manifest": {
          "display_name": "C#, NUNit",
          "image_name": "cyberdojofoundation/csharp_nunit",
          "filename_extension": [ ".cs" ],
          "visible_files": {
             "Hiker.cs": {               
               "content" => "public class Hiker..."
             },
             "HikerTest.cs": {
               "content" => "using NUnit.Framework;..."
             },
             "cyber-dojo.sh": {
               "content" => "NUNIT_PATH=/nunit/lib/net45..."
             }
          }
       },
       "exercise": "Write a program that prints..."
    }
  }

GET custom_start_points

  • parameters, none
  {}
  • returns an array of the display_names for the starter service's currently installed custom start-point, eg
  { "custom_start_points": [
      "Yahtzee refactoring, C# NUnit",
      "Yahtzee refactoring, C++ (g++) assert",
      "Yahtzee refactoring, Java JUnit",
      "Yahtzee refactoring, Python unitttest"
    ]
  }

GET custom_manifest

  • parameter, display_name from a previous call to the custom_start_points method above, eg
  {  "display_name": "Yahtzee refactoring, C# NUnit"
  }
  • returns, the manifest for the given display_name, eg
  { "custom_manifest": {
       "display_name": "Yahtzee refactoring, C# NUnit",
       "image_name": "cyberdojofoundation/csharp_nunit",
       "filename_extension": [".cs"],
       "visible_files": {
          "Yahtzee.cs": {
            "content"= > "public class Yahtzee {..."
          },
          "YahtzeeTest.cs": {
            "content"= > "using NUnit.Framework;..."
          },
          "cyber-dojo.sh": {
            "content"= > "NUNIT_PATH=/nunit/lib/net45..."
          }
          "instructions": {
            "content"= > "The starting code..."
          }
       }
    }
  }

build the docker images

Builds the starter-server image and an example starter-client image.

$ ./sh/build_docker_images.sh

bring up the docker containers

Brings up a starter-server container and a starter-client container.

$ ./sh/docker_containers_up.sh

run the tests

Runs the starter-server's tests from inside a starter-server container and then the starter-client's tests from inside the starter-client container.

$ ./sh/run_tests_in_containers.sh

run the demo

$ ./sh/run_demo.sh

Runs inside the starter-client's container. Calls the starter-server's micro-service methods and displays their json results and how long they took. If the starter-client's IP address is 192.168.99.100 then put 192.168.99.100:4598 into your browser to see the output.

demo screenshot


cyber-dojo.org home page

starter's People

Contributors

jonjagger avatar

Watchers

Austin Bingham avatar James Cloos avatar

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.