Skip to content
repo for the cyberdojo/ragger Docker image
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
docs
sh
src
test_client
test_server
.dockerignore
.gitignore
Dockerfile
LICENSE.md
README.md
config.ru
docker-compose.yml
pipe_build_up_test.sh
rack-base.trigger
up.sh

README.md

CircleCI


API:


JSON in, JSON out

  • All methods receive a json hash.
    • The hash contains any method arguments as key-value pairs.
  • 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 colour(image_name,id,stdout,stderr,status)

  • returns the traffic-light colour "red", "amber", or "green", by passing the stdout, stderr, status strings to a Ruby lambda, read from image_name, at /usr/local/bin/red_amber_green.rb.

    • stdout is a String
    • stderr is a String
    • status is an Integer
    • If this file does not exist in image_name, the colour is "amber".
    • If eval'ing the lambda raises an exception, the colour is "amber".
    • If calling the lambda raises an exception, the colour is "amber".
    • If calling the lambda returns anything other than :red, :amber, or :green, the colour is "amber".
    • eg
      $ docker run --rm cyberdojofoundation/gcc_assert bash -c 'cat /usr/local/bin/red_amber_green.rb'
      
      lambda { |stdout, stderr, status|
        output = stdout + stderr
        return :green if status == 0
        return :red   if /(.*)Assertion(.*)failed/.match(output)
        return :amber
      }
      
  • parameters, eg

  {        "image_name": "cyberdojofoundation/gcc_assert",
                   "id": "15B9zD",
               "stdout": "...",
               "stderr": "...",
               "status": 3,
  }

GET ready?

  • returns true if the service is ready, otherwise false, eg
    { "ready?": true }
    { "ready?": false }
  • parameters, none
    {}

GET sha

  • returns the git commit sha used to create the docker image, eg
    { "sha": "b28b3e13c0778fe409a50d23628f631f87920ce5" }
  • parameters, none
    {}

cyber-dojo.org home page

You can’t perform that action at this time.