Skip to content

update dockerfile base#421

Merged
vsoch merged 9 commits intomasterfrom
update/dockerfile-base
Apr 6, 2023
Merged

update dockerfile base#421
vsoch merged 9 commits intomasterfrom
update/dockerfile-base

Conversation

@vsoch
Copy link
Copy Markdown
Member

@vsoch vsoch commented Mar 30, 2023

This will update Django / other deps in the container.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
vsoch added 4 commits March 30, 2023 17:08
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>
Copy link
Copy Markdown
Contributor

@SethosII SethosII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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)

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Mar 31, 2023

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.

@SethosII
Copy link
Copy Markdown
Contributor

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.

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Mar 31, 2023

Yep seeing that now! Pushing a fix soon (just getting the version of black right!)

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@SethosII
Copy link
Copy Markdown
Contributor

SethosII commented Apr 4, 2023

Now I'm getting this error 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 442, in execute_from_command_line
uwsgi_1      |     utility.execute()
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 436, in execute
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 412, in run_from_argv
uwsgi_1      |     self.execute(*args, **cmd_options)
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 453, in execute
uwsgi_1      |     self.check()
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 485, 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_config
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 17, in <module>
uwsgi_1      |     from rest_framework.documentation import include_docs_urls
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/rest_framework/documentation.py", line 3, in <module>
uwsgi_1      |     from rest_framework.renderers import (
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/rest_framework/renderers.py", line 17, in <module>
uwsgi_1      |     from django.http.multipartparser import parse_header
uwsgi_1      | ImportError: cannot import name 'parse_header' from 'django.http.multipartparser' (/usr/local/lib/python3.9/site-packages/django/http/multipart
parser.py)

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 4, 2023

Did you completely stop, remove, rebuild, and start again?

@SethosII
Copy link
Copy Markdown
Contributor

SethosII commented Apr 4, 2023

Yes, I removed everything like that:

sudo docker system prune --volumes -f
sudo docker rmi -f $(sudo docker images -aq)
sudo rm -rf sregistry/
git clone https://github.com/singularityhub/sregistry
git checkout update/dockerfile-base

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 4, 2023

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.

@SethosII
Copy link
Copy Markdown
Contributor

SethosII commented Apr 5, 2023

Yes, I rebuild the image like so: sudo docker build --build-arg ENABLE_LDAP=true -t quay.io/vanessa/sregistry ..

During the build with LDAP enabled there is still a reference that Django 2.2.28 gets replaced by 4.2:

Step 18/40 : RUN if $ENABLE_LDAP; then pip install django-auth-ldap ; fi;                                                                                     
 ---> Running in 7c7c9596c3a6                                                                                                                                 
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.5 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.2-py3-none-any.whl (8.0 MB)                                                                                                            
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.0/8.0 MB 74.9 MB/s eta 0:00:00                                                                                
Collecting asgiref<4,>=3.6.0                                                                                                                                  
  Downloading asgiref-3.6.0-py3-none-any.whl (23 kB)                                                                                                          
Requirement already satisfied: sqlparse>=0.3.1 in /usr/local/lib/python3.9/site-packages (from Django>=3.2->django-auth-ldap) (0.4.3)                         
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)              
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)
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=314174 sha256=ef6075a80bfce35b12ab63ecfd7e038497b67cb0bb3cba7819eb
7e49a4af26dc                 
  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.2 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 package manager. It is recommended to use a
 virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container 7c7c9596c3a6
 ---> 39fb31cdee35

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 5, 2023

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.

@SethosII
Copy link
Copy Markdown
Contributor

SethosII commented Apr 5, 2023

I removed the Version from Django in requirements.txt the step now looks like this:

Step 18/40 : RUN if $ENABLE_LDAP; then pip install django-auth-ldap ; fi;
 ---> Running in 474b98311594                                                  
Collecting django-auth-ldap  
  Downloading django_auth_ldap-4.2.0-py3-none-any.whl (20 kB)
Requirement already satisfied: Django>=3.2 in /usr/local/lib/python3.9/site-packages (from django-auth-ldap) (4.2)
Collecting python-ldap>=3.1                                                                                                                                   
  Downloading python-ldap-3.4.3.tar.gz (377 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 377.4/377.4 kB 19.1 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'      
Requirement already satisfied: sqlparse>=0.3.1 in /usr/local/lib/python3.9/site-packages (from Django>=3.2->django-auth-ldap) (0.4.3)
Requirement already satisfied: asgiref<4,>=3.6.0 in /usr/local/lib/python3.9/site-packages (from Django>=3.2->django-auth-ldap) (3.6.0)
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)
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)
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=314178 sha256=f732dc00bbdc937cfcaf74e1ca046c5382379ff7fb5231e37fde
34661b7af7a9                 
  Stored in directory: /root/.cache/pip/wheels/79/43/5e/1a029878450f5949466f351db7ff4c5459c0b1937999f39000
Successfully built python-ldap
Installing collected packages: python-ldap, django-auth-ldap
Successfully installed 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 package manager. It is recommended to use a
 virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container 474b98311594
 ---> 9fe64a6aa4d1

However, when opening the website I get a very long error message on the server (first thing is KeyError: 'staticfiles'). I attached it as a text file.

vsoch added 2 commits April 5, 2023 05:49
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>
@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 5, 2023

okay I reproduced and pushed a bunch of changes:

  • staticfiles -> static
  • added default auto field for models
  • pinned django to new 4.2

@SethosII
Copy link
Copy Markdown
Contributor

SethosII commented Apr 5, 2023

That fixes the errors, thanks!

@vsoch vsoch force-pushed the update/dockerfile-base branch from ff44c75 to b452d68 Compare April 5, 2023 19:35
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@vsoch vsoch force-pushed the update/dockerfile-base branch from b452d68 to 5b18c45 Compare April 5, 2023 19:44
@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 6, 2023

@SethosII give me the A-ok when all is good here to merge and release. Thanks!

Copy link
Copy Markdown
Contributor

@SethosII SethosII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@vsoch vsoch merged commit 2fdfc1f into master Apr 6, 2023
@vsoch vsoch deleted the update/dockerfile-base branch April 6, 2023 07:07
@karcaw
Copy link
Copy Markdown
Contributor

karcaw commented Apr 26, 2023

If i update to this commit from a4b0bf0 I get the following error:

uwsgi_1      | Traceback (most recent call last):
uwsgi_1      |   File "shub/wsgi.py", line 7, in <module>
uwsgi_1      |     application = get_wsgi_application()
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
uwsgi_1      |     django.setup(set_prefix=False)
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
uwsgi_1      |     apps.populate(settings.INSTALLED_APPS)
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
uwsgi_1      |     app_config.import_models()
uwsgi_1      |   File "/usr/local/lib/python3.9/site-packages/django/apps/config.py", line 211, in import_models
uwsgi_1      |     self.models_module = import_module(models_module_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/apps/logs/models.py", line 51, in <module>
uwsgi_1      |     class APIRequestCount(models.Model):
uwsgi_1      |   File "/code/./shub/apps/logs/models.py", line 56, in APIRequestCount
uwsgi_1      |     from shub.apps.main.models import Collection
uwsgi_1      |   File "/code/./shub/apps/main/models/__init__.py", line 1, in <module>
uwsgi_1      |     from .containers import Container
uwsgi_1      |   File "/code/./shub/apps/main/models/containers.py", line 40, in <module>
uwsgi_1      |     class Container(models.Model):
uwsgi_1      |   File "/code/./shub/apps/main/models/containers.py", line 58, in Container
uwsgi_1      |     metadata = models.JSONField(default=dict, blank=True)
uwsgi_1      | AttributeError: module 'django.db.models' has no attribute 'JSONField'

Is there something i am missing in the update?

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 26, 2023

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?

@karcaw
Copy link
Copy Markdown
Contributor

karcaw commented Apr 27, 2023

looks like it has
Django 2.2.28

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.

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 27, 2023

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!

@karcaw
Copy link
Copy Markdown
Contributor

karcaw commented Apr 27, 2023

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..

@karcaw
Copy link
Copy Markdown
Contributor

karcaw commented Apr 27, 2023

The containers I build myself from the Dockerfile work fine. just not the 'latest' tags out there on quay.io

@vsoch
Copy link
Copy Markdown
Member Author

vsoch commented Apr 27, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants