class_docstr: EnvironmentController inherits from BaseController and manages business logic related to the
  environment.
  
  Methods
  -------
  create(dictionary)
      Create an environment within the project
  build(id)
      Build the environment for use within the project
  list()
      List all environments within the project
  delete(id)
      Delete the specified environment from the project
class_docstr_tok: ["EnvironmentController","inherits","from","BaseController","and","manages","business","logic","related","to","the","environment",".","Methods","--","--","--","-","create","(","dictionary",")","Create","an","environment","within","the","project","build","(","id",")","Build","the","environment","for","use","within","the","project","list","(",")","List","all","environments","within","the","project","delete","(","id",")","Delete","the","specified","environment","from","the","project"]
docstr: Build environment from definition file
  
  Parameters
  ----------
  environment_id : str
      environment object id to build
  workspace : str
      workspace to be used
  Returns
  -------
  bool
      returns True if success
  
  Raises
  ------
  EnvironmentDoesNotExist
      if the specified Environment does not exist.
docstr_tok: ["Build","environment","from","definition","file","Parameters","--","--","--","--","--","environment_id",":","str","environment","object","id","to","build","workspace",":","str","workspace","to","be","used","Returns","--","--","--","-","bool","returns","True","if","success","Raises","--","--","--","EnvironmentDoesNotExist","if","the","specified","Environment","does","not","exist","."]
code: def build(self, environment_id, workspace=None):
      """Build environment from definition file
  
      Parameters
      ----------
      environment_id : str
          environment object id to build
      workspace : str
          workspace to be used
      Returns
      -------
      bool
          returns True if success
  
      Raises
      ------
      EnvironmentDoesNotExist
          if the specified Environment does not exist.
      """
      self.environment_driver.init()
      if not self.exists(environment_id):
          raise EnvironmentDoesNotExist(
              __(
                  "error",
                  "controller.environment.build",
                  environment_id,
              )
          )
      environment_obj = self.dal.environment.get_by_id(environment_id)
      file_collection_obj = self.dal.file_collection.get_by_id(
          environment_obj.file_collection_id
      )
      # TODO: Check hardware info here if different from creation time
      # Add in files for that environment id
      environment_definition_path = os.path.join(
          self.home, file_collection_obj.path
      )
      # Copy to temp folder and remove files that are datmo specific
      _temp_env_dir = get_datmo_temp_path(self.home)
      self.file_driver.copytree(
          environment_definition_path, _temp_env_dir
      )
      # get definition filepath for the temp folder
      environment_definition_filepath = os.path.join(
          _temp_env_dir, environment_obj.definition_filename
      )
      try:
          # Build the Environment with the driver
          self.spinner.start()
          result = self.environment_driver.build(
              environment_id,
              path=environment_definition_filepath,
              workspace=workspace,
          )
      finally:
          self.spinner.stop()
      # Remove both temporary directories
      shutil.rmtree(_temp_env_dir)
      return result
  
imports: import os
  import shutil
  from datmo.core.controller.base import BaseController
  from datmo.core.controller.file.file_collection import FileCollectionController
  from datmo.core.entity.environment import Environment
  from datmo.core.util.i18n import get
  from datmo.core.util.validation import validate
  from datmo.core.util.spinner import Spinner
  from datmo.core.util.json_store import JSONStore
  from datmo.core.util.misc_functions import get_datmo_temp_path, list_all_filepaths
  from datmo.core.util.exceptions import PathDoesNotExist, RequiredArgumentMissing, TooManyArgumentsFound, EnvironmentNotInitialized, UnstagedChanges, ArgumentError, EnvironmentDoesNotExist, ProjectNotInitialized
label_desc: Use image node_id 8 for calling the EnvironmentController obj's underlying member method code with example usage: obj.build(environment_id, workspace) and returns: result