code: def configure_storage(app: FastAPI):
      def _on_backoff(event):
          _LOGGER.warning(
              f"Connection to {settings.obfuscated_elasticsearch()} is not ready. "
              f"Tried {event['tries']} times. Retrying..."
          )
  
      @backoff.on_exception(
          lambda: backoff.constant(interval=15),
          ConfigError,
          max_time=60,
          on_backoff=_on_backoff,
      )
      def _setup_elasticsearch():
          try:
              backend = GenericElasticEngineBackend.get_instance()
              dataset_records: DatasetRecordsDAO = DatasetRecordsDAO(
                  backend
              )
              datasets: DatasetsDAO = DatasetsDAO.get_instance(
                  es=backend,
                  records_dao=dataset_records,
              )
              datasets.init()
              dataset_records.init()
          except GenericSearchError as error:
              raise ConfigError(
                  f"Your Elasticsearch endpoint at {settings.obfuscated_elasticsearch()} "
                  "is not available or not responding.\n"
                  "Please make sure your Elasticsearch instance is launched and correctly running and\n"
                  "you have the necessary access permissions. "
                  "Once you have verified this, restart the argilla server.\n"
              ) from error
  
      @app.on_event("startup")
      async def setup_elasticsearch():
          _setup_elasticsearch()
  
imports: import contextlib
  import glob
  import inspect
  import logging
  import os
  import shutil
  import tempfile
  from pathlib import Path
  import backoff
  from brotli_asgi import BrotliMiddleware
  from fastapi import FastAPI
  from fastapi.exceptions import RequestValidationError
  from starlette.middleware.cors import CORSMiddleware
  from starlette.responses import RedirectResponse
  from argilla import __version__
  from argilla.logging import configure_logging
  from argilla.server import helpers
  from argilla.server.constants import DEFAULT_API_KEY, DEFAULT_PASSWORD, DEFAULT_USERNAME
  from argilla.server.contexts import accounts
  from argilla.server.daos.backend import GenericElasticEngineBackend
  from argilla.server.daos.backend.base import GenericSearchError
  from argilla.server.daos.datasets import DatasetsDAO
  from argilla.server.daos.records import DatasetRecordsDAO
  from argilla.server.database import get_async_db
  from argilla.server.errors import APIErrorHandler, BadRequestError, ClosedDatasetError, EntityAlreadyExistsError, EntityNotFoundError, ForbiddenOperationError, InvalidTextSearchError, MissingInputParamError, UnauthorizedError, WrongTaskError
  from argilla.server.models import User
  from argilla.server.pydantic_v1 import ValidationError
  from argilla.server.pydantic_v1.errors import ConfigError
  from argilla.server.routes import api_router
  from argilla.server.security import auth
  from argilla.server.settings import settings
  from argilla.server.static_rewrite import RewriteStaticFiles
label_desc: Use image node_id 6 for calling a global function with example usage: configure_storage(app) without return types