Exemplo n.º 1
0
 def prepare_run_resource(
     self,
     owner_name: str,
     project_name: str,
     run_name: str,
     run_uuid: str,
     content: str,
 ) -> Dict:
     try:
         return converter.convert(
             owner_name=owner_name,
             project_name=project_name,
             run_name=run_name,
             run_uuid=run_uuid,
             content=content,
             default_auth=True,
         )
     except PolypodException as e:
         self.log_run_failed(
             run_owner=owner_name,
             run_project=project_name,
             run_uuid=run_uuid,
             exc=e,
             message="Agent failed converting run manifest.\n",
         )
     except Exception as e:
         self.log_run_failed(
             run_owner=owner_name,
             run_project=project_name,
             run_uuid=run_uuid,
             exc=e,
             message=
             "Agent failed during compilation with unknown exception.\n",
         )
Exemplo n.º 2
0
def apply(
    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.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).apply(run_uuid=run_uuid,
                                         run_kind=run_kind,
                                         resource=resource)
Exemplo n.º 3
0
def start(
    content: str,
    owner_name: str,
    project_name: str,
    run_name: str,
    run_kind: str,
    run_uuid: str,
    namespace: str,
    in_cluster: bool = None,
    default_auth: bool = False,
):
    resource = converter.convert(
        owner_name=owner_name,
        project_name=project_name,
        run_name=run_name,
        run_uuid=run_uuid,
        content=content,
        default_auth=default_auth,
    )
    Spawner(namespace=namespace, in_cluster=in_cluster).create(
        run_uuid=run_uuid, run_kind=run_kind, resource=resource
    )