<commit_before>
- - - - - - - - - - - - - - - - - - - - -

travis.yml run is failing with error from very last [docker run]
command to run the tests..
   'rpc error: code = 2 desc = oci runtime error'
Searching finds this.
https://github.com/docker/docker/issues/22648
Which mentions a zombie process eating all the cpu. Sounds familiar.
And this
https://github.com/docker/docker/issues/22650
which mentions bug in aufs kernel
See
https://github.com/docker/docker/issues/18180#issuecomment-187583209
Which says on 14.04 you need kernel 3.13.0-79.123 or later
But $uname -r
Says
3.19.0-30-generic
--debug option on final [docker exec] says
DEBU[0000] framesize: 60
rpc error: code = 2 desc = "containerd: container not found"DEBU[0000] Corrupted prefix: []
DEBU[0000] [hijack] End of stdout
Error response from daemon: Container d51548afc9eba0143f6d3947c6d909338f53f4cd48779664b11ba22b8df6fb20 is not running: Exited (1) Less than a second ago
$ docker logs web-cdf
--->Could not find rake-11.1.2 in any of the sources (Bundler::GemNotFound)
Progress!
Problem was Gemfile.lock. Need to ensure it is not inside web's docker context.

- - - - - - - - - - - - - - - - - - - - -

$ ./cyber-dojo volume rm NAME
This fails if the server is up, presumably because the volume is in use.

- - - - - - - - - - - - - - - - - - - - -

Now that data is externalized I can arrange for it to
always be at the same locations inside the web container!
I don't need CYBER_DOJO_EXERCISES_ROOT et al.
But it is worth keeping them anyway for setting up
a local (not inside docker) web server?

- - - - - - - - - - - - - - - - - - - - -

dialog for [create practice session]
                new your new id is
is better as
           [new practice session created]
                its id is

- - - - - - - - - - - - - - - - - - - - -

Get scripts/dev_server.sh running again by making X...ROOT env-vars
point to where the data repos live. Then try out docker_tar_pipe_runner.sh
mods (above and below) and see if it fixes the warnings.

- - - - - - - - - - - - - - - - - - - - -

How to run local server? Have the 3 git data repos on the local hard disk and
make the CYBER_DOJO_LANGUAGES_ROOT env-vars point to these in script/dev-server.sh
Do that and get tests running locally and inside web container.
Document which (if any) docker images are required for tests to run.
Make these small Alpine-based images.

- - - - - - - - - - - - - - - - - - - - -

Looking to make some smaller alpine-linux language images.
Specifically, C#-NUnit and Java-JUnit
This will allow me to [docker pull] them both before running travis tests
which hopefully will give me all tests passing.
In fact, I should be able to get away with just Java-JUnit if I tweak the test.

Java
frolvlad/alpine-oraclejdk8:slim
  How big is it? ~166.9 MB  (vs 843.7 MB)
  docker run --rm frolvlad/alpine-oraclejdk8:slim sh -c "javac -version"
    javac 1.8.0_92
  There is a package called junit (branch=edge, repo=testing)

- - - - - - - - - - - - - - - - - - - - -

app_controllers tests has this warning
/usr/lib/ruby/gems/2.3.0/gems/activesupport-4.1.0/lib/active_support/values/time_zone.rb:285: warning: circular argument reference - now
Tried upgrading to Ruby 4.2.6
solves this as long Gemfile.lock is not part of the docker context
(remove it from web's dockerignore file)
This causes a few app_controller deprecation warnings
and a load of app_controller test fails which seem to be due to bad URLs

- - - - - - - - - - - - - - - - - - - - -

Having Gemfile as part of web's docker image context is unfortunate.
It means the Alpine apk update stuff repeats unnecessarily if, for
example, you bump the rails version in Gemfile.

- - - - - - - - - - - - - - - - - - - - -

Occasional test failures...
  ForkerControllerTest#test_'EAE021',
    when language no longer exists, the fork fails, and the reason given is language
  SetupControllerTest#test_'EB77D9',
    show_exercises page uses cached exercises that are runnable

  Tests are defintely not unit-tests and almost certainly have order
  dependencies. State of cache files. How to resolve?

  I could reinstate FakeDisk, leave env-vars for data ROOTs, then
  fill FakeDisk with known content, then do access to dojo methods
  such as dojo.exercises

  For now, deleting caches at start of app_controller tests.

- - - - - - - - - - - - - - - - - - - - -

Does the Tennis-Ruby exercise still crash the web server?
$ docker pull cyberdojofoundation/ruby_test_unit
And try it.

- - - - - - - - - - - - - - - - - - - - -

Note: need a check that each docker image has a user in it called nobody
      (I don't think it's uid is important)

- - - - - - - - - - - - - - - - - - - - -

If the server is up you can still do [docker rmi image]
So I still need proper nil error handling on the setup pages

- - - - - - - - - - - - - - - - - - - - -

Crib
ruby cyber-dojo.rb volume create --name=abc --git=https://github.com/JonJagger/cyber-dojo-refactoring-exercises.git

ruby ./cyber-dojo.rb volume create --name=default_languages --git=https://github.com/JonJagger/cyber-dojo-languages.git

- - - - - - - - - - - - - - - - - - - - -

)) Does the rails log folder needs to be volume-mounted so if the server
   goes down I can inspect the rails log file?

- - - - - - - - - - - - - - - - - - - - -

)) ./cyber-dojo catalog

     $ ./cyber-dojo volume create --name=VOL --git=URL
       This will check that the URL adhered to the api,
       viz it specified whether it was languages/exercises/instructions
       If ok it will add a label, --label=cyber-dojo-volume=languages

       manifest.json in the github source will specify
          'type': (languages/exercises/instructions)
       and if not instructions type
          'lhs-column-title': 'name',
          'rhs-column-title': 'language'

       Then volume can be mounted read-only.

     $ ./cyber-dojo volume rm VOL [VOL...]

     $ ./cyber-dojo volume inspect VOL [VOL...]
       This would do the old catalog listing.
       This should show the origin (URL) of the volume.
       Need to make the languages checker work by being
       passed a path (there are now 2 manifest locations, exercises and languages)
       Then [volume inspect] call with then do<commit_msg>notes update<commit_after>
- - - - - - - - - - - - - - - - - - - - -

$ ./cyber-dojo volume rm NAME
This fails if the server is up, presumably because the volume is in use.

- - - - - - - - - - - - - - - - - - - - -

Now that data is externalized I can arrange for it to
always be at the same locations inside the web container!
I don't need CYBER_DOJO_EXERCISES_ROOT et al.
But it is worth keeping them anyway for setting up
a local (not inside docker) web server?

- - - - - - - - - - - - - - - - - - - - -

Get scripts/dev_server.sh running again by making X...ROOT env-vars
point to where the data repos live. Then try out docker_tar_pipe_runner.sh
mods (above and below) and see if it fixes the warnings.

- - - - - - - - - - - - - - - - - - - - -

How to run local server? Have the 3 git data repos on the local hard disk and
make the CYBER_DOJO_LANGUAGES_ROOT env-vars point to these in script/dev-server.sh
Do that and get tests running locally and inside web container.
Document which (if any) docker images are required for tests to run.
Make these small Alpine-based images.

- - - - - - - - - - - - - - - - - - - - -

Looking to make some smaller alpine-linux language images.
Specifically, C#-NUnit and Java-JUnit

Java
frolvlad/alpine-oraclejdk8:slim
  How big is it? ~166.9 MB  (vs 843.7 MB)
  docker run --rm frolvlad/alpine-oraclejdk8:slim sh -c "javac -version"
    javac 1.8.0_92
  There is a package called junit (branch=edge, repo=testing)

- - - - - - - - - - - - - - - - - - - - -

app_controllers tests has this warning
/usr/lib/ruby/gems/2.3.0/gems/activesupport-4.1.0/lib/active_support/values/time_zone.rb:285: warning: circular argument reference - now
Tried upgrading to Ruby 4.2.6
solves this as long Gemfile.lock is not part of the docker context
(remove it from web's dockerignore file)
This causes a few app_controller deprecation warnings
and a load of app_controller test fails which seem to be due to bad URLs

- - - - - - - - - - - - - - - - - - - - -

Having Gemfile as part of web's docker image context is unfortunate.
It means the Alpine apk update stuff repeats unnecessarily if, for
example, you bump the rails version in Gemfile.

- - - - - - - - - - - - - - - - - - - - -

Occasional test failures...
  ForkerControllerTest#test_'EAE021',
    when language no longer exists, the fork fails, and the reason given is language
  SetupControllerTest#test_'EB77D9',
    show_exercises page uses cached exercises that are runnable

  Tests are defintely not unit-tests and almost certainly have order
  dependencies. State of cache files. How to resolve?

  I could reinstate FakeDisk, leave env-vars for data ROOTs, then
  fill FakeDisk with known content, then do access to dojo methods
  such as dojo.exercises

  For now, deleting caches at start of app_controller tests.

- - - - - - - - - - - - - - - - - - - - -

Does the Tennis-Ruby exercise still crash the web server?
$ docker pull cyberdojofoundation/ruby_test_unit
And try it.

- - - - - - - - - - - - - - - - - - - - -

Note: need a check that each docker image has a user in it called nobody
      (I don't think it's uid is important)

- - - - - - - - - - - - - - - - - - - - -

If the server is up you can still do [docker rmi image]
So I still need proper nil error handling on the setup pages

- - - - - - - - - - - - - - - - - - - - -

Crib
ruby cyber-dojo.rb volume create --name=abc --git=https://github.com/JonJagger/cyber-dojo-refactoring-exercises.git

ruby ./cyber-dojo.rb volume create --name=default_languages --git=https://github.com/JonJagger/cyber-dojo-languages.git

- - - - - - - - - - - - - - - - - - - - -

)) ./cyber-dojo catalog

     $ ./cyber-dojo volume create --name=VOL --git=URL
       This will check that the URL adhered to the api,
       viz it specified whether it was languages/exercises/instructions
       If ok it will add a label, --label=cyber-dojo-volume=languages

       manifest.json in the github source will specify
          'type': (languages/exercises/instructions)
       and if not instructions type
          'lhs-column-title': 'name',
          'rhs-column-title': 'language'

       Then volume can be mounted read-only.

     $ ./cyber-dojo volume rm VOL [VOL...]

     $ ./cyber-dojo volume inspect VOL [VOL...]
       This would do the old catalog listing.
       This should show the origin (URL) of the volume.
       Need to make the languages checker work by being
       passed a path (there are now 2 manifest locations, exercises and languages)
       Then [volume inspect] call with then do
{'fraction_non_alphanumeric': 0.11272693590218599, 'fraction_numerical': 0.01620970729899963, 'mean_word_length': 2.256031363088058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 87, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7349986', 'n_tokens_mistral': 3665, 'n_tokens_neox': 3428, 'n_words': 1286}