리셋 되지 말자

csapi 프로젝트 (4) - django 추가 본문

프로젝트

csapi 프로젝트 (4) - django 추가

kyeongjun-dev 2023. 7. 28. 01:31
https://not-to-be-reset.tistory.com/343 글에 작성한 대로, 모델 다운로드 링크가 만료되고 코드가 동작하지 않아서 다시 포스팅 합니다.
단일 인스턴스 부터 쿠버네티스 클러스터까지 확장해 나가려고 합니다.

개발환경

2023. 7. 22 기준 wsl 윈도우에서 진행

github 주소

https://github.com/kyeongjun-dev/csapi

커밋 : https://github.com/kyeongjun-dev/csapi/tree/d07fe3c082b503f00f2bec3dea2f5c3b02a1349f


django 설치

docker-compose.yml 파일에서 필요없는 주석이랑 rabbitmq의 포트 expose 제거 및 수정합니다

version: "3"
services:
  worker:
    build:
      context: ./celery
    command: celery -A tasks worker --loglevel=info --max-tasks-per-child 1 -c 1

  rabbit:
    image: rabbitmq:3-management
    # expose:
    #   - "5672"
    ports:
      - "5672:5672"
      - "15672:15672"
    environment:
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest

 

docker compose를 실행합니다

docker-compose up --build

 

이제 django 관련 파일을 작성할 django 디렉토리를 추가합니다

mkdir django

 

추가 위치는 아래와 같습니다

tree csapi/
csapi/
├── celery
│   ├── Dockerfile
│   ├── model.h5
│   ├── requirements.txt
│   ├── run.py
│   ├── tasks.py
│   └── test_input.png
├── django
└── docker-compose.yml

 

celery에 사용한 베이스 도커 이미지가 python 3.7 이기 때문에, 각자 로컬에서 python 3.7 설치 후 django를 설치합니다

$ python3.7 -m venv venv

$ source venv/bin/activate

$ pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/50/c2/e06851e8cc28dcad7c155f4753da8833ac06a5c704c109313b8d5a62968a/pip-23.2.1-py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-23.2.1

$ pip install django

 

그리고 django 디렉토리로 이동한뒤 django 프로젝트를 생성합니다

$ django-admin startproject config .

$ ls
config  manage.py

 

django가 잘 동작하는지 확인합니다

$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
July 27, 2023 - 15:15:53
Django version 3.2.20, using settings 'config.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

 

브라우저에서 접속했을때 아래와 같이 표시되면 정상 동작 중임을 알 수 있습니다


django app 연결

이제 docker compose로 실행시킨 rabbitmq와 django를 연결합니다

먼저 csapi 앱을 django 디렉토리에 추가합니다

$ django-admin startapp csapi

$ ls
config  csapi  db.sqlite3  manage.py

 

config/settings.py에 csapi 앱을 추가합니다

# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'csapi',
]

 

다음으로 config/urls.py를 아래와 같이 수정합니다 - 루트 url로 접속시, csapi 앱 디렉토리에 있는 views.py의 index 함수를 실행

from django.contrib import admin
from django.urls import path
from csapi import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.index, name='index'),
]

 

csapi 앱 디렉토리의 views.py를 아래와 같이 수정합니다

from django.shortcuts import render
from django.http import HttpResponse
from celery import shared_task
from .tasks import api
# Create your views here.
def index(request):
    print(api.delay('test_input.png'))
    return HttpResponse(api.delay('test_input.png'))

 

csapi 앱 디렉토리에 tasks.py 파일을 아래와 같이 작성하여 추가합니다

from celery import shared_task

@shared_task
def api(input_file_name):
    return current_task.request.id

 

현재까지의 디렉토리 상태는 아래와 같습니다 - django를 runserver로 실행하면 __pycache__, db.sqlite3 파일이 자동으로 생성됩니다

$ tree csapi/
csapi/
├── celery
│   ├── Dockerfile
│   ├── model.h5
│   ├── requirements.txt
│   ├── run.py
│   ├── tasks.py
│   └── test_input.png
├── django
│   ├── config
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── settings.cpython-37.pyc
│   │   │   ├── urls.cpython-37.pyc
│   │   │   └── wsgi.cpython-37.pyc
│   │   ├── asgi.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── csapi
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── admin.cpython-37.pyc
│   │   │   ├── apps.cpython-37.pyc
│   │   │   ├── models.cpython-37.pyc
│   │   │   └── views.cpython-37.pyc
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── migrations
│   │   │   ├── __init__.py
│   │   │   └── __pycache__
│   │   │       └── __init__.cpython-37.pyc
│   │   ├── models.py
│   │   ├── tasks.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── db.sqlite3
│   └── manage.py
└── docker-compose.yml

 

config/settings.py 파일의 맨 아래에 celery 관련 정보를 추가합니다

CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_RESULT_BACKEND = 'rpc://'
CELERY_TIMEZONE = 'Asia/Seoul'

 

config/celery.py 파일을 작성합니다 - django 실행 시, config/settings.py에 작성한 CELERY 관련 변수를 이용해 celery 앱을 생성하고, autodiscover_tasks()를 실행해 앱들에 작성한 celery task들을 자동으로 인식합니다

from celery import Celery
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
app = Celery('config')
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()

 

csapi/django/config/__init__.py 파일을 아래와 같이 내용을 추가합니다 - django 실행 시 celery app을 로드

from .celery import app

__all__ = ("app",)

 

다음으로 celery를 이용하기 위해 celery와 importlib-metadata 패키지를 설치합니다 - celery에 사용한 패키지 버전과 동일하게 설치합니다

$ pip install importlib-metadata==4.8.3
$ pip install celery==5.1.2

 

다시 django를 실행합니다

$ python manage.py runseer

 

브라우저에서 접속하면 아래와 같이 task id가 표시되는것을 확인할 수 있습니다 - 새로고침 하면 새로운 task가 실행되기 때문에 계속 값이 변경되어 표시됩니다

 

하지만 celery가 task를 받지 못해서 django 로그를 확인하면 아래와 같이 표시됩니다

[27/Jul/2023 15:38:30] "GET / HTTP/1.1" 500 200102
856c8e41-b964-420a-afb2-172199bacbeb
[27/Jul/2023 15:40:04] "GET / HTTP/1.1" 200 36
4333a203-050a-45c2-b14c-5cbafbdd49ca
[27/Jul/2023 15:40:09] "GET / HTTP/1.1" 200 36
e785a184-3dd3-488e-800b-5d0d72ec5630
[27/Jul/2023 15:40:10] "GET / HTTP/1.1" 200 36
c0f066a4-8e56-41f9-84bb-1b1d58c52c8d
[27/Jul/2023 15:40:10] "GET / HTTP/1.1" 200 36
9898c8a1-b9f9-4276-9cfe-031ee3226791
[27/Jul/2023 15:40:11] "GET / HTTP/1.1" 200 36

 

docker compose 에서 로그를 확인하면 아래와 같은 메시지가 표시됩니다

csapi-worker-1  | [2023-07-27 15:48:16,781: ERROR/MainProcess] Received unregistered task of type 'csapi.tasks.api'.
csapi-worker-1  | The message has been ignored and discarded.
csapi-worker-1  | 
csapi-worker-1  | Did you remember to import the module containing this task?
csapi-worker-1  | Or maybe you're using relative imports?
csapi-worker-1  | 
csapi-worker-1  | Please see
csapi-worker-1  | http://docs.celeryq.org/en/latest/internals/protocol.html
csapi-worker-1  | for more information.
csapi-worker-1  | 
csapi-worker-1  | The full contents of the message body was:
csapi-worker-1  | '[["test_input.png"], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (93b)
csapi-worker-1  | Traceback (most recent call last):
csapi-worker-1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 581, in on_task_received
csapi-worker-1  |     strategy = strategies[type_]
csapi-worker-1  | KeyError: 'csapi.tasks.api'
csapi-worker-1  | 
csapi-worker-1  | [2023-07-27 15:48:16,784: ERROR/MainProcess] Received unregistered task of type 'csapi.tasks.api'.
csapi-worker-1  | The message has been ignored and discarded.
csapi-worker-1  | 
csapi-worker-1  | Did you remember to import the module containing this task?
csapi-worker-1  | Or maybe you're using relative imports?
csapi-worker-1  | 
csapi-worker-1  | Please see
csapi-worker-1  | http://docs.celeryq.org/en/latest/internals/protocol.html
csapi-worker-1  | for more information.
csapi-worker-1  | 
csapi-worker-1  | The full contents of the message body was:
csapi-worker-1  | '[["test_input.png"], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (93b)
csapi-worker-1  | Traceback (most recent call last):
csapi-worker-1  |   File "/usr/local/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 581, in on_task_received
csapi-worker-1  |     strategy = strategies[type_]
csapi-worker-1  | KeyError: 'csapi.tasks.api'
csapi-worker-1  |

 

이는 celery에서는 key가 tasks.api 인 task가 설정되었는데, django 에서는 key가 csapi.tasks.api 인 task가 설정되었기 때문입니다. 이를 해결하기 위해 csapi/celery 디렉토리에 csapi 디렉토리를 생성 후, tasks.py 파일을 옮겨줍니다

- 옮기기 전

$ tree csapi/
csapi/
├── celery
│   ├── Dockerfile
│   ├── model.h5
│   ├── requirements.txt
│   ├── run.py
│   ├── tasks.py
│   └── test_input.png
├── django
│   ├── config
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── settings.cpython-37.pyc
│   │   │   ├── urls.cpython-37.pyc
│   │   │   └── wsgi.cpython-37.pyc
│   │   ├── asgi.py
│   │   ├── celery.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── csapi
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── admin.cpython-37.pyc
│   │   │   ├── apps.cpython-37.pyc
│   │   │   ├── models.cpython-37.pyc
│   │   │   ├── tasks.cpython-37.pyc
│   │   │   └── views.cpython-37.pyc
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── migrations
│   │   │   ├── __init__.py
│   │   │   └── __pycache__
│   │   │       └── __init__.cpython-37.pyc
│   │   ├── models.py
│   │   ├── tasks.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── db.sqlite3
│   └── manage.py
└── docker-compose.yml

 

- 옮긴 후

$ tree csapi/
csapi/
├── celery
│   ├── Dockerfile
│   ├── model.h5
│   ├── csapi             # 이부분
│   │   └── tasks.py      # 이부분
│   ├── requirements.txt
│   ├── run.py
│   └── test_input.png
├── django
│   ├── config
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── settings.cpython-37.pyc
│   │   │   ├── urls.cpython-37.pyc
│   │   │   └── wsgi.cpython-37.pyc
│   │   ├── asgi.py
│   │   ├── celery.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── csapi
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   │   ├── __init__.cpython-37.pyc
│   │   │   ├── admin.cpython-37.pyc
│   │   │   ├── apps.cpython-37.pyc
│   │   │   ├── models.cpython-37.pyc
│   │   │   ├── tasks.cpython-37.pyc
│   │   │   └── views.cpython-37.pyc
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── migrations
│   │   │   ├── __init__.py
│   │   │   └── __pycache__
│   │   │       └── __init__.cpython-37.pyc
│   │   ├── models.py
│   │   ├── tasks.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── db.sqlite3
│   └── manage.py
└── docker-compose.yml

 

다음으로 docker-compose.yml에서도 celery를 실행시키는 명령어를 변경해줍니다

version: "3"
services:
  worker:
    build:
      context: ./celery
    command: celery -A csapi.tasks worker --loglevel=info --max-tasks-per-child 1 -c 1

  rabbit:
    image: rabbitmq:3-management
    # expose:
    #   - "5672"
    ports:
      - "5672:5672"
      - "15672:15672"
    environment:
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest

 

docker compose 종료 후, 다시 실행합니다

$ docker-compose down -v

$ docker-compose up --build

 

docker compose의 로그를 확인하면 아래와 같이 task의 key가 csapi.tasks.api로 변경된 것을 확인할 수 있습니다

csapi-worker-1  | - *** --- * --- 
csapi-worker-1  | - ** ---------- [config]
csapi-worker-1  | - ** ---------- .> app:         tasks:0x7ff7479b8fd0
csapi-worker-1  | - ** ---------- .> transport:   amqp://guest:**@rabbit:5672//
csapi-worker-1  | - ** ---------- .> results:     disabled://
csapi-worker-1  | - *** --- * --- .> concurrency: 1 (prefork)
csapi-worker-1  | -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
csapi-worker-1  | --- ***** ----- 
csapi-worker-1  |  -------------- [queues]
csapi-worker-1  |                 .> celery           exchange=celery(direct) key=celery
csapi-worker-1  |                 
csapi-worker-1  | 
csapi-worker-1  | [tasks]
csapi-worker-1  |   . csapi.tasks.api
csapi-worker-1  | 
csapi-worker-1  | 
csapi-worker-1  | [2023-07-27 15:53:22,007: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@rabbit:5672//: [Errno 111] Connection refused.
csapi-worker-1  | Trying again in 2.00 seconds... (1/100)

 

다시 django를 실행한 뒤, 브라우저로 접속합니다. 접속하면 docker compose 로그에서 아래와 같이 celery가 동작하는 것을 확인할 수 있습니다

csapi-worker-1  | [2023-07-27 16:02:14,420: INFO/MainProcess] Task csapi.tasks.api[6f8a322f-985d-415b-a31d-0ff846e819d5] received
csapi-worker-1  | [2023-07-27 16:02:14,430: INFO/MainProcess] Task csapi.tasks.api[0d898484-f531-4581-8432-5c8edda20583] received
csapi-worker-1  | 2023-07-27 16:02:14.819721: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
csapi-worker-1  | 2023-07-27 16:02:14.819793: W tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:265] failed call to cuInit: UNKNOWN ERROR (303)
csapi-worker-1  | 2023-07-27 16:02:14.819822: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (2ff9df896ffe): /proc/driver/nvidia/version does not exist
csapi-worker-1  | 2023-07-27 16:02:14.820545: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
csapi-worker-1  | To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
1/1 [==============================] - ETA: 0sRNING/ForkPoolWorker-3] 
1/1 [==============================] - 5s 5s/stepNG/ForkPoolWorker-3] 
csapi-worker-1  | 
csapi-worker-1  | 
csapi-worker-1  | [2023-07-27 16:02:23,090: INFO/ForkPoolWorker-3] Task csapi.tasks.api[6f8a322f-985d-415b-a31d-0ff846e819d5] succeeded in 8.673343926000598s: '6f8a322f-985d-415b-a31d-0ff846e819d5'
csapi-worker-1  | 2023-07-27 16:02:23.567746: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
csapi-worker-1  | 2023-07-27 16:02:23.567827: W tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:265] failed call to cuInit: UNKNOWN ERROR (303)
csapi-worker-1  | 2023-07-27 16:02:23.567857: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (2ff9df896ffe): /proc/driver/nvidia/version does not exist
csapi-worker-1  | 2023-07-27 16:02:23.568406: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
csapi-worker-1  | To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
1/1 [==============================] - ETA: 0sRNING/ForkPoolWorker-4] 
1/1 [==============================] - 5s 5s/stepNG/ForkPoolWorker-4] 
csapi-worker-1  | 
csapi-worker-1  | 
csapi-worker-1  | [2023-07-27 16:02:31,997: INFO/ForkPoolWorker-4] Task csapi.tasks.api[0d898484-f531-4581-8432-5c8edda20583] succeeded in 8.7987348989991s: '0d898484-f531-4581-8432-5c8edda20583'

 

그리고 실제 woker 컨테이너에 접속하면 test_input.png 파일을 처리한 결과물 <UUID>.png 파일들 목록을 확인할 수 있습니다

$ docker exec -it csapi-worker-1 bash
root@2ff9df896ffe:/csapi# ls
550c8b29-1f0f-4955-bace-d4bdc4b146a8.png  csapi
9b62ef26-9adc-45a6-8198-8ee7807aea58.png  model.h5
Dockerfile                                requirements.txt
a82596d2-8b45-4eb8-ba6d-d9ee6201bee1.png  run.py
b0f630e2-3bf4-42e9-bc80-6f3e6148580f.png  test_input.png

django 컨테이너화

csapi/django 디렉토리에 Dockerfile을 작성합니다 - celery와 동일한 파이썬 이미지를 사용합니다

FROM python:3.7.16-slim
ENV PYTHONUNBUFFERED 1
WORKDIR /csapi
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt --no-cache-dir
COPY . .

 

csapi/django 디렉토리에 requirements.txt 파일을 작성합니다 - django 버전은 pip freeze | grep django 로 확인할 수 있으며, 나머지는 celery와 동일한 패키지 버전을 사용합니다

Django==3.2.20
importlib-metadata==4.8.3
celery==5.1.2

 

최종 디렉토리 형태는 아래와 같습니다 - __pycache__, db.sqlite3 파일 삭제

$ tree csapi/
csapi/
├── celery
│   ├── Dockerfile
│   ├── csapi
│   │   └── tasks.py
│   ├── model.h5
│   ├── requirements.txt
│   ├── run.py
│   └── test_input.png
├── django
│   ├── Dockerfile
│   ├── config
│   │   ├── __init__.py
│   │   ├── asgi.py
│   │   ├── celery.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── csapi
│   │   ├── __init__.py
│   │   ├── admin.py
│   │   ├── apps.py
│   │   ├── models.py
│   │   ├── tasks.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── manage.py
│   └── requirements.txt
└── docker-compose.yml

 

이제 docker compose에 django를 추가한 뒤, rabbit의 5672 포트를 다시 expose로 변경합니다 - expose는 컨테이너 끼리만 포트를 허용하고, ports는 컨테이너와 호스트(docker compose를 실행하는 로컬)에게 전부 포트를 허용합니다

version: "3"
services:
  django:
    build:
      context: ./django
    command: python manage.py runserver 0.0.0.0:8000
    ports:
      - "8000:8000"

  worker:
    build:
      context: ./celery
    command: celery -A csapi.tasks worker --loglevel=info --max-tasks-per-child 1 -c 1

  rabbit:
    image: rabbitmq:3-management
    expose:
      - "5672"
    ports:
      - "15672:15672"
    environment:
      - RABBITMQ_DEFAULT_USER=guest
      - RABBITMQ_DEFAULT_PASS=guest

 

다음으로 csapi/django/config/settings.py를 수정합니다

- ALLOWED_HOSTS에 localhost를 명시하여 django 컨테이너에서 django 서비스에 접속할 수 있도록 허용합니다

//변경 전
ALLOWED_HOSTS = []

//변경 후
ALLOWED_HOSTS = ["localhost"]

 

- django 앱을 로컬이 아닌 docker로 실행하기 때문에 BROKER URL을 컨테이너의 이름이자 호스트 주소인 rabbit으로 변경합니다

//변경 전
CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_RESULT_BACKEND = 'rpc://'
CELERY_TIMEZONE = 'Asia/Seoul'

//변경 후
CELERY_BROKER_URL = 'amqp://guest:guest@rabbit:5672//'
CELERY_RESULT_BACKEND = 'rpc://'
CELERY_TIMEZONE = 'Asia/Seoul'

 

docker compose 종료 후, 다시 실행시킵니다

$ docker-compose down -v
$ docker-compose up --build

 

브라우저로 localhost:8000 접속 시, docker compose 로그를 통해 celery가 task를 수행하는 것을 확인할 수 있습니다

csapi-worker-1  | 2023-07-27 16:28:57.537999: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
csapi-worker-1  | 2023-07-27 16:28:57.538067: W tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:265] failed call to cuInit: UNKNOWN ERROR (303)
csapi-worker-1  | 2023-07-27 16:28:57.538135: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (5b545141829f): /proc/driver/nvidia/version does not exist
csapi-worker-1  | 2023-07-27 16:28:57.538685: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
csapi-worker-1  | To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
1/1 [==============================] - ETA: 0sRNING/ForkPoolWorker-2] 
1/1 [==============================] - 5s 5s/stepNG/ForkPoolWorker-2] 
csapi-worker-1  | 
csapi-worker-1  | 
csapi-worker-1  | [2023-07-27 16:29:05,990: INFO/ForkPoolWorker-2] Task csapi.tasks.api[9a446dc8-0ca0-48c4-b229-4bb806619f38] succeeded in 8.834102527998766s: '9a446dc8-0ca0-48c4-b229-4bb806619f38'
Comments