code: def register_on_startup_hook(
      func: Callable[[FastAPI], Awaitable[None]]
  ):
      _ON_STARTUP_HOOKS.append(func)
  
imports: import os
  import time
  from contextlib import asynccontextmanager
  from typing import Awaitable, Callable, List
  import sentry_sdk
  from fastapi import FastAPI, Request, status
  from fastapi.responses import JSONResponse, RedirectResponse
  from dstack._internal.cli.utils.common import console
  from dstack._internal.core.errors import ForbiddenError, ServerClientError
  from dstack._internal.core.services.configs import update_default_project
  from dstack._internal.server import settings
  from dstack._internal.server.background import start_background_tasks
  from dstack._internal.server.db import get_session_ctx, migrate
  from dstack._internal.server.routers import backends, gateways, logs, projects, repos, runs, secrets, users
  from dstack._internal.server.services.config import ServerConfigManager
  from dstack._internal.server.services.gateways import update_gateways
  from dstack._internal.server.services.projects import get_or_create_default_project
  from dstack._internal.server.services.storage import init_default_storage
  from dstack._internal.server.services.users import get_or_create_admin_user
  from dstack._internal.server.settings import DEFAULT_PROJECT_NAME, DSTACK_DO_NOT_UPDATE_DEFAULT_PROJECT, DSTACK_UPDATE_DEFAULT_PROJECT, SERVER_CONFIG_FILE_PATH, SERVER_URL
  from dstack._internal.server.utils.logging import configure_logging
  from dstack._internal.server.utils.routers import check_client_server_compatibility, error_detail, get_server_client_error_details
  from dstack._internal.settings import DSTACK_VERSION
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 2 for calling a global function with example usage: register_on_startup_hook(func) without return types