code: def run_job() -> None:
      job_config = JobConfig.from_env()
  
      init_logging(level=job_config.log.level)
      # ^ set first to have logs as soon as possible
  
      with (
          CacheMongoResource(
              database=job_config.cache.mongo_database,
              host=job_config.cache.mongo_url,
          ) as cache_resource,
          MetricsMongoResource(
              database=job_config.metrics.mongo_database,
              host=job_config.metrics.mongo_url,
          ) as metrics_resource,
          QueueMongoResource(
              database=job_config.queue.mongo_database,
              host=job_config.queue.mongo_url,
          ) as queue_resource,
          MigrationsMongoResource(
              database=job_config.database_migrations.mongo_database,
              host=job_config.database_migrations.mongo_url,
          ) as migrations_database_resource,
      ):
          if not cache_resource.is_available():
              logging.warning(
                  "The connection to the cache database could not be established. The migration job is skipped."
              )
              return
          if not metrics_resource.is_available():
              logging.warning(
                  "The connection to the metrics database could not be established. The migration job is skipped."
              )
              return
          if not queue_resource.is_available():
              logging.warning(
                  "The connection to the queue database could not be established. The migration job is skipped."
              )
              return
          if not migrations_database_resource.is_available():
              logging.warning(
                  "The connection to the migrations database could not be established. The migration job is skipped."
              )
              return
          collected_migrations = MigrationsCollector().get_migrations()
          Plan(collected_migrations=collected_migrations).execute()
  
file_path: datasets-server/jobs/mongodb_migration/src/mongodb_migration/main.py
imports: import logging
  import sys
  from libcommon.log import init_logging
  from libcommon.resources import CacheMongoResource, MetricsMongoResource, QueueMongoResource
  from mongodb_migration.collector import MigrationsCollector
  from mongodb_migration.config import JobConfig
  from mongodb_migration.plan import Plan
  from mongodb_migration.resources import MigrationsMongoResource
label_desc: Use image node_id 1 for calling a global function with example usage: run_job() without return types