Code Monkey home page Code Monkey logo

k8s-install'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

k8s-install's People

Contributors

jonjagger avatar neethu-philip avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

dpolivaev

k8s-install's Issues

"web" service generates with probes, but installs without probes

The notes say that web should be installed with helm_upgrade_probe_yes_prometheus_no, and the YAML for the service appears to agree, as of cyber-dojo/web@9ac1ed6

However, the install script uses helm_upgrade_probe_no_prometheus_no and hence the install fails, because there is a liveness probe path, but not a port:

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(DaemonSet.spec.template.spec.containers[0].livenessProbe.httpGet): missing required field "port" in io.k8s.api.core.v1.HTTPGetAction, ValidationError(DaemonSet.spec.template.spec.containers[0].readinessProbe.httpGet): missing required field "port" in io.k8s.api.core.v1.HTTPGetAction]

Tested against a 1.18.9 on-prem k8s cluster.

Changing the install script to use helm_upgrade_probe_yes_prometheus_no seems to have allowed the install to complete, although it's not yet working, I'm still looking into that.

Pods don't seem to get the port env-vars they need

Firstly, I noticed model isn't part of the install script, but I suspect that's just because it was only (re-)added into the full system recently. I trivially resolved that just by copying the existing two blocks for differ.

However, I then hit a more-complex issue.

It seems that none of the services receive the CYBER_DOJO_XXX_PORT env-vars they need to talk to the other services, causing them to attempt to talk on port 0.

A few pods (model, differ, and creator) fail to start because of this, but after adding the env-vars by hand, I found that KataController#edit then failed trying to talk to port 0 on saver, so I have to assume not every pod is checking its necessary ports at startup.

More to the point, it's not clear how this is intended to work. I don't see anything attempting to set env-vars for the ports of the other services in the scripts, so it's not clear to me what's broken, so it's not as simple a fix as the other issues I've noticed giving this a burl today.

In case I or someone else comes looking for this later, I worked around this by adding the below block to almost all the '*-k8s-general-values.yml' files in the installer dir, before volumeMounts in the container definition.

    env:
      CYBER_DOJO_PROMETHEUS: "true"
      CYBER_DOJO_CUSTOM_START_POINTS_PORT: "4526"
      CYBER_DOJO_EXERCISES_START_POINTS_PORT: "4525"
      CYBER_DOJO_LANGUAGES_START_POINTS_PORT: "4524"
      CYBER_DOJO_CREATOR_PORT: "4523"
      CYBER_DOJO_MODEL_PORT: "4528"
      CYBER_DOJO_DIFFER_PORT: "4567"
      CYBER_DOJO_REPLER_PORT: "4657"
      CYBER_DOJO_RUNNER_PORT: "4597"
      CYBER_DOJO_SAVER_PORT: "4537"
      CYBER_DOJO_SHAS_PORT: "4522"
      CYBER_DOJO_WEB_PORT: "3000"

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.