GithubHelp home page GithubHelp logo

cyber-dojo / cyber-dojo Goto Github PK

View Code? Open in Web Editor NEW
154.0 10.0 33.0 38.27 MB

home repo for the cyber-dojo organization

Home Page: https://cyber-dojo.org

License: BSD 2-Clause "Simplified" License

Shell 100.00%
kata tdd individual-practice team-practice

cyber-dojo's Introduction

Hi. Welcome to cyber-dojo 😄



running a server on Kubernetes

Follow these instructions


running a server on docker

Follow these instructions to install the cyber-dojo bash script and to prepare your server.

$ cyber-dojo up
...
$ cyber-dojo version
Version: 0.1.19
   Type: public
...

running a server on docker swarm

This is exploratory only and may be dropped without notice. Follow these instructions to install the cyber-dojo bash script and to prepare your server.

$ export CYBER_DOJO_SWARM=true
$ cyber-dojo up

listing the current version

$ cyber-dojo version
Version: 0.1.23
   Type: public

listing installed versions

From 0.1.50 onwards:

$ cyber-dojo version ls
0.1.49              2019-11-21 21:31:09 +0000 UTC
0.1.48              2019-11-20 12:52:04 +0000 UTC
...
0.1.21              2019-08-07 11:51:48 +0000 UTC
...

updating the server to the latest version

$ cyber-dojo update latest
$ cyber-dojo version
Version: 0.1.49
   Type: public
...
# Now make it live...
$ cyber-dojo up
Using version=0.1.49 (public)
...

setting the server to a specific version

$ cyber-dojo update 0.1.21
$ cyber-dojo version
Version: 0.1.21
   Type: public
...
# Now make it live...
$ cyber-dojo up
Using version=0.1.21 (public)
...

overriding the default port

By default your cyber-dojo server will be on port 80.

  • Override this port using the command-line argument --port. Eg
    $ cyber-dojo up --port=8000
    ...
    Using port=8000
    ...

overriding the default start-point images

overriding the default nginx image

  • By default your cyber-dojo server will use cyberdojo/nginx as its nginx service image (tagged appropriately).
  • From 0.1.47 onwards you can override this by exporting two environment variables. Eg
    $ export CYBER_DOJO_NGINX_IMAGE=cucumber/nginx
    $ export CYBER_DOJO_NGINX_TAG=efd7e37
    $ cyber-dojo up ...
    ...
    Using nginx=cucumber/nginx:efd7e37
    ...

overriding the default rails web image

  • By default your cyber-dojo server will use cyberdojo/web as its web service image (tagged appropriately).
  • From 0.1.28 onwards you can override this by exporting two environment variables. Eg
    $ export CYBER_DOJO_WEB_IMAGE=turtlesec/web
    $ export CYBER_DOJO_WEB_TAG=84d6d0e
    $ cyber-dojo up ...
    ...
    Using web=turtlesec/web:84d6d0e
    ...

overriding the default dot env files

  • There are default .env files for the web and nginx services.
  • You can override these by exporting two environment variables set to the absolute path of your own .env file. Eg
    $ export CYBER_DOJO_NGINX_ENV=/home/fred/my_nginx.env
    $ export CYBER_DOJO_WEB_ENV=/home/fred/my_web.env
    $ cyber-dojo up
    ...
    Using nginx.env=/home/fred/my_nginx.env (custom)
    Using web.env=/home/fred/my_web.env (custom)
    ...

From 0.1.131 onwards, when an exercise starts a welcome dialog displays traffic-light information. You can turn off this dialog with the following web.env entry:

STARTING_INFO_DIALOG=off

From 0.1.137 onwards, there is an experimental REPL service for Python. You can turn this on with the following web.env entry:

REPL=on

From 0.1.291 onwards, you can turn off the review page's [fork] button with the following web.env entry:

FORK_BUTTON=off

From 0.1.319 onwards, you can turn off the [dashboard] button from the info toolbar with the following web.env entry:

DASHBOARD_BUTTON=off

From 0.1.320 onwards, you can turn off traffic-light prediction with the following web.env entry:

PREDICT=off

Micro Services

Each repo in the github cyber-dojo organization builds a single docker image.
The main Amazon ECS backed https://cyber-dojo.org uses:

  • custom-start-points Github Action
    serves the custom start-points.
  • exercises-start-points Github Action
    serves the exercises start-points.
  • languages-start-points Github Action
    serves the languages start-points.
  • differ Github Action
    diffs two sets of files.
  • nginx Github Action
    web-proxy, security, images (jpg) cache, and service routing.
  • runner Github Action
    runs the tests and returns [stdout,stderr,status,timed_out,colour].
  • saver Github Action
    API to GET/POST group/kata data, e.g., for individual traffic-lights.
  • creator Gitlab
    UI to configure and create (or re-enter) a group-exercise or an individual-exercise.
  • dashboard Github Action
    UX for a group session dashboard of all traffic-lights.
  • web Github Action
    main UX for coding, testing, and reviewing.

Locally running servers also use:


Image Dependencies

Image Dependency Graph


Domain Model

Domain model


Screenshots

cyber-dojo.org home page

cyber-dojo's People

Contributors

jonjagger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cyber-dojo's Issues

new/changed files could be large

The runners now send new/changed text files back to the browser (via web).
These files could be large and need to be truncated by the runner in the same way stdout+stderr is.
Currently stdout+stderr is truncated to 10K. Is this too small? A 10K file is often only about ~250 lines.

add jq

If interested in adding jq as a language option, I've started a repo with three sub-folders, and as far as I understand each subfolder should be a repo in two different orgs.
My testing capabilities are limitted, but it looks pretty good "on my machine".

Output from previous test runs displaying

The output of each round of test runs is stacking and continues to be displayed on subsequent iterations. This issue is resolved when the page is refreshed. Identified using Chrome v66.

image

Build scripts incorrectly assume all repos have a 'build.sh'

In following the build steps described in dev/README.md, I ran into a problem where build-all.sh was trying to run build.sh scripts that didn't exist. Here's what I think is going on:

  1. build-all.sh is sourcing env-var-repos.sh, and this sets the CYBER_DOJO_REPOS to a list of repos.
  2. For every repo in CYBER_DOJO_REPOS, build-all.sh cd's to that directory and tries to run build.sh..
  3. However, some of those directories (e.g. starter) don't contain a build.sh, and this causes the script to terminate prematurely.

I see at least two possible approaches to fixing this. First, we could modify env-var-repos.sh to only include repos containing build.sh in CYBER_DOJO_REPOS. Or, we could update build-all.sh so that it checks for each potential build.sh before running it.

This second change is very straightforward, and it seems a bit more future-proof insofar as it will automatically pick up new build scripts as they become available.

Cannot generate a new exercise

Hi, guys.

Not sure if this is the proper space, so I apologize in advance if it's the wrong place.

That said, our team uses the Cyber Dojo during our interview process so we can know a bit more about how the developer builds the solution and even know him as a person, because we believe that the code can tell us a lot. But, sadly, today we experienced a problem during the exercise gerenation that made it impossible to create a new one.

Looks like the button below isn't working properly:
image

Could you take a look at it?

Thanks a lot.

partner request

very much, I would like to contribute my knowledge about devops to the repository, greetings

username github: samuelbarrionuevo

`cyber-dojo up` is looking for the `storer` user which doesn't exist

The instructions in dev/README.md tell me to run build-all.sh followed by cyber-dojo up. If I do this (after working around #1), the cyber-dojo up command fails telling me:

ERROR: for cyber-dojo-storer  Cannot start service storer: linux spec user: unable to find user storer: no matching entries in passwd file

ERROR: for storer  Cannot start service storer: linux spec user: unable to find user storer: no matching entries in passwd file
Encountered errors while bringing up the project.

It looks like I need to create a user named storer somewhere, though I'm not sure if this is on my actual host OS or in a docker container somewhere (if container-specific users are even a thing).

Text file is lost after running a test with a stray '\20' in the file

Summary

Something about my keyboard setup means that if I hit a particular key, then a non-ascii character gets inserted.

If I run the tests without spotting it, here's what happens:

Expected behaviour: error message saying my code is wrong
Actual behaviour: error message saying my code is wrong - and the source file is removed from the list of available files.

It's a windows keyboard attached to a Mac, and the key that on PCs causes the context menu to appear, in cyber-dojo causes a little round circle to appear in the code.

Workaround

This has happened to me 3 times now, in an online course, and each time I have had to use the '+' sign to create a new file, and copy-and-paste the in the file from a previous step, which took a few minutes.

I see now that I can "revert" an earlier step, but either I didn't spot that, at the time - or I tried it, and it didn't seem to re-add the file...

Steps to reproduce

Here's exactly what I did - I suspect some of the middle steps can be removed...

  1. Start a new session - I chose C++ with CppUTest and Roman numerals
  2. Run the test and confirm they fail
  3. Edit HikerTest.cpp to make the failing test pass
  4. Accidentally hit a key on my keyboard that puts a '\20' (little round blob) into the source
  5. Run the tests

Example

There is an example of this having happened in Step 3 of https://www.cyber-dojo.org/kata/edit/8HV74p

This is the error text in the output window:

:stdout:
compiling AllTests.cpp
compiling HikerTest.cpp

:stderr:
tests/HikerTest.cpp:22:5: error: stray '\20' in program
   22 |     �
      |     ^
make: *** [/cpputest/build/MakefileWorker.mk:511: objs/tests/HikerTest.o] Error 1

:status:
2

And here is a screenshot: notice how the output file refers to HikerTest.cpp but that file is no longer listed in the list of available files:

image

application of hidden_filenames is less than optimal

Currently the runners collect new/changed text files and send them back to web service which then filters them based on the hidden_filenames manifest.json property.
It would be more efficient to send the hidden_filenames property to the runner and for the runner to filter them in-place.

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.