open-semantic-search icon indicating copy to clipboard operation
open-semantic-search copied to clipboard

Old Django vs Current Django version

Open MKatereggaExigent opened this issue 2 years ago • 9 comments

Hi OSS,

I am trying to build a docker image, however, I am having two issues:

  1. the cloning doesn't permit me to include the --recurse-submodules --remote-submodules flags. Unknown flags.
  2. the build seems to be building with the latest Django version but I guess the software was intended to use some older version of Django perhaps django==1.7. when django.conf.urls was still valid So once the build is done, some buttons on the UI break the whole software.

How can I resolve these two issues?

MKatereggaExigent avatar Apr 07 '22 09:04 MKatereggaExigent

Same problem for me. I still used the instructions to build the docker image but it shows just the apache server default page and not the search engine. In the main module the Python url error is shown.

hdwinkel avatar Apr 10 '22 12:04 hdwinkel

@hdwinkel I think in your case you need to go to http://localhost:8000/search instead of http://localhost:8000

MKatereggaExigent avatar Apr 10 '22 14:04 MKatereggaExigent

@MKatereggaExigent You are right, my fault. I've done some small changes in the Dockerfile to replace Django4 with Django3.2: remove the line with apt-get python3-django add in the RUN pip3lines on top instead: RUN pip3 install Django==3.2 && \ This seems to work (at least the menus are visible now without the url-error messages)

hdwinkel avatar Apr 10 '22 15:04 hdwinkel

@hdwinkel thank you - it works now.

MKatereggaExigent avatar Apr 11 '22 07:04 MKatereggaExigent

@MKatereggaExigent Do you know how to link the filesystem of the host into the Docker setup for using as external document-root? For what container is it needed? Or is one of the existing ENV variables foreseen to that? Unfortunatley I didn't found any documentation about the setup.

hdwinkel avatar Apr 11 '22 08:04 hdwinkel

@hdwinkel you will notice that in the docker-compose.yml they include data_media:/var/opensemanticsearch/media on line 18.

So you might consider adding a folder data_media in the root directory after the clone, and add all your search folders/files. Then once the image is built, you will have to add the path var/opensemanticsearch/media/<<YOUR_FOLDER/FILES_ADDED_AT_data_media>>

This shouldn't be the right approach to do this but I think the projects docker pipeline is not yet tested by the developers for these" bugs".

MKatereggaExigent avatar Apr 11 '22 09:04 MKatereggaExigent

@hdwinkel you will notice that in the docker-compose.yml they include data_media:/var/opensemanticsearch/media on line 18.

So you might consider adding a folder data_media in the root directory after the clone, and add all your search folders/files. Then once the image is built, you will have to add the path var/opensemanticsearch/media/<<YOUR_FOLDER/FILES_ADDED_AT_data_media>>

This shouldn't be the right approach to do this but I think the projects docker pipeline is not yet tested by the developers for these" bugs".

That are normal values and do not bind to the host. Also if you add such directory. https://docs.docker.com/storage/volumes/ If you want to bind to the host you need bind mounts: https://docs.docker.com/storage/bind-mounts/ At the end this is listed:

  - type: bind
    source: ./static
    target: /opt/app/staticvolumes:

But I use it a little different. I create a directory with name “shared” next to docker-compose.yml and add a line the following to docker-compose.yml (at the end with shared in it):

volumes:
  - config_etl:/etc/opensemanticsearch
  - config_solr-php-ui:/etc/solr-php-ui
  # Django sqlite DB for settings and thesaurus
  - data_db:/var/opensemanticsearch/db
  # Ontologies uploaded to Django web app and thumbnails generated by ETL
  - data_media:/var/opensemanticsearch/media
  - ./shared:/shared
environment:
  - SOLR_PHP_UI_SOLR_HOST=solr
  

I did not list shared in the volume section at the end of the file. After container startup I see a directory /shared in the container. Inside the container on the container CLI cd /shared echo test > test.txt Now this file test.txt is available at the host in the shared directory.

BobHamburg avatar May 03 '22 14:05 BobHamburg

@MKatereggaExigent You are right, my fault. I've done some small changes in the Dockerfile to replace Django4 with Django3.2: remove the line with apt-get python3-django add in the RUN pip3lines on top instead: RUN pip3 install Django==3.2 && \ This seems to work (at least the menus are visible now without the url-error messages)

I see also the problem with Django. And your change helps to overcome the first problem. Without the change this would be installed: https://packages.debian.org/bullseye/python3-django And this version is also installed inside the Virtual Box Image. And in the context of Virtual Box this version do not crash! In Docker the apps container crash fast with this version. And in the end my docker deplyoment (on Windows - use LF format not CRLF) do not work. What do you change additionally to get it work?

BobHamburg avatar May 03 '22 14:05 BobHamburg

There were dependency hell issues with the Django version on builds of the docker container after one of the last Django imort export releases (now removed, will test more next days): #443

Mandalka avatar Oct 08 '22 14:10 Mandalka