7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-10 17:52:20 +00:00
tutor/tutor
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
..
commands Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
templates Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
__about__.py v3.11.12 (2020-04-16) 2020-04-16 19:31:36 +02:00
__init__.py Tutor v3 complete rewrite 2019-02-09 20:30:01 +01:00
config.py Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
env.py Add encrypt template filter 2020-04-04 18:22:15 +02:00
exceptions.py Tutor v3 complete rewrite 2019-02-09 20:30:01 +01:00
fmt.py env.py refactoring 2020-01-16 15:07:35 +01:00
images.py Better dev environment 2019-10-24 20:03:36 +02:00
interactive.py Minor code refactoring, for naming clarity 2020-02-27 17:14:00 +01:00
plugins.py env.py refactoring 2020-01-16 15:07:35 +01:00
scripts.py Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
serialize.py Improve job running in local and k8s 2020-04-25 23:12:42 +02:00
utils.py Add encrypt template filter 2020-04-04 18:22:15 +02:00