# This is an autogenerated nbx_user.py file for a [NBX](www.nimblebox.ai) app:
# created time: {{ created_time }}
#   created by: {{ nbx_username }}

import os

os.environ["NBOX_LOG_LEVEL"] = "INFO" # Keep it the way you like

from nbox import Operator
from nbox.hyperloop.job_pb2 import Resource
from nbox.jobs import Schedule
from nbox import logger # Use this logger for printing

def get_op(serving: bool = False) -> Operator:
  if serving:
    # initialise your Operator for NBX-Serving here
    operator = None

    # confused? uncomment lines below
    # from nbox.lib.demo import MagicServing
    # operator = MagicServing()
  else:
    # initialise your Operator for NBX-Job here
    operator = None

    # confused? uncomment lines below
    # from nbox.lib.demo import Magic
    # operator = Magic()

  return operator

def get_resource() -> Resource:
  """Define your pod config here"""
  return Resource(
    cpu = "100m",         # 100mCPU
    memory = "200Mi",     # MiB
    disk_size = "1Gi",    # GiB
    gpu = "none",         # keep "none" for no GPU
    gpu_count = "0",      # keep "0" when no GPU
    timeout = 120_000,    # 2 minutes between attempts
    max_retries = 3,      # third times the charm :P
  )

def get_schedule() -> Schedule:
  # only relevant for NBX-Jobs
  # define your schedule here, if None will run only once.
  return None
