Conversation
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
SethosII
left a comment
There was a problem hiding this comment.
@vsoch I tested the branch.
There is still an update of Django in step 18 during the built of the docker image when I enable LDAP:
Step 18/40 : RUN if $ENABLE_LDAP; then pip install django-auth-ldap ; fi;
---> Running in a13f997ddc98
Collecting django-auth-ldap
Downloading django_auth_ldap-4.2.0-py3-none-any.whl (20 kB)
Collecting python-ldap>=3.1
Downloading python-ldap-3.4.3.tar.gz (377 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 377.4/377.4 kB 14.9 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting Django>=3.2
Downloading Django-4.1.7-py3-none-any.whl (8.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.1/8.1 MB 70.5 MB/s eta 0:00:00
Collecting asgiref<4,>=3.5.2
Downloading asgiref-3.6.0-py3-none-any.whl (23 kB)
Requirement already satisfied: sqlparse>=0.2.2 in /usr/local/lib/python3.9/site-packages (from Django>=3.2->django-aut
h-ldap) (0.4.3)
Requirement already satisfied: pyasn1>=0.3.7 in /usr/local/lib/python3.9/site-packages (from python-ldap>=3.1->django-
auth-ldap) (0.4.8)
Requirement already satisfied: pyasn1-modules>=0.1.5 in /usr/local/lib/python3.9/site-packages (from python-ldap>=3.1-
>django-auth-ldap) (0.2.8)
Building wheels for collected packages: python-ldap
Building wheel for python-ldap (pyproject.toml): started
Building wheel for python-ldap (pyproject.toml): finished with status 'done'
Created wheel for python-ldap: filename=python_ldap-3.4.3-cp39-cp39-linux_x86_64.whl size=314179 sha256=7588ee340419
0049d8d1e97013026b81e5af880f062f155657abcbcda17c80b1
Stored in directory: /root/.cache/pip/wheels/79/43/5e/1a029878450f5949466f351db7ff4c5459c0b1937999f39000
Successfully built python-ldap
Installing collected packages: asgiref, python-ldap, Django, django-auth-ldap
Attempting uninstall: Django
Found existing installation: Django 2.2.28
Uninstalling Django-2.2.28:
Successfully uninstalled Django-2.2.28
Successfully installed Django-4.1.7 asgiref-3.6.0 django-auth-ldap-4.2.0 python-ldap-3.4.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system pac
kage manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container a13f997ddc98
---> b7fff61b585c
And you replaced some imports of django.conf.urls but there are still imports of it in the hub/plugins/*/urls.py files. This leads to errors during startup:
uwsgi_1 | Traceback (most recent call last):
uwsgi_1 | File "/code/manage.py", line 9, in <module>
uwsgi_1 | execute_from_command_line(sys.argv)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execut
e_from_command_line
uwsgi_1 | utility.execute()
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execut
e
uwsgi_1 | self.fetch_command(subcommand).run_from_argv(self.argv)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_a
rgv
uwsgi_1 | self.execute(*args, **cmd_options)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 443, in execute
uwsgi_1 | self.check() uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 475, in check
uwsgi_1 | all_issues = checks.run_checks(
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/checks/registry.py", line 88, in run_checks
uwsgi_1 | new_errors = check(app_configs=app_configs, databases=databases)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/checks/urls.py", line 14, in check_url_confi
g
uwsgi_1 | return check_resolver(resolver)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/core/checks/urls.py", line 24, in check_resolver
uwsgi_1 | return check_method()
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/urls/resolvers.py", line 494, in check
uwsgi_1 | for pattern in self.url_patterns:
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
uwsgi_1 | res = instance.__dict__[self.name] = self.func(instance)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/urls/resolvers.py", line 715, in url_patterns
uwsgi_1 | patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
uwsgi_1 | res = instance.__dict__[self.name] = self.func(instance)
uwsgi_1 | File "/usr/local/lib/python3.9/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
uwsgi_1 | return import_module(self.urlconf_name)
uwsgi_1 | File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
uwsgi_1 | return _bootstrap._gcd_import(name[level:], package, level)
uwsgi_1 | File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
uwsgi_1 | File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
uwsgi_1 | File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
uwsgi_1 | File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
uwsgi_1 | File "<frozen importlib._bootstrap_external>", line 850, in exec_module
uwsgi_1 | File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
uwsgi_1 | File "/code/shub/urls.py", line 60, in <module>
uwsgi_1 | plugin_urls = import_module(urls_module)
uwsgi_1 | File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
uwsgi_1 | return _bootstrap._gcd_import(name[level:], package, level)
uwsgi_1 | File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
uwsgi_1 | File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
uwsgi_1 | File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
uwsgi_1 | File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
uwsgi_1 | File "<frozen importlib._bootstrap_external>", line 850, in exec_module
uwsgi_1 | File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
uwsgi_1 | File "/code/shub/plugins/ldap_auth/urls.py", line 1, in <module>
uwsgi_1 | from django.conf.urls import url
uwsgi_1 | ImportError: cannot import name 'url' from 'django.conf.urls' (/usr/local/lib/python3.9/site-packages/d
jango/conf/urls/__init__.py)
|
It doesn't look like you built a container from the new code - I removed those deprecated calls - but let me double check if I did for plugins too. |
|
You replaced it in most cases but not in the plugins. See for example here: https://github.com/singularityhub/sregistry/blob/update/dockerfile-base/shub/plugins/ldap_auth/urls.py#L1. |
|
Yep seeing that now! Pushing a fix soon (just getting the version of black right!) |
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
|
Now I'm getting this error during startup: |
|
Did you completely stop, remove, rebuild, and start again? |
|
Yes, I removed everything like that: |
|
But did you build the base container again? The dependencies have changed so you would need to rebuild the quay.io main image with the new Dockerfile. |
|
Yes, I rebuild the image like so: During the build with LDAP enabled there is still a reference that |
|
I intended to remove the Django pin from the requirements.txt - feel free to do that for now, and the update to 4.x is what we want. It's late here, but I can test this again tomorrow to see if I can reproduce your build. |
|
I removed the Version from However, when opening the website I get a very long error message on the server (first thing is |
also using default models JsonField and setting default autofield Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
|
okay I reproduced and pushed a bunch of changes:
|
|
That fixes the errors, thanks! |
ff44c75 to
b452d68
Compare
b452d68 to
5b18c45
Compare
|
@SethosII give me the A-ok when all is good here to merge and release. Thanks! |
|
If i update to this commit from a4b0bf0 I get the following error: Is there something i am missing in the update? |
|
That looks like you are using an old version of Django - the new install should be using Django 4.x that has JSONField added. Can you double check the version you have in this container? |
|
looks like it has do i need to request a specific version of the sregistry docker image? Also, I am just using the public images with the docker-compose.yml file currently. I'll try to build my own image if that would be better. |
|
If you are pulling the updated code from the repository here, you also need to use the matching image, so yes I'd pull the newer image. But you want to be very careful about this - I can't guarantee that you won't run into issues migrating. I would make a backup of everything first, or just stick to the older code. One of the challenges of maintaining these kinds of apps! |
|
just testing at this point, so no worries about data in the image. the older code seemed to have issues with the larger images i need to upload, so I was trying to move to the newer code that seems to handle it better.. |
|
The containers I build myself from the Dockerfile work fine. just not the 'latest' tags out there on quay.io |
|
You're right! The last update was 6 months ago, and I'm not sure about why https://quay.io/repository/vanessa/sregistry?tab=tags. I think our best bet is to probably build to ghcr.io alongside the repository - I'll get this tweak in soon. Thanks for noticing I had not! |
This will update Django / other deps in the container.