Jobs are used to train machine learning models, process a dataset, build container images, execute generic tasks and can be used to perform a variety of functions from compiling a model to running an ETL operation.
Since Polyaxon 2.18.0, a short Polyaxonfile with root shortcuts such as container defines a job. The full form declares the component and its kind: job runtime, and also works on older versions:
container:
image: my-image
command: [python, model.py]kind: component
version: 1.1
run:
kind: job
container:
image: my-image
command: [python, model.py]The same example in Python.
from polyaxon.schemas import V1Component, V1Job
from polyaxon import k8s
job = V1Job(
container=k8s.V1Container(image="my-image", command=["python", "model.py"]),
)
component = V1Component(run=job)Specification
Please check the job specification guide to learn about all details for running jobs in Polyaxon.