Esempio n. 1
0
    def log_artifacts(self, local_dir, artifact_path=None):

        verify_artifact_path(artifact_path)
        artifact_dir = self._resolve_path(artifact_path)

        if not self.get_path_module().exists(artifact_dir):
            mkdir(artifact_dir)
        dir_util.copy_tree(src=local_dir, dst=artifact_dir)
Esempio n. 2
0
    def log_artifact(self, local_file, artifact_path=None):

        verify_artifact_path(artifact_path)
        artifact_dir = self._resolve_path(artifact_path)

        if not self.get_path_module().exists(artifact_dir):
            mkdir(artifact_dir)
        shutil.copy(local_file, artifact_dir)
Esempio n. 3
0
 def log_artifacts(self, local_dir, artifact_path=None):
     verify_artifact_path(artifact_path)
     # NOTE: The artifact_path is expected to be in posix format.
     # Posix paths work fine on windows but just in case we normalize it here.
     if artifact_path:
         artifact_path = os.path.normpath(artifact_path)
     artifact_dir = os.path.join(self.artifact_dir, artifact_path) if artifact_path else \
         self.artifact_dir
     if not os.path.exists(artifact_dir):
         mkdir(artifact_dir)
     dir_util.copy_tree(src=local_dir, dst=artifact_dir)