code: def __init__(
      self,
      environment,
      modules=None,
      cmd_tmpl=None,
      cpu=None,
      memory=None,
      log_config=None,
      extra_args=None,
      **kwargs,
  ):
      files = kwargs.pop("files", dict())
      kwargs["files"] = files
  
      parsed = urlparse(environment)
      self._env_scheme = parsed.scheme
  
      if parsed.scheme:
          import mars
  
          self._source_path = os.path.dirname(
              os.path.dirname(os.path.abspath(mars.__file__))
          )
  
          self._env_path = environment[len(parsed.scheme) + 3 :]
          self._path_environ = os.environ["PATH"]
      else:
          self._source_path = None
          self._env_path = environment
          self._path_environ = None
  
      self._cmd_tmpl = cmd_tmpl or '"{executable}"'
      if not self._env_scheme:
          files["mars_env"] = AppFileConfig(environment)
  
      self._log_config = log_config
      if log_config:
          files["logging.conf"] = AppFileConfig(log_config)
  
      self._modules = (
          modules.split(",") if isinstance(modules, str) else modules
      )
  
      self._extra_args = extra_args or ""
  
      cpu = cpu or 1
      memory = memory or "1 GiB"
      super().__init__(cpu=cpu, memory=memory, **kwargs)
  
imports: import os
  import textwrap
  from urllib.parse import urlparse
  from ...utils import parse_readable_size
label_desc: Use image node_id 1 to create a new MarsServiceConfig object from inherited base classes: AppServiceConfig with example: obj = MarsServiceConfig(environment, modules, cmd_tmpl, cpu, memory, log_config, extra_args)