136 Commits

Author SHA1 Message Date
Syed Muhammad Dawoud Sheraz Ali
1d57879cc8 feat!: Rename branches master->release, nightly->main 2024-11-27 22:33:41 +05:00
Eugene Dyudyunov
d56924e455 fix: pathway API permissions
Grant staff permissions to the catalog_service_user to
fix 403 error during the pathways fetching.

Note: this issue is also described in the readme.

Related discussions:
- https://discuss.openedx.org/t/tutor-discovery-service-api-v1-pathways-403/7995
- https://discuss.openedx.org/t/tutor-discovery-program-issue/10283
2024-07-23 14:34:44 +05:00
Muhammad Faraz Maqsood
a40d767426 refactor: address comments 2024-07-01 19:41:37 +05:00
Muhammad Faraz Maqsood
c5e56dfa2c fix: permission denied error for media directory
"""
discovery-1  | PermissionError: [Errno 13] Permission denied: '/openedx/discovery/course_discovery/media/media'
discovery-1  | 2024-06-25 13:35:29,038 ERROR 7 [django.request] /openedx/venv/lib/python3.8/site-packages/django/utils/log.py:241 - Internal Server Error: /admin/course_metadata/program/9/change/
discovery-1  | Traceback (most recent call last):
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
discovery-1  |     response = get_response(request)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
discovery-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 688, in wrapper
discovery-1  |     return self.admin_site.admin_view(view)(*args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 134, in _wrapper_view
discovery-1  |     response = view_func(request, *args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/views/decorators/cache.py", line 62, in _wrapper_view_func
discovery-1  |     response = view_func(request, *args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/contrib/admin/sites.py", line 242, in inner
discovery-1  |     return view(request, *args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django_object_actions/utils.py", line 57, in change_view
discovery-1  |     return super(BaseDjangoObjectActions, self).change_view(
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1889, in change_view
discovery-1  |     return self.changeform_view(request, object_id, form_url, extra_context)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 46, in _wrapper
discovery-1  |     return bound_method(*args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py", line 134, in _wrapper_view
discovery-1  |     response = view_func(request, *args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1747, in changeform_view
discovery-1  |     return self._changeform_view(request, object_id, form_url, extra_context)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1798, in _changeform_view
discovery-1  |     self.save_model(request, new_object, form, not add)
discovery-1  |   File "/openedx/discovery/./course_discovery/apps/course_metadata/admin.py", line 462, in save_model
discovery-1  |     super().save_model(request, obj, form, change)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/simple_history/admin.py", line 228, in save_model
discovery-1  |     super().save_model(request, obj, form, change)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1227, in save_model
discovery-1  |     obj.save()
discovery-1  |   File "/openedx/discovery/./course_discovery/apps/course_metadata/models.py", line 3613, in save
discovery-1  |     super().save(*args, **kwargs)
discovery-1  |   File "/openedx/discovery/./course_discovery/apps/course_metadata/models.py", line 102, in save
discovery-1  |     super().save(*args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django_extensions/db/models.py", line 22, in save
discovery-1  |     super().save(**kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/base.py", line 814, in save
discovery-1  |     self.save_base(
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/model_utils/tracker.py", line 375, in inner
discovery-1  |     return original(instance, *args, **kwargs)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/base.py", line 877, in save_base
discovery-1  |     updated = self._save_table(
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/base.py", line 981, in _save_table
discovery-1  |     values = [
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/base.py", line 985, in <listcomp>
discovery-1  |     (getattr(self, f.attname) if raw else f.pre_save(self, False)),
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/fields/files.py", line 317, in pre_save
discovery-1  |     file.save(file.name, file.file, save=False)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/stdimage/models.py", line 32, in save
discovery-1  |     super().save(name, content, save)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/fields/files.py", line 93, in save
discovery-1  |     self.name = self.storage.save(name, content, max_length=self.field.max_length)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/files/storage/base.py", line 38, in save
discovery-1  |     name = self._save(name, content)
discovery-1  |   File "/openedx/venv/lib/python3.8/site-packages/django/core/files/storage/filesystem.py", line 87, in _save
discovery-1  |     os.makedirs(directory, exist_ok=True)
discovery-1  |   File "/usr/lib/python3.8/os.py", line 213, in makedirs
discovery-1  |     makedirs(head, exist_ok=exist_ok)
discovery-1  |   File "/usr/lib/python3.8/os.py", line 213, in makedirs
discovery-1  |     makedirs(head, exist_ok=exist_ok)
discovery-1  |   File "/usr/lib/python3.8/os.py", line 223, in makedirs
discovery-1  |     mkdir(name, mode)
discovery-1  | PermissionError: [Errno 13] Permission denied: '/openedx/discovery/course_discovery/media/media'
"""
2024-07-01 19:41:37 +05:00
Muhammad Faraz Maqsood
d8b0e6a327 fix: images does not persist
On stopping discovery container and deleting it
And starting it again, images gives 404
2024-07-01 19:41:37 +05:00
Régis Behmo
14684ef2ca fix: docker build deprecation warnings
With the latest Docker upgrade, we got the following warnings during
build:

	FromAsCasing: 'as' and 'FROM' keywords' casing do not match
	LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format
2024-06-21 17:12:57 +02:00
Muhammad Faraz Maqsood
48c13d7105 v18.0.0 2024-06-20 01:51:37 +02:00
Muhammad Faraz Maqsood
e63be4fcc3 fix: wrong mime type by adding mime-support
The admin's stylesheets e.g.https://{{DISCOVERY_HOST}}/static/admin/css/base.css, were not loaded because its MIME type appears to be "text/plain", It should be "text/css".
2024-06-07 22:19:39 +05:00
Muhammad Faraz Maqsood
34691b58e2 docs: add a comment explaining the need of root user
=> [minimal  7/19] RUN echo "{}" > /openedx/config.yml                                                                          0.2s
 => ERROR [minimal  8/19] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.3.36 --depth 1                     0.4s
------
 > importing cache manifest from docker.io/overhangio/openedx-discovery:17.0.0-nightly-cache:
------
------
 > [minimal  8/19] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.3.36 --depth 1:
0.341 fatal: could not create work tree dir '/opt/pyenv': Permission denied
------
Dockerfile:36
--------------------
  34 |     ENV PYENV_ROOT /opt/pyenv
  35 |     # USER root
  36 | >>> RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1
  37 |     # Install Python
  38 |     RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION
--------------------
ERROR: failed to solve: process "/bin/sh -c git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1" did not complete successfully: exit code: 128
2024-05-02 15:34:21 +05:00
Muhammad Faraz Maqsood
d27b7523e1 fix: fix compile messages error
ModuleNotFoundError: No module named '_sqlite3'
fixed above error on line
>>> RUN python manage.py compilemessages
2024-05-02 15:34:21 +05:00
Muhammad Faraz Maqsood
213e4dbc0d enhancement: upgrade python version to 3
.12.2
2024-05-02 15:34:21 +05:00
Muhammad Faraz Maqsood
96d6ba9ca2 v17.0.1 2024-04-25 11:58:24 +05:00
Andrés González
ecff88eb40 fix: Create media directory in Dockerfile.
If the media directory does not exist at the time that
uwsgi is launched, the mapping to /media to serve
media files will not be created.
2024-04-25 11:47:02 +05:00
Muhammad Faraz Maqsood
0034aaddb3 fix: fix volumes empty list error during tutor dev launch 2024-03-13 13:06:11 +05:00
Muhammad Faraz Maqsood
90abd11ca6 Revert "fix: fix empty volumes list"
This reverts commit 69c8ba5e9c49a7f085b6542612b4f2fc27432208.
2024-03-13 13:00:34 +05:00
Muhammad Faraz Maqsood
69c8ba5e9c fix: fix empty volumes list
this error occurs during dev launch
2024-03-13 12:59:18 +05:00
Max Sokolski
b3bc099364 feat: add mounts for docker-compose-dev-services 2024-03-11 16:50:39 +05:00
Régis Behmo
b8f6ad8c9c fix: remove pkg_resources for compatibility with python 3.12
pkg_resources is a package that is unavailable in python 3.12, unless
setuptools is explicitely installed. Turns out, there are replacement
functions coming from importlib_resources, which can be obtained from
the importlib-resources pypi package. This package will be installed
with tutor starting from 17.0.2.
2024-02-12 11:57:51 +01:00
Zia Fazal
52af6adb57 feat: upgrade to quince 2023-12-11 18:12:10 +01:00
Overhang.IO
073fe08a04 Merge remote-tracking branch 'origin/master' into nightly 2023-12-09 18:15:12 +00:00
Régis Behmo
18cce706a7 v16.0.2 2023-12-09 19:05:52 +01:00
Muhammad Faraz Maqsood
e30a78936d fix: banner image base urls
close #46
2023-12-09 19:02:06 +01:00
Omar Al-Ithawi
e766c92c86 chore: use course-discovery openedx-atlas requirement
course-discovery now maintains its own base.in requirement for atlas
the tutor-discovery no longer needs to install it.
2023-12-08 11:00:30 +01:00
Overhang.IO
829025ff26 Merge remote-tracking branch 'origin/master' into nightly 2023-11-24 03:49:54 +00:00
Emad Rad
0f9ac7f4d4 chore: cleanup 2023-11-24 08:39:38 +05:00
Emad Rad
e18fede815 fix: typing added 2023-11-24 08:39:38 +05:00
Overhang.IO
0adea6785e Merge remote-tracking branch 'origin/master' into nightly 2023-11-21 10:40:21 +00:00
Muhammad Faraz Maqsood
8105cd9230 feat: introduce course discovery repository and version settings 2023-11-21 15:30:13 +05:00
Régis Behmo
902c223370 Merge branch 'master' into nightly 2023-11-20 17:46:41 +01:00
Régis Behmo
411a601ba9 feat: simplify nightly version management
By pulling the version suffix from tutor, we avoid git conflicts when
merging the release branch in nightly.
2023-11-20 17:39:47 +01:00
Overhang.IO
05f0bfe9d5 Merge remote-tracking branch 'origin/master' into nightly 2023-11-08 09:03:50 +00:00
Muhammad Faraz Maqsood
d3ab250f57 v16.0.1 2023-11-08 14:02:04 +05:00
Overhang.IO
16e90e10c4 Merge remote-tracking branch 'origin/master' into nightly 2023-11-08 07:02:12 +00:00
Muhammad Faraz Maqsood
811e792a17
fix: wrong variable name for extra_requirement for pip extra requirements
Co-authored-by: Muhammad Faraz  Maqsood <faraz.maqsood@a006-01130.home>
2023-11-08 07:50:17 +01:00
Omar Al-Ithawi
b9dd940903 feat: add minimal atlas step to the build
This contribution is part of the [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) which is sparked by the [Translation Infrastructure update OEP-58](https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification).
2023-10-16 18:27:29 +02:00
Régis Behmo
21b82de63f fix: missing pkg-config in image build
Build was failing with the following error during the installation of
mysqlclient==2.2.0:

	#39 22.19 Collecting mysqlclient==2.2.0 (from -r requirements/production.txt (line 435))
	#39 22.20   Downloading mysqlclient-2.2.0.tar.gz (89 kB)
	#39 22.20      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.5/89.5 kB 95.8 MB/s eta 0:00:00
	#39 22.24   Installing build dependencies: started
	#39 24.79   Installing build dependencies: finished with status 'done'
	#39 24.81   Getting requirements to build wheel: started
	#39 25.07   Getting requirements to build wheel: finished with status 'error'
	#39 25.08   error: subprocess-exited-with-error
	#39 25.08
	#39 25.08   × Getting requirements to build wheel did not run successfully.
	#39 25.08   │ exit code: 1
	#39 25.08   ╰─> [24 lines of output]
	#39 25.08       /bin/sh: 1: pkg-config: not found
	#39 25.08       /bin/sh: 1: pkg-config: not found
	#39 25.08       Trying pkg-config --exists mysqlclient
	#39 25.08       Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127.
	#39 25.08       Trying pkg-config --exists mariadb
	#39 25.08       Command 'pkg-config --exists mariadb' returned non-zero exit status 127.
	#39 25.08       Traceback (most recent call last):
	#39 25.08         File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
	#39 25.08           main()
	#39 25.08         File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
	#39 25.08           json_out['return_val'] = hook(**hook_input['kwargs'])
	#39 25.08         File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
	#39 25.08           return hook(config_settings)
	#39 25.08         File "/tmp/pip-build-env-5hyrozx4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
	#39 25.08           return self._get_build_requires(config_settings, requirements=['wheel'])
	#39 25.08         File "/tmp/pip-build-env-5hyrozx4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
	#39 25.08           self.run_setup()
	#39 25.08         File "/tmp/pip-build-env-5hyrozx4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in run_setup
	#39 25.08           exec(code, locals())
	#39 25.08         File "<string>", line 154, in <module>
	#39 25.08         File "<string>", line 48, in get_config_posix
	#39 25.08         File "<string>", line 27, in find_package_name
	#39 25.08       Exception: Can not find valid pkg-config name.
	#39 25.08       Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
	#39 25.08       [end of output]
2023-09-08 09:53:08 +02:00
Régis Behmo
b5c266efdb fix: nightly package version
The package version may not include the "-nightly" suffix. Otherwise,
`pip install .` fails with:

    setuptools.extern.packaging.version.InvalidVersion: Invalid version: '...-nightly'
2023-09-07 18:39:53 +02:00
Régis Behmo
06536ceb4d Merge branch 'master' into nightly 2023-06-15 01:01:23 +02:00
Muhammad Faraz Maqsood
286acdae0b feat: upgrade to palm 2023-06-15 00:42:53 +02:00
Régis Behmo
f09d6140ec fix: nightly package version
The package version number may not include the "-nightly" suffix.
Otherwise, installation fails with:

   setuptools.extern.packaging.version.InvalidVersion: Invalid version: '15.0.7-nightly'
2023-05-26 18:47:48 +02:00
Régis Behmo
e8cf712a0b feat: label nightly version
This is to address https://github.com/overhangio/tutor-mfe/issues/122
As a consequence of this change, images will be tagged with a "-nightly"
suffix. Next, we'll probably have to build them periodically in CI.
2023-05-26 18:26:28 +02:00
Régis Behmo
dbcf969a7a chore: handle nightly version numbers
Here, we make it possible to add a "-nightly" suffix to the package
version. This suffix will find its way to the Docker image tags. Thus,
the nightly branch will have different image tags. This will resolve
some confusion, as image tags are currently identical in nightly and
master.
2023-05-26 16:28:10 +02:00
Navin Karkera
38a538a675 feat: extra pip requirements 2023-05-03 17:49:14 +02:00
Abderraouf Mehdi Bouhali
c0fadf4faa fix(build): load NPM_REGISTRY from config 2022-12-31 18:08:39 +01:00
Régis Behmo
36bbec4a9e feat: upgrade to olive 2022-12-12 19:23:02 +01:00
Régis Behmo
fec9f3202c v14.0.2 2022-11-21 18:13:03 +01:00
Régis Behmo
27b76c0096 fix: rsa_import_key is undefined
See: https://discuss.openedx.org/t/tutor-4-2-0-rsa-import-key-is-undefined/8763/1
2022-11-21 16:55:09 +01:00
Régis Behmo
84886feaa7 v14.0.1 2022-07-04 06:24:49 +02:00
Régis Behmo
a1eef4cd78 chore: simplify DJANGO_SETTINGS_MODULE configuration
The Docker image now defaults to the tutor production settings, which allows us
to remove the environment variable from the docker-compose and k8s
configuration files.
2022-07-04 06:24:49 +02:00
Régis Behmo
eac59cd82d fix: ConnectionError during init
Since we introduced `tutor dev quickstart`, we must be able to initialize the
discovery container in dev mode. The problem is that the "openedx" partner is
unavailable in dev mode. Thus, we need to default to the "dev" partner in dev
mode.

Close #33.
2022-07-04 06:24:49 +02:00