Ejemplo n.º 1
0
 def create_jobs(self) -> List[Job]:
     return [Job(
         image="python:3.9",
         commands=[
             f"curl {self.url} -o {self.output}"
         ],
         artifacts=self.artifacts
     )]
Ejemplo n.º 2
0
 def create_jobs(self) -> List[Job]:
     return [
         Job(image=self.image,
             commands=self._commands(),
             environment=self.environment,
             working_dir=self.working_dir,
             resources=self.resources,
             artifacts=self.artifacts)
     ]
Ejemplo n.º 3
0
 def create_jobs(self) -> List[Job]:
     master_job = Job(
         image=self._image(),
         commands=self._commands(0),
         working_dir=self.working_dir,
         resources=self.resources,
         artifacts=self.artifacts,
         environment=self.environment,
         port_count=1,
     )
     jobs = [master_job]
     if self.nodes > 1:
         for i in range(self.nodes - 1):
             jobs.append(
                 Job(image=self._image(),
                     commands=self._commands(i + 1),
                     working_dir=self.working_dir,
                     resources=self.resources,
                     environment=self.environment,
                     master=master_job))
     return jobs
Ejemplo n.º 4
0
 def create_jobs(self) -> List[Job]:
     return [
         Job(image=self.image,
             commands=self._commands(),
             environment=self.environment,
             working_dir=self.working_dir,
             resources=self.resources,
             artifacts=self.artifacts,
             port_count=1,
             apps=[App(
                 port_index=0,
                 app_name="Gradio",
             )])
     ]
Ejemplo n.º 5
0
 def create_jobs(self) -> List[Job]:
     environment = dict(self.environment)
     token = uuid.uuid4().hex
     environment["TOKEN"] = token
     return [
         Job(image=self.image,
             commands=self._commands(),
             environment=environment,
             working_dir=self.working_dir,
             resources=self.resources,
             artifacts=self.artifacts,
             port_count=1,
             apps=[
                 App(port_index=0,
                     app_name="Jupyter",
                     url_query_params={"token": token})
             ])
     ]