Skip to main content

License: MIT Build Status PyPI version Slack

Polyaxon-helper

Polyaxon helper is a lightweight python library to report metrics and communicate information with Polyaxon.

Installation

$ pip install -U polyaxon-helper

for python3

$ pip3 install -U polyaxon-helper

Install polyaxon

Please check polyaxon installation guide

Install in polyaxonfile

If you want to delegate the installation to polyaxon during the build process, add a new step to the run section in your polyaxonfile:

...
build:
  image: ...
  build_steps:
    - ...
    - pip install -U polyaxon-helper
    - ...

run:
  cmd: ...

Usage

Getting env variables defined by Polyaxon

from polyaxon_helper import (
    get_cluster_def,
    get_declarations,
    get_experiment_info,
    get_task_info,
    get_tf_config,
    get_job_info,
    get_outputs_path,
    get_outputs_refs_paths,
    get_data_paths,
    get_log_level
)

cluster_def = get_cluster_def()
declarations = get_declarations()
experiment_info = get_experiment_info()
task_info = get_task_info()
job_info = get_job_info()
outputs_path = get_outputs_path()
outputs_refs_paths = get_outputs_refs_paths()
data_paths = get_data_paths()
tf_config = get_tf_config()
log_level = get_log_level()
  • get_cluster_def: Returns cluster definition created by polyaxon.

    {
        "master": ["plxjob-master0-8eefb7a1146f476ca66e3bee9b88c1de:2000"],
        "worker": ["plxjob-worker1-8eefb7a1146f476ca66e3bee9b88c1de:2000",
                   "plxjob-worker2-8eefb7a1146f476ca66e3bee9b88c1de:2000"],
        "ps": ["plxjob-ps3-8eefb7a1146f476ca66e3bee9b88c1de:2000"],
    }
    
  • get_declarations: Returns all the experiment declarations based on both,

    • declarations section
    • matrix section
  • get_tf_config: Returns the TF_CONFIG defining the cluster and the current task. if envvar is not null, it will set and env variable with envvar.

  • get_experiment_info: Returns information about the experiment.

    • project_name
    • experiment_group_name
    • experiment_name
    • project_uuid
    • experiment_group_uuid
    • experiment_uuid
  • get_job_info: Returns information about the job.

    • project_name
    • job_name
    • project_uuid
    • job_uuid
  • get_task_info: Returns the task info: {"type": str, "index": int}.

  • outputs_path: The outputs path generated by polyaxon based on the hierarchy of the experiment.

     `user/project/group/experiment/files`
    
  • data_paths: The data paths mounted for the job/experiment:

     {
       'data1': '/data/1',
       'data-foo': '/data/foo',
     }
    
  • outputs_path: The references outputs paths requested by the user, the order follows the order specified by the user:

     {
         'experiments': [
             `user/project/job12/files`,
         ], 'experiments': [
             `user/project/group/experiment1/files`,
             `user/project/experiment100/files`
         ]
     }
    
  • get_log_level: If set on the polyaxonfile it will return the log level.

Reporting metrics to Polyaxon

In order to report metrics for an experiment, just add these lines in you program.

from polyaxon_helper import send_metrics

send_metrics(accuracy=0.9, precision=0.95)

Quick start

Please check our quick start guide to start training your first experiment.

License

FOSSA Status

Metadata

Release files for polyaxon-helper 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polyaxon-helper 0.5.0
File Size Uploaded
polyaxon-helper-0.5.0.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for polyaxon-helper 0.5.0
File Interpreter ABI Platform
polyaxon_helper-0.5.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.4 kB

Release files / polyaxon-helper-0.5.0.tar.gz

Download URL polyaxon-helper-0.5.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6c7e23dcf6c2d0e5c3532754be2cc475783a7473ecfe8102f1b2c7bb7f0cdfdf
BLAKE2b-256 checksum
How to use checksums
df575a505a1a904df83405b756aff087259ac49b618240640dc87d43198ff0eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4

Release files / polyaxon_helper-0.5.0-py2.py3-none-any.whl

Download URL polyaxon_helper-0.5.0-py2.py3-none-any.whl
Size 6.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
552934f42fb5fab24cd13148d262f8ed1fcfd340544d00c6c178e8bf7e018942
BLAKE2b-256 checksum
How to use checksums
36bd3cae6e3157f355f1f5db6ec7b0a55405147686026f0f7e23e4122948cf4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.4

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page