Commit Graph

1136 Commits

Author SHA1 Message Date
Régis Behmo 39d3eaf801 fix: type tests
Type tests were broken following the upgrade of click. We take the
opportunity to simplify the TutorCli implementation.
2023-08-29 16:21:43 +02:00
Overhang.IO ad6cc4fcc7 Merge remote-tracking branch 'origin/master' into nightly 2023-08-29 09:59:22 +00:00
Régis Behmo 748340f751 v16.1.1 2023-08-29 11:43:24 +02:00
Overhang.IO 06b021df23 Merge remote-tracking branch 'origin/master' into nightly 2023-08-28 07:59:39 +00:00
Florian Haas cfb786ab2d fix: Apply mysqld character set fix to Kubernetes deployment
This is a follow-up fix to #819, where the corresponding change was
added to the mysqld invocation in the "tutor local" (that is,
docker-compose) deployment method, but omitted from its "tutor k8s"
equivalent.
2023-08-28 09:53:38 +02:00
Overhang.IO c475ff63e6 Merge remote-tracking branch 'origin/master' into nightly 2023-08-28 07:53:24 +00:00
Kyle D. McCormick 97b999b519 docs: tutor uses `docker compose` now, not `docker-compose` 2023-08-28 09:48:42 +02:00
Overhang.IO 4cd4ddb1e7 Merge remote-tracking branch 'origin/master' into nightly 2023-08-16 17:19:54 +00:00
Régis Behmo 8ccc3588e7 v16.1.0 2023-08-16 19:12:35 +02:00
Régis Behmo 021a305084 Merge branch 'master' into nightly 2023-08-16 19:07:07 +02:00
Régis Behmo 2a47100d6a fix: broken mysql after palm upgrade
This fix is for a rather serious issue that affects users who upgrade
from Olive to Palm. The client mysql charset and collation was
incorrectly set to utf8mb4, while the server stil runs utf8mb3. Only
users who run the mysql container are affected.

To resolve this issue, we explicitely configure the client to use the
utf8mb3 charset/collation.

Important note: users who have somehow managed to upgrade from olive to
Palm before may find themselves in an undefined state. They might have
to fix their mysql data manually. Same thing for users who launched Palm
from scratch; although, according to my preliinary tests, they should be
able to downgrade their connection from utf8mb4 to utf8mb3 without
issue.

In addition, we upgrade to mysql 8.1.0. Among many other fixes, this
avoids a server restart after the upgrade:

> An in-place upgrade from MySQL 5.7 to MySQL 8.0, without a server
> restart, could result in unexpected errors when executing queries on
> tables. This fix eliminates the need to restart the server between the
> upgrade and queries. (Bug #35410528)

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-34.html

See also the 8.1.0 release notes:

https://dev.mysql.com/doc/relnotes/mysql/8.1/en/news-8-1-0.html

Close #887.
2023-08-16 19:01:41 +02:00
0x29a df07422adb fix: race condition could cause mkdirs() to fail with "dir exists" 2023-08-16 18:59:15 +02:00
Régis Behmo b51fdb46f3 fix: ask whether we run as prod in `local launch`
User was no longer asked whether they wanted to run on prod or not. In
other words, it was not convenient to run as local.overhang.io.
2023-08-16 18:57:26 +02:00
Régis Behmo 67009fb857 fix: improve support of non-buildkit Docker build
See comment here:
https://github.com/overhangio/tutor/pull/868#issuecomment-1640429396

See also the conversation that spawned this PR:
https://discuss.openedx.org/t/issue-in-tutor-palm-release-with-tuotr-dev-launch-while-installing/10629
2023-08-16 18:56:59 +02:00
Emad Rad ef30dbc193 chore: left out "Filters" word added 2023-08-14 16:25:59 +02:00
Régis Behmo f6507f995a v16.0.5 2023-08-09 22:42:32 +02:00
Régis Behmo a6338e2880 feat: upgrade to open-release/palm.2 2023-08-09 22:41:34 +02:00
Overhang.IO 1e0f71450a Merge remote-tracking branch 'origin/master' into nightly 2023-08-03 09:43:18 +00:00
Régis Behmo bb23afcc60 v16.0.4 2023-08-03 11:19:17 +02:00
Emad Rad 8414200262
fix: remove references to the wizard edition 2023-08-03 11:08:35 +02:00
Régis Behmo 63c8f8ec58 feat: add support for http/3
It was observed that waiting time was cut in half after http/3 was
enabled. Plus, supporting http/3 is super easy :)

Close #845
2023-08-03 10:59:43 +02:00
Régis Behmo d7eb539277 fix: ignore discussion units when forum is not enabled
This is a backport of a commit to the master branch:
https://github.com/openedx/edx-platform/pull/32464

In particular, it will fix many issues that appear when the demo course
is imported.
2023-07-31 16:00:18 +02:00
Overhang.IO 982e425d9a Merge remote-tracking branch 'origin/master' into nightly 2023-07-31 13:59:14 +00:00
Régis Behmo 2bca024daf docs: fix many verbatim issues in catalog 2023-07-31 15:52:13 +02:00
Overhang.IO 95f95c0946 Merge remote-tracking branch 'origin/master' into nightly 2023-07-28 20:03:50 +00:00
Régis Behmo 78ba4ea7cf fix: don't apply edx-platform patches in nightly 2023-07-28 21:58:10 +02:00
Régis Behmo e9723bd7dc v16.0.3 2023-07-28 21:56:37 +02:00
Overhang.IO 82eeca8f57 Merge remote-tracking branch 'origin/master' into nightly 2023-07-28 19:32:12 +00:00
Régis Behmo a1945245b8 security: fix unprivileged content libraries creation
See:
https://github.com/openedx/edx-platform/security/advisories/GHSA-3q74-3rfh-g37j
https://github.com/openedx/edx-platform/pull/32838
https://discuss.openedx.org/t/security-upcoming-security-release-for-edx-platform-on-2023-07-25/10769
2023-07-28 21:04:26 +02:00
Régis Behmo 98d7532d0d fix: copy-node-modules error with buildx 2023-07-21 12:00:25 +02:00
Kyle D. McCormick e4ddee2604 build: copy in copy-node-modules.sh for npm post-install hook
This post-install hook replaces `openedx-assets npm`.

Part of: https://github.com/openedx/edx-platform/issues/31604
2023-07-21 11:23:57 +02:00
Overhang.IO b3ef12c3fd Merge remote-tracking branch 'origin/master' into nightly 2023-07-17 08:42:51 +00:00
Kyle D. McCormick 3affd546e9 fix: set default theme by simply deleting SiteTheme objects
`tutor ... do settheme default` is meant to revert to the
default theme.  However, in its current implementation, it
creates SiteTheme objects pointing to a theme named "default",
which doesn't exist, resulting in errors like:

    Theme dirs:
    [Path('/openedx/themes')]]
    Traceback (most recent call last):
      File "/openedx/edx-platform/openedx/core/djangoapps/theming/helpers.py", line 204, in get_current_theme
	themes_base_dir=get_theme_base_dir(site_theme.theme_dir_name),
      File "/openedx/edx-platform/openedx/core/djangoapps/theming/helpers.py", line 242, in get_theme_base_dir
	raise ValueError(
    ValueError: Theme 'default' not found in any of the following themes dirs,

This works from the perspective of the user, because a missing theme is
treated as the default theme. However, the errors are unneccesary &
confusing.

By simply deleting & not recreating SiteTheme objects instead,
we are able to revert to the default theme while keeping the
logs clear of theming errors.
2023-07-17 10:19:33 +02:00
Overhang.IO bfd09fa61d Merge remote-tracking branch 'origin/master' into nightly 2023-06-22 11:13:19 +00:00
Régis Behmo b5b74bec9d v16.0.2 2023-06-22 13:00:17 +02:00
Régis Behmo 41eddd813c fix: mysql deployment on k8s
The `--ignore-db-dir` option is no longer supported on MySQL 8. See:
https://dev.mysql.com/doc/refman/8.0/en/upgrade-prerequisites.html

This option was causing the mysql container to fail.
2023-06-22 12:57:46 +02:00
Overhang.IO 808e21209a Merge remote-tracking branch 'origin/master' into nightly 2023-06-16 10:09:31 +00:00
Régis Behmo 58e4e89e48 v16.0.1 2023-06-16 11:45:17 +02:00
Régis Behmo b2067ce1f6 fix: load kube config from file
Close #860
2023-06-16 11:44:13 +02:00
Régis Behmo c575422d9c Merge branch 'master' into nightly 2023-06-14 22:49:05 +02:00
Régis Behmo 42f7819374 v16.0.0 2023-06-14 21:08:49 +02:00
Régis Behmo 64f36d910d fix: double config prompting during upgrade 2023-06-14 21:08:49 +02:00
Régis Behmo 189bfb2a7a feat: upgrade mongodb to 4.4
This is for
https://github.com/openedx/wg-build-test-release/issues/288

Note that we also upgrade mongodb from 4.0 to 4.2, because somehow this
hasn't been done in olive.
2023-06-14 21:08:49 +02:00
Régis Behmo cac8530481 fix: format output of `config printvalue` as yaml 2023-06-14 21:08:49 +02:00
Régis Behmo 69944e4028 feat: separate mounts command
Manual configuration via the `MOUNTS` setting was inconvenient. We
(re)introduce a new(ish) `tutor mounts` command. Old timers will perhaps
remember that we used to have a `tutor bindmount` command. Well, it's
back! But better and different.
2023-06-14 21:08:49 +02:00
Régis Behmo 5ce39d36e2 feat: auto-complete image names in `images build/pull/...` 2023-06-14 21:08:49 +02:00
Régis Behmo 947b37524f feat: auto build "openedx-dev" on "dev launch"
To achieve that, we introduce a new IMAGES_BUILD_REQUIRED filter.
2023-06-14 21:08:49 +02:00
Régis Behmo 17f66fb467 refactor: simplify image tag management 2023-06-14 21:08:49 +02:00
Régis Behmo 2a21b2adf3 feat: `images build openedx-dev`
We no longer run `docker-compose up --build`. Instead, users are
encouraged to build the "openedx-dev" Docker image.
2023-06-14 21:08:49 +02:00
Régis Behmo a5dd3017d7 depr: remove obsolete task actions 2023-06-14 21:08:49 +02:00
Régis Behmo 3ab0dcb9e6 depr: templated hooks
Templated hooks we almost completely useless, so we get rid of them.
This allows us to get rid entirely of hook names and hook indexes, which
makes the whole implementation much simpler. Hook removal (with
`clear_all`) is achieved thanks to weak references.
2023-06-14 21:08:49 +02:00
Régis Behmo cbe32cbc15 docs: improve all available values from `ENV_TEMPLATE_VARIABLES` 2023-06-14 21:08:49 +02:00
Régis Behmo 18ce1f2fe4 feat: persistent bind-mounts
This is an important change, where we get remove the previous `--mount`
option, and instead opt for persistent bind-mounts.

Persistent bind mounts have several advantages:
- They make it easier to remember which folders need to be bind-mounted.
- Code is *much* less clunky, as we no longer need to generate temporary
  docker-compose files.
- They allow us to bind-mount host directories *at build time* using the
  buildx `--build-context` option.
- The transition from development to production becomes much easier, as
  images will automatically be built using the host repo.

The only drawback is that persistent bind-mounts are slightly less
portable: when a config.yml file is moved to a different folder, many
things will break if the repo is not checked out in the same path.

For instance, this is how to start working on a local fork of
edx-platform:

    tutor config save --append MOUNTS=/path/to/edx-platform

And that's all there is to it. No, this fork will be used whenever we
run:

    tutor images build openedx
    tutor local start
    tutor dev start

This change is made possible by huge improvements in the build time
performance. These improvements make it convenient to re-build Docker
images often.

Related issues:
https://github.com/openedx/wg-developer-experience/issues/71
https://github.com/openedx/wg-developer-experience/issues/66
https://github.com/openedx/wg-developer-experience/issues/166
2023-06-14 21:08:49 +02:00
Régis Behmo 7972a75915 feat: leverage `RUN --mount` for faster image building
We make use of the Docker build cache to install python and nodejs
requirements faster in the case of repeated builds.

This feature is only possible for users of BuildKit, so we detect
whether `docker buildx` is available at runtime.

We do not make use of `COPY --link` because the `--link` option is
incompatible with `--chown=app:app`:
https://github.com/docker/buildx/issues/1408

For reference, see:

https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/
https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context
2023-06-14 21:08:49 +02:00
Régis Behmo 220b8296a9 feat: `config save --append/--remove KEY=VAL` options
This paves the way for persisting bind-mounts across runs, since this
setting will be a list.
2023-06-14 19:40:58 +02:00
Régis Behmo c2265c3f11 feat: simplify docker-compose permissions
It was useless to create a *-permissions job for every application.
Instead, we create a single "permissions" service. It can be extended
via the "docker-compose-permissions-command" patch.
2023-06-14 19:40:58 +02:00
Régis Behmo ee8de62770 depr: RUN_LMS, RUN_CMS settings
These tutor settings are mostly useless and make templates much more
difficult to work with.
2023-06-14 19:40:58 +02:00
Régis Behmo b2a22a6993 fix: remove useless "privileged: false" statements
These values are by default anyway.
2023-06-14 19:40:58 +02:00
Régis Behmo 39a8b46854 depr: drop support for `docker-compose`
Instead, the compose plugin must be installed.
We deprecate docker-compose because v1 is not supported starting from
the end of June 2023.

See "evolution of compose": https://docs.docker.com/compose/compose-v2/
2023-06-14 19:40:58 +02:00
Régis Behmo 11b2091e32 depr: halt compatibility with python 3.7 2023-06-14 19:40:58 +02:00
Régis Behmo 2d6b9c1767 feat: hide TOS link during registration
Registering a user was causing a 400 error because the LMS expected the
TOS checkbox to be checked, but it's not displayed in the frontend. So
we just disable it.

Close https://github.com/openedx/wg-build-test-release/issues/262
2023-06-14 19:40:58 +02:00
Régis Behmo 6dbb5baf81 feat: `importdemocourse --repo-dir=...` option
This allows us to run:

    tutor local do importdemocourse --repo=https://github.com/openedx/openedx-test-course --version=open-release/palm.master --repo-dir=test-course/course
2023-06-14 19:40:58 +02:00
Régis Behmo b3c3c4a2cc feat: upgrade to Palm
Among other changes: ORA2 file uploads were stored in a folder named
"SET-ME-PLEASE (ex.  bucket-name)" (sigh). With this change, the folder
should be automatically renamed to "openedxuploads". This issue has been
occuring since June 2019... (sigh²)

Close #707
2023-06-14 19:40:58 +02:00
Régis Behmo 253b69ffe3 feat: faster builds with registry cache
Automatically pull Docker build cache from remote registry. This
considerably improves build performances, as discovered here:
https://github.com/overhangio/test-docker-build/
2023-06-14 19:40:58 +02:00
Overhang.IO bcc4f6bf1a Merge remote-tracking branch 'origin/master' into nightly 2023-06-13 08:41:13 +00:00
Régis Behmo 9d2c1f134c v15.3.7 2023-06-13 10:21:55 +02:00
Florian Haas 30d3ba3ba8 chore: Bump MongoDB default to version 4.2.24
Bump the default image reference for MongoDB from 4.2.17 to 4.2.24, to
address a critical issue present in versions 4.2.0 through 4.2.23.

References:
https://www.mongodb.com/docs/manual/release-notes/4.2/#patch-releases
https://jira.mongodb.org/browse/WT-10461

Fixes #854.
2023-06-13 10:10:53 +02:00
Emad Rad 86f846aba3 feat: Add support for loading in-cluster config when running inside a pod
in some cases, tutor might run inside a pod, which that pod has access to a cluster via role binding and a service account. this way, there's no ./kube/config file, but kubectl commands run with no issue.

Close #843
2023-06-06 15:14:52 +02:00
Overhang.IO e73e13a6e9 Merge remote-tracking branch 'origin/master' into nightly 2023-06-01 14:10:29 +00:00
Emad Rad 1d3a215c00 feat: Add support for loading in-cluster config when running inside a pod
in some cases, tutor might run inside a pod, which that pod has access to a cluster via role binding and a service account. this way, there's no ./kube/config file, but kubectl commands run with no issue.

Close #843
2023-06-01 15:44:27 +02:00
Overhang.IO af997dbc51 Merge remote-tracking branch 'origin/master' into nightly 2023-05-29 14:19:19 +00:00
Johan Castiblanco 4bb8671f26 fix!: use correct case for authsource mongo
Update `authSource`  keyword argument to  `authsource`

Authsource was configurated in camelcase.
https://github.com/overhangio/tutor/blob/master/tutor/templates/apps/openedx/settings/partials/common_all.py#L16
Something I think is ok because pymongo uses it in camelcase.
https://pymongo.readthedocs.io/en/3.10.1/api/pymongo/mongo_client.html

However, the error was presented because edx-platform use another variable when credentials are provided **(LOWERCASE)**.
https://github.com/openedx/edx-platform/blob/master/xmodule/mongo_utils.py#L72

Looking more ,  the `auth_source `is configured with another key name:  `authsource` **(LOWERCASE)** from the kwargs.
https://github.com/openedx/edx-platform/blob/master/xmodule/mongo_utils.py#L34

This won't change the **kwargs behavior of the camelCase in pymongo `MongoClient` because pymongo has a caseInsentive method.
https://github.com/mongodb/mongo-python-driver/blob/3.12.3/pymongo/mongo_client.py#L651
 ``it's  OK to pass `authsource` instead of authSource as a keyword argument.``
2023-05-29 15:53:36 +02:00
Régis Behmo 35743eb905 Merge branch 'master' into nightly 2023-05-23 08:16:43 +02:00
Régis Behmo 185a13a2e1 v15.3.6 2023-05-22 18:17:34 +02:00
Régis Behmo 2233c3422a feat: upgrade to open-release/olive.4 2023-05-22 18:16:39 +02:00
Overhang.IO ca69eb31d3 Merge remote-tracking branch 'origin/master' into nightly 2023-05-03 16:46:39 +00:00
Kyle McCormick 2e276cbb09 docs: explain why docker-compose.jobs.yml exists
Based on:
https://github.com/overhangio/tutor/issues/642#issuecomment-1483970113
2023-05-03 17:51:13 +02:00
Overhang.IO a6ac7fe354 Merge remote-tracking branch 'origin/master' into nightly 2023-04-28 07:13:23 +00:00
Régis Behmo a302acc228 v15.3.5 2023-04-28 08:20:44 +02:00
Overhang.IO a1b1945908 Merge remote-tracking branch 'origin/master' into nightly 2023-04-26 09:39:05 +00:00
Régis Behmo 19016b8ab1 feat: add `do sqlshell` command
An optional `--db=openedx` argument can be passed to the job command.

This should close
https://github.com/openedx/wg-developer-experience/issues/51
2023-04-26 10:36:13 +02:00
Régis Behmo 6257c1c7ac feat: improve edx-platform logging by silencing a few warnings
These warnings were occurring when launching a django shell ("shell"
command) or a development server ("runserver").
2023-04-26 10:36:13 +02:00
Régis Behmo 586045143f feat: add a `do print-edx-platform-setting` command
The command is pretty straightforward, but quite convenient.
2023-04-26 10:36:13 +02:00
Régis Behmo b3c5c9685b feat: custom importable courses
This makes it possible to import courses not just from the demo repo.

Close #730
2023-04-26 10:36:13 +02:00
Overhang.IO 5326882908 Merge remote-tracking branch 'origin/master' into nightly 2023-04-13 14:04:13 +00:00
Régis Behmo a392a93bdd v15.3.4 2023-04-13 15:15:47 +02:00
Régis Behmo 0887691cc4
feat: upgrade to open-release/olive.3 2023-04-12 21:46:04 +02:00
Overhang.IO c3da9c5bef Merge remote-tracking branch 'origin/master' into nightly 2023-03-22 15:03:35 +00:00
Régis Behmo 679fe5f86b v15.3.3 2023-03-22 10:10:08 -04:00
Overhang.IO c9cdf293ef Merge remote-tracking branch 'origin/master' into nightly 2023-03-20 15:28:35 +00:00
Régis Behmo 3377ffc38a fix: v0 plugin patch ordering
v0 plugin patches were directly added to ENV_PATCH, while v1 patches
were added to ENV_PATCHES. ENV_PATCHES items are forwarded to ENV_PATCH
later at runtime, which means that yaml plugin patches were always
loaded before v1 patches.

This was causing weird ordering issues, as discussed here:
https://discuss.openedx.org/t/using-mfe-config-to-set-logo-trademark-url-for-the-footer-component-in-olive/9578
2023-03-20 16:15:12 +01:00
Overhang.IO 465d8075b5 Merge remote-tracking branch 'origin/master' into nightly 2023-03-20 14:13:55 +00:00
Régis Behmo fa9e86e188 improvement: COPY dockerize for faster build
Dockerize now ships with multi-arch Docker images, so we can just
COPY the binary from these images. This allows us to skip an image
layer.
2023-03-20 14:20:30 +01:00
Régis Behmo 28dce8c51a improvement: customisable `docker build` command
This paves the way for `docker buildx build` and better caching.

For instance, with this change you can try out the following plugin,
which should make image building much faster in CI:
https://gist.github.com/regisb/4049622ec4b48cbd48c89ec708dc5252
(not ready for production just yet, we still need to build and push the
images)
2023-03-20 14:20:30 +01:00
Régis Behmo ff5357cdc0 improvement: faster build with `npm ci` 2023-03-20 14:20:30 +01:00
Régis Behmo f42abe18ad feat: highlight enabled plugins with
In the output of `plugins list` it's difficult to see which plugins are
enabled at a glance. This change adds a more visible checkmark to the
output.

Ex:

	$ tutor plugins list
	NAME            STATUS          VERSION
	cairn            enabled      15.0.3
	discovery       installed       15.0.0
	ecommerce       installed       15.0.1
	forum           installed       14.0.0
	mfe              enabled      15.0.5
	minio           installed       15.1.0
2023-03-20 14:19:44 +01:00
Overhang.IO ea1ed85694 Merge remote-tracking branch 'origin/master' into nightly 2023-03-15 12:47:31 +00:00
Kyle McCormick f984361d9c
feat: full edx-platform setup with `tutor dev launch -m ...`
Before this commit, setting up an edx-platform development environment
took multiple steps:

   tutor dev launch
   tutor dev run --mount=/path/to/edx-platform lms bash
   >> pip install -e .
   >> npm clean-install
   >> openedx-assets build --env=dev

This commit moves the steps under ``run`` into an init task, which
is automatically run by ``launch``. Thus, setup is now one command:

   tutor dev launch --mount=edx-platform

These extra init steps are only applicable when bind-mounting
edx-platform (because bind-mounting the repository overrides
some important artifacts that exist on the image, which must be
re-generated). Thus, the new init tasks exists early if it detects
that it is *not* operating on a bind-mounted repository.

Finally, we try to simplify the Open edX development docs so that
it is clearer how bind-mounting fits into the development process.

These bind-mounts:

* ../build/openedx/themes:/openedx/themes
* ../build/openedx/requirements:/openedx/requirements

existed in the dev lms and cms containers, but they did
not exist in the lms-job and cms-job containers.

This means that themes and requirements that were *built into the
image* would exist in the job containers, but live updates to the
themes and requirements would not apply.

To resolve this, we set ``volumes:`` on the lms-job and cms-job
services so that they match the volumes for the normal lms and
cms services.

Part of: https://github.com/openedx/wg-developer-experience/issues/146
Closes: https://github.com/openedx/wg-developer-experience/issues/152

This works around (but does not close) these related issues:
* https://github.com/openedx/wg-developer-experience/issues/150
* https://github.com/openedx/wg-developer-experience/issues/151
2023-03-15 13:31:49 +01:00
Overhang.IO ddd6987852 Merge remote-tracking branch 'origin/master' into nightly 2023-03-15 11:09:18 +00:00
Moisés González aac0355183 feat: configure uwsgi through an ini file 2023-03-15 11:19:22 +01:00