7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-01 22:00:48 +00:00
Commit Graph

177 Commits

Author SHA1 Message Date
Régis Behmo
0d997c9479 feat: auto-mount edx-platform python requirements
These changes make to possible to run:

    tutor mounts add /path/to/my-xblock

The xblock directory with then be auto-magically bind-mounted in the
"openedx" image at build time, and the lms*/cms* containers at run time.

This makes it effectively possible to work as a developer on
edx-platform requirements.

We take the opportunity to move some openedx-specific code to a
dedicated module.

Close https://github.com/openedx/wg-developer-experience/issues/177
2023-12-10 22:57:08 +01:00
Emad Rad
f4dc508c19
fix: 600GB openedx-dev image on macOS
On macOS, building the "openedx-dev" Docker image resulted in an image that required more than 600 GB of disk space. This was due to the `adduser` command which was called with a user ID of 2x10⁹ (on macOS only). This resulted in a very large /var/log/faillog file, hence the image size.

Related upstream discussion: https://github.com/moby/moby/issues/5419
Close https://github.com/openedx/wg-developer-experience/issues/178
2023-10-11 10:02:03 +02:00
Régis Behmo
575a56b767 fix: build error caused by removed py2neo package
On Oct. 10, py2neo package was abruptly removed from pypi, GitHub, and
the py2neo website now displays just a super funny meme: https://py2neo.org/

Yes, we should get rid of that dependency, but we are still supposed to
support existing users. So we install py2neo from our fork.
2023-10-10 11:37:40 +02:00
Régis Behmo
00c58e7a9e chore: upgrade nodeenv to fix nodejs install
We upgrade nodeenv as an attempt to fix incomplete reads.

From time to time we face the following error:

	#67 [linux/amd64 nodejs-requirements 2/4] RUN nodeenv /openedx/nodeenv --node=16.14.0 --prebuilt
	#67 0.338  * Install prebuilt node (16.14.0) .Incomplete read while readingfrom https://nodejs.org/download/release/v16.14.0/node-v16.14.0-linux-x64.tar.gz
	#67 204.1 .
	#67 204.1 Traceback (most recent call last):
	#67 204.1   File "/openedx/venv/bin/nodeenv", line 8, in <module>
	#67 204.1     sys.exit(main())
	#67 204.1   File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 1104, in main
	#67 204.1     create_environment(env_dir, args)
	#67 204.1   File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 980, in create_environment
	#67 204.1     install_node(env_dir, src_dir, args)
	#67 204.1   File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 739, in install_node
	#67 204.1     install_node_wrapped(env_dir, src_dir, args)
	#67 204.1   File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 762, in install_node_wrapped
	#67 204.1     download_node_src(node_url, src_dir, args)
	#67 204.1   File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 602, in download_node_src
	#67 204.1     with ctx as archive:
	#67 204.1   File "/opt/pyenv/versions/3.8.15/lib/python3.8/contextlib.py", line 113, in __enter__
	#67 204.1     return next(self.gen)
	#67 204.1   File "/openedx/venv/lib/python3.8/site-packages/nodeenv.py", line 573, in tarfile_open
	#67 204.1     tf = tarfile.open(*args, **kwargs)
	#67 204.1   File "/opt/pyenv/versions/3.8.15/lib/python3.8/tarfile.py", line 1601, in open
	#67 204.1     saved_pos = fileobj.tell()
	#67 204.1 AttributeError: 'bytes' object has no attribute 'tell'

This change was added to 1.8.0 as an attempt to resolve the issue: https://github.com/ekalinin/nodeenv/pull/329

We are not sure it will work every time, but it can't hurt.
2023-09-13 11:01:04 +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
Régis Behmo
a6338e2880 feat: upgrade to open-release/palm.2 2023-08-09 22:41:34 +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
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
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
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
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
0887691cc4
feat: upgrade to open-release/olive.3 2023-04-12 21:46:04 +02: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
ff5357cdc0 improvement: faster build with npm ci 2023-03-20 14:20:30 +01: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
Moisés González
aac0355183 feat: configure uwsgi through an ini file 2023-03-15 11:19:22 +01:00
Maria Grimaldi
a373e24b2c fix: use supported YouTube API for transcripts imports cherry-pick 2023-03-07 18:38:24 +01:00
Régis Behmo
91385ba8d7 feat: upgrade to open-release/olive.2 2023-02-10 11:07:22 +01:00
Régis Behmo
9df3b18c31 sec: fix LTI consumer xblock grading
See advisory:
https://github.com/openedx/xblock-lti-consumer/security/advisories/GHSA-7j9p-67mm-5g87
Discussion:
https://discuss.openedx.org/t/upcoming-security-release-xblock-lti-consumer/9165
Pull requests:
https://github.com/openedx/xblock-lti-consumer/pull/331
https://github.com/openedx/edx-platform/pull/31724
2023-02-09 11:55:18 +01:00
Régis Behmo
ca04b245f3 fix: backport fix for html component editing in studio
See: https://discuss.openedx.org/t/text-component-does-not-remove-text-with-link-or-insert-a-link-to-text/9029
2023-01-18 07:51:24 +01:00
Régis Behmo
c70a6a5e80 feat: upgrade ipdb/ipython in openedx-dev image 2022-12-13 17:25:58 +01:00
Régis Behmo
c26999ec65 feat: upgrade to olive 2022-12-12 16:55:07 +01:00
Régis Behmo
a6c6fde867 fix: installation of local requirements
The `compilejsi18n` command was failing during image building because the
Open-edX package was not installed properly. The reason for that was an earlier
change where we got rid of the `pip install -r requirements/edx/local.in`
command. Installing the Open-edX package was part of this requirement file.

The local.in requirements file no longer exists, but we still need to `pip
install -e .` the edx-platform repo. To run this command we need both the
edx-platform repo and the virtualenv.

The good news is that there are no more local requirements in the base.txt
requirements file. This means that we no longer have to COPY the edx-platform
repo in the requirements installation step. Thus, changes in edx-platform will
no longer trigger a rebuild of the pip requirements; this means that re-builds
will be much faster when making changes to edx-platform.

Note that plugins that implemented the
"openedx-dockerfile-post-python-requirements" patch and that needed access to
the edx-platform repo will no longer work. Instead, these plugins should
implement the "openedx-dockerfile-pre-assets" patch. This scenario should be
very rare, though.

Close #726
2022-10-04 09:18:04 +02:00
Régis Behmo
2f442d7db3 fix: edx-platform requirement installation
The local requirements files does not exist since local requirements were all
removed from the edx-platform repo. As a consequence, the nightly build was
broken.
2022-09-30 12:06:28 +02:00
Overhang.IO
435de0f21f Merge remote-tracking branch 'origin/master' into nightly 2022-09-08 10:03:17 +00:00
Régis Behmo
b4f905c2aa feat: upgrade i18n openedx strings to nutmeg.2
Strings could not be pulled from transifex because the file names were
incorrect. This is now fixed and we are now able to pull the i18n strings from
the nutmeg.2 tag.
2022-09-08 11:20:49 +02:00
Kyle McCormick
d9314b7507 build: prepare Dockerfile for common/lib removal
Soon, running:

  pip install -r ./requirements/edx/base.txt

in edx-platform will no longer install the local
project (that is, `-e .`). To prepare for that change,
we add the line:

  pip install -e .

to the Dockerfile. This is backwards-compatible.
More details:
https://openedx.atlassian.net/browse/BOM-2575?focusedCommentId=613181
2022-09-06 16:15:39 +02:00
Sofiane Bebert
6674e267de feat: upgrade all apps to open-release/nutmeg.2 2022-08-21 09:15:00 +01:00
Régis Behmo
8e188dc946 Merge branch 'master' into nightly 2022-07-25 16:13:05 +02:00
Régis Behmo
5b5700eff4 fix: build openedx-dev image when host user is root
Sometimes, the host user is root: this may happen when tutor is run with
"sudo" (which is not recommended) or on Windows. In such cases, building
the image should not fail, but default to a reasonable user. Also, when
we pass an invalid APP_USER_ID as a build arg, then we should fail with
an explicit message.

See this conversation:
https://discuss.overhang.io/t/problem-with-dev-image-build-useradd-uid-0-is-not-unique/2406
2022-07-09 00:09:20 +02:00
David Ormsbee
ac3b4e3065 fix: apply LTI 1.3 XBlock patch fix 3.4.7 over nutmeg.1
The actual merge of this into open-release/nutmeg.master is here:
  https://github.com/openedx/edx-platform/pull/30716
2022-07-08 23:48:45 +02:00
Maria Grimaldi
4b8cf4ccc7 fix: update problem with hint according newer python versions 2022-06-27 09:15:56 +02:00
Overhang.IO
7f1162d29b Merge remote-tracking branch 'origin/master' into nightly 2022-06-22 10:09:09 +00:00
Carlos Muniz
4dac13923f
feat: default to ipdb as PYTHONBREAKPOINT
PYTHONBREAKPOINT has been exposed as an environment variable in
the openedx Dockerfile available to be changed in config.yml. The docs have also been changed to recommend using
breakpoint and explaining how PYTHONBREAKPOINT can be modified to use a
custom debugger.

Close https://github.com/overhangio/2u-tutor-adoption/issues/45
2022-06-22 11:26:50 +02:00
Régis Behmo
c014a05504 Merge branch 'master' into nightly 2022-06-16 18:04:03 +02:00
iamcristye@outlook.com
e5850eb02e improvement: use git am instead of cherry-pick 2022-06-16 17:19:54 +02:00
Régis Behmo
4af9fed338 Merge branch 'master' into nightly 2022-06-09 20:01:26 +02:00
Régis Behmo
c4388e134c v14.0.0: upgrade to Nutmeg
- 💥 [Feature] Upgrade to Nutmeg: (by @regisb)
    - 💥 [Feature] Persistent grades are now enabled by default.
    - [Bugfix] Remove edX references from bulk emails ([issue](https://github.com/openedx/build-test-release-wg/issues/100)).
    - [Improvement] For Tutor Nightly (and only Nightly), official plugins are now installed from their nightly branches on GitHub instead of a version range on PyPI. This will allow Nightly users to install all official plugins by running ``pip install -e ".[full]"``.
    - [Bugfix] Start MongoDB when running migrations, because a new data migration fails if MongoDB is not running
2022-06-09 19:18:20 +02:00
Régis Behmo
5faf03e3b3 fix: revert back to "npm install"
"npm ci" is broken in master because of the node 16 upgrade. See discussion
here:
https://github.com/openedx/edx-platform/pull/30459#issuecomment-1136888560

We will revert to "npm ci" once the node 16 upgrade is complete.
2022-06-03 18:54:21 +02:00
Régis Behmo
33c5c3269c chore: upgrade to node 16 in openedx Docker image 2022-06-03 18:54:21 +02:00
Régis Behmo
79eca380f6 security: apply logout redirect security patch 2022-06-03 14:58:32 +02:00
Overhang.IO
e942fca24f Merge remote-tracking branch 'origin/master' into nightly 2022-05-30 09:10:54 +00:00
Daniel Rudnitski
bae65ff701 feat: patch for openedx-dockerfile-final 2022-05-30 10:34:53 +02:00
Régis Behmo
26c68c6b1d Merge branch 'master' into nightly 2022-05-24 11:57:25 +02:00
Régis Behmo
4bbeb4b84f feat: pinned nodejs requirements with npm ci
Contrary to what we might expect, `npm install` does not install pinned
requirements from a project's package-lock.json. That's the responsibility of
`npm ci`: https://docs.npmjs.com/cli/v8/commands/npm-ci

Running `npm ci` is also *much* faster than `npm install`, so that's a huge win.

See this issue for reference: https://github.com/openedx/frontend-wg/issues/100
2022-05-24 11:17:14 +02:00
Régis Behmo
3290def1ef fix: broken file upload in studio
see discussion: https://discuss.overhang.io/t/missing-js-css-files-missing-from-openedx-docker-image-in-studio/2629
see pull request: https://github.com/openedx/edx-platform/pull/30309
(thanks @uetuluk!)
2022-05-06 13:51:07 +01:00
Régis Behmo
224cd6c19f Merge branch 'master' into nightly 2022-04-20 22:01:14 +02:00
Régis Behmo
658d6957db sec: apply rate limiting security fix 2022-04-20 19:48:34 +02:00
Régis Behmo
f147fa93f1 Merge branch 'master' into nightly 2022-04-15 16:07:33 +02:00
Régis Behmo
d5a790d5d0 refactor: get rid of the openedx Docker entrypoint
The entrypoint in the "openedx" Docker image was used only to define the
DJANGO_SETTINGS_MODULE environment variable, based on SERVICE_VARIANT and
SETTINGS. We ditch SETTINGS in favour of defining explicitely
DJANGO_SETTINGS_MODULE.

The problem with the Docker entrypoint is that it was bypassed whenever we ran
`tutor local exec` or `tutor k8s exec`. By removing it we make it simpler for
end-users to run manage.py commands in kubernetes.
2022-04-15 15:37:56 +02:00