Blast server with Apollo

8 views
Skip to first unread message

Michał T. Lorenc

unread,
May 26, 2021, 8:54:46 AM5/26/21
to apollo
Hello,
I found your Blast project on GitHub. Furthermore, I was able to get it running with Docker as described below. Unfortunately, it crashed always when I try to upload a FASTA file with this error `ImproperlyConfigured: Error finding Upload-Folder. Maybe it does not exist?`.

 2. `$ cat requirements.txt` in this files the below dependencies had to be updated:
    - psycopg2==2.8.6

I have the following Dockerfile:

```
FROM python:2
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y postgresql-client
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
RUN mkdir -p /var/log/django
RUN mkdir -p /var/log/i5k
```

For `docker-compose.yml` I use:

```
version: "3"

services:
  db:
    image: postgres
    volumes:
      - ./data/db:/var/lib/postgresql/data
      - ./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sql

    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres

  web:
    build: .
    command: python manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db
    links:
      - db
```

```
$ cat scripts/install-extensions.sql
CREATE EXTENSION hstore;
```

I had to change:

```
    $ vim i5k/settings.py
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'postgres',
            'USER': 'postgres',
            'PASSWORD': 'postgres',
            'HOST': 'db',
            'PORT': '5432',
            }
    }
```

```
...
FILEBROWSER_SUIT_TEMPLATE = True
FILEBROWSER_DIRECTORY = ''
FILEBROWSER_VERSIONS_BASEDIR = '_versions/'
FILEBROWSER_MAX_UPLOAD_SIZE = 10737418240 # 10GB
FILEBROWSER_EXTENSIONS = {
    'Folder': [''],
    #'Image': ['.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff'],
    'Document': ['.pdf', '.doc', '.rtf', '.txt', '.xls', '.csv', '.docx'],
    #'Video': ['.mov', '.wmv', '.mpeg', '.mpg', '.avi', '.rm'],
    #'Audio': ['.mp3', '.mp4', '.wav', '.aiff', '.midi', '.m4p'],
    'FASTA': ['.fa', '.faa', '.fna', '.fasta', '.cds', '.pep'],
    'FASTQ': ['.fq', '.fastq'],
    'SAM': ['.sam', '.bam'],
    'WIG': ['.wig', '.bw', '.bigwig'],
    'JSON': ['.json'],
    'GFF': ['.gff', '.gff3']
}
FILEBROWSER_SELECT_FORMATS = {
    'file': ['Folder', 'Image', 'Document', 'Video', 'Audio', 'FASTA', 'FASTQ', 'SAM', 'WIG', 'JSON', 'GFF'],
    #'image': ['Image'],
    'document': ['Document'],
    #'media': ['Video','Audio'],
    'FASTA': ['FASTA'],
    'FASTQ': ['FASTQ'],
    'SAM': ['SAM'],
    'WIG': ['WIG'],
    'JSON': ['JSON'],
    'GFF': ['GFF'],
}
FILEBROWSER_VERSIONS = {
    'admin_thumbnail': {'verbose_name': 'Admin Thumbnail', 'width': 60, 'height': 60, 'opts': 'crop'},
    'thumbnail': {'verbose_name': 'Thumbnail (1 col)', 'width': 60, 'height': 60, 'opts': 'crop'},
    'small': {'verbose_name': 'Small (2 col)', 'width': 140, 'height': '', 'opts': ''},
    'medium': {'verbose_name': 'Medium (4col )', 'width': 300, 'height': '', 'opts': ''},
    'big': {'verbose_name': 'Big (6 col)', 'width': 460, 'height': '', 'opts': ''},
    'large': {'verbose_name': 'Large (8 col)', 'width': 680, 'height': '', 'opts': ''},
}
...
```
Next, I ran:
  1.     `docker-compose up --build`
  2.     `docker-compose run web python manage.py`
  3.     `docker-compose run web python manage.py migrate`
  4.     `docker-compose run web python manage.py createsuperuser`

Finally, I opened in Browser `http://localhost:8000/admin/blast/blastdb/add/` and try to upload a file and got this error:

```
web_1  | [24/May/2021 18:04:53] "POST /admin/blast/sequencetype/add/?_to_field=id&_popup=1 HTTP/1.1" 200 237
web_1  | [24/May/2021 18:04:58] "GET /admin/blast/blastdb/add/ HTTP/1.1" 200 15281
web_1  | [24/May/2021 18:04:58] "GET /admin/jsi18n/ HTTP/1.1" 200 2372
web_1  | django.request ERROR 2021-05-24 18:05:05,381 10 [Internal Server Error: /admin/filebrowser/browse/]
web_1  | Traceback (most recent call last):
web_1  |   File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
web_1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
web_1  |   File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
web_1  |     return view_func(request, *args, **kwargs)
web_1  |   File "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
web_1  |     response = view_func(request, *args, **kwargs)
web_1  |   File "/code/filebrowser/views.py", line 89, in browse
web_1  |     raise ImproperlyConfigured, _("Error finding Upload-Folder. Maybe it does not exist?")
web_1  | ImproperlyConfigured: Error finding Upload-Folder. Maybe it does not exist?
web_1  | [24/May/2021 18:05:05] "GET /admin/filebrowser/browse/?pop=1&dir=blast/db/&type=FASTA&filter_type=FASTA HTTP/1.1" 500 101471
```
I tried to create the missing `blast/db` folder in the following way but it still does not work:

```
$ docker-compose exec web /bin/bash
# pwd
/code
# mkdir -p blast/db
# mkdir -p i5k/blast/db
```
Where do I have to create blast/db folder?

Thank you in advance

Best wishes,

Michal

Nathan Dunn

unread,
May 29, 2021, 11:54:44 AM5/29/21
to apollo, m.t.l...@gmail.com, Childers, Christopher, Monica Poelchau, Robert Buels

I've copied Monica and Chris from the NAL directly as theses are services that they run.  

If anyone could help you with this, they would be it. 

If they aren't able to help you, you can do something similar using these tools:

Reply all
Reply to author
Forward
0 new messages