Exemple #1
0
 def make_run_resource(
     self,
     owner_name: str,
     project_name: str,
     run_name: str,
     run_uuid: str,
     content: str,
     default_auth=False,
 ) -> Dict:
     try:
         return converter.make_and_convert(
             owner_name=owner_name,
             project_name=project_name,
             run_name=run_name,
             run_uuid=run_uuid,
             content=content,
             default_auth=default_auth,
         )
     except PolypodException as e:
         logger.info(
             "Run could not be cleaned. Agent failed converting run manifest: {}\n{}"
             .format(repr(e), traceback.format_exc()))
     except Exception as e:
         logger.info(
             "Agent failed during compilation with unknown exception: {}\n{}"
             .format(repr(e), traceback.format_exc()))
Exemple #2
0
def make_and_create(
    content: str,
    owner_name: str,
    project_name: str,
    run_name: str,
    run_kind: str,
    run_uuid: str,
    namespace: str,
    in_cluster: bool = None,
):
    resource = converter.make_and_convert(
        owner_name=owner_name,
        project_name=project_name,
        run_name=run_name,
        run_uuid=run_uuid,
        content=content,
    )

    Spawner(namespace=namespace,
            in_cluster=in_cluster).create(run_uuid=run_uuid,
                                          run_kind=run_kind,
                                          resource=resource)