### Full V1DockerfileType Configuration Example Source: https://polyaxon.com/docs/core/specification/types A comprehensive example showing various configuration fields for V1DockerfileType. ```yaml image: image:tag env: KEY1: value1 KEY2: value2 path: - module/add/to/path copy: - copy/local/requirements.txt - [copy/.cache/dir, /destination] run: - pip install ... - mv foo bar postRunCopy: - copy/local/path - [copy/local/path, /path/to/user/in/container] langEnv: en_US.UTF-8 uid: 2222 gid: 1111 filename: Dockerfile2 workdir: ../my-code ``` -------------------------------- ### Clone the ml-serving repository Source: https://polyaxon.com/docs/intro/serving/preparing-model Download the example repository to your local environment. ```bash git clone https://github.com/polyaxon/polyaxon-ml-serving.git ``` -------------------------------- ### Configure Ray Start Parameters Source: https://polyaxon.com/docs/experimentation/clusters/ray-replica Specify parameters for starting the Ray process. ```yaml head: rayStartParams: "dashboard-host": "0.0.0.0" "block": "true" "num-cpus": "0" ``` -------------------------------- ### Start Tensorboard Source: https://polyaxon.com/docs/intro/quick-start Launches a Tensorboard instance for a specific experiment run. ```bash polyaxon run --hub tensorboard:single-run -P uuid=UUID -w ``` -------------------------------- ### Instantiate ProjectClient with Scoping Source: https://polyaxon.com/docs/core/python-library/project-client Examples of initializing the client for organization-level or team-scoped projects. ```python ProjectClient(owner="my-org", project="my-project") # Organization project ProjectClient(owner="my-org/engineering", project="my-project") # Team project ``` -------------------------------- ### start() Source: https://polyaxon.com/docs/core/python-library/run-client Sets the current run to running status. ```APIDOC ## start() ### Description Sets the current run to 'running' status. This method is only useful for manual runs outside of Polyaxon. ``` -------------------------------- ### Install plotting dependencies Source: https://polyaxon.com/docs/intro/iterative-process/iterate-in-notebooks Installs necessary libraries for data visualization. ```bash !pip install plotly hiplot ``` -------------------------------- ### Complete Iterative Operation Example Source: https://polyaxon.com/docs/automation/optimization-engine/iterative Full configuration example for an iterative operation including search space and component definition. ```yaml version: 1.1 kind: operation matrix: kind: iterative concurrency: 10 maxIterations: 5 tuner: hubRef: my-suggestion-component params: lr: kind: logspace value: 0.01:0.1:5 dropout: kind: choice value: [0.2, 0.5] activation: kind: pchoice value: [[elu, 0.1], [relu, 0.2], [sigmoid, 0.7]] early_stopping: - metric: accuracy value: 0.9 optimization: maximize - metric: loss value: 0.05 optimization: minimize component: inputs: - name: batch_size type: int isOptional: true value: 128 - name: lr type: float - name: dropout type: float - name: activation type: str container: image: image:latest command: [python3, train.py] args: [ "--batch-size={{ batch_size }}", "--lr={{ lr }}", "--dropout={{ dropout }}", "--activation={{ activation }}" ] ``` -------------------------------- ### Configure Spot Instances in Python Source: https://polyaxon.com/docs/core/scheduling-strategies/node-scheduling Python SDK examples for configuring preemptible VM environments. ```python from polyaxon.schemas import V1Environment environment = V1Environment(annotations={"cloud.google.com/gke-preemptible": "true"}) ``` ```python from polyaxon.schemas import V1Environment environment = V1Environment( annotations={"cloud.google.com/gke-preemptible": "true"}, tolerations=[{ "key": "cloud.google.com/gke-preemptible", "operator": "Equal", "value": "true", "effect": "NoSchedule", }], ) ``` -------------------------------- ### Configure Spot Instances Source: https://polyaxon.com/docs/core/scheduling-strategies/node-scheduling Examples for scheduling on preemptible VMs using node selectors and tolerations. ```yaml ... environment: nodeSelector: cloud.google.com/gke-preemptible: "true" ... ``` ```yaml ... environment: nodeSelector: cloud.google.com/gke-preemptible: "true" tolerations: - key: cloud.google.com/gke-preemptible operator: Equal value: "true" effect: NoSchedule ... ``` -------------------------------- ### Clone the Polyaxon quick-start repository Source: https://polyaxon.com/docs/intro/iterative-process/iterate-with-cli-local-code Download the example repository to your local machine to begin the integration process. ```bash git clone https://github.com/polyaxon/polyaxon-quick-start.git ``` -------------------------------- ### Configure Cleaner via YAML Source: https://polyaxon.com/docs/setup/auxiliaries/cleaner Full YAML configuration example for the cleaner job. ```yaml cleaner: image: polyaxon/polyaxon-init imageTag: v1.x imagePullPolicy: IfNotPresent resources: requests: memory: "64Mi" cpu: "50m" nodeSelector: foo: bar ``` -------------------------------- ### Usage Example for Tracking Module Source: https://polyaxon.com/docs/experimentation/tracking/module Demonstrates initializing the module and logging metrics directly from the top-level interface. ```python from polyaxon import tracking tracking.init() ... tracking.log_metrics(step=1, loss=0.09, accuracy=0.75) ... tracking.log_metrics(step=1, loss=0.02, accuracy=0.85) ... ``` -------------------------------- ### Define Start Time Source: https://polyaxon.com/docs/automation/schedules/datetime Setting the start time for the first execution using ISO 8601 format. ```yaml run: startAt: "2019-06-24T21:20:07+00:00" ``` -------------------------------- ### Configure V1RayReplica in Python Source: https://polyaxon.com/docs/experimentation/clusters/ray-replica Example of setting up a V1RayReplica instance with environment, init, sidecar, and container configurations. ```python from polyaxon.schemas import V1Environment, V1Init, V1RayReplica from polyaxon import k8s replica = V1RayReplica( replicas=2, environment=V1Environment(...), init=[V1Init(...)], sidecars=[k8s.V1Container(...)], container=k8s.V1Container(...), ) ``` -------------------------------- ### Deploy Polyaxon with Recommended Defaults Source: https://polyaxon.com/docs/setup/platform Installs Polyaxon using the recommended 'polyaxon' release name and namespace. ```bash helm install polyaxon/polyaxon \ --name=polyaxon \ --namespace=polyaxon \ -f config.yaml ``` -------------------------------- ### Polyaxonfile configuration for RunClient Source: https://polyaxon.com/docs/intro/passing-params/with-python-library Component definition for running the RunClient example. ```yaml version: 1.1 kind: component inputs: - name: message type: str isOptional: true value: "Default message" run: kind: job init: - file: content: | from polyaxon.client import RunClient client = RunClient() client.refresh_data() print(client.get_inputs()) filename: echo.py container: image: polyaxon/polyaxon-quick-start workingDir: "{{ globals.artifacts_path }}" command: [python3, -u, echo.py] ``` -------------------------------- ### Configure Ray cluster with Python Source: https://polyaxon.com/docs/experimentation/clusters/ray-clusters Example of setting up a V1RayCluster instance with specific versions and replica configurations. ```python from polyaxon.schemas import V1Environment, V1Init, V1RayCluster, V1RayReplica ray_cluster = V1RayCluster( connections=["connection-name1"], volumes=[k8s.V1Volume(...)], ray_version="2.5.0", head=V1RayReplica(...), worker=V1RayReplica(...), enable_in_tree_autoscaling=True, ) ``` -------------------------------- ### Define Joins in YAML Source: https://polyaxon.com/docs/automation/joins/specification Example configuration for joins using YAML syntax. ```yaml joins: - query: "metrics.loss: <0.01" sort: "metrics.loss" limit: 5 params: all_param1: value: inputs.param1 all_result1: value: outputs.result1 all_result2: value: outputs.result2 tensorboard_paths: value: artifacts.tensorboard contextOnly: true - query: "metrics.accuracy: >.9" sort: "-metrics.accuracy" params: all_inputs: value: inputs all_outputs: value: outputs run_artifact_paths: value: artifacts.base uuids: value: globals.uuid contextOnly: true files: value: {files: ["subpath/files", "subpath2/file2"]} toInit: true ``` -------------------------------- ### Start a JupyterLab notebook session Source: https://polyaxon.com/docs/intro/serving/preparing-model Launch a notebook session on the Kubernetes cluster and wait for it to become ready. ```bash polyaxon run --hub jupyterlab -w ``` -------------------------------- ### Deploy Polyaxon Agent with Recommended Defaults Source: https://polyaxon.com/docs/setup/agent Installs the agent using 'polyaxon' for both the release name and namespace. ```bash helm install polyaxon/agent \ --name=polyaxon \ --namespace=polyaxon \ -f config.yaml ``` -------------------------------- ### Run an experiment with a Git connection Source: https://polyaxon.com/docs/setup/connections/git Example of an experiment configuration utilizing a pre-defined Git connection. ```yaml kind: experiment build: image: tensorflow/tensorflow:1.4.1-py3 commit: 62b264813aaf5cba3a81919c623ea55c3f79698f run: kind: job init: - connection: "polyaxon-quick-start" container: command: [python3, model.py] ``` -------------------------------- ### Run an Experiment Source: https://polyaxon.com/docs/intro/quick-start Starts an experiment using a remote YAML manifest and streams the logs. ```bash polyaxon run --url=https://raw.githubusercontent.com/polyaxon/polyaxon-quick-start/master/experimentation/simple.yaml -l ``` -------------------------------- ### Get configuration keys Source: https://polyaxon.com/docs/core/cli/config Retrieves specific keys from the global configuration. ```bash Usage: polyaxon config get [OPTIONS] [KEYS]... Get the specific keys from the global configuration. Examples: $ polyaxon config get home host verify-ssl Options: --help Show this message and exit. ``` -------------------------------- ### Start a notebook with Polyaxon CLI Source: https://polyaxon.com/docs/intro/iterative-process/iterate-in-notebooks Execute a public JupyterLab component with TensorFlow support using the CLI. ```bash polyaxon run --hub jupyterlab:tensorflow -w ``` -------------------------------- ### Switching project context Source: https://polyaxon.com/docs/core/cli/cache Examples of overriding the current context to access different projects or operations. ```bash polyaxon project ops -p mnist -s "-created_at" ``` ```bash polyaxon project ops --project=acme/mnist -q "status: failed" ``` ```bash polyaxon ops ls --project=mnist --query="name: tensorboard" --sort="-created_at" ``` ```bash polyaxon tensorboards ls -p acme/mnist --query="name: tensorboard, status: running" ``` ```bash polyaxon ops get -p mnist -uid UUID ``` ```bash polyaxon ops get -p acme/mnist --uid=UUID ``` -------------------------------- ### Install JupyterLab extensions Source: https://polyaxon.com/docs/intro/iterative-process/iterate-in-notebooks Installs required extensions for Plotly support in JupyterLab. ```bash jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyterlab-plotly ``` -------------------------------- ### Configure PyTorch Job with Python Source: https://polyaxon.com/docs/experimentation/distributed/pytorch-jobs Example of creating a V1PytorchJob instance with specific policies and replica configurations. ```python from polyaxon.schemas import V1KFReplica, V1PytorchJob pytorch_job = V1PytorchJob( clean_pod_policy='All', master=V1KFReplica(...), worker=V1KFReplica(...), ) ``` -------------------------------- ### Install Polyaxon in Jupyter Source: https://polyaxon.com/docs/intro/iterative-process/iterate-in-notebooks Install or upgrade the Polyaxon package within the Jupyter environment. ```bash !pip install -U polyaxon ``` -------------------------------- ### Launch Tensorboard for multiple runs Source: https://polyaxon.com/docs/intro/tensorboard/comparing-runs-tensorboard Commands to start a Tensorboard service for comparing specific experiments by their UUIDs. ```bash polyaxon run --hub [-p PROJECT_NAME] tensorboard:multi-run -P uuids=UUID1,UUID2,UUID3,UUID4,UUID5 ``` ```bash polyaxon run --hub tensorboard:multi-run-storepath -P uuids=UUID1,UUID2,UUID3,UUID4,UUID5 ``` -------------------------------- ### Install Polyaxon CLI Source: https://polyaxon.com/docs/core/cli Use pip to install or upgrade the Polyaxon CLI package. ```bash pip install -U polyaxon ``` -------------------------------- ### Create a New Project Source: https://polyaxon.com/docs/core/cli/project Create a project with a specified name and description. ```bash $ polyaxon project create --name=cats-vs-dogs --description="Image Classification with DL" ``` ```bash $ polyaxon project create --name=owner/name --description="Project Description" ``` -------------------------------- ### V1MetricEarlyStopping YAML and Python Usage Source: https://polyaxon.com/docs/automation/helpers/early-stopping Examples for configuring metric-based early stopping in YAML and Python. ```yaml earlyStopping: - kind: metric_early_stopping metric: loss value: 0.001 optimization: minimize - kind: metric_early_stopping metric: accuaracy value: 0.9 optimization: maximize ``` ```python from polyaxon.schemas import V1MetricEarlyStopping, V1Optimization early_stopping = [ V1MetricEarlyStopping(metric="loss", optimization=V1Optimization.MINIMIZE), V1MetricEarlyStopping(metric="accuracy", optimization=V1Optimization.MAXIMIZE), ] ``` -------------------------------- ### Create a Polyaxon project Source: https://polyaxon.com/docs/management/artifacts-versioning/projects Initializes a new project with a specified name, description, and tags. ```bash polyaxon project create --name OWNER_NAME/MODEL_NAME --description ... --tags tag1,tag2,... ``` -------------------------------- ### Jupyter preset examples Source: https://polyaxon.com/docs/core/scheduling-presets/services-timeout Common preset configurations for Jupyter environments with varying timeout requirements. ```yaml termination: culling: timeout: 3600 probe: http: path: "/api/status" port: 8888 ``` ```yaml termination: timeout: 86400 culling: timeout: 14400 probe: http: path: "/api/status" port: 8888 ``` -------------------------------- ### get_member Source: https://polyaxon.com/docs/core/python-library/organization-client Gets an organization member. ```APIDOC ## get_member(user) ### Description Gets an organization member by username. ### Parameters - **user** (str) - Required - The username of the member. ``` -------------------------------- ### Configure Random Search in Python Source: https://polyaxon.com/docs/automation/optimization-engine/random-search Example of initializing the V1RandomSearch object with parameters and early stopping conditions. ```python from polyaxon.schemas import ( V1RandomSearch, V1HpLogSpace, V1HpUniform, V1FailureEarlyStopping, V1MetricEarlyStopping ) matrix = V1RandomSearch( num_runs=20, concurrency=2, seed=23, params={"param1": V1HpLogSpace(...), "param2": V1HpUniform(...), ... }, early_stopping=[V1FailureEarlyStopping(...), V1MetricEarlyStopping(...)] ) ``` -------------------------------- ### Define multiple components in Python Source: https://polyaxon.com/docs/intro/iterative-process/iterate-programmatically Example structure for a Python file containing multiple V1Component definitions. ```python from polyaxon.schemas import V1Component component1 = V1Component(...) component2 = V1Component(...) main = V1Component(...) ``` -------------------------------- ### Initialize a local project Source: https://polyaxon.com/docs/intro/iterative-process/iterate-with-cli-local-code Set up the current directory as a Polyaxon project to enable CLI caching and simplify command execution. ```bash polyaxon init -p quick-start --polyaxonignore ``` -------------------------------- ### get_logs Source: https://polyaxon.com/docs/core/python-library/run-client Gets the run’s logs. ```APIDOC ## get_logs(last_file=None, last_time=None) ### Description Gets the run’s logs, returning up to 2000 lines per request. ### Returns - **V1Logs** - The logs object. ``` -------------------------------- ### get_statuses Source: https://polyaxon.com/docs/core/python-library/run-client Gets the run’s statuses. ```APIDOC ## get_statuses(last_status=None) ### Description Retrieves the run’s statuses. ### Parameters - **last_status** (str) - Optional - A valid Statuses value. ### Returns - **Tuple[str, List[Conditions]]** - Last status and ordered status conditions. ``` -------------------------------- ### View Deployment Notes Source: https://polyaxon.com/docs/setup/agent Displays the post-installation instructions provided by the Helm chart. ```bash NOTES: ... ``` -------------------------------- ### polyaxon upgrade Source: https://polyaxon.com/docs/core/cli/version Installs or upgrades the Polyaxon CLI. ```APIDOC ## polyaxon upgrade ### Description Install/Upgrade polyaxon cli. ### Options - **--help** (flag) - Optional - Show this message and exit. ``` -------------------------------- ### Initialize a Polyaxon project Source: https://polyaxon.com/docs/core/cli/init Displays the usage and available options for the polyaxon init command. ```bash Usage: polyaxon init [OPTIONS] Initialize a new local project and cache directory. Note: Make sure to add the local cache `.polyaxon` to your `.gitignore` and `.dockerignore` files. Options: -p, --project TEXT To enable local cache in this folder, the project name to initialize, e.g. 'mnist' or 'acme/mnist'. --git-connection TEXT Optional git connection to use for the interactive mode and to automatically injecting code references in your operation manifests. --git-url TEXT Optional git url to use for the interactive mode and for automatically injecting code references in your operation manifests. If no git-connection is passed, this url must point to a public repo,If a connection is passed and if it has a git url reference in the schema it will be patched with this url. --polyaxonfile Init a polyaxon file in this project. --polyaxonignore Init a polyaxonignore file in this project. -y, --yes Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively. --help Show this message and exit. ``` -------------------------------- ### Offset Specification Source: https://polyaxon.com/docs/automation/joins/specification Example of setting an offset for pagination. ```yaml joins: - offset: "100" ``` -------------------------------- ### Create a New Project Source: https://polyaxon.com/docs/intro/quick-start Initializes a new project and sets it as the active project in the global cache. ```bash polyaxon project create --name=quick-start --description='Polyaxon quick start examples.' --tags=examples ``` -------------------------------- ### Define YAML params for artifacts Source: https://polyaxon.com/docs/core/specification/types Example of passing artifact values and connection configurations in YAML params. ```yaml params: some-file-names: {value: {files: ["file1", "/path/to/file2"]}} custom-file-paths: {value: {files: [["file1", "to/this/path/file1"], "/path/to/file2"]}} tensorboard-log-dir: {value: {dirs: ["/tensorboard-logs"]}, connection: "foo", toInit: True} dataset1: {value: {value: {dirs: ["/"]}, connection: "s3-dataset", toInit: True} ``` -------------------------------- ### get_artifact_version Source: https://polyaxon.com/docs/core/python-library/project-client Gets an artifact version under the current owner/project. ```APIDOC ## get_artifact_version(version) ### Description Gets an artifact version under the current owner/project. ### Parameters - **version** (str) - Required - The version name/tag. ### Returns - **V1ProjectVersion** - Artifact version. ``` -------------------------------- ### Get project details via CLI Source: https://polyaxon.com/docs/management/projects/general Retrieves information for a specific project using the owner and component name. ```bash polyaxon project get -c OWNER_NAME/COMPONENT_NAME ``` -------------------------------- ### get_component_version Source: https://polyaxon.com/docs/core/python-library/project-client Gets a component version under the current owner/project. ```APIDOC ## get_component_version(version) ### Description Gets a component version under the current owner/project. ### Parameters - **version** (str) - Required - The version name/tag. ### Returns - V1ProjectVersion - Component version. ``` -------------------------------- ### get_run Source: https://polyaxon.com/docs/core/python-library/organization-client Gets a run by uuid from the organization or team. ```APIDOC ## get_run(uuid) ### Description Gets a run by uuid from the organization or team. ### Parameters - **uuid** (str) - Required - The run uuid. ### Returns - **V1Run** - Run instance. ``` -------------------------------- ### Create a component project Source: https://polyaxon.com/docs/management/component-hub/projects Initializes a new project configured for component features. ```bash polyaxon project create --name OWNER_NAME/COMPONENT_NAME --description ... --tags tag1,tag2,... ``` -------------------------------- ### Start Tensorboard for a specific run Source: https://polyaxon.com/docs/intro/tensorboard/single-tensorboard Use this command to visualize outputs for a finished experiment by providing the run UUID. ```bash polyaxon run --hub tensorboard:single-run -P uuid=UUID ``` -------------------------------- ### Limit Specification Source: https://polyaxon.com/docs/automation/joins/specification Example of setting a limit for joined runs. ```yaml joins: - limit: "10" ``` -------------------------------- ### Initialize the project with a git URL Source: https://polyaxon.com/docs/intro/iterative-process/iterate-with-cli-git-code Initialize the local folder with a public git repository URL. ```bash polyaxon init -p quick-start --git-url https://github.com/polyaxon/polyaxon-quick-start ``` -------------------------------- ### Example Artifacts Resolution Source: https://polyaxon.com/docs/automation/joins/specification Representation of how artifacts are concatenated into a list. ```json { "artifacts": { "file": [ "run_3/subpath/files", "run_3/subpath2/file2", "run_4/subpath/files", "run_4/subpath2/file2", ... ], } ... } ``` -------------------------------- ### Configure V1Iterative in Python Source: https://polyaxon.com/docs/automation/optimization-engine/iterative Example of configuring the V1Iterative object with parameters, early stopping, and a tuner reference. ```python from polyaxon.schemas import ( V1Iterative, V1HpLogSpace, V1HpUniform, V1FailureEarlyStopping, V1MetricEarlyStopping, V1Tuner, ) matrix = V1Iterative( max_iterations=20, concurrency=2, seed=23, params={"param1": V1HpLogSpace(...), "param2": V1HpUniform(...), ... }, early_stopping=[V1FailureEarlyStopping(...), V1MetricEarlyStopping(...)], tuner=V1Tuner(hub_ref="org/my-suggestion-component") ) ``` -------------------------------- ### View CLI configuration help Source: https://polyaxon.com/docs/core/cli/reconfiguration Displays all available sub-commands and options for the configuration command. ```bash polyaxon config --help ``` -------------------------------- ### polyaxon ops get Source: https://polyaxon.com/docs/core/cli/ops Retrieves details for a specific run. ```APIDOC ## polyaxon ops get ### Description Get details for a specific run identified by its UUID. ### Options - **-p, --project** (TEXT) - Optional - The project name. - **-uid, -id, --uid, --uuid** (TEXT) - Optional - The run uuid. - **--offline** (FLAG) - Optional - Use the offline store for resolving runs. - **--path, --path-from** (PATH) - Optional - Offline root path to use where runs are persisted. - **-o, --output** (TEXT) - Optional - Print response as json or store as json file. ``` -------------------------------- ### Initialize tracking with manual client configuration Source: https://polyaxon.com/docs/experimentation/tracking/instantiation Use this to manually provide authentication and host configuration when not using a cluster or CLI. ```python from polyaxon import tracking from polyaxon.client import PolyaxonClient, RunClient client = PolyaxonClient(token=API_TOKEN, config=ClientConfig(host=HOST, use_https=None, verify_ssl=None)) run_client = RunClient(client=client) tracking.init(client=run_client) ``` -------------------------------- ### polyaxon project get Source: https://polyaxon.com/docs/core/cli/project Retrieves information for a specific project. ```APIDOC ## polyaxon project get ### Description Get info for current project, by project_name, or owner/project_name. ### Options - **-p, --project** (TEXT) - Optional - The project name, e.g. 'mnist' or 'acme/mnist'. ``` -------------------------------- ### Create a new Polyaxon project Source: https://polyaxon.com/docs/intro/serving/preparing-model Initialize a new project and configure the local directory for Polyaxon commands. ```bash polyaxon project create --name=ml-serving --init ``` -------------------------------- ### Run from a URL Source: https://polyaxon.com/docs/intro/quick-start/components Loads and executes a configuration file from a public web address. ```bash polyaxon run --url=https://public-site.com/polyaxonfile.yaml ``` -------------------------------- ### V1DaskReplica Python Usage Source: https://polyaxon.com/docs/experimentation/clusters/dask-replica Example of instantiating a V1DaskReplica object in Python. ```python from polyaxon.schemas import V1Environment, V1Init, V1DaskReplica from polyaxon import k8s replica = V1DaskReplica( replicas=2, environment=V1Environment(...), init=[V1Init(...)], sidecars=[k8s.V1Container(...)], container=k8s.V1Container(...), ) ``` -------------------------------- ### Reference operations in DAG Source: https://polyaxon.com/docs/automation/flow-engine/specification Example of referencing components using dagRef. ```yaml run: kind: dag operations: - name: download1 dagRef: download params: url: {value: 'gs://ml-pipeline-playground/shakespeare1.txt'} result: {value: 'result.txt'} - name: download2 dagRef: download params: url: {value: 'gs://ml-pipeline-playground/shakespeare2.txt'} result: {value: 'result.txt'} ``` -------------------------------- ### Sort Specification Source: https://polyaxon.com/docs/automation/joins/specification Example of a sort using Polyaxon Query Language. ```yaml joins: - sort: "created_at, -metrics.loss" ``` -------------------------------- ### View components CLI help Source: https://polyaxon.com/docs/core/cli/components Displays the available commands and options for managing components. ```bash Usage: polyaxon components [OPTIONS] COMMAND [ARGS]... Commands for managing components. Options: -p, --project TEXT The project name, e.g. 'mnist' or 'acme/mnist'. -ver, --version TEXT The component version, e.g. 'v1.3.4' or 'rc1' or 'latest'. --help Show this message and exit. Commands: copy Copy a component version. dashboard Open this component version's dashboard details in browser. delete Delete component version. get Get info for a component version by name, name & version,... ls List component versions by project or owner/project. pull Package and download a component version or multiple... push Push local packaged component version or multiple component... register Register a new component version. stage Update stage for a component version. stages List stages information for a component version by name,... transfer Transfer the version to a destination project under the same... update Update component version. ``` -------------------------------- ### Query Specification Source: https://polyaxon.com/docs/automation/joins/specification Example of a query using Polyaxon Query Language. ```yaml joins: - query: "metrics.loss: <0.01, project.name: {{ globals.project_name}}, kind: job" ``` -------------------------------- ### Initialize local folder with git repository Source: https://polyaxon.com/docs/core/cli/customize-git-preset Commands to initialize a project with a connection, a public URL, or a combination of both. ```bash polyaxon init -p PROJECT_NAME --connection CONNECTION_NAME ``` ```bash polyaxon init -p PROJECT_NAME --git-url https://github.com/org/repo-name ``` ```bash polyaxon init -p PROJECT_NAME --connection CONNECTION_NAME --git-url https://github.com/org/repo-name ``` -------------------------------- ### Retrieve project details Source: https://polyaxon.com/docs/management/artifacts-versioning/projects Fetches metadata and configuration for an existing project. ```bash polyaxon project get -p OWNER_NAME/MODEL_NAME ``` -------------------------------- ### Example Parameter List Resolution Source: https://polyaxon.com/docs/automation/joins/specification Representation of how parameters are resolved into lists. ```json { "all_param1": [val_run_1, val_run_223, val_run_234, ...], ... } ``` -------------------------------- ### Instantiate client with manual configuration Source: https://polyaxon.com/docs/core/python-library/instantiation Manually provide authentication tokens and host configuration to the PolyaxonClient. ```python from polyaxon.client import PolyaxonClient, ProjectClient, RunClient client = PolyaxonClient(token=API_TOKEN, config=ClientConfig(host=HOST, use_https=None, verify_ssl=None)) project_client = ProjectClient(owner="org1", project="project-name", client=client) run_client = RunClient(owner="org1", project="project-name", run_uuid="uuid", client=client) ``` -------------------------------- ### Get run metrics Source: https://polyaxon.com/docs/intro/iterative-process/iterate-in-notebooks Retrieves specific metrics for the current run. ```python from polyaxon.client import RunClient run_client = RunClient() run_client.get_metrics(['loss', 'accuracy']) ``` -------------------------------- ### Initialize V1Init class Source: https://polyaxon.com/docs/core/specification/init Instantiate the V1Init class to configure initialization logic. ```python polyaxon._flow.init.V1Init() ``` -------------------------------- ### Get Artifact Version Source: https://polyaxon.com/docs/core/python-library/project-client Fetches details for a specific artifact version. ```python get_artifact_version(self, version) ``` -------------------------------- ### Get run details Source: https://polyaxon.com/docs/core/python-library/organization-client Retrieves a specific run instance by its UUID. ```python get_run(self, uuid) ``` -------------------------------- ### Initialize V1KFReplica Source: https://polyaxon.com/docs/experimentation/distributed/kubeflow-replica Instantiate the V1KFReplica class to define a replica configuration. ```python polyaxon._flow.run.kubeflow.replica.V1KFReplica() ``` -------------------------------- ### Upgrade Polyaxon CLI Source: https://polyaxon.com/docs/core/cli/version Installs or upgrades the Polyaxon CLI to the latest version. ```bash Usage: polyaxon upgrade [OPTIONS] Install/Upgrade polyaxon cli. Options: --help Show this message and exit. ``` -------------------------------- ### Run component with parameters Source: https://polyaxon.com/docs/intro/passing-params/with-python-library CLI commands to execute the component with different input values. ```bash polyaxon run -f echo.yaml -P message="test 1" -l ``` ```bash polyaxon run -f echo.yaml -P message="test 2" -l ``` -------------------------------- ### Show current configuration Source: https://polyaxon.com/docs/core/cli/config Displays the current CLI, client, and user configuration settings. ```bash Usage: polyaxon config show [OPTIONS] Show the current cli, client, and user configs. Options: --help Show this message and exit. ``` -------------------------------- ### Define Joins in Python Source: https://polyaxon.com/docs/automation/joins/specification Example configuration for joins using Python objects. ```python joins = [ V1Join( query="metrics.loss: <0.01", sort="metrics.loss", limit=5, params={ "all_param1": V1JoinParam(value="inputs.param1"), "all_result1": V1JoinParam(value="outputs.result1"), "all_result2": V1JoinParam(value="outputs.result2"), "tensorboard_paths": V1JoinParam( value="artifacts.tensorboard", context_only=True ), }, ), V1Join( query="metrics.accuracy: >.9", sort="-metrics.accuracy", params={ "all_inputs": V1JoinParam(value="inputs"), "all_outputs": V1JoinParam(value="outputs"), "run_artifact_paths": V1JoinParam(value="artifacts") "uuids": V1JoinParam(value="globals.uuid"), "artifacts": V1JoinParam( value={files: ["subpath/files", "subpath2/file2"]}, to_init=True, ), } ) ] ``` -------------------------------- ### View upload command help Source: https://polyaxon.com/docs/intro/iterative-process/iterate-with-cli-local-code Access documentation for the CLI command used to upload artifacts to existing experiments. ```bash polyaxon ops upload --help ``` -------------------------------- ### Get model version details Source: https://polyaxon.com/docs/management/model-registry/versions Retrieves information about a specific model version. ```bash polyaxon models get -ver VERSION_NAME ``` ```python from polyaxon.client import ProjectClient project_client = ProjectClient(project="ORGANIZATION/bot-detection") version = project_client.get_model_version(version="v1") print(version) ``` -------------------------------- ### Run a component with parameters Source: https://polyaxon.com/docs/intro/quick-start/components Execute a component using the CLI while providing required parameters via the -P flag. ```bash polyaxon run --url=https://raw.githubusercontent.com/polyaxon/polyaxon-quick-start/master/experimentation/typed.yaml -P epochs=10 -l ``` -------------------------------- ### Get Organization Member Source: https://polyaxon.com/docs/core/python-library/organization-client Retrieves details for a specific organization member by username. ```python get_member(self, user) ``` -------------------------------- ### Navigate to the project directory Source: https://polyaxon.com/docs/intro/serving/preparing-model Change the current working directory to the cloned repository. ```bash cd polyaxon-ml-serving ``` -------------------------------- ### Initialize Tracking with Module Reference Source: https://polyaxon.com/docs/experimentation/tracking Initialize the tracking module globally to log experiment data. ```python from polyaxon import tracking tracking.init() tracking.log... ``` -------------------------------- ### Polyaxonfile configuration for tracking module Source: https://polyaxon.com/docs/intro/passing-params/with-python-library Component definition for running the tracking module example. ```yaml version: 1.1 kind: component inputs: - name: message type: str isOptional: true value: "Default message" run: kind: job init: - file: content: | from polyaxon import tracking tracking.init() print(tracking.TRACKING_RUN.get_inputs()) filename: echo.py container: image: polyaxon/polyaxon-quick-start workingDir: "{{ globals.artifacts_path }}" command: [python3, -u, echo.py] ``` -------------------------------- ### Define YAML inputs for artifacts Source: https://polyaxon.com/docs/core/specification/types Example of defining artifacts in a YAML inputs section. ```yaml inputs: - name: some-file-names type: artifacts - name: tensorboard-log-dir type: artifacts - name: dataset1 type: artifacts ``` -------------------------------- ### Initialize ProjectClient Source: https://polyaxon.com/docs/core/python-library/project-client Constructor for the ProjectClient class. If no arguments are provided, it attempts to resolve configuration from the environment or CLI. ```python polyaxon._client.project.ProjectClient(owner=None, project=None, client=None, is_offline=None, no_op=None, manual_exceptions_handling=False) ``` -------------------------------- ### Define Job in Python Source: https://polyaxon.com/docs/experimentation/jobs/specification Example of instantiating a V1Job object using the Python client. ```python from polyaxon.schemas import V1Environment, V1Init, V1Job from polyaxon import k8s job = V1Job( environment=V1Environment(...), connections=["connection-name1"], volumes=[k8s.V1Volume(...)], init=[V1Init(...)], sidecars=[k8s.V1Container(...)], container=k8s.V1Container(...), ) ``` -------------------------------- ### Define IO in YAML Source: https://polyaxon.com/docs/core/specification/io Example of declaring inputs and outputs within a YAML manifest. ```yaml inputs: - name: loss type: str isOptional: true value: MeanSquaredError - name: preprocess type: bool outputs: - name: accuracy type: float - name: outputs-path type: path ``` -------------------------------- ### Initialize Offline Tracking with tracking.init Source: https://polyaxon.com/docs/experimentation/tracking/offline Use the tracking.init module with is_offline=True to initialize local tracking. ```python from polyaxon import tracking ... tracking.init(..., is_offline=True, ...) ... tracking.log_metrics(m1=2.3, m2=0.1, step=2) tracking.log_outputs(result1=11, result2="foo") ... print(tracking.TRACKING_RUN.run_uuid) print(tracking.TRACKING_RUN.run_data) ... ``` -------------------------------- ### V1MetricEarlyStopping Field Examples Source: https://polyaxon.com/docs/automation/helpers/early-stopping Configuration snippets for specific fields in metric early stopping. ```yaml earlyStopping: - kind: metric_early_stopping ``` ```yaml earlyStopping: - metric: loss ``` ```yaml earlyStopping: - value: 0.5 ``` ```yaml earlyStopping: - optimization: maximize ``` -------------------------------- ### Retrieve component details Source: https://polyaxon.com/docs/management/component-hub/projects Fetches the overview of a specific component project. ```bash polyaxon project get -p OWNER_NAME/COMPONENT_NAME ``` -------------------------------- ### Initialize V1Plugins Source: https://polyaxon.com/docs/core/specification/plugins Instantiate the V1Plugins class to configure utility settings. ```python polyaxon._flow.plugins.V1Plugins() ``` -------------------------------- ### V1FailureEarlyStopping Field Examples Source: https://polyaxon.com/docs/automation/helpers/early-stopping Configuration snippets for specific fields in failure early stopping. ```yaml earlyStopping: - kind: failure_early_stopping ``` ```yaml earlyStopping: - kind: failure_early_stopping percent: 30 ``` -------------------------------- ### Initialize a repository as a parameter Source: https://polyaxon.com/docs/setup/connections/git Using a defined Git connection as an initialization parameter. ```yaml params: repo: connection: "repo-test" init: true ``` -------------------------------- ### Get absolute artifacts path Source: https://polyaxon.com/docs/experimentation/tracking/module Retrieves the absolute path for artifacts in the current run. ```python tracking.get_artifacts_path(rel_path=None, ensure_path=False, is_dir=False, use_store_path=False) ``` -------------------------------- ### Get run details Source: https://polyaxon.com/docs/intro/query-metadata-artifacts/using-cli Retrieve information about a specific run using its unique identifier. ```bash polyaxon ops get -uid 8aac02e3a62a4f0aaa257c59da5eab80 [-p PROJECT_NAME] ``` -------------------------------- ### View Polyaxon CLI Help Source: https://polyaxon.com/docs/setup/cli Display the list of supported commands and options for the Polyaxon CLI. ```bash polyaxon --help ``` -------------------------------- ### Get a model version Source: https://polyaxon.com/docs/core/python-library/project-client Fetches details for a specific model version by name or tag. ```python get_model_version(self, version) ``` -------------------------------- ### Get artifact version info Source: https://polyaxon.com/docs/core/cli/artifacts Retrieve information for an artifact version by name or project. ```bash $ polyaxon artifacts get -p data-versioning ``` ```bash $ polyaxon artifacts get -p owner/data-versioning -ver rc1 ``` -------------------------------- ### Initialize Tracking with Run Client Source: https://polyaxon.com/docs/experimentation/tracking Instantiate a tracking client using the Run class to log experiment data. ```python from polyaxon.tracking import Run experiment = Run() experiment.log... ``` -------------------------------- ### Get component version info Source: https://polyaxon.com/docs/core/cli/components Retrieves detailed information for a specific component version. ```bash Usage: polyaxon components get [OPTIONS] Get info for a component version by name, name & version, owner/name & tag. Examples: $ polyaxon components get // returns `latest` in current project $ polyaxon components get --project=my-project --version=test-version $ polyaxon components get -p owner/my-project -ver rc12 Options: -p, --project TEXT The project name, e.g. 'mnist' or 'acme/mnist'. -ver, --version TEXT The component version, e.g. 'v1.3.4' or 'rc1' or 'latest'. --help Show this message and exit. ``` -------------------------------- ### Create a new project via CLI Source: https://polyaxon.com/docs/management/projects/general Creates a new project with a specified name and description. Projects are private by default unless the --public flag is used. ```bash polyaxon project create --name=mnist --description='Classification of handwritten images.' ```