Skip to content

Repository files navigation

GitHub CI

A docker-containerized micro-service for https://cyber-dojo.org serving this page:

Screenshot

A languages-start-points image provides an API for the language & test-framework choices when setting up a practice session in cyber-dojo

In the above screenshot, Python 3.14.3, pytest 9.0.2 is selected.

The source for the Python,pytest start point is the GitHub repo cyber-dojo-languages/python-pytest

The following cyber-dojo CLI command creates a languages-start-points image called only-python-pytest serving only this start-point, at commit 921f17a:

   $ cyber-dojo start-point create only-python-pytest \
       --languages \
         921f17a@https://github.com/cyber-dojo-start-points/python-pytest
   ...
   Successfully created only-python-pytest

The --languages flag can be repeated. The following command creates a languages-start-points image called ruby-ruby-ruby serving start-points for three Ruby test-frameworks:

   $ cyber-dojo start-point create ruby-ruby-ruby \
        --languages \
          e889c83@https://github.com/cyber-dojo-start-points/ruby-approval \
          c1b2910@https://github.com/cyber-dojo-start-points/ruby-cucumber \
          6b72590@https://github.com/cyber-dojo-start-points/ruby-minitest
   ...
   Successfully created ruby-ruby-ruby

The next command creates a languages-start-points image called csharp-nunit-dev from a local clone of https://github.com/cyber-dojo-start-points/csharp-nunit:

   $ cyber-dojo start-point create csharp-nunit-dev \
      --languages \
        5ac141d@file:///Users/jonjagger/repos/cyber-dojo-start-points/csharp-nunit
   ...
   Successfully created create csharp-nunit-dev

To bring up a cyber-dojo server http://localhost:80 using this image:

   $ cyber-dojo up --languages=csharp-nunit-dev
   ...

https://cyber-dojo.org serves a lot of languages-start-points. Their git-repo-urls are in this repo's git_repo_urls.tagged file:

   $ cat git_repo_urls.tagged
   62d4547@https://github.com/cyber-dojo-start-points/bash-bats
   ededcb8@https://github.com/cyber-dojo-start-points/bash-shunit2
   6011b21@https://github.com/cyber-dojo-start-points/bash-unit
   ...
   9b73fe9@https://github.com/cyber-dojo-start-points/php-unit
   640e4df@https://github.com/cyber-dojo-start-points/prolog-plunit
   ee92da2@https://github.com/cyber-dojo-start-points/python-approval-pytest
   ...
  $ cyber-dojo start-point create cyberdojo/languages-start-points \
      --languages \
        $(cat git_repo_urls.tagged)

  Successfully created cyberdojo/languages-start-points

The script bin/concat_all_start_points.sh creates the file git_repo_urls.tagged by reading all data/*/git_repo.url files.

  $ cat data/python-behave/git_repo.url
  f331e88@https://github.com/cyber-dojo-start-points/python-behave

Main workflow

  • To add one new start-point, or to refresh one existing start-point:
    • Run make add_one_start_point name=[NAME]
    • This measures only [NAME], so it takes minutes rather than hours. It creates data/[NAME]/, adds [NAME] to the ALL_START_POINTS array in bin/all_start_points.sh, and rebuilds git_repo_urls.tagged and docs/durations.* from the files on disk, so both still cover every start-point.
  • To re-measure every start-point:
    • Add any new start-points to the ALL_START_POINTS array in bin/all_start_points.sh
    • Run make all_start_points to create an up-to-date version of git_repo_urls.tagged which lists all the cyber-dojo-start-points repositories (each start-point repo contributes one manifest.json to the image).
    • This clones every start-point and runs its red/amber/green tests, which takes a long time.
  • You can also update git_repo_urls.tagged via the .github/workflows/refresh.yml workflow.
    • This creates a branch that you can then merge into main.
    • It splits the start-points across parallel jobs, each measuring its own share, so it takes minutes rather than the half hour one job takes. Its shard_count input says how many jobs to use; 1 measures every start-point in a single job.
  • Run the make image to build the image from git_repo_urls.tagged for local development/testing.
  • Run make tests to run the tests in test/, which cover the scripts in bin/.
  • Create a branch, add, commit, push.

cyber-dojo.org home page


Kosli

About

repo for the cyberdojo/languages-start-points Docker image microservice

Topics

Resources

Contributing

Stars

0 stars

Watchers

3 watching

Forks

Used by

Contributors

Languages