7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-02 14:20:47 +00:00
tutor/tutor/commands
Régis Behmo bce6432d85 Improve job running in local and k8s
Running jobs was previously done with "exec". This was because it
allowed us to avoid copying too much container specification information
from the docker-compose/deployments files to the jobs files. However,
this was limiting:

- In order to run a job, the corresponding container had to be running.
This was particularly painful in Kubernetes, where containers are
crashing as long as migrations are not correctly run.
- Containers in which we need to run jobs needed to be present in the
docker-compose/deployments files. This is unnecessary, for example when
mysql is disabled, or in the case of the certbot container.

Now, we create dedicated jobs files, both for local and k8s deployment.
This introduces a little redundancy, but not too much. Note that
dependent containers are not listed in the docker-compose.jobs.yml file,
so an actual platform is still supposed to be running when we launch the
jobs.

This also introduces a subtle change: now, jobs go through the container
entrypoint prior to running. This is probably a good thing, as it will
avoid forgetting about incorrect environment variables.

In k8s, we find ourselves interacting way too much with the kubectl
utility. Parsing output from the CLI is a pain. So we need to switch to
the native kubernetes client library.
2020-04-25 23:12:42 +02:00
..
__init__.py Move command modules to dedicated directory 2019-05-29 09:53:54 +02:00
android.py Move "-r/--root" option to parent command level 2019-12-15 18:52:58 +01:00
cli.py Add a big fat warning against "sudo" 2020-03-16 17:43:55 +01:00
compose.py Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
config.py Minor code refactoring, for naming clarity 2020-02-27 17:14:00 +01:00
context.py More feature-complete dev/local docker-compose commands 2020-01-10 11:10:54 +01:00
dev.py Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
images.py Move "-r/--root" option to parent command level 2019-12-15 18:52:58 +01:00
k8s.py Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
local.py Clarify certbot image source repository 2020-03-27 09:56:53 +01:00
plugins.py Minor code refactoring, for naming clarity 2020-02-27 17:14:00 +01:00
ui.py Move command modules to dedicated directory 2019-05-29 09:53:54 +02:00
webui.py Minor code refactoring, for naming clarity 2020-02-27 17:14:00 +01:00