tutor 23.0.0.dev3233__tar.gz → 23.0.0.dev3237__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/PKG-INFO +1 -1
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/cli.py +51 -3
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/config.py +2 -1
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/context.py +21 -1
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/plugins.py +2 -1
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/hooks/catalog.py +9 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/plugins/__init__.py +2 -1
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/Dockerfile +0 -2
- tutor-23.0.0.dev3237/tutor/templates/build/openedx/bin/wait-for-tcp +42 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/jobs/init/cms.sh +1 -1
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/jobs/init/lms.sh +3 -3
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/.gitignore +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/.hatch_build.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/LICENSE.txt +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/README.rst +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/pyproject.toml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/requirements/base.in +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/requirements/dev.txt +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/requirements/plugins.txt +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/__about__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/bindmount.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/compose.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/dev.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/images.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/jobs.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/jobs_utils.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/k8s.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/local.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/mounts.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/params.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/upgrade/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/upgrade/common.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/upgrade/compose.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/commands/upgrade/k8s.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/config.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/core/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/core/hooks/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/core/hooks/actions.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/core/hooks/contexts.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/core/hooks/filters.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/core/hooks/priorities.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/env.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/exceptions.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/fmt.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/hooks/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/images.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/interactive.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/plugins/base.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/plugins/indexes.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/plugins/openedx.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/plugins/v0.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/plugins/v1.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/py.typed +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/serialize.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/tasks.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/caddy/Caddyfile +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/config/cms.env.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/config/lms.env.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/config/partials/auth.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/granian-config +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/cms/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/cms/development.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/cms/production.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/cms/test.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/lms/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/lms/development.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/lms/production.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/lms/test.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/partials/common_all.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/partials/common_cms.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/partials/common_lms.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/partials/common_test.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/permissions/fix-volume-permissions.sh +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/permissions/setowners.sh +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/redis/redis.conf +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/bin/reload-granian +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/bin/run-granian +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/revisions.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/cms/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/cms/assets.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/cms/i18n.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/granian-config +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/lms/__init__.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/lms/assets.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/lms/i18n.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/partials/assets.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/partials/i18n.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/themes/README +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/permissions/Dockerfile +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/permissions/setowner.sh +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/config/base.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/config/defaults.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/dev/docker-compose.jobs.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/dev/docker-compose.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/jobs/init/meilisearch.sh +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/jobs/init/mounted-directories.sh +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/jobs/init/mysql.sh +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/k8s/deployments.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/k8s/jobs.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/k8s/namespace.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/k8s/override.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/k8s/services.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/k8s/volumes.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/kustomization.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/local/docker-compose.jobs.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/local/docker-compose.prod.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/local/docker-compose.yml +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/version +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/types.py +0 -0
- {tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: tutor
|
|
3
|
-
Version: 23.0.0.
|
|
3
|
+
Version: 23.0.0.dev3237
|
|
4
4
|
Summary: The Docker-based Open edX distribution designed for peace of mind
|
|
5
5
|
Project-URL: Homepage, https://docs.tutor.edly.io/
|
|
6
6
|
Project-URL: Documentation, https://docs.tutor.edly.io/
|
|
@@ -9,7 +9,7 @@ import click
|
|
|
9
9
|
from tutor import exceptions, fmt, hooks, utils
|
|
10
10
|
from tutor.__about__ import __app__, __version__
|
|
11
11
|
from tutor.commands.config import config_command
|
|
12
|
-
from tutor.commands.context import Context
|
|
12
|
+
from tutor.commands.context import Context, ignore_plugin_errors
|
|
13
13
|
from tutor.commands.dev import dev
|
|
14
14
|
from tutor.commands.images import images_command
|
|
15
15
|
from tutor.commands.k8s import k8s
|
|
@@ -32,6 +32,41 @@ def main() -> None:
|
|
|
32
32
|
sys.exit(1)
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
def check_plugin_errors(context: click.Context) -> None:
|
|
36
|
+
"""
|
|
37
|
+
Check for plugin loading errors and exit with code 1 if any were found,
|
|
38
|
+
unless --ignore-plugin-errors is set.
|
|
39
|
+
"""
|
|
40
|
+
errors: list[tuple[str, str]] = list(hooks.Filters.PLUGIN_ERRORS.iterate())
|
|
41
|
+
if not errors or context.invoked_subcommand is None:
|
|
42
|
+
return
|
|
43
|
+
# This is done to narrow the type. This function is only called from a one
|
|
44
|
+
# place which is always a group.
|
|
45
|
+
assert isinstance(context.command, click.Group)
|
|
46
|
+
subcommand = context.command.get_command(context, context.invoked_subcommand)
|
|
47
|
+
ignore = context.obj.ignore_plugin_errors or getattr(
|
|
48
|
+
subcommand, "ignore_plugin_errors", False
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
for plugin, error in errors:
|
|
52
|
+
if ignore:
|
|
53
|
+
fmt.echo_alert(f"Failed to enable plugin '{plugin}': {error}")
|
|
54
|
+
else:
|
|
55
|
+
fmt.echo_error(f"Plugin '{plugin}' failed to load: {error}")
|
|
56
|
+
# Only exit with an error code if:
|
|
57
|
+
# - errors are not being ignored
|
|
58
|
+
# - no exception has already been raised that would return its own error code
|
|
59
|
+
if ignore:
|
|
60
|
+
return
|
|
61
|
+
match sys.exc_info()[1]:
|
|
62
|
+
case None:
|
|
63
|
+
sys.exit(1)
|
|
64
|
+
case SystemExit(code=code) | click.exceptions.Exit(exit_code=code) if code == 0:
|
|
65
|
+
sys.exit(1)
|
|
66
|
+
case _:
|
|
67
|
+
return
|
|
68
|
+
|
|
69
|
+
|
|
35
70
|
class TutorCli(click.Group):
|
|
36
71
|
"""
|
|
37
72
|
Dynamically load subcommands at runtime.
|
|
@@ -99,20 +134,33 @@ class TutorCli(click.Group):
|
|
|
99
134
|
is_flag=True,
|
|
100
135
|
help="Print this help",
|
|
101
136
|
)
|
|
137
|
+
@click.option(
|
|
138
|
+
"--ignore-plugin-errors",
|
|
139
|
+
"ignore_plugin_errors",
|
|
140
|
+
is_flag=True,
|
|
141
|
+
default=False,
|
|
142
|
+
help="Continue running even if plugin loading fails",
|
|
143
|
+
)
|
|
102
144
|
@click.pass_context
|
|
103
|
-
def cli(
|
|
145
|
+
def cli(
|
|
146
|
+
context: click.Context, root: str, show_help: bool, ignore_plugin_errors: bool
|
|
147
|
+
) -> None:
|
|
104
148
|
if utils.is_root():
|
|
105
149
|
fmt.echo_alert(
|
|
106
150
|
"You are running Tutor as root. This is strongly not recommended. If you are doing this in order to access"
|
|
107
151
|
" the Docker daemon, you should instead add your user to the 'docker' group. (see https://docs.docker.com"
|
|
108
152
|
"/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user)"
|
|
109
153
|
)
|
|
110
|
-
context.obj = Context(root)
|
|
154
|
+
context.obj = Context(root, ignore_plugin_errors)
|
|
111
155
|
context.help_option_names = ["-h", "--help"]
|
|
156
|
+
|
|
157
|
+
check_plugin_errors(context)
|
|
158
|
+
|
|
112
159
|
if context.invoked_subcommand is None or show_help:
|
|
113
160
|
click.echo(context.get_help())
|
|
114
161
|
|
|
115
162
|
|
|
163
|
+
@ignore_plugin_errors
|
|
116
164
|
@click.command(help="Print this help", name="help")
|
|
117
165
|
@click.pass_context
|
|
118
166
|
def help_command(context: click.Context) -> None:
|
|
@@ -11,11 +11,12 @@ import click.shell_completion
|
|
|
11
11
|
from tutor import config as tutor_config
|
|
12
12
|
from tutor import env, exceptions, fmt, hooks, serialize, utils
|
|
13
13
|
from tutor import interactive as interactive_config
|
|
14
|
-
from tutor.commands.context import Context
|
|
14
|
+
from tutor.commands.context import Context, ignore_plugin_errors
|
|
15
15
|
from tutor.commands.params import ConfigLoaderParam, ParamValue
|
|
16
16
|
from tutor.types import Config, ConfigValue
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
@ignore_plugin_errors
|
|
19
20
|
@click.group(
|
|
20
21
|
name="config",
|
|
21
22
|
short_help="Configure Open edX",
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from typing import TypeVar
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
1
5
|
from tutor.tasks import BaseTaskRunner
|
|
2
6
|
from tutor.types import Config
|
|
3
7
|
|
|
@@ -12,8 +16,9 @@ class Context:
|
|
|
12
16
|
$ tutor --root=... local run ...
|
|
13
17
|
"""
|
|
14
18
|
|
|
15
|
-
def __init__(self, root: str) -> None:
|
|
19
|
+
def __init__(self, root: str, ignore_plugin_errors: bool = False) -> None:
|
|
16
20
|
self.root = root
|
|
21
|
+
self.ignore_plugin_errors = ignore_plugin_errors
|
|
17
22
|
|
|
18
23
|
|
|
19
24
|
class BaseTaskContext(Context):
|
|
@@ -28,3 +33,18 @@ class BaseTaskContext(Context):
|
|
|
28
33
|
Return a runner capable of running docker-compose/kubectl commands.
|
|
29
34
|
"""
|
|
30
35
|
raise NotImplementedError
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
CMD = TypeVar("CMD", bound=click.Command)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def ignore_plugin_errors(command: CMD) -> CMD:
|
|
42
|
+
"""
|
|
43
|
+
Ignore plugins errors for commands marked with this.
|
|
44
|
+
|
|
45
|
+
Commands decorated with this will run even if there were errors when loading
|
|
46
|
+
plugins. This needs to be the first decorator and only works for top-level
|
|
47
|
+
command, exempting all subcommands.
|
|
48
|
+
"""
|
|
49
|
+
setattr(command, "ignore_plugin_errors", True)
|
|
50
|
+
return command
|
|
@@ -16,7 +16,7 @@ from tutor.plugins import indexes
|
|
|
16
16
|
from tutor.plugins.base import PLUGINS_ROOT, PLUGINS_ROOT_ENV_VAR_NAME
|
|
17
17
|
from tutor.types import Config
|
|
18
18
|
|
|
19
|
-
from .context import Context
|
|
19
|
+
from .context import Context, ignore_plugin_errors
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class PluginName(click.ParamType[str]):
|
|
@@ -74,6 +74,7 @@ class IndexPluginNameOrLocation(IndexPluginName):
|
|
|
74
74
|
return autocompleted
|
|
75
75
|
|
|
76
76
|
|
|
77
|
+
@ignore_plugin_errors
|
|
77
78
|
@click.group(
|
|
78
79
|
name="plugins",
|
|
79
80
|
short_help="Manage Tutor plugins",
|
|
@@ -479,6 +479,15 @@ class Filters:
|
|
|
479
479
|
#: regular expression. For instance: ``("openedx", r".*xblock.*")``.
|
|
480
480
|
MOUNTED_DIRECTORIES: Filter[list[tuple[str, str]], []] = Filter()
|
|
481
481
|
|
|
482
|
+
#: List of plugins that failed to load, along with the corresponding error
|
|
483
|
+
#: message. This filter is populated by `tutor.plugins.load_all` when a
|
|
484
|
+
#: plugin raises an exception during loading. It is consumed by the CLI to
|
|
485
|
+
#: report errors after the subcommand has finished.
|
|
486
|
+
#:
|
|
487
|
+
#: :parameter list[tuple[str, str]] errors: list of ``(plugin_name, error_message)``
|
|
488
|
+
#: tuples.
|
|
489
|
+
PLUGIN_ERRORS: Filter[list[tuple[str, str]], []] = Filter()
|
|
490
|
+
|
|
482
491
|
#: List of plugin indexes that are loaded when we run ``tutor plugins update``. By
|
|
483
492
|
#: default, the plugin indexes are stored in the user configuration. This filter makes
|
|
484
493
|
#: it possible to extend and modify this list with plugins.
|
|
@@ -61,7 +61,8 @@ def load_all(names: t.Iterable[str]) -> None:
|
|
|
61
61
|
try:
|
|
62
62
|
load(name)
|
|
63
63
|
except Exception as e:
|
|
64
|
-
|
|
64
|
+
with hooks.Contexts.PLUGINS.enter():
|
|
65
|
+
hooks.Filters.PLUGIN_ERRORS.add_item((name, str(e)))
|
|
65
66
|
hooks.Actions.PLUGINS_LOADED.do()
|
|
66
67
|
|
|
67
68
|
|
|
@@ -193,8 +193,6 @@ USER ${APP_USER_ID}
|
|
|
193
193
|
# since Linux's username->userid mapping is stored in a file (/etc/passwd), it means that we must
|
|
194
194
|
# --chown with an integer user id ($APP_USER_ID) rather the a username (app).
|
|
195
195
|
|
|
196
|
-
# https://hub.docker.com/r/powerman/dockerize/tags
|
|
197
|
-
COPY --link --from=docker.io/powerman/dockerize:0.19.0 /usr/local/bin/dockerize /usr/local/bin/dockerize
|
|
198
196
|
COPY --link --chown=$APP_USER_ID:$APP_USER_ID --from=edx-platform / /openedx/edx-platform
|
|
199
197
|
COPY --link --chown=$APP_USER_ID:$APP_USER_ID --from=python /opt/pyenv /opt/pyenv
|
|
200
198
|
COPY --link --chown=$APP_USER_ID:$APP_USER_ID --from=python-requirements /openedx/venv /openedx/venv
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Wait until a TCP service accepts connections.
|
|
4
|
+
|
|
5
|
+
Usage: wait-for-tcp HOST:PORT [TIMEOUT_SECONDS]
|
|
6
|
+
|
|
7
|
+
Exits with a non-zero status if the service is still unreachable after the
|
|
8
|
+
timeout (default: 20 seconds).
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import socket
|
|
12
|
+
import sys
|
|
13
|
+
import time
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
USAGE = "Usage: wait-for-tcp HOST:PORT [TIMEOUT_SECONDS]"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def main() -> None:
|
|
20
|
+
try:
|
|
21
|
+
host, _, port_str = sys.argv[1].rpartition(":")
|
|
22
|
+
port = int(port_str)
|
|
23
|
+
timeout = float(sys.argv[2]) if len(sys.argv) > 2 else 20
|
|
24
|
+
if not host or len(sys.argv) > 3:
|
|
25
|
+
raise ValueError
|
|
26
|
+
except (IndexError, ValueError):
|
|
27
|
+
sys.exit(USAGE)
|
|
28
|
+
deadline = time.monotonic() + timeout
|
|
29
|
+
while True:
|
|
30
|
+
try:
|
|
31
|
+
with socket.create_connection((host, port), timeout=1):
|
|
32
|
+
print(f"Connected to {host}:{port}")
|
|
33
|
+
return
|
|
34
|
+
except OSError as e:
|
|
35
|
+
if time.monotonic() >= deadline:
|
|
36
|
+
sys.exit(f"Timeout after {timeout:g}s waiting for {host}:{port}: {e}")
|
|
37
|
+
print(f"Waiting for {host}:{port}: {e}")
|
|
38
|
+
time.sleep(1)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
main()
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
wait-for-tcp {{ MYSQL_HOST }}:{{ MYSQL_PORT }}
|
|
2
2
|
|
|
3
3
|
{%- if MONGODB_HOST.startswith("mongodb+srv://") %}
|
|
4
4
|
echo "MongoDB is using SRV records, so we cannot wait for it to be ready"
|
|
5
5
|
{%- elif ',' in MONGODB_HOST %}
|
|
6
6
|
echo "Waiting for MongoDB (replica set, checking all members)"
|
|
7
7
|
{%- for host in MONGODB_HOST.split(',') %}
|
|
8
|
-
|
|
8
|
+
wait-for-tcp {{ host.strip() }}:{{ MONGODB_PORT }}
|
|
9
9
|
{%- endfor %}
|
|
10
10
|
{%- else %}
|
|
11
|
-
|
|
11
|
+
wait-for-tcp {{ MONGODB_HOST }}:{{ MONGODB_PORT }}
|
|
12
12
|
{%- endif %}
|
|
13
13
|
|
|
14
14
|
echo "Loading settings $DJANGO_SETTINGS_MODULE"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/config/cms.env.yml
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/config/lms.env.yml
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/config/partials/auth.yml
RENAMED
|
File without changes
|
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/cms/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/cms/test.py
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/lms/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/apps/openedx/settings/lms/test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/bin/reload-granian
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/cms/__init__.py
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/cms/assets.py
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/cms/i18n.py
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/granian-config
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/lms/__init__.py
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/lms/assets.py
RENAMED
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/build/openedx/settings/lms/i18n.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tutor-23.0.0.dev3233 → tutor-23.0.0.dev3237}/tutor/templates/jobs/init/mounted-directories.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|