├── .github ├── dependabot.yml └── workflows │ ├── cli.yml │ └── codeql-analysis.yml ├── .gitignore ├── .prospector.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── cli ├── MANIFEST.in ├── polyaxon-complete.sh ├── polyaxon │ ├── __init__.py │ ├── __main__.py │ ├── _auxiliaries │ │ ├── __init__.py │ │ ├── cleaner.py │ │ ├── default_scheduling.py │ │ ├── init.py │ │ ├── notifier.py │ │ ├── sidecar.py │ │ └── tuner.py │ ├── _cli │ │ ├── __init__.py │ │ ├── admin.py │ │ ├── artifacts.py │ │ ├── auth.py │ │ ├── check.py │ │ ├── completion.py │ │ ├── components.py │ │ ├── config.py │ │ ├── dashboard.py │ │ ├── errors.py │ │ ├── init.py │ │ ├── models.py │ │ ├── operations.py │ │ ├── options.py │ │ ├── port_forward.py │ │ ├── project_versions.py │ │ ├── projects.py │ │ ├── run.py │ │ ├── services │ │ │ ├── __init__.py │ │ │ ├── agent.py │ │ │ ├── clean_artifacts.py │ │ │ ├── docker.py │ │ │ ├── initializer.py │ │ │ ├── notifier.py │ │ │ ├── sidecar.py │ │ │ ├── tuner.py │ │ │ └── wait.py │ │ ├── session.py │ │ ├── utils.py │ │ └── version.py │ ├── _client │ │ ├── __init__.py │ │ ├── client.py │ │ ├── decorators │ │ │ ├── __init__.py │ │ │ ├── client_call_handler.py │ │ │ ├── errors.py │ │ │ └── is_managed.py │ │ ├── impersonate.py │ │ ├── init.py │ │ ├── mixin.py │ │ ├── project.py │ │ ├── run.py │ │ ├── store.py │ │ ├── transport │ │ │ ├── __init__.py │ │ │ ├── http_transport.py │ │ │ ├── periodic_transport.py │ │ │ ├── retry_transport.py │ │ │ ├── socket_transport.py │ │ │ ├── threaded_transport.py │ │ │ └── ws_client.py │ │ └── workers │ │ │ ├── __init__.py │ │ │ ├── base_worker.py │ │ │ ├── periodic_worker.py │ │ │ └── queue_worker.py │ ├── _compiler │ │ ├── __init__.py │ │ ├── contexts │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── contexts.py │ │ │ ├── dask_job.py │ │ │ ├── job.py │ │ │ ├── kubeflow │ │ │ │ ├── __init__.py │ │ │ │ ├── mpi_job.py │ │ │ │ ├── pytroch_job.py │ │ │ │ └── tf_job.py │ │ │ ├── ray_job.py │ │ │ └── service.py │ │ ├── lineage │ │ │ ├── __init__.py │ │ │ ├── artifacts_collector.py │ │ │ ├── collector.py │ │ │ └── io_collector.py │ │ └── resolver │ │ │ ├── __init__.py │ │ │ ├── agent.py │ │ │ ├── resolver.py │ │ │ └── runtime.py │ ├── _config │ │ ├── __init__.py │ │ ├── manager.py │ │ ├── parser.py │ │ ├── reader.py │ │ └── spec.py │ ├── _connections │ │ ├── __init__.py │ │ ├── kinds.py │ │ └── schemas.py │ ├── _constants │ │ ├── __init__.py │ │ ├── globals.py │ │ └── metadata.py │ ├── _containers │ │ ├── __init__.py │ │ ├── names.py │ │ ├── pull_policy.py │ │ └── statuses.py │ ├── _contexts │ │ ├── __init__.py │ │ ├── keys.py │ │ ├── params.py │ │ ├── paths.py │ │ ├── refs.py │ │ └── sections.py │ ├── _deploy │ │ ├── __init__.py │ │ ├── operators │ │ │ ├── __init__.py │ │ │ ├── cmd_operator.py │ │ │ ├── compose.py │ │ │ ├── conda.py │ │ │ ├── docker.py │ │ │ ├── helm.py │ │ │ ├── kubectl.py │ │ │ └── pip.py │ │ ├── reader.py │ │ └── schemas │ │ │ ├── __init__.py │ │ │ ├── auth.py │ │ │ ├── celery.py │ │ │ ├── deployment.py │ │ │ ├── deployment_types.py │ │ │ ├── email.py │ │ │ ├── ingress.py │ │ │ ├── intervals.py │ │ │ ├── operators.py │ │ │ ├── proxy.py │ │ │ ├── rbac.py │ │ │ ├── root_user.py │ │ │ ├── security_context.py │ │ │ ├── service.py │ │ │ ├── service_types.py │ │ │ ├── ssl.py │ │ │ └── ui.py │ ├── _dist.py │ ├── _docker │ │ ├── __init__.py │ │ ├── agent.py │ │ ├── builder │ │ │ ├── __init__.py │ │ │ ├── builder.py │ │ │ ├── dockerfile.py │ │ │ └── generator.py │ │ ├── converter │ │ │ ├── __init__.py │ │ │ ├── base │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── containers.py │ │ │ │ ├── env_vars.py │ │ │ │ ├── init.py │ │ │ │ ├── main.py │ │ │ │ └── mounts.py │ │ │ ├── converters │ │ │ │ ├── __init__.py │ │ │ │ ├── job.py │ │ │ │ └── service.py │ │ │ └── mixins.py │ │ ├── docker_types.py │ │ └── executor.py │ ├── _env_vars │ │ ├── __init__.py │ │ ├── getters │ │ │ ├── __init__.py │ │ │ ├── agent.py │ │ │ ├── owner_entity.py │ │ │ ├── project.py │ │ │ ├── queue.py │ │ │ ├── run.py │ │ │ ├── user.py │ │ │ └── versioned_entity.py │ │ └── keys.py │ ├── _flow │ │ ├── __init__.py │ │ ├── builds │ │ │ └── __init__.py │ │ ├── cache │ │ │ ├── __init__.py │ │ │ └── enums.py │ │ ├── component │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── component.py │ │ │ └── component_reference.py │ │ ├── containers │ │ │ ├── __init__.py │ │ │ └── container.py │ │ ├── dags │ │ │ └── __init__.py │ │ ├── early_stopping │ │ │ ├── __init__.py │ │ │ └── policies.py │ │ ├── environment │ │ │ └── __init__.py │ │ ├── events │ │ │ ├── __init__.py │ │ │ └── enums.py │ │ ├── hooks │ │ │ └── __init__.py │ │ ├── init │ │ │ └── __init__.py │ │ ├── io │ │ │ ├── __init__.py │ │ │ └── io.py │ │ ├── joins │ │ │ └── __init__.py │ │ ├── matrix │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── bayes.py │ │ │ ├── enums.py │ │ │ ├── grid_search.py │ │ │ ├── hyperband.py │ │ │ ├── hyperopt.py │ │ │ ├── iterative.py │ │ │ ├── mapping.py │ │ │ ├── params.py │ │ │ ├── random_search.py │ │ │ └── tuner.py │ │ ├── mounts │ │ │ ├── __init__.py │ │ │ └── artifacts_mounts.py │ │ ├── notifications │ │ │ └── __init__.py │ │ ├── operations │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── compiled_operation.py │ │ │ └── operation.py │ │ ├── operators.py │ │ ├── optimization │ │ │ ├── __init__.py │ │ │ └── enums.py │ │ ├── params │ │ │ ├── __init__.py │ │ │ ├── ops_params.py │ │ │ └── params.py │ │ ├── plugins │ │ │ └── __init__.py │ │ ├── references │ │ │ ├── __init__.py │ │ │ ├── dag.py │ │ │ ├── hub.py │ │ │ ├── mixin.py │ │ │ ├── path.py │ │ │ └── url.py │ │ ├── run │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── cleaner.py │ │ │ ├── dag.py │ │ │ ├── dask │ │ │ │ ├── __init__.py │ │ │ │ ├── dask.py │ │ │ │ └── replica.py │ │ │ ├── enums.py │ │ │ ├── job.py │ │ │ ├── kubeflow │ │ │ │ ├── __init__.py │ │ │ │ ├── clean_pod_policy.py │ │ │ │ ├── mpi_job.py │ │ │ │ ├── pytorch_job.py │ │ │ │ ├── replica.py │ │ │ │ ├── scheduling_policy.py │ │ │ │ └── tf_job.py │ │ │ ├── notifier.py │ │ │ ├── patch.py │ │ │ ├── ray │ │ │ │ ├── __init__.py │ │ │ │ ├── ray.py │ │ │ │ └── replica.py │ │ │ ├── resources.py │ │ │ ├── service.py │ │ │ ├── tuner.py │ │ │ └── utils.py │ │ ├── schedules │ │ │ ├── __init__.py │ │ │ ├── cron.py │ │ │ ├── datetime.py │ │ │ ├── enums.py │ │ │ └── interval.py │ │ ├── templates │ │ │ └── __init__.py │ │ ├── termination │ │ │ └── __init__.py │ │ └── trigger_policies.py │ ├── _fs │ │ ├── __init__.py │ │ ├── async_manager.py │ │ ├── fs.py │ │ ├── manager.py │ │ ├── tar.py │ │ ├── types.py │ │ ├── utils.py │ │ └── watcher.py │ ├── _init │ │ ├── __init__.py │ │ ├── artifacts.py │ │ ├── auth.py │ │ ├── dockerfile.py │ │ ├── file.py │ │ ├── git.py │ │ └── tensorboard.py │ ├── _k8s │ │ ├── __init__.py │ │ ├── agent │ │ │ ├── __init__.py │ │ │ ├── agent.py │ │ │ └── async_agent.py │ │ ├── constants.py │ │ ├── converter │ │ │ ├── __init__.py │ │ │ ├── base │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── containers.py │ │ │ │ ├── env_vars.py │ │ │ │ ├── init.py │ │ │ │ ├── main.py │ │ │ │ ├── mounts.py │ │ │ │ └── sidecar.py │ │ │ ├── common │ │ │ │ ├── __init__.py │ │ │ │ ├── accelerators.py │ │ │ │ ├── annotations.py │ │ │ │ └── volumes.py │ │ │ ├── converters │ │ │ │ ├── __init__.py │ │ │ │ ├── dask_job.py │ │ │ │ ├── helpers.py │ │ │ │ ├── job.py │ │ │ │ ├── kubeflow │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── mpi_job.py │ │ │ │ │ ├── pytroch_job.py │ │ │ │ │ └── tf_job.py │ │ │ │ ├── ray_job.py │ │ │ │ └── service.py │ │ │ ├── mixins.py │ │ │ └── pod │ │ │ │ ├── __init__.py │ │ │ │ ├── spec.py │ │ │ │ └── volumes.py │ │ ├── custom_resources │ │ │ ├── __init__.py │ │ │ ├── crd.py │ │ │ ├── dask_job.py │ │ │ ├── job.py │ │ │ ├── kubeflow │ │ │ │ ├── __init__.py │ │ │ │ ├── common.py │ │ │ │ ├── mpi_job.py │ │ │ │ ├── pytorch_job.py │ │ │ │ └── tf_job.py │ │ │ ├── operation.py │ │ │ ├── ray_job.py │ │ │ ├── service.py │ │ │ └── setter.py │ │ ├── events.py │ │ ├── executor │ │ │ ├── __init__.py │ │ │ ├── async_executor.py │ │ │ ├── base.py │ │ │ └── executor.py │ │ ├── k8s_schemas.py │ │ ├── k8s_validation.py │ │ ├── logging │ │ │ ├── __init__.py │ │ │ ├── async_monitor.py │ │ │ └── monitor.py │ │ ├── manager │ │ │ ├── __init__.py │ │ │ ├── async_manager.py │ │ │ ├── base.py │ │ │ └── manager.py │ │ ├── monitor.py │ │ ├── namespace.py │ │ ├── nodes.py │ │ ├── pods.py │ │ └── replica.py │ ├── _local_process │ │ ├── __init__.py │ │ ├── agent.py │ │ ├── converter │ │ │ ├── __init__.py │ │ │ ├── base │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── containers.py │ │ │ │ ├── env_vars.py │ │ │ │ ├── init.py │ │ │ │ ├── main.py │ │ │ │ └── mounts.py │ │ │ ├── converters │ │ │ │ ├── __init__.py │ │ │ │ ├── job.py │ │ │ │ └── service.py │ │ │ └── mixins.py │ │ ├── executor.py │ │ └── process_types.py │ ├── _managers │ │ ├── __init__.py │ │ ├── agent.py │ │ ├── auth.py │ │ ├── cli.py │ │ ├── client.py │ │ ├── compose.py │ │ ├── deploy.py │ │ ├── git.py │ │ ├── home.py │ │ ├── ignore.py │ │ ├── project.py │ │ ├── run.py │ │ └── user.py │ ├── _notifiers │ │ ├── __init__.py │ │ └── spec.py │ ├── _operations │ │ ├── __init__.py │ │ ├── cleaner.py │ │ ├── notifier.py │ │ └── tuner.py │ ├── _plugins │ │ ├── __init__.py │ │ └── sentry.py │ ├── _polyaxonfile │ │ ├── __init__.py │ │ ├── check.py │ │ ├── manager │ │ │ ├── __init__.py │ │ │ ├── operations.py │ │ │ └── workflows.py │ │ ├── params.py │ │ └── specs │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── compiled_operation.py │ │ │ ├── component.py │ │ │ ├── kinds.py │ │ │ ├── libs │ │ │ ├── __init__.py │ │ │ ├── engine.py │ │ │ ├── parser.py │ │ │ └── validator.py │ │ │ ├── operation.py │ │ │ └── sections.py │ ├── _pql │ │ ├── __init__.py │ │ ├── builder.py │ │ ├── manager.py │ │ └── parser.py │ ├── _runner │ │ ├── __init__.py │ │ ├── agent │ │ │ ├── __init__.py │ │ │ ├── async_agent.py │ │ │ ├── base_agent.py │ │ │ ├── client.py │ │ │ └── sync_agent.py │ │ ├── converter │ │ │ ├── __init__.py │ │ │ ├── common │ │ │ │ ├── __init__.py │ │ │ │ ├── constants.py │ │ │ │ ├── containers.py │ │ │ │ └── volumes.py │ │ │ ├── converter.py │ │ │ ├── init │ │ │ │ ├── __init__.py │ │ │ │ ├── artifacts.py │ │ │ │ ├── dockerfile.py │ │ │ │ ├── file.py │ │ │ │ ├── git.py │ │ │ │ ├── store.py │ │ │ │ └── tensorboard.py │ │ │ └── types.py │ │ ├── executor.py │ │ └── kinds.py │ ├── _schemas │ │ ├── __init__.py │ │ ├── agent.py │ │ ├── authentication.py │ │ ├── base.py │ │ ├── checks.py │ │ ├── cli.py │ │ ├── client.py │ │ ├── compatibility.py │ │ ├── container_resources.py │ │ ├── home.py │ │ ├── installation.py │ │ ├── lifecycle.py │ │ ├── log_handler.py │ │ ├── services.py │ │ ├── types │ │ │ ├── __init__.py │ │ │ ├── artifacts.py │ │ │ ├── base.py │ │ │ ├── clipped.py │ │ │ ├── dockerfile.py │ │ │ ├── event.py │ │ │ ├── file.py │ │ │ ├── git.py │ │ │ └── tensorboard.py │ │ ├── user.py │ │ └── version.py │ ├── _sdk │ │ ├── __init__.py │ │ ├── api │ │ │ ├── __init__.py │ │ │ ├── agents_v1_api.py │ │ │ ├── artifacts_stores_v1_api.py │ │ │ ├── auth_v1_api.py │ │ │ ├── connections_v1_api.py │ │ │ ├── dashboards_v1_api.py │ │ │ ├── organizations_v1_api.py │ │ │ ├── presets_v1_api.py │ │ │ ├── project_dashboards_v1_api.py │ │ │ ├── project_searches_v1_api.py │ │ │ ├── projects_v1_api.py │ │ │ ├── queues_v1_api.py │ │ │ ├── runs_v1_api.py │ │ │ ├── searches_v1_api.py │ │ │ ├── service_accounts_v1_api.py │ │ │ ├── tags_v1_api.py │ │ │ ├── teams_v1_api.py │ │ │ ├── users_v1_api.py │ │ │ └── versions_v1_api.py │ │ ├── async_client │ │ │ ├── __init__.py │ │ │ ├── api_client.py │ │ │ └── rest.py │ │ ├── base_api.py │ │ ├── configuration.py │ │ ├── schemas │ │ │ ├── __init__.py │ │ │ ├── v1_activity.py │ │ │ ├── v1_agent.py │ │ │ ├── v1_agent_reconcile_body_request.py │ │ │ ├── v1_agent_state_response.py │ │ │ ├── v1_agent_state_response_agent_state.py │ │ │ ├── v1_agent_status_body_request.py │ │ │ ├── v1_analytics_spec.py │ │ │ ├── v1_artifact_tree.py │ │ │ ├── v1_auth.py │ │ │ ├── v1_cloning.py │ │ │ ├── v1_connection_response.py │ │ │ ├── v1_dashboard.py │ │ │ ├── v1_dashboard_spec.py │ │ │ ├── v1_entities_tags.py │ │ │ ├── v1_entities_transfer.py │ │ │ ├── v1_entity_notification_body.py │ │ │ ├── v1_entity_stage_body_request.py │ │ │ ├── v1_entity_status_body_request.py │ │ │ ├── v1_events_response.py │ │ │ ├── v1_list_activities_response.py │ │ │ ├── v1_list_agents_response.py │ │ │ ├── v1_list_bookmarks_response.py │ │ │ ├── v1_list_connections_response.py │ │ │ ├── v1_list_dashboards_response.py │ │ │ ├── v1_list_organization_members_response.py │ │ │ ├── v1_list_organizations_response.py │ │ │ ├── v1_list_presets_response.py │ │ │ ├── v1_list_project_versions_response.py │ │ │ ├── v1_list_projects_response.py │ │ │ ├── v1_list_queues_response.py │ │ │ ├── v1_list_run_artifacts_response.py │ │ │ ├── v1_list_run_connections_response.py │ │ │ ├── v1_list_run_edges_response.py │ │ │ ├── v1_list_runs_response.py │ │ │ ├── v1_list_searches_response.py │ │ │ ├── v1_list_service_accounts_response.py │ │ │ ├── v1_list_tags_response.py │ │ │ ├── v1_list_team_members_response.py │ │ │ ├── v1_list_teams_response.py │ │ │ ├── v1_list_token_response.py │ │ │ ├── v1_operation_body.py │ │ │ ├── v1_organization.py │ │ │ ├── v1_organization_member.py │ │ │ ├── v1_password_change.py │ │ │ ├── v1_pipeline.py │ │ │ ├── v1_preset.py │ │ │ ├── v1_project.py │ │ │ ├── v1_project_settings.py │ │ │ ├── v1_project_version.py │ │ │ ├── v1_queue.py │ │ │ ├── v1_run.py │ │ │ ├── v1_run_connection.py │ │ │ ├── v1_run_edge.py │ │ │ ├── v1_run_edge_lineage.py │ │ │ ├── v1_run_edges_graph.py │ │ │ ├── v1_run_reference_catalog.py │ │ │ ├── v1_run_settings.py │ │ │ ├── v1_search.py │ │ │ ├── v1_search_spec.py │ │ │ ├── v1_section_spec.py │ │ │ ├── v1_service_account.py │ │ │ ├── v1_settings_catalog.py │ │ │ ├── v1_tag.py │ │ │ ├── v1_team.py │ │ │ ├── v1_team_member.py │ │ │ ├── v1_team_settings.py │ │ │ ├── v1_token.py │ │ │ ├── v1_trial_start.py │ │ │ ├── v1_user.py │ │ │ ├── v1_user_access.py │ │ │ ├── v1_user_email.py │ │ │ ├── v1_user_singup.py │ │ │ └── v1_uuids.py │ │ └── sync_client │ │ │ ├── __init__.py │ │ │ ├── api_client.py │ │ │ └── rest.py │ ├── _services │ │ ├── __init__.py │ │ ├── auth.py │ │ ├── headers.py │ │ └── values.py │ ├── _sidecar │ │ ├── __init__.py │ │ ├── container │ │ │ ├── __init__.py │ │ │ ├── intervals.py │ │ │ └── monitors │ │ │ │ ├── __init__.py │ │ │ │ ├── artifacts.py │ │ │ │ ├── logs.py │ │ │ │ └── spec.py │ │ ├── ignore.py │ │ └── processor.py │ ├── _utils │ │ ├── __init__.py │ │ ├── cache.py │ │ ├── cli_constants.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── backfill.py │ │ │ ├── bo.py │ │ │ ├── build.py │ │ │ ├── grid.py │ │ │ ├── jobs.py │ │ │ ├── mapping.py │ │ │ ├── pipelines.py │ │ │ ├── schedule.py │ │ │ └── services.py │ │ ├── formatting.py │ │ ├── fqn_utils.py │ │ ├── host_utils.py │ │ ├── test_utils.py │ │ └── urls_utils.py │ ├── _vendor │ │ ├── __init__.py │ │ └── shell_pty.py │ ├── api.py │ ├── cli.py │ ├── client.py │ ├── docker.py │ ├── exceptions.py │ ├── fs.py │ ├── k8s.py │ ├── logger.py │ ├── pkg.py │ ├── polyaxonfile.py │ ├── py.typed │ ├── schemas.py │ ├── settings.py │ ├── tracking │ │ ├── __init__.py │ │ ├── contrib │ │ │ ├── __init__.py │ │ │ ├── fastai.py │ │ │ ├── fastai_v1.py │ │ │ ├── hugging_face.py │ │ │ ├── ignite.py │ │ │ ├── keras.py │ │ │ ├── lightgbm.py │ │ │ ├── pytorch_lightning.py │ │ │ ├── scikit.py │ │ │ ├── tensorboard.py │ │ │ ├── tensorflow.py │ │ │ └── xgboost.py │ │ └── run.py │ ├── tuners │ │ ├── __init__.py │ │ ├── bayesian_optimization.py │ │ ├── grid_search.py │ │ ├── hyperband.py │ │ ├── hyperopt.py │ │ ├── mapping.py │ │ └── random_search.py │ └── types.py ├── polyaxon_sdk │ └── __init__.py ├── requirements │ ├── dev.txt │ ├── fs.txt │ ├── init.txt │ ├── k8s_async.txt │ ├── master.txt │ ├── prod.txt │ ├── requirements.txt │ ├── sidecar.txt │ └── test.txt ├── ruff.toml ├── setup.cfg ├── setup.py └── tests │ ├── __init__.py │ ├── conftest.py │ ├── fixtures │ ├── deployment │ │ ├── all_agent_values.yml │ │ ├── all_external_platform_values.yml │ │ ├── all_platform_values.yml │ │ ├── external_pgsql_values.yml │ │ ├── external_rabbitmq_values.yml │ │ ├── external_redis_values.yml │ │ ├── internal_redis_rabbitmq_values.yml │ │ ├── monitoring_values.yml │ │ ├── values1.yml │ │ ├── values2.yml │ │ ├── values3.yml │ │ ├── values4.yml │ │ ├── values5.yml │ │ ├── values6.yml │ │ ├── wrong_values1.yml │ │ ├── wrong_values10.yml │ │ ├── wrong_values11.yml │ │ ├── wrong_values2.yml │ │ ├── wrong_values3.yml │ │ ├── wrong_values4.yml │ │ ├── wrong_values5.yml │ │ ├── wrong_values6.yml │ │ ├── wrong_values7.yml │ │ ├── wrong_values8.yml │ │ └── wrong_values9.yml │ ├── pipelines │ │ ├── build_run_pipeline.yml │ │ ├── cyclic_pipeline.yml │ │ ├── matrix_file.yml │ │ ├── matrix_file_early_stopping.yml │ │ ├── matrix_file_with_int_float_types.yml │ │ ├── pipeline_ops_not_corresponding_to_components.yml │ │ ├── pipeline_with_no_components.yml │ │ ├── pipeline_with_no_ops.yml │ │ ├── ref_pipeline.yml │ │ ├── simple_cron_pipeline.yml │ │ ├── simple_dag_pipeline.yml │ │ ├── simple_dag_pipeline_with_builds.yml │ │ ├── simple_joins_pipeline.yml │ │ ├── simple_parallel_pipeline.yml │ │ ├── simple_recurrent_pipeline.yml │ │ └── simple_sequential_pipeline.yml │ ├── plain │ │ ├── distributed_dask_file.yml │ │ ├── distributed_mpi_file.yml │ │ ├── distributed_pytorch_file.yml │ │ ├── distributed_ray_file.yml │ │ ├── distributed_tensorflow_file.yml │ │ ├── distributed_tensorflow_file_build.yml │ │ ├── job_file_with_environment.yml │ │ ├── job_file_with_init.yml │ │ ├── job_file_with_templated_file_init_and_to_env.yml │ │ ├── job_file_with_termination.yml │ │ ├── job_missing_container.yml │ │ ├── jupyterlab_service_with_custom_environment.yml │ │ ├── mapping_job_file_early_stopping.yml │ │ ├── matrix_job_file.yml │ │ ├── matrix_job_file_build.yml │ │ ├── matrix_job_file_early_stopping.yml │ │ ├── matrix_job_file_with_int_float_types.yml │ │ ├── missing_kind.yml │ │ ├── missing_version.yml │ │ ├── non_supported_file.yml │ │ ├── polyaxonfile_with_contexts_requirements.yaml │ │ ├── polyaxonfile_with_quotes.yaml │ │ ├── replicas_file_with_custom_configs_and_resources.yml │ │ ├── simple_job.yml │ │ ├── simple_job_run_patch.yml │ │ ├── simple_json_file.json │ │ └── tensorboard_with_custom_environment.yml │ ├── samples │ │ ├── artifaction_location.yaml │ │ ├── condition.yaml │ │ ├── image_pull_secret.yaml │ │ └── parallel_join.yaml │ └── typing │ │ ├── auto_delayed_validation_with_jinja.yml │ │ ├── inputs_delayed_validation.yml │ │ ├── matrix_file_with_int_float_types.yml │ │ ├── matrix_job_file_with_int_float_types.yml │ │ ├── matrix_job_required_inputs_file.yml │ │ ├── matrix_job_required_inputs_file_wrong_matrix_type.yml │ │ ├── required_inputs.yml │ │ ├── required_inputs_with_arg_format.yml │ │ ├── required_outputs.yml │ │ ├── run_cmd_simple_file.yml │ │ ├── run_with_refs.yml │ │ └── untyped_params.yml │ ├── fixtures_static │ └── repo.tar.gz │ ├── test_api │ ├── __init__.py │ ├── test_authentication.py │ ├── test_home.py │ ├── test_log_handler.py │ └── test_user.py │ ├── test_cli │ ├── __init__.py │ ├── test_artifacts.py │ ├── test_auth.py │ ├── test_check.py │ ├── test_components.py │ ├── test_config.py │ ├── test_docker.py │ ├── test_models.py │ ├── test_operations.py │ ├── test_projects.py │ ├── test_version.py │ └── utils.py │ ├── test_client │ ├── __init__.py │ ├── test_impersonate.py │ ├── test_polyaxon_client.py │ ├── test_run_client.py │ └── test_statuses.py │ ├── test_compiler │ ├── __init__.py │ ├── test_contexts.py │ ├── test_lineage │ │ ├── __init__.py │ │ └── test_lineage_resolver.py │ └── test_resolvers │ │ ├── __init__.py │ │ └── test_core_resolver.py │ ├── test_config │ ├── __init__.py │ └── test_parser.py │ ├── test_deploy │ ├── __init__.py │ ├── test_celery.py │ ├── test_deployment.py │ ├── test_email.py │ ├── test_ingress.py │ ├── test_intervals.py │ ├── test_rbac.py │ ├── test_security_context.py │ ├── test_service.py │ ├── test_ssl.py │ └── test_user.py │ ├── test_docker │ ├── __init__.py │ ├── test_builder.py │ ├── test_converters │ │ ├── __init__.py │ │ ├── base.py │ │ ├── test_base │ │ │ ├── __init__.py │ │ │ ├── test_base_converter.py │ │ │ ├── test_containers.py │ │ │ ├── test_env_vars.py │ │ │ ├── test_init │ │ │ │ ├── __init__.py │ │ │ │ ├── test_init_auth.py │ │ │ │ ├── test_init_dockerfile.py │ │ │ │ ├── test_init_file.py │ │ │ │ ├── test_init_git.py │ │ │ │ ├── test_init_outputs.py │ │ │ │ ├── test_init_store.py │ │ │ │ └── test_init_tensorboard.py │ │ │ ├── test_main │ │ │ │ ├── __init__.py │ │ │ │ ├── test_main_container.py │ │ │ │ ├── test_main_env_vars.py │ │ │ │ └── test_main_mounts.py │ │ │ └── test_mounts.py │ │ └── test_converters │ │ │ ├── __init__.py │ │ │ ├── test_base_converter.py │ │ │ └── test_job_converter.py │ └── test_dockerfile_generator.py │ ├── test_fixtures │ ├── __init__.py │ ├── test_backfill.py │ ├── test_bo.py │ ├── test_build.py │ ├── test_grid.py │ ├── test_jobs.py │ ├── test_mapping.py │ ├── test_pipelines.py │ ├── test_schedule.py │ └── test_services.py │ ├── test_init │ ├── __init__.py │ ├── test_init_auth.py │ └── test_init_code.py │ ├── test_k8s │ ├── __init__.py │ ├── fixtures.py │ ├── test_agent.py │ ├── test_async_agent.py │ ├── test_converters │ │ ├── __init__.py │ │ ├── base.py │ │ ├── test_base │ │ │ ├── __init__.py │ │ │ ├── test_base_converter.py │ │ │ ├── test_containers.py │ │ │ ├── test_env_vars.py │ │ │ ├── test_init │ │ │ │ ├── __init__.py │ │ │ │ ├── test_init_auth.py │ │ │ │ ├── test_init_dockerfile.py │ │ │ │ ├── test_init_file.py │ │ │ │ ├── test_init_git.py │ │ │ │ ├── test_init_outputs.py │ │ │ │ ├── test_init_store.py │ │ │ │ └── test_init_tensorboard.py │ │ │ ├── test_main │ │ │ │ ├── __init__.py │ │ │ │ ├── test_main_container.py │ │ │ │ ├── test_main_env_vars.py │ │ │ │ └── test_main_mounts.py │ │ │ ├── test_mounts.py │ │ │ └── test_sidecar │ │ │ │ ├── __init__.py │ │ │ │ ├── test_sidecar_container.py │ │ │ │ └── test_sidecar_utils.py │ │ ├── test_common │ │ │ ├── __init__.py │ │ │ ├── test_accelerators.py │ │ │ ├── test_annotations.py │ │ │ ├── test_container_resources.py │ │ │ └── test_volumes.py │ │ ├── test_converters │ │ │ ├── __init__.py │ │ │ ├── test_base_converter.py │ │ │ └── test_job_converter.py │ │ └── test_pods │ │ │ ├── __init__.py │ │ │ ├── test_pod_spec.py │ │ │ └── test_volumes.py │ ├── test_crd.py │ ├── test_custom_resources │ │ ├── __init__.py │ │ ├── base_distributed.py │ │ ├── test_dask_job_crd.py │ │ ├── test_job_crd.py │ │ ├── test_mpi_job_crd.py │ │ ├── test_pytorch_job_crd.py │ │ ├── test_ray_job_crd.py │ │ ├── test_service_crd.py │ │ └── test_tf_job_crd.py │ ├── test_executor │ │ ├── __init__.py │ │ ├── test_async_executor.py │ │ └── test_executor.py │ └── test_monitors.py │ ├── test_lifecycles │ ├── __init__.py │ └── test_lifecycle.py │ ├── test_managers │ ├── __init__.py │ ├── test_agent.py │ ├── test_auth.py │ ├── test_cli.py │ ├── test_deployment.py │ ├── test_git.py │ ├── test_home.py │ ├── test_ignore.py │ ├── test_project.py │ ├── test_run.py │ └── test_user.py │ ├── test_notifiers │ ├── __init__.py │ └── test_notification_spec.py │ ├── test_operators │ ├── __init__.py │ ├── test_compose.py │ ├── test_conda.py │ ├── test_docker.py │ ├── test_helm.py │ ├── test_kubectl.py │ └── test_pip.py │ ├── test_polyaxonfile │ ├── __init__.py │ ├── test_default.py │ ├── test_parser.py │ ├── test_patch_specification.py │ ├── test_polyaxonfile.py │ ├── test_polyaxonfile_pipelines.py │ ├── test_polyaxonfile_typing.py │ └── test_specification.py │ ├── test_polyflow │ ├── __init__.py │ ├── test_builds │ │ ├── __init__.py │ │ └── test_builds.py │ ├── test_cache │ │ ├── __init__.py │ │ └── test_cache.py │ ├── test_components │ │ ├── __init__.py │ │ └── test_components.py │ ├── test_container │ │ ├── __init__.py │ │ ├── test_container.py │ │ └── test_resources.py │ ├── test_dags.py │ ├── test_environments │ │ ├── __init__.py │ │ └── test_environments.py │ ├── test_events │ │ ├── __init__.py │ │ └── test_events.py │ ├── test_hooks │ │ ├── __init__.py │ │ └── test_hooks.py │ ├── test_image_validation.py │ ├── test_init │ │ ├── __init__.py │ │ └── test_init.py │ ├── test_io │ │ ├── __init__.py │ │ ├── test_io.py │ │ ├── test_io_transforms.py │ │ ├── test_io_validation.py │ │ └── test_params.py │ ├── test_joins │ │ ├── __init__.py │ │ └── test_joins.py │ ├── test_mounts │ │ ├── __init__.py │ │ └── test_k8s_artifact_mounts.py │ ├── test_notifications │ │ ├── __init__.py │ │ └── test_notifications.py │ ├── test_operators.py │ ├── test_ops │ │ ├── __init__.py │ │ ├── test_op_runs.py │ │ └── test_ops.py │ ├── test_plugins │ │ ├── __init__.py │ │ └── test_plugins.py │ ├── test_schedules │ │ ├── __init__.py │ │ └── test_schedules.py │ ├── test_sidecars │ │ ├── __init__.py │ │ └── test_sidecars.py │ ├── test_termination │ │ ├── __init__.py │ │ └── test_termination.py │ └── test_workflows │ │ ├── __init__.py │ │ ├── test_bo.py │ │ ├── test_dags.py │ │ ├── test_early_stopping.py │ │ ├── test_grid_search.py │ │ ├── test_hyperband.py │ │ ├── test_iterative.py │ │ ├── test_matrix.py │ │ ├── test_parallel.py │ │ └── test_random_search.py │ ├── test_pql │ ├── __init__.py │ └── test_parser.py │ ├── test_runner │ ├── __init__.py │ ├── test_base_agent.py │ ├── test_base_converter.py │ └── test_init_utils.py │ ├── test_schemas │ ├── __init__.py │ ├── test_cli │ │ ├── __init__.py │ │ ├── test_agent_config.py │ │ ├── test_checks_config.py │ │ ├── test_cli_config.py │ │ └── test_client_config.py │ └── test_types │ │ ├── __init__.py │ │ ├── test_dockerfile.py │ │ ├── test_file.py │ │ └── test_tensorboard.py │ ├── test_sidecar │ ├── __init__.py │ ├── test_interval.py │ └── test_monitor.py │ ├── test_stores │ ├── __init__.py │ ├── test_polyaxon_store.py │ └── test_stores_manager.py │ ├── test_transports │ ├── __init__.py │ ├── test_http_transport.py │ ├── test_periodic_transport.py │ ├── test_threaded_transport.py │ ├── test_transport.py │ └── utils.py │ ├── test_utils │ ├── __init__.py │ ├── test_fqn.py │ └── test_urls_utils.py │ └── tests_env_vars │ ├── __init__.py │ ├── test_agent.py │ ├── test_owner.py │ ├── test_project.py │ ├── test_queue.py │ ├── test_run.py │ └── test_versioned_entity.py └── polyaxon-complete.sh /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: "pip" 8 | directory: "/" 9 | schedule: 10 | interval: "daily" 11 | - package-ecosystem: "gomod" 12 | directory: "/" 13 | schedule: 14 | interval: "daily" 15 | - package-ecosystem: "npm" 16 | directory: "/" 17 | schedule: 18 | interval: "daily" 19 | - package-ecosystem: "composer" 20 | directory: "/" 21 | schedule: 22 | interval: "daily" 23 | -------------------------------------------------------------------------------- /.prospector.yaml: -------------------------------------------------------------------------------- 1 | output-format: grouped 2 | 3 | strictness: high 4 | test-warnings: false 5 | doc-warnings: true 6 | 7 | max-line-length: 100 8 | 9 | 10 | ignore-patterns: 11 | - __init__.py 12 | - src 13 | 14 | pep257: 15 | run: false 16 | 17 | mccabe: 18 | run: false 19 | 20 | pylint: 21 | disable: 22 | - abstract-method 23 | - broad-except 24 | - cyclic-import 25 | - invalid-name 26 | - missing-docstring 27 | - no-init 28 | - no-self-use 29 | - old-style-class 30 | - redefined-variable-type 31 | - too-many-ancestors 32 | - too-many-arguments 33 | - too-many-instance-attributes 34 | - too-many-locals 35 | - unused-argument 36 | enable: 37 | - missing-final-newline 38 | options: 39 | ignore: migrations 40 | -------------------------------------------------------------------------------- /cli/MANIFEST.in: -------------------------------------------------------------------------------- 1 | global-exclude *.py[cod] 2 | global-exclude __pycache__ 3 | prune tests 4 | prune __pycache__ 5 | include polyaxon/py.typed 6 | include ../README.md 7 | include ../CONTRIBUTING.md 8 | include ../LICENSE 9 | -------------------------------------------------------------------------------- /cli/polyaxon-complete.sh: -------------------------------------------------------------------------------- 1 | eval "$(_POLYAXON_COMPLETE=source polyaxon)" 2 | -------------------------------------------------------------------------------- /cli/polyaxon/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/__main__.py: -------------------------------------------------------------------------------- 1 | from polyaxon.cli import cli 2 | 3 | cli(auto_envvar_prefix="POLYAXON_CLI") 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_auxiliaries/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._auxiliaries.cleaner import ( 2 | V1PolyaxonCleaner, 3 | get_default_cleaner_container, 4 | ) 5 | from polyaxon._auxiliaries.default_scheduling import V1DefaultScheduling 6 | from polyaxon._auxiliaries.init import ( 7 | V1PolyaxonInitContainer, 8 | get_default_init_container, 9 | get_init_resources, 10 | ) 11 | from polyaxon._auxiliaries.notifier import ( 12 | V1PolyaxonNotifier, 13 | get_default_notification_container, 14 | ) 15 | from polyaxon._auxiliaries.sidecar import ( 16 | V1PolyaxonSidecarContainer, 17 | get_default_sidecar_container, 18 | get_sidecar_resources, 19 | ) 20 | from polyaxon._auxiliaries.tuner import get_default_tuner_container 21 | -------------------------------------------------------------------------------- /cli/polyaxon/_cli/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_cli/services/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_client/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/_client/__init__.py -------------------------------------------------------------------------------- /cli/polyaxon/_client/decorators/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._client.decorators.client_call_handler import ( 2 | client_handler, 3 | get_global_or_inline_config, 4 | ) 5 | from polyaxon._client.decorators.is_managed import ensure_is_managed 6 | -------------------------------------------------------------------------------- /cli/polyaxon/_client/decorators/errors.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Optional 2 | 3 | from polyaxon.exceptions import handle_api_error 4 | from polyaxon.logger import logger 5 | 6 | 7 | def handle_client_error( 8 | e, 9 | message: Optional[str] = None, 10 | http_messages_mapping: Optional[Dict] = None, 11 | sys_exit: bool = False, 12 | ): 13 | handle_api_error( 14 | e=e, 15 | logger=logger, 16 | message=message, 17 | http_messages_mapping=http_messages_mapping, 18 | sys_exit=sys_exit, 19 | ) 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_client/decorators/is_managed.py: -------------------------------------------------------------------------------- 1 | from polyaxon import settings 2 | from polyaxon.exceptions import PolyaxonClientException 3 | 4 | 5 | def ensure_is_managed(): 6 | if not settings.CLIENT_CONFIG.is_managed and not settings.CLIENT_CONFIG.in_cluster: 7 | raise PolyaxonClientException("This experiment/job is not managed by Polyaxon.") 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_client/init.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from polyaxon import settings 4 | from polyaxon._client.run import RunClient 5 | from polyaxon.exceptions import PolyaxonClientException, PolyaxonContainerException 6 | 7 | 8 | def get_client_or_raise() -> Optional[RunClient]: 9 | if settings.CLIENT_CONFIG.no_api: 10 | return None 11 | 12 | try: 13 | return RunClient() 14 | except PolyaxonClientException as e: 15 | raise PolyaxonContainerException(e) 16 | -------------------------------------------------------------------------------- /cli/polyaxon/_client/workers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/contexts/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._compiler.contexts.contexts import ( 2 | resolve_contexts, 3 | resolve_globals_contexts, 4 | ) 5 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/contexts/job.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from polyaxon._compiler.contexts.base import BaseContextsManager 4 | from polyaxon._connections import V1Connection 5 | from polyaxon._flow import V1CompiledOperation 6 | 7 | 8 | class JobContextsManager(BaseContextsManager): 9 | @classmethod 10 | def resolve( 11 | cls, 12 | namespace: str, 13 | owner_name: str, 14 | project_name: str, 15 | run_uuid: str, 16 | contexts: Dict, 17 | compiled_operation: V1CompiledOperation, 18 | connection_by_names: Dict[str, V1Connection], 19 | ) -> Dict: 20 | return cls._resolver_replica( 21 | contexts=contexts, 22 | init=compiled_operation.run.init, 23 | connections=compiled_operation.run.connections, 24 | connection_by_names=connection_by_names, 25 | ) 26 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/contexts/kubeflow/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._compiler.contexts.kubeflow.mpi_job import MPIJobContextsManager 2 | from polyaxon._compiler.contexts.kubeflow.pytroch_job import PytorchJobContextsManager 3 | from polyaxon._compiler.contexts.kubeflow.tf_job import TfJobContextsManager 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/lineage/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._compiler.lineage.artifacts_collector import ( 2 | collect_lineage_artifacts_path, 3 | ) 4 | from polyaxon._compiler.lineage.collector import resolve_artifacts_lineage 5 | from polyaxon._compiler.lineage.io_collector import collect_io_artifacts 6 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/lineage/artifacts_collector.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from typing import Optional 4 | 5 | from polyaxon._utils.fqn_utils import to_fqn_name 6 | from traceml.artifacts import V1ArtifactKind, V1RunArtifact 7 | 8 | 9 | def collect_lineage_artifacts_path(artifact_path: str) -> Optional[V1RunArtifact]: 10 | name = os.path.basename( 11 | artifact_path.rstrip("/") 12 | ) # Trim handles cases like `foo/` -> '' 13 | return V1RunArtifact( 14 | name=to_fqn_name(name) if name else "_", 15 | kind=V1ArtifactKind.DIR, 16 | path=artifact_path, 17 | summary={"path": artifact_path}, 18 | is_input=True, 19 | ) 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/lineage/collector.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List 2 | 3 | from polyaxon._compiler.lineage.io_collector import collect_io_artifacts 4 | from polyaxon._connections import V1Connection 5 | from polyaxon._flow import ParamSpec, V1CompiledOperation 6 | from traceml.artifacts import V1RunArtifact 7 | 8 | 9 | def resolve_artifacts_lineage( 10 | owner_name: str, 11 | project_name: str, 12 | project_uuid: str, 13 | run_uuid: str, 14 | run_name: str, 15 | run_path: str, 16 | param_spec: Dict[str, ParamSpec], 17 | compiled_operation: V1CompiledOperation, 18 | artifacts_store: V1Connection, 19 | connection_by_names: Dict[str, V1Connection], 20 | ) -> List[V1RunArtifact]: 21 | return collect_io_artifacts( 22 | compiled_operation=compiled_operation, connection_by_names=connection_by_names 23 | ) 24 | -------------------------------------------------------------------------------- /cli/polyaxon/_compiler/resolver/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._compiler.resolver.agent import AgentResolver 2 | from polyaxon._compiler.resolver.resolver import resolve, resolve_hooks 3 | from polyaxon._compiler.resolver.runtime import BaseResolver 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_config/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_config/manager.py: -------------------------------------------------------------------------------- 1 | from clipped.config.manager import ConfigManager as _ConfigManager 2 | 3 | from polyaxon._config.reader import ConfigReader 4 | from polyaxon._contexts import paths as ctx_paths 5 | from polyaxon.logger import logger 6 | 7 | 8 | class ConfigManager(_ConfigManager): 9 | _CONFIG_READER = ConfigReader 10 | _LOGGER = logger 11 | _PROJECT = ".polyaxon" 12 | _PROJECT_PATH: str = ctx_paths.CONTEXT_USER_POLYAXON_PATH 13 | _TEMP_PATH: str = ctx_paths.CONTEXT_TMP_POLYAXON_PATH 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_config/parser.py: -------------------------------------------------------------------------------- 1 | from clipped.config.parser import ConfigParser as _ConfigParser 2 | from clipped.decorators.memoization import memoize 3 | 4 | 5 | class ConfigParser(_ConfigParser): 6 | @staticmethod 7 | @memoize 8 | def type_mapping(): 9 | from polyaxon import types 10 | 11 | return types.MAPPING 12 | 13 | @staticmethod 14 | @memoize 15 | def type_forwarding(): 16 | from polyaxon import types 17 | 18 | return types.FORWARDING 19 | -------------------------------------------------------------------------------- /cli/polyaxon/_config/reader.py: -------------------------------------------------------------------------------- 1 | from clipped.config.reader import ConfigReader as _ConfigReader 2 | 3 | from polyaxon._config.parser import ConfigParser 4 | from polyaxon._config.spec import ConfigSpec 5 | 6 | 7 | class ConfigReader(_ConfigReader): 8 | _CONFIG_SPEC = ConfigSpec 9 | _CONFIG_PARSER = ConfigParser 10 | -------------------------------------------------------------------------------- /cli/polyaxon/_connections/kinds.py: -------------------------------------------------------------------------------- 1 | from vents.providers.kinds import ProviderKind 2 | 3 | V1ConnectionKind = ProviderKind 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_constants/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_constants/globals.py: -------------------------------------------------------------------------------- 1 | UNKNOWN = "unknown" 2 | DEFAULT = "default" 3 | DEFAULT_HUB = "polyaxon" 4 | NO_AUTH = "no-auth" 5 | DEFAULT_UPLOADS_PATH = "uploads" 6 | -------------------------------------------------------------------------------- /cli/polyaxon/_constants/metadata.py: -------------------------------------------------------------------------------- 1 | META_EDGE = "edge" 2 | META_ITERATION = "iteration" 3 | META_BRACKET_ITERATION = "bracket_iteration" 4 | META_REWRITE_PATH = "rewrite_path" 5 | META_IS_EXTERNAL = "is_external" 6 | META_PORTS = "ports" 7 | META_HAS_EARLY_STOPPING = "has_early_stopping" 8 | META_HAS_JOBS = "has_jobs" 9 | META_HAS_SERVICES = "has_services" 10 | META_HAS_DAGS = "has_dags" 11 | META_HAS_MATRICES = "has_matrices" 12 | META_HAS_SCHEDULES = "has_schedules" 13 | META_HAS_HOOKS = "has_hooks" 14 | META_IS_HOOK = "is_hook" 15 | META_IS_ACTION = "is_action" 16 | META_IS_TUNER = "is_tuner" 17 | META_IS_PROMOTED = "is_promoted" 18 | META_CONCURRENCY = "concurrency" 19 | META_HAS_DOWNSTREAM_EVENTS_TRIGGER = "has_downstream_events_trigger" 20 | META_UPLOAD_ARTIFACTS = "upload_artifacts" 21 | META_COPY_ARTIFACTS = "copy_artifacts" 22 | META_DESTINATION_IMAGE = "destination_image" 23 | META_PROGRESS = "progress" 24 | META_RECOMPILE = "recompile" 25 | META_TTL = "ttl" 26 | -------------------------------------------------------------------------------- /cli/polyaxon/_containers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_containers/pull_policy.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class PullPolicy(str, Enum): 5 | ALWAYS = "Always" 6 | IF_NOT_PRESENT = "IfNotPresent" 7 | NEVER = "Never" 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_containers/statuses.py: -------------------------------------------------------------------------------- 1 | class ContainerStatuses: 2 | RUNNING = "running" 3 | WAITING = "waiting" 4 | TERMINATED = "terminated" 5 | -------------------------------------------------------------------------------- /cli/polyaxon/_contexts/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_contexts/keys.py: -------------------------------------------------------------------------------- 1 | OWNER_NAME = "owner_name" 2 | PROJECT_NAME = "project_name" 3 | PROJECT_UUID = "project_uuid" 4 | PROJECT_UNIQUE_NAME = "project_unique_name" 5 | USERNAME = "username" 6 | USER_EMAIL = "user_email" 7 | CONTEXT_PATH = "context_path" 8 | ARTIFACTS_PATH = "artifacts_path" 9 | ITERATION = "iteration" 10 | NAMESPACE = "namespace" 11 | BASE = "base" 12 | STORE_PATH = "store_path" 13 | 14 | RUN_ARTIFACTS_PATH = "run_artifacts_path" 15 | RUN_OUTPUTS_PATH = "run_outputs_path" 16 | RUN_RELATIVE_OUTPUTS_PATH = "run_relative_outputs_path" 17 | RUN_INFO = "run_info" 18 | STATUS = "status" 19 | CONDITION = "condition" 20 | NAME = "name" 21 | UUID = "uuid" 22 | CREATED_AT = "created_at" 23 | COMPILED_AT = "compiled_at" 24 | SCHEDULE_AT = "schedule_at" 25 | STARTED_AT = "started_at" 26 | FINISHED_AT = "finished_at" 27 | DURATION = "duration" 28 | CLONING_KIND = "cloning_kind" 29 | ORIGINAL_UUID = "original_uuid" 30 | IS_INDEPENDENT = "is_independent" 31 | -------------------------------------------------------------------------------- /cli/polyaxon/_contexts/params.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | PARAM_REGEX = re.compile(r"{{\s*(.+)\s*}}") 4 | 5 | 6 | def is_template_ref(value: str) -> bool: 7 | try: 8 | value_parts = PARAM_REGEX.search(value) # type: ignore[attr-defined] 9 | if value_parts: 10 | return True 11 | except Exception: # noqa 12 | pass 13 | return False 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_contexts/sections.py: -------------------------------------------------------------------------------- 1 | from polyaxon._contexts import keys 2 | 3 | INPUTS = "inputs" 4 | OUTPUTS = "outputs" 5 | INPUTS_OUTPUTS = "io" 6 | ARTIFACTS = "artifacts" 7 | GLOBALS = "globals" 8 | 9 | CONTEXTS = { 10 | INPUTS, 11 | OUTPUTS, 12 | INPUTS_OUTPUTS, 13 | ARTIFACTS, 14 | } 15 | CONTEXTS_WITH_NESTING = { 16 | INPUTS, 17 | OUTPUTS, 18 | ARTIFACTS, 19 | GLOBALS, 20 | } 21 | GLOBALS_CONTEXTS = { 22 | keys.OWNER_NAME, 23 | keys.PROJECT_NAME, 24 | keys.PROJECT_UNIQUE_NAME, 25 | keys.PROJECT_UUID, 26 | keys.RUN_INFO, 27 | keys.NAME, 28 | keys.UUID, 29 | keys.STATUS, 30 | keys.NAMESPACE, 31 | keys.ITERATION, 32 | keys.CONTEXT_PATH, 33 | keys.ARTIFACTS_PATH, 34 | keys.CREATED_AT, 35 | keys.COMPILED_AT, 36 | keys.SCHEDULE_AT, 37 | keys.STARTED_AT, 38 | keys.FINISHED_AT, 39 | keys.DURATION, 40 | keys.CLONING_KIND, 41 | keys.ORIGINAL_UUID, 42 | keys.IS_INDEPENDENT, 43 | } 44 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/operators/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/operators/conda.py: -------------------------------------------------------------------------------- 1 | from polyaxon._deploy.operators.cmd_operator import CmdOperator 2 | 3 | 4 | class CondaOperator(CmdOperator): 5 | CMD = "conda" 6 | 7 | @classmethod 8 | def params(cls, args): 9 | params = [cls.CMD] + args 10 | return params 11 | 12 | @classmethod 13 | def check(cls): 14 | command_exist = cls.execute(args=["-V"]) 15 | if not command_exist: 16 | return False 17 | return True 18 | 19 | @classmethod 20 | def execute(cls, args, is_json=False, stream=False): 21 | params = cls.params(args) 22 | return cls._execute(params=params, env=None, is_json=is_json, stream=stream) 23 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/operators/helm.py: -------------------------------------------------------------------------------- 1 | from polyaxon._deploy.operators.cmd_operator import CmdOperator 2 | 3 | 4 | class HelmOperator(CmdOperator): 5 | CMD = "helm" 6 | 7 | @classmethod 8 | def params(cls, args): 9 | params = [cls.CMD] + args 10 | return params 11 | 12 | @classmethod 13 | def check(cls): 14 | command_exist = cls.execute(args=[]) 15 | if not command_exist: 16 | return False 17 | command_exist = cls.execute(args=["version"]) 18 | if not command_exist: 19 | return False 20 | return True 21 | 22 | @classmethod 23 | def is_v3(cls): 24 | command_version = cls.execute(args=["version"]) 25 | return "v3" in command_version 26 | 27 | @classmethod 28 | def execute(cls, args, stream=False): 29 | params = cls.params(args) 30 | return cls._execute(params=params, env=None, stream=stream) 31 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/operators/pip.py: -------------------------------------------------------------------------------- 1 | from polyaxon._deploy.operators.cmd_operator import CmdOperator 2 | 3 | 4 | class PipOperator(CmdOperator): 5 | CMD = "pip" 6 | 7 | @classmethod 8 | def params(cls, args): 9 | params = [cls.CMD] + args 10 | return params 11 | 12 | @classmethod 13 | def check(cls): 14 | command_exist = cls.execute(args=["-V"]) 15 | if not command_exist: 16 | return False 17 | return True 18 | 19 | @classmethod 20 | def execute(cls, args, stream=False): 21 | params = cls.params(args) 22 | return cls._execute(params=params, env=None, stream=stream) 23 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/reader.py: -------------------------------------------------------------------------------- 1 | from polyaxon._config.spec import ConfigSpec 2 | from polyaxon._deploy.schemas.deployment import DeploymentConfig 3 | 4 | 5 | def read(filepaths): 6 | data = ConfigSpec.read_from(filepaths) 7 | return DeploymentConfig.from_dict(data) 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/auth.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class AuthConfig(BaseSchemaModel): 9 | enabled: Optional[bool] = None 10 | external: Optional[StrictStr] = None 11 | use_resolver: Optional[bool] = Field(alias="useResolver", default=None) 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/deployment_types.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.enums import PEnum 2 | 3 | 4 | class DeploymentTypes(str, PEnum): 5 | KUBERNETES = "kubernetes" 6 | MINIKUBE = "minikube" 7 | MICRO_K8S = "microk8s" 8 | DOCKER_COMPOSE = "docker-compose" 9 | DOCKER = "docker" 10 | HEROKU = "heroku" 11 | 12 | 13 | class DeploymentCharts(str, PEnum): 14 | PLATFORM = "platform" 15 | AGENT = "agent" 16 | GATEWAY = "gateway" 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/email.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictInt, StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class EmailConfig(BaseSchemaModel): 9 | enabled: Optional[bool] = None 10 | email_from: Optional[StrictStr] = Field(alias="from", default=None) 11 | host: Optional[StrictStr] = None 12 | port: Optional[StrictInt] = None 13 | use_tls: Optional[bool] = Field(alias="useTls", default=None) 14 | host_user: Optional[StrictStr] = Field(alias="hostUser", default=None) 15 | host_password: Optional[StrictStr] = Field(alias="hostPassword", default=None) 16 | backend: Optional[StrictStr] = None 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/ingress.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class IngressConfig(BaseSchemaModel): 9 | enabled: Optional[bool] = None 10 | host_name: Optional[StrictStr] = Field(alias="hostName", default=None) 11 | path: Optional[StrictStr] = None 12 | tls: Optional[List[Dict]] = None 13 | annotations: Optional[Dict] = None 14 | 15 | class Config: 16 | extra = "ignore" 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/intervals.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictInt 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class IntervalsConfig(BaseSchemaModel): 9 | compatibility_check: Optional[StrictInt] = Field( 10 | alias="compatibilityCheck", default=None 11 | ) 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/operators.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from polyaxon._schemas.base import BaseSchemaModel 4 | 5 | 6 | class OperatorsConfig(BaseSchemaModel): 7 | tfjob: Optional[bool] = None 8 | pytorchjob: Optional[bool] = None 9 | mpijob: Optional[bool] = None 10 | daskjob: Optional[bool] = None 11 | rayjob: Optional[bool] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/proxy.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictInt, StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class ProxyConfig(BaseSchemaModel): 9 | enabled: Optional[bool] = None 10 | use_in_ops: Optional[bool] = Field(alias="useInOps", default=None) 11 | http_proxy: Optional[StrictStr] = Field(alias="httpProxy", default=None) 12 | https_proxy: Optional[StrictStr] = Field(alias="httpsProxy", default=None) 13 | no_proxy: Optional[StrictStr] = Field(alias="noProxy", default=None) 14 | port: Optional[StrictInt] = None 15 | host: Optional[StrictStr] = None 16 | protocol: Optional[StrictStr] = None 17 | kind: Optional[StrictStr] = None 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/rbac.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from polyaxon._schemas.base import BaseSchemaModel 4 | 5 | 6 | class RBACConfig(BaseSchemaModel): 7 | enabled: Optional[bool] = None 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/root_user.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import NAME_REGEX, StrictStr, patter_constr 4 | from clipped.types.email import EmailStr 5 | 6 | from polyaxon._schemas.base import BaseSchemaModel 7 | 8 | 9 | class RootUserConfig(BaseSchemaModel): 10 | username: Optional[patter_constr(pattern=NAME_REGEX)] = None # type: ignore[valid-type] 11 | password: Optional[StrictStr] = None 12 | email: Optional[EmailStr] = None 13 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/service_types.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.enums import PEnum 2 | 3 | 4 | class ServiceTypes(str, PEnum): 5 | LOAD_BALANCER = "LoadBalancer" 6 | NODE_PORT = "NodePort" 7 | CLUSTER_IP = "ClusterIP" 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/ssl.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class SSLConfig(BaseSchemaModel): 9 | enabled: Optional[bool] = None 10 | secret_name: Optional[StrictStr] = Field(alias="secretName", default=None) 11 | path: Optional[StrictStr] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_deploy/schemas/ui.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class UIConfig(BaseSchemaModel): 9 | enabled: Optional[bool] = None 10 | offline: Optional[bool] = None 11 | static_url: Optional[StrictStr] = Field(alias="staticUrl", default=None) 12 | base_url: Optional[StrictStr] = Field(alias="baseUrl", default=None) 13 | assets_version: Optional[StrictStr] = Field(alias="assetsVersion", default=None) 14 | admin_enabled: Optional[bool] = Field(alias="adminEnabled", default=None) 15 | single_url: Optional[bool] = Field(alias="singleUrl", default=None) 16 | default_streams_url: Optional[StrictStr] = Field( 17 | alias="defaultStreamsUrl", default=None 18 | ) 19 | -------------------------------------------------------------------------------- /cli/polyaxon/_dist.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | LOCAL = "local" 4 | SANDBOX = "sandbox" 5 | CLOUD = "cloud" 6 | CE = "ce" 7 | EE = "ee" 8 | 9 | 10 | def is_local(value: str): 11 | return LOCAL == value 12 | 13 | 14 | def is_sandbox(value: str): 15 | return SANDBOX == value 16 | 17 | 18 | def is_ce(value: str): 19 | return CE == value 20 | 21 | 22 | def is_community(value: str): 23 | return value is None or value in {LOCAL, SANDBOX, CE} 24 | 25 | 26 | def is_cloud(value: str): 27 | return CLOUD == value 28 | 29 | 30 | def is_ee(value: str): 31 | return EE == value 32 | 33 | 34 | def get_dist(value: str, default: Optional[str] = None): 35 | if value and value in {LOCAL, SANDBOX, CE, CLOUD, EE}: 36 | return value 37 | return default 38 | -------------------------------------------------------------------------------- /cli/polyaxon/_docker/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_docker/agent.py: -------------------------------------------------------------------------------- 1 | from polyaxon._docker.executor import Executor 2 | from polyaxon._runner.agent.sync_agent import BaseSyncAgent 3 | 4 | 5 | class Agent(BaseSyncAgent): 6 | EXECUTOR = Executor 7 | -------------------------------------------------------------------------------- /cli/polyaxon/_docker/builder/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._docker.builder.builder import ( 2 | DockerBuilder, 3 | DockerPusher, 4 | build, 5 | build_and_push, 6 | push, 7 | ) 8 | from polyaxon._docker.builder.generator import DockerFileGenerator 9 | -------------------------------------------------------------------------------- /cli/polyaxon/_docker/converter/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_docker/converter/base/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._docker.converter.base.base import BaseConverter 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_docker/converter/converters/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._docker.converter.converters.job import JobConverter 2 | from polyaxon._docker.converter.converters.service import ServiceConverter 3 | from polyaxon._flow import V1RunKind 4 | 5 | CONVERTERS = { 6 | V1RunKind.JOB: JobConverter, 7 | V1RunKind.SERVICE: ServiceConverter, 8 | } 9 | -------------------------------------------------------------------------------- /cli/polyaxon/_env_vars/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_env_vars/getters/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._env_vars.getters.agent import get_agent_info, get_artifacts_store_name 2 | from polyaxon._env_vars.getters.owner_entity import resolve_entity_info 3 | from polyaxon._env_vars.getters.project import ( 4 | get_project_error_message, 5 | get_project_or_local, 6 | ) 7 | from polyaxon._env_vars.getters.queue import get_queue_info 8 | from polyaxon._env_vars.getters.run import ( 9 | get_collect_artifacts, 10 | get_collect_resources, 11 | get_log_level, 12 | get_project_run_or_local, 13 | get_run_info, 14 | get_run_or_local, 15 | ) 16 | from polyaxon._env_vars.getters.user import get_local_owner 17 | from polyaxon._env_vars.getters.versioned_entity import ( 18 | get_component_info, 19 | get_model_info, 20 | get_versioned_entity_info, 21 | ) 22 | -------------------------------------------------------------------------------- /cli/polyaxon/_env_vars/getters/queue.py: -------------------------------------------------------------------------------- 1 | from polyaxon.exceptions import PolyaxonSchemaError 2 | 3 | 4 | def get_queue_info(queue: str): 5 | if not queue: 6 | raise PolyaxonSchemaError("Received an invalid queue {}".format(queue)) 7 | 8 | parts = queue.replace(".", "/").split("/") 9 | agent = None 10 | queue_name = queue 11 | if len(parts) == 2: 12 | agent, queue_name = parts 13 | elif len(parts) > 2: 14 | raise PolyaxonSchemaError( 15 | "Please provide a valid queue. " 16 | "The queue name should be: queue-name to use the default agent or agent-name/queue." 17 | ) 18 | 19 | return agent, queue_name 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/cache/enums.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.enums import PEnum 2 | 3 | 4 | class CacheSection(str, PEnum): 5 | CONTAINERS = "containers" 6 | INIT = "init" 7 | CONNECTIONS = "connections" 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/component/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.component.component import V1Component 2 | from polyaxon._flow.component.component_reference import V1ComponentReference 3 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/component/component_reference.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | from typing_extensions import Annotated 3 | 4 | from clipped.compact.pydantic import Field 5 | 6 | from polyaxon._flow.component.component import V1Component 7 | from polyaxon._flow.references import V1DagRef, V1HubRef, V1PathRef, V1UrlRef 8 | 9 | V1ComponentReference = Annotated[ 10 | Union[V1Component, V1DagRef, V1HubRef, V1PathRef, V1UrlRef], 11 | Field(discriminator="kind"), 12 | ] 13 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/containers/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.containers.container import get_container_command_args 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/containers/container.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.lists import to_list 2 | from clipped.utils.strings import strip_spaces 3 | 4 | 5 | def get_container_command_args(config): 6 | def sanitize_str(value): 7 | if not value: 8 | return 9 | value = strip_spaces(value=value, join=False) 10 | value = [c.strip().strip("\\") for c in value if (c and c != "\\")] 11 | value = [c for c in value if (c and c != "\\")] 12 | return " ".join(value) 13 | 14 | def sanitize(value): 15 | return ( 16 | [sanitize_str(v) for v in value] 17 | if isinstance(value, list) 18 | else to_list(sanitize_str(value), check_none=True) 19 | ) 20 | 21 | return to_list(config.command, check_none=True), sanitize(config.args) 22 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/early_stopping/__init__.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | from typing_extensions import Annotated 3 | 4 | from clipped.compact.pydantic import Field 5 | 6 | from polyaxon._flow.early_stopping.policies import ( 7 | V1DiffStoppingPolicy, 8 | V1FailureEarlyStopping, 9 | V1MedianStoppingPolicy, 10 | V1MetricEarlyStopping, 11 | V1TruncationStoppingPolicy, 12 | ) 13 | 14 | V1EarlyStopping = Annotated[ 15 | Union[V1MetricEarlyStopping, V1FailureEarlyStopping], 16 | Field(discriminator="kind"), 17 | ] 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/io/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.io.io import V1IO, V1Validation 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/matrix/base.py: -------------------------------------------------------------------------------- 1 | from polyaxon._schemas.base import BaseSchemaModel 2 | 3 | 4 | class BaseSearchConfig(BaseSchemaModel): 5 | _USE_DISCRIMINATOR = True 6 | 7 | def create_iteration(self, **kwargs) -> int: 8 | return 0 9 | 10 | def should_reschedule(self, **kwargs) -> bool: 11 | return False 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/mounts/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.mounts.artifacts_mounts import V1ArtifactsMount 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/mounts/artifacts_mounts.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class V1ArtifactsMount(BaseSchemaModel): 9 | _IDENTIFIER = "artifacts_mount" 10 | 11 | name: StrictStr 12 | paths: Optional[List[StrictStr]] = None 13 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/operations/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.operations.compiled_operation import V1CompiledOperation 2 | from polyaxon._flow.operations.operation import V1Operation 3 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/params/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.params.params import ParamSpec, V1Param 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/references/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.references.dag import V1DagRef 2 | from polyaxon._flow.references.hub import V1HubRef 3 | from polyaxon._flow.references.mixin import RefMixin 4 | from polyaxon._flow.references.path import V1PathRef 5 | from polyaxon._flow.references.url import V1UrlRef 6 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/references/dag.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Literal 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | 5 | from polyaxon._flow.references.mixin import RefMixin 6 | from polyaxon._schemas.base import BaseSchemaModel 7 | 8 | 9 | class V1DagRef(BaseSchemaModel, RefMixin): 10 | _IDENTIFIER = "dag_ref" 11 | _USE_DISCRIMINATOR = True 12 | 13 | kind: Literal[_IDENTIFIER] = _IDENTIFIER 14 | name: StrictStr 15 | 16 | def get_kind_value(self): 17 | return self.name 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/references/hub.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Literal 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | 5 | from polyaxon._flow.references.mixin import RefMixin 6 | from polyaxon._schemas.base import BaseSchemaModel 7 | 8 | 9 | class V1HubRef(BaseSchemaModel, RefMixin): 10 | _IDENTIFIER = "hub_ref" 11 | _USE_DISCRIMINATOR = True 12 | 13 | kind: Literal[_IDENTIFIER] = _IDENTIFIER 14 | name: StrictStr 15 | 16 | def get_kind_value(self): 17 | return self.name 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/references/mixin.py: -------------------------------------------------------------------------------- 1 | class RefMixin: 2 | def get_kind_value(self): 3 | raise NotImplementedError 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/references/path.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Literal 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | 5 | from polyaxon._flow.references.mixin import RefMixin 6 | from polyaxon._schemas.base import BaseSchemaModel 7 | 8 | 9 | class V1PathRef(BaseSchemaModel, RefMixin): 10 | _IDENTIFIER = "path_ref" 11 | _USE_DISCRIMINATOR = True 12 | 13 | kind: Literal[_IDENTIFIER] = _IDENTIFIER 14 | path: StrictStr 15 | 16 | def get_kind_value(self): 17 | return self.path 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/references/url.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Literal 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | 5 | from polyaxon._flow.references.mixin import RefMixin 6 | from polyaxon._schemas.base import BaseSchemaModel 7 | 8 | 9 | class V1UrlRef(BaseSchemaModel, RefMixin): 10 | _IDENTIFIER = "url_ref" 11 | _USE_DISCRIMINATOR = True 12 | 13 | kind: Literal[_IDENTIFIER] = _IDENTIFIER 14 | url: StrictStr 15 | 16 | def get_kind_value(self): 17 | return self.url 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/base.py: -------------------------------------------------------------------------------- 1 | from polyaxon._schemas.base import BaseSchemaModel 2 | 3 | 4 | class BaseRun(BaseSchemaModel): 5 | _USE_DISCRIMINATOR = True 6 | 7 | def get_resources(self): 8 | raise NotImplementedError 9 | 10 | def get_all_containers(self): 11 | raise NotImplementedError 12 | 13 | def get_all_connections(self): 14 | raise NotImplementedError 15 | 16 | def get_all_init(self): 17 | raise NotImplementedError 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/cleaner.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Literal 2 | 3 | from polyaxon._flow.run.enums import V1RunKind 4 | from polyaxon._flow.run.job import V1Job 5 | 6 | 7 | class V1CleanerJob(V1Job): 8 | _IDENTIFIER = V1RunKind.CLEANER 9 | 10 | kind: Literal[_IDENTIFIER] = _IDENTIFIER 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/dask/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.run.dask.dask import V1DaskJob 2 | from polyaxon._flow.run.dask.replica import V1DaskReplica 3 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/kubeflow/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/kubeflow/clean_pod_policy.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.enums import PEnum 2 | 3 | 4 | class V1CleanPodPolicy(str, PEnum): 5 | ALL = "All" 6 | RUNNING = "Running" 7 | var_NONE = "None" 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/notifier.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Literal 2 | 3 | from polyaxon._flow.run.enums import V1RunKind 4 | from polyaxon._flow.run.job import V1Job 5 | 6 | 7 | class V1NotifierJob(V1Job): 8 | _IDENTIFIER = V1RunKind.NOTIFIER 9 | 10 | kind: Literal[_IDENTIFIER] = _IDENTIFIER 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/ray/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow.run.ray.ray import V1RayJob 2 | from polyaxon._flow.run.ray.replica import V1RayReplica 3 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/tuner.py: -------------------------------------------------------------------------------- 1 | from typing_extensions import Literal 2 | 3 | from polyaxon._flow.run.enums import V1RunKind 4 | from polyaxon._flow.run.job import V1Job 5 | 6 | 7 | class V1TunerJob(V1Job): 8 | _IDENTIFIER = V1RunKind.TUNER 9 | 10 | kind: Literal[_IDENTIFIER] = _IDENTIFIER 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/run/utils.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.k8s_schemas import V1Container 2 | 3 | 4 | class DestinationImageMixin: 5 | def apply_image_destination(self, image: str): 6 | self.container = self.container or V1Container() 7 | self.container.image = image 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/schedules/enums.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.enums import PEnum 2 | 3 | 4 | class V1ScheduleKind(str, PEnum): 5 | CRON = "cron" 6 | INTERVAL = "interval" 7 | DATETIME = "datetime" 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_flow/trigger_policies.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.enums import PEnum 2 | 3 | from polyaxon._schemas.lifecycle import V1Statuses 4 | 5 | 6 | class V1TriggerPolicy(str, PEnum): 7 | ALL_SUCCEEDED = "all_succeeded" 8 | ALL_FAILED = "all_failed" 9 | ALL_DONE = "all_done" 10 | ONE_SUCCEEDED = "one_succeeded" 11 | ONE_FAILED = "one_failed" 12 | ONE_DONE = "one_done" 13 | 14 | @classmethod 15 | def trigger_statuses_mapping(cls): 16 | return { 17 | cls.ALL_SUCCEEDED: V1Statuses.SUCCEEDED, 18 | cls.ALL_FAILED: V1Statuses.FAILED, 19 | cls.ALL_DONE: V1Statuses.DONE, 20 | cls.ONE_SUCCEEDED: V1Statuses.SUCCEEDED, 21 | cls.ONE_FAILED: V1Statuses.FAILED, 22 | cls.ONE_DONE: V1Statuses.DONE, 23 | } 24 | -------------------------------------------------------------------------------- /cli/polyaxon/_fs/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_fs/types.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from fsspec import AbstractFileSystem 4 | from fsspec.asyn import AsyncFileSystem 5 | 6 | FSSystem = Union[AbstractFileSystem, AsyncFileSystem] 7 | -------------------------------------------------------------------------------- /cli/polyaxon/_fs/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from typing import Optional 4 | 5 | from polyaxon._env_vars.keys import ENV_KEYS_SERVICE_MODE 6 | from polyaxon._schemas.lifecycle import V1ProjectFeature 7 | from polyaxon._services import PolyaxonServices 8 | 9 | 10 | def get_store_path(store_path: str, subpath: str, entity: Optional[str] = None) -> str: 11 | full_path = store_path 12 | 13 | if os.environ.get(ENV_KEYS_SERVICE_MODE) == PolyaxonServices.VIEWER: 14 | dir_path = "runs" if entity == V1ProjectFeature.RUNTIME else f"{entity}s" 15 | full_path = os.path.join(full_path, dir_path) 16 | 17 | if subpath: 18 | full_path = os.path.join(full_path, subpath) 19 | return full_path 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_init/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_init/dockerfile.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from typing import Dict 4 | 5 | from polyaxon._client.init import get_client_or_raise 6 | from traceml.artifacts import V1ArtifactKind 7 | 8 | 9 | def create_dockerfile_lineage(dockerfile_path: str, summary: Dict): 10 | if not dockerfile_path: 11 | return 12 | filename = os.path.basename(dockerfile_path) 13 | 14 | run_client = get_client_or_raise() 15 | if not run_client: 16 | return 17 | 18 | run_client.log_artifact_ref( 19 | path=dockerfile_path, 20 | kind=V1ArtifactKind.DOCKERFILE, 21 | name=filename, 22 | summary=summary, 23 | is_input=True, 24 | ) 25 | -------------------------------------------------------------------------------- /cli/polyaxon/_init/file.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from typing import Dict 4 | 5 | from polyaxon._client.init import get_client_or_raise 6 | from traceml.artifacts import V1ArtifactKind 7 | 8 | 9 | def create_file_lineage(filepath: str, summary: Dict, kind: str): 10 | if not filepath: 11 | return 12 | filename = os.path.basename(filepath) 13 | if not kind: 14 | if "dockerfile" in filename.lower(): 15 | kind = V1ArtifactKind.DOCKERFILE 16 | else: 17 | kind = V1ArtifactKind.FILE 18 | 19 | run_client = get_client_or_raise() 20 | if not run_client: 21 | return 22 | 23 | run_client.log_artifact_ref( 24 | path=filepath, 25 | kind=kind, 26 | name=filename, 27 | summary=summary, 28 | is_input=True, 29 | ) 30 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/agent/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/_k8s/agent/__init__.py -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/agent/agent.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.executor.executor import Executor 2 | from polyaxon._runner.agent.sync_agent import BaseSyncAgent 3 | 4 | 5 | class Agent(BaseSyncAgent): 6 | EXECUTOR = Executor 7 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/agent/async_agent.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.executor.async_executor import AsyncExecutor 2 | from polyaxon._runner.agent.async_agent import BaseAsyncAgent 3 | 4 | 5 | class AsyncAgent(BaseAsyncAgent): 6 | EXECUTOR = AsyncExecutor 7 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/constants.py: -------------------------------------------------------------------------------- 1 | K8S_API_VERSION_V1 = "v1" 2 | K8S_API_VERSION_NETWORKING_V1_BETA1 = "networking.k8s.io/v1beta1" 3 | K8S_API_VERSION_BATCH_V1 = "batch/v1" 4 | K8S_API_VERSION_APPS_V1 = "apps/v1" 5 | K8S_PERSISTENT_VOLUME_KIND = "PersistentVolume" 6 | K8S_PERSISTENT_VOLUME_CLAIM_KIND = "PersistentVolumeClaim" 7 | K8S_CONFIG_MAP_KIND = "ConfigMap" 8 | K8S_SECRET_KIND = "Secret" # noqa 9 | K8S_POD_KIND = "Pod" 10 | K8S_POD_TEMPLATE_KIND = "PodTemplate" 11 | K8S_DEPLOYMENT_KIND = "Deployment" 12 | K8S_SERVICE_KIND = "Service" 13 | K8S_INGRESS_KIND = "Ingress" 14 | K8S_JOB_KIND = "Job" 15 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/converter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/_k8s/converter/__init__.py -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/converter/base/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.converter.base.base import BaseConverter 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/converter/common/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/converter/converters/helpers.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.converter.converters.job import JobConverter 2 | from polyaxon._k8s.converter.mixins import CleanerMixin, NotifierMixin, TunerMixin 3 | from polyaxon._utils.fqn_utils import get_cleaner_instance, get_cleaner_resource_name 4 | 5 | 6 | class NotifierConverter(NotifierMixin, JobConverter): 7 | pass 8 | 9 | 10 | class TunerConverter(TunerMixin, JobConverter): 11 | pass 12 | 13 | 14 | class CleanerConverter(CleanerMixin, JobConverter): 15 | def get_instance(self): 16 | return get_cleaner_instance( 17 | owner=self.owner_name, project=self.project_name, run_uuid=self.run_uuid 18 | ) 19 | 20 | def get_resource_name(self): 21 | return get_cleaner_resource_name(self.run_uuid) 22 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/converter/converters/kubeflow/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.converter.converters.kubeflow.mpi_job import MPIJobConverter 2 | from polyaxon._k8s.converter.converters.kubeflow.pytroch_job import PytorchJobConverter 3 | from polyaxon._k8s.converter.converters.kubeflow.tf_job import TfJobConverter 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/converter/pod/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/custom_resources/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/custom_resources/crd.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from polyaxon._k8s import k8s_schemas 4 | 5 | 6 | def get_custom_object( 7 | namespace: str, 8 | resource_name: str, 9 | kind: str, 10 | api_version: str, 11 | labels: Dict, 12 | annotations: Dict, 13 | custom_object: Dict, 14 | ) -> Dict: 15 | metadata = k8s_schemas.V1ObjectMeta( 16 | name=resource_name, 17 | labels=labels, 18 | annotations=annotations, 19 | namespace=namespace, 20 | ) 21 | custom_object.update( 22 | {"kind": kind, "apiVersion": api_version, "metadata": metadata} 23 | ) 24 | 25 | return custom_object 26 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/custom_resources/kubeflow/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.custom_resources.kubeflow.mpi_job import get_mpi_job_custom_resource 2 | from polyaxon._k8s.custom_resources.kubeflow.pytorch_job import ( 3 | get_pytorch_job_custom_resource, 4 | ) 5 | from polyaxon._k8s.custom_resources.kubeflow.tf_job import get_tf_job_custom_resource 6 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/custom_resources/operation.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from polyaxon._k8s.custom_resources.crd import get_custom_object 4 | 5 | KIND = "Operation" 6 | PLURAL = "operations" 7 | API_VERSION = "v1" 8 | GROUP = "core.polyaxon.com" 9 | 10 | 11 | def get_operation_custom_object( 12 | resource_name: str, 13 | namespace: str, 14 | custom_object: Dict, 15 | annotations: Dict[str, str], 16 | labels: Dict[str, str], 17 | ) -> Dict: 18 | return get_custom_object( 19 | resource_name=resource_name, 20 | namespace=namespace, 21 | kind=KIND, 22 | api_version="{}/{}".format(GROUP, API_VERSION), 23 | labels=labels, 24 | annotations=annotations, 25 | custom_object=custom_object, 26 | ) 27 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/events.py: -------------------------------------------------------------------------------- 1 | def get_container_statuses_by_name(statuses): 2 | return { 3 | container_status["name"]: { 4 | "ready": container_status["ready"], 5 | "state": container_status["state"], 6 | } 7 | for container_status in statuses 8 | } 9 | 10 | 11 | def get_container_status(statuses, container_ids): 12 | job_container_status = None 13 | for container_id in container_ids: 14 | job_container_status = statuses.get(container_id) 15 | if job_container_status: 16 | break 17 | return job_container_status 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/executor/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/executor/executor.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.executor.base import BaseExecutor 2 | from polyaxon._k8s.manager.manager import K8sManager 3 | 4 | 5 | class Executor(BaseExecutor): 6 | def _get_manager(self): 7 | return K8sManager( 8 | k8s_config=self.k8s_config, 9 | namespace=self.namespace, 10 | in_cluster=self.in_cluster, 11 | ) 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/logging/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/manager/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/monitor.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.events import get_container_status, get_container_statuses_by_name 2 | from polyaxon._k8s.pods import PodLifeCycle 3 | 4 | 5 | def is_container_terminated(status, container_id): 6 | container_statuses = status.get("container_statuses") or [] 7 | statuses_by_name = get_container_statuses_by_name(container_statuses) 8 | statuses = get_container_status(statuses_by_name, (container_id,)) 9 | statuses = statuses or {} 10 | return statuses.get("state", {}).get("terminated") 11 | 12 | 13 | def is_pod_running(event, container_id): 14 | event = event.to_dict() 15 | event_status = event.get("status", {}) 16 | is_terminated = is_container_terminated( 17 | status=event_status, container_id=container_id 18 | ) 19 | 20 | return ( 21 | event_status.get("phase") 22 | in {PodLifeCycle.RUNNING, PodLifeCycle.PENDING, PodLifeCycle.CONTAINER_CREATING} 23 | and not is_terminated 24 | ) 25 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/namespace.py: -------------------------------------------------------------------------------- 1 | DEFAULT_NAMESPACE = "polyaxon" 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/pods.py: -------------------------------------------------------------------------------- 1 | from polyaxon._constants.globals import UNKNOWN 2 | 3 | 4 | class EventTypes: 5 | ADDED = "ADDED" 6 | MODIFIED = "MODIFIED" 7 | DELETED = "DELETED" 8 | ERROR = "ERROR" 9 | 10 | 11 | class PodConditions: 12 | READY = "Ready" 13 | INITIALIZED = "Initialized" 14 | SCHEDULED = "PodScheduled" 15 | UNSCHEDULABLE = "Unschedulable" 16 | 17 | VALUES = [READY, INITIALIZED, SCHEDULED] 18 | 19 | 20 | class PodLifeCycle: 21 | CONTAINER_CREATING = "ContainerCreating" 22 | PENDING = "Pending" 23 | RUNNING = "Running" 24 | SUCCEEDED = "Succeeded" 25 | FAILED = "Failed" 26 | UNKNOWN = UNKNOWN 27 | 28 | DONE_STATUS = [FAILED, SUCCEEDED] 29 | -------------------------------------------------------------------------------- /cli/polyaxon/_k8s/replica.py: -------------------------------------------------------------------------------- 1 | from collections import namedtuple 2 | 3 | 4 | class ReplicaSpec( 5 | namedtuple( 6 | "ReplicaSpec", 7 | "volumes init_containers sidecar_containers main_container labels annotations environment num_replicas custom", 8 | ) 9 | ): 10 | pass 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_local_process/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/_local_process/__init__.py -------------------------------------------------------------------------------- /cli/polyaxon/_local_process/agent.py: -------------------------------------------------------------------------------- 1 | from polyaxon._local_process.executor import Executor 2 | from polyaxon._runner.agent.sync_agent import BaseSyncAgent 3 | 4 | 5 | class Agent(BaseSyncAgent): 6 | EXECUTOR = Executor 7 | -------------------------------------------------------------------------------- /cli/polyaxon/_local_process/converter/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_local_process/converter/base/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._local_process.converter.base.base import BaseConverter 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_local_process/converter/converters/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._flow import V1RunKind 2 | from polyaxon._local_process.converter.converters.job import JobConverter 3 | from polyaxon._local_process.converter.converters.service import ServiceConverter 4 | 5 | CONVERTERS = { 6 | V1RunKind.JOB: JobConverter, 7 | V1RunKind.SERVICE: ServiceConverter, 8 | } 9 | -------------------------------------------------------------------------------- /cli/polyaxon/_managers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_managers/compose.py: -------------------------------------------------------------------------------- 1 | from polyaxon._config.manager import ConfigManager 2 | 3 | 4 | class ComposeConfigManager(ConfigManager): 5 | """Manages access cli configuration .compose file.""" 6 | 7 | VISIBILITY = ConfigManager.Visibility.GLOBAL 8 | CONFIG_FILE_NAME = ".compose/.env" 9 | FREQUENCY = 3 10 | 11 | @classmethod 12 | def get_config_filepath(cls, create: bool = True) -> str: 13 | path = super().get_config_filepath(create=create) 14 | values = path.split("/")[:-1] 15 | cls._create_dir("/".join(values)) 16 | return path 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_managers/git.py: -------------------------------------------------------------------------------- 1 | from typing import Type 2 | 3 | from polyaxon._config.manager import ConfigManager 4 | from polyaxon._flow import V1Init 5 | from polyaxon._schemas.types import V1GitType 6 | 7 | 8 | class GitConfigManager(ConfigManager): 9 | """Manages access token configuration .auth file.""" 10 | 11 | VISIBILITY = ConfigManager.Visibility.LOCAL 12 | CONFIG_FILE_NAME = "polyaxongit.yaml" 13 | CONFIG: Type[V1Init] = V1Init 14 | 15 | @classmethod 16 | def get_config_from_env(cls) -> V1Init: 17 | pass 18 | 19 | @classmethod 20 | def get_config(cls, check: bool = True) -> V1Init: 21 | config = super(GitConfigManager, cls).get_config(check=check) 22 | if not config.git: 23 | config.git = V1GitType() 24 | 25 | return config 26 | -------------------------------------------------------------------------------- /cli/polyaxon/_managers/project.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from typing import Type 4 | 5 | from clipped.formatting import Printer 6 | 7 | from polyaxon._config.manager import ConfigManager 8 | from polyaxon._sdk.schemas.v1_project import V1Project 9 | from polyaxon._utils import cli_constants 10 | 11 | 12 | class ProjectConfigManager(ConfigManager): 13 | """Manages project configuration .project file.""" 14 | 15 | VISIBILITY = ConfigManager.Visibility.ALL 16 | IN_PROJECT_DIR = True 17 | CONFIG_FILE_NAME = ".project" 18 | CONFIG: Type[V1Project] = V1Project 19 | 20 | @classmethod 21 | def get_config_or_raise(cls) -> V1Project: 22 | project = cls.get_config() 23 | if not project: 24 | Printer.error( 25 | "No project was found, please initialize a project." " {}".format( 26 | cli_constants.INIT_COMMAND 27 | ) 28 | ) 29 | sys.exit(1) 30 | 31 | return project 32 | -------------------------------------------------------------------------------- /cli/polyaxon/_managers/run.py: -------------------------------------------------------------------------------- 1 | from typing import Type 2 | 3 | from clipped.formatting import Printer 4 | 5 | from polyaxon._config.manager import ConfigManager 6 | from polyaxon._sdk.schemas.v1_run import V1Run 7 | 8 | 9 | class RunConfigManager(ConfigManager): 10 | """Manages run configuration .run file.""" 11 | 12 | VISIBILITY = ConfigManager.Visibility.ALL 13 | IN_PROJECT_DIR = True 14 | CONFIG_FILE_NAME = ".run" 15 | CONFIG: Type[V1Run] = V1Run 16 | 17 | @classmethod 18 | def get_config_or_raise(cls) -> V1Run: 19 | run = cls.get_config() 20 | if not run: 21 | Printer.error("No run was provided.", sys_exit=True) 22 | 23 | return run 24 | -------------------------------------------------------------------------------- /cli/polyaxon/_managers/user.py: -------------------------------------------------------------------------------- 1 | from typing import Type 2 | 3 | from clipped.formatting import Printer 4 | 5 | from polyaxon._config.manager import ConfigManager 6 | from polyaxon._sdk.schemas.v1_user import V1User 7 | 8 | 9 | class UserConfigManager(ConfigManager): 10 | """Manages user configuration .user file.""" 11 | 12 | VISIBILITY = ConfigManager.Visibility.GLOBAL 13 | IN_PROJECT_DIR = True 14 | CONFIG_FILE_NAME = ".user" 15 | CONFIG: Type[V1User] = V1User 16 | 17 | @classmethod 18 | def get_config_or_raise(cls) -> V1User: 19 | user = cls.get_config() 20 | if not user: 21 | Printer.error("User configuration was not found.", sys_exit=True) 22 | 23 | return user 24 | 25 | @classmethod 26 | def get_config_from_env(cls): 27 | pass 28 | -------------------------------------------------------------------------------- /cli/polyaxon/_notifiers/__init__.py: -------------------------------------------------------------------------------- 1 | from vents.notifiers import NOTIFIERS 2 | 3 | from polyaxon._notifiers.spec import NotificationSpec 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_operations/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._operations.cleaner import ( 2 | get_batch_cleaner_operation, 3 | get_cleaner_operation, 4 | ) 5 | from polyaxon._operations.notifier import get_notifier_operation 6 | from polyaxon._operations.tuner import ( 7 | get_bo_tuner, 8 | get_hyperband_tuner, 9 | get_hyperopt_tuner, 10 | ) 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_plugins/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_polyaxonfile/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._polyaxonfile.check import ( 2 | DEFAULT_POLYAXON_FILE_EXTENSION, 3 | DEFAULT_POLYAXON_FILE_NAME, 4 | check_default_path, 5 | check_polyaxonfile, 6 | ) 7 | from polyaxon._polyaxonfile.manager import ( 8 | get_op_from_schedule, 9 | get_op_specification, 10 | get_ops_from_suggestions, 11 | ) 12 | from polyaxon._polyaxonfile.params import parse_hparams, parse_params 13 | from polyaxon._polyaxonfile.specs import ( 14 | BaseSpecification, 15 | CompiledOperationSpecification, 16 | ComponentSpecification, 17 | OperationSpecification, 18 | get_specification, 19 | spec_kinds, 20 | ) 21 | -------------------------------------------------------------------------------- /cli/polyaxon/_polyaxonfile/manager/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._polyaxonfile.manager.operations import get_op_specification 2 | from polyaxon._polyaxonfile.manager.workflows import ( 3 | get_op_from_schedule, 4 | get_ops_from_suggestions, 5 | ) 6 | -------------------------------------------------------------------------------- /cli/polyaxon/_polyaxonfile/specs/__init__.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Mapping 2 | 3 | from polyaxon._config.spec import ConfigSpec 4 | from polyaxon._polyaxonfile.specs import kinds as spec_kinds 5 | from polyaxon._polyaxonfile.specs.base import BaseSpecification 6 | from polyaxon._polyaxonfile.specs.compiled_operation import ( 7 | CompiledOperationSpecification, 8 | ) 9 | from polyaxon._polyaxonfile.specs.component import ComponentSpecification 10 | from polyaxon._polyaxonfile.specs.operation import OperationSpecification 11 | 12 | SPECIFICATION_BY_KIND = { 13 | spec_kinds.OPERATION: OperationSpecification, 14 | spec_kinds.COMPILED_OPERATION: CompiledOperationSpecification, 15 | spec_kinds.COMPONENT: ComponentSpecification, 16 | } 17 | 18 | 19 | def get_specification(data): 20 | if not isinstance(data, Mapping): 21 | data = ConfigSpec.read_from(data) 22 | kind = BaseSpecification.get_kind(data=data) 23 | return SPECIFICATION_BY_KIND[kind].read(data) 24 | -------------------------------------------------------------------------------- /cli/polyaxon/_polyaxonfile/specs/component.py: -------------------------------------------------------------------------------- 1 | from typing import Type 2 | 3 | from polyaxon._flow import V1Component 4 | from polyaxon._polyaxonfile.specs import kinds 5 | from polyaxon._polyaxonfile.specs.base import BaseSpecification 6 | 7 | 8 | class ComponentSpecification(BaseSpecification): 9 | """The polyaxonfile specification for component.""" 10 | 11 | _SPEC_KIND = kinds.COMPONENT 12 | 13 | CONFIG: Type[V1Component] = V1Component 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_polyaxonfile/specs/kinds.py: -------------------------------------------------------------------------------- 1 | OPERATION = "operation" 2 | COMPILED_OPERATION = "compiled_operation" 3 | COMPONENT = "component" 4 | KINDS = {OPERATION, COMPILED_OPERATION, COMPONENT} 5 | -------------------------------------------------------------------------------- /cli/polyaxon/_polyaxonfile/specs/libs/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_polyaxonfile/specs/libs/engine.py: -------------------------------------------------------------------------------- 1 | import jinja2 2 | 3 | from typing import Optional 4 | 5 | from markupsafe import soft_str 6 | 7 | 8 | def map_format(value, pattern, variable_name: Optional[str] = None): 9 | if variable_name: 10 | return soft_str(pattern) % {variable_name: value} 11 | return soft_str(pattern) % value 12 | 13 | 14 | def get_engine(): 15 | env = jinja2.Environment() 16 | env.filters["map_format"] = map_format 17 | return env 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_pql/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/agent/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/_runner/agent/__init__.py -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._runner.converter.converter import BaseConverter 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/common/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/common/constants.py: -------------------------------------------------------------------------------- 1 | VOLUME_MOUNT_DOCKER = "docker" 2 | VOLUME_MOUNT_SHM = "shm" 3 | VOLUME_MOUNT_CONFIGS = "configs-context" 4 | VOLUME_MOUNT_ARTIFACTS = "artifacts-context" 5 | VOLUME_MOUNT_CONNECTIONS_FORMAT = "connections-context-{}" 6 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/common/volumes.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | from polyaxon._runner.converter.common import constants 4 | 5 | 6 | def get_volume_name(path: str) -> str: 7 | name = uuid.uuid5(namespace=uuid.NAMESPACE_DNS, name=path).hex 8 | return constants.VOLUME_MOUNT_CONNECTIONS_FORMAT.format(name) 9 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/init/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/init/dockerfile.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from polyaxon._contexts import paths as ctx_paths 4 | from polyaxon._schemas.types import V1DockerfileType 5 | 6 | INIT_DOCKERFILE_COMMAND = ["polyaxon", "docker", "generate"] 7 | 8 | 9 | def get_dockerfile_init_container( 10 | dockerfile_args: V1DockerfileType, 11 | run_path: str, 12 | mount_path: Optional[str] = None, 13 | ) -> List[str]: 14 | return [ 15 | "--build-context={}".format(dockerfile_args.to_json()), 16 | "--destination={}".format(mount_path), 17 | "--copy-path={}".format( 18 | ctx_paths.CONTEXT_MOUNT_RUN_OUTPUTS_FORMAT.format(run_path) 19 | ), 20 | "--track", 21 | ] 22 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/init/file.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from polyaxon._contexts import paths as ctx_paths 4 | from polyaxon._schemas.types import V1FileType 5 | 6 | FILE_INIT_COMMAND = ["polyaxon", "initializer", "file"] 7 | 8 | 9 | def get_file_init_args( 10 | file_args: V1FileType, 11 | run_path: str, 12 | mount_path: Optional[str] = None, 13 | ) -> List[str]: 14 | return [ 15 | "--file-context={}".format(file_args.to_json()), 16 | "--filepath={}".format(mount_path), 17 | "--copy-path={}".format( 18 | ctx_paths.CONTEXT_MOUNT_RUN_OUTPUTS_FORMAT.format(run_path) 19 | ), 20 | "--track", 21 | ] 22 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/converter/types.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Union 2 | 3 | from polyaxon._docker import docker_types 4 | from polyaxon._k8s import k8s_schemas 5 | 6 | EnvVar = Union[k8s_schemas.V1EnvVar, docker_types.V1EnvVar] 7 | ResourceRequirements = Union[ 8 | k8s_schemas.V1ResourceRequirements, docker_types.V1ResourceRequirements 9 | ] 10 | Container = Union[k8s_schemas.V1Container, docker_types.V1Container] 11 | ContainerPort = Union[k8s_schemas.V1ContainerPort, docker_types.V1ContainerPort] 12 | Resource = Union[Dict, List[docker_types.V1Container]] 13 | VolumeMount = Union[k8s_schemas.V1VolumeMount, docker_types.V1VolumeMount] 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_runner/kinds.py: -------------------------------------------------------------------------------- 1 | from clipped.utils.enums import PEnum 2 | 3 | 4 | class RunnerKind(str, PEnum): 5 | K8S = "k8s" 6 | PROCESS = "process" 7 | DOCKER = "docker" 8 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/_schemas/__init__.py -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/compatibility.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from polyaxon._schemas.base import BaseSchemaModel 4 | from polyaxon._schemas.version import V1Version 5 | 6 | 7 | class V1Compatibility(BaseSchemaModel): 8 | cli: Optional[V1Version] = None 9 | platform: Optional[V1Version] = None 10 | agent: Optional[V1Version] = None 11 | ui: Optional[V1Version] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/home.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictStr 4 | 5 | from polyaxon._env_vars.keys import ENV_KEYS_HOME 6 | from polyaxon._schemas.base import BaseSchemaModel 7 | 8 | 9 | class HomeConfig(BaseSchemaModel): 10 | """ 11 | Home config for managing the main context path. 12 | 13 | 14 | Args: 15 | path: `str`. The context path where to write/read configs. 16 | """ 17 | 18 | _IDENTIFIER = "home" 19 | 20 | path: Optional[StrictStr] = Field(alias=ENV_KEYS_HOME, default=None) 21 | 22 | class Config: 23 | extra = "ignore" 24 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/installation.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import Field, StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1Installation(BaseAllowSchemaModel): 8 | key: Optional[StrictStr] = None 9 | version: Optional[StrictStr] = None 10 | dist: Optional[StrictStr] = None 11 | host: Optional[StrictStr] = None 12 | hmac: Optional[StrictStr] = None 13 | mode: Optional[StrictStr] = None 14 | org: Optional[bool] = None 15 | auth: Optional[List[StrictStr]] = None 16 | single_url: Optional[bool] = Field(alias="singleUrl", default=None) 17 | default_streams_url: Optional[StrictStr] = Field( 18 | alias="defaultStreamsUrl", default=None 19 | ) 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/log_handler.py: -------------------------------------------------------------------------------- 1 | import base64 2 | 3 | from typing import Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | 8 | 9 | class V1LogHandler(BaseAllowSchemaModel): 10 | _IDENTIFIER = "log_handler" 11 | 12 | dsn: Optional[StrictStr] = None 13 | environment: Optional[StrictStr] = None 14 | 15 | @property 16 | def decoded_dsn(self): 17 | if self.dsn: 18 | return base64.b64decode(self.dsn.encode("utf-8")).decode("utf-8") 19 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/types/__init__.py: -------------------------------------------------------------------------------- 1 | from clipped.types.gcs import GcsPath 2 | from clipped.types.s3 import S3Path 3 | from clipped.types.uri import Uri 4 | from clipped.types.wasb import WasbPath 5 | 6 | from polyaxon._schemas.types.artifacts import V1ArtifactsType 7 | from polyaxon._schemas.types.dockerfile import V1DockerfileType 8 | from polyaxon._schemas.types.event import V1EventType 9 | from polyaxon._schemas.types.file import V1FileType 10 | from polyaxon._schemas.types.git import V1GitType 11 | from polyaxon._schemas.types.tensorboard import V1TensorboardType 12 | 13 | V1GcsType = GcsPath 14 | V1S3Type = S3Path 15 | V1UriType = Uri 16 | V1WasbType = WasbPath 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/types/base.py: -------------------------------------------------------------------------------- 1 | from polyaxon._schemas.base import BaseSchemaModel 2 | 3 | 4 | class BaseTypeConfig(BaseSchemaModel): 5 | def to_param(self): 6 | return self.to_dict() 7 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/types/event.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | 5 | from polyaxon._schemas.types.base import BaseTypeConfig 6 | 7 | 8 | class V1EventType(BaseTypeConfig): 9 | _IDENTIFIER = "event" 10 | 11 | name: Optional[StrictStr] = None 12 | kind: Optional[StrictStr] = None 13 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/user.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.types.email import EmailStr 5 | 6 | from polyaxon._schemas.base import BaseSchemaModel 7 | 8 | 9 | class UserConfig(BaseSchemaModel): 10 | _IDENTIFIER = "user" 11 | 12 | username: StrictStr 13 | email: Optional[EmailStr] = None 14 | name: Optional[StrictStr] = None 15 | theme: Optional[int] = None 16 | -------------------------------------------------------------------------------- /cli/polyaxon/_schemas/version.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | 5 | from polyaxon._schemas.base import BaseSchemaModel 6 | 7 | 8 | class V1Version(BaseSchemaModel): 9 | min: Optional[StrictStr] = None 10 | latest: Optional[StrictStr] = None 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/_sdk/__init__.py -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/async_client/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/base_api.py: -------------------------------------------------------------------------------- 1 | from polyaxon._sdk.async_client.api_client import AsyncApiClient 2 | from polyaxon._sdk.sync_client.api_client import ApiClient 3 | 4 | 5 | class BaseApi: 6 | def __init__(self, api_client=None, is_async=False): 7 | if api_client is None: 8 | api_client = ( 9 | AsyncApiClient.get_default() if is_async else ApiClient.get_default() 10 | ) 11 | self.api_client = api_client 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_activity.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | 9 | 10 | class V1Activity(BaseAllowSchemaModel): 11 | actor: Optional[StrictStr] = None 12 | owner: Optional[StrictStr] = None 13 | created_at: Optional[datetime.datetime] = None 14 | event_action: Optional[StrictStr] = None 15 | event_subject: Optional[StrictStr] = None 16 | object_name: Optional[StrictStr] = None 17 | object_uuid: Optional[UUIDStr] = None 18 | object_parent: Optional[StrictStr] = None 19 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_agent_reconcile_body_request.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1AgentReconcileBodyRequest(BaseAllowSchemaModel): 8 | """ 9 | V1AgentReconcileBodyRequest 10 | """ 11 | 12 | owner: Optional[StrictStr] = None 13 | uuid: Optional[StrictStr] = None 14 | reconcile: Optional[Dict[str, Any]] = None 15 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_agent_state_response.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | 5 | from polyaxon._schemas.lifecycle import V1Statuses 6 | from polyaxon._sdk.schemas.v1_agent_state_response_agent_state import ( 7 | V1AgentStateResponseAgentState, 8 | ) 9 | 10 | 11 | class V1AgentStateResponse(BaseAllowSchemaModel): 12 | status: Optional[V1Statuses] = None 13 | state: Optional[V1AgentStateResponseAgentState] = None 14 | live_state: Optional[int] = None 15 | compatible_updates: Optional[Dict[str, Any]] = None 16 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_agent_state_response_agent_state.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | 5 | 6 | class V1AgentStateResponseAgentState(BaseAllowSchemaModel): 7 | schedules: Optional[List] = None 8 | hooks: Optional[List] = None 9 | watchdogs: Optional[List] = None 10 | tuners: Optional[List] = None 11 | queued: Optional[List] = None 12 | stopping: Optional[List] = None 13 | deleting: Optional[List] = None 14 | apply: Optional[List] = None 15 | checks: Optional[List] = None 16 | full: Optional[bool] = None 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_agent_status_body_request.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | from polyaxon._schemas.lifecycle import V1StatusCondition 8 | 9 | 10 | class V1AgentStatusBodyRequest(BaseAllowSchemaModel): 11 | owner: Optional[StrictStr] = None 12 | uuid: Optional[UUIDStr] = None 13 | condition: Optional[V1StatusCondition] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_analytics_spec.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1AnalyticsSpec(BaseAllowSchemaModel): 8 | view: Optional[StrictStr] = None 9 | trunc: Optional[StrictStr] = None 10 | groupby: Optional[StrictStr] = None 11 | frequency: Optional[StrictStr] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_artifact_tree.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1ArtifactTree(BaseAllowSchemaModel): 8 | files: Optional[Dict[str, int]] = None 9 | dirs: Optional[List[StrictStr]] = None 10 | is_done: Optional[bool] = None 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_auth.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1Auth(BaseAllowSchemaModel): 8 | token: Optional[StrictStr] = None 9 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_cloning.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | from polyaxon._flow import V1CloningKind 8 | 9 | 10 | class V1Cloning(BaseAllowSchemaModel): 11 | uuid: Optional[UUIDStr] = None 12 | name: Optional[StrictStr] = None 13 | kind: Optional[V1CloningKind] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_connection_response.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import List, Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | from vents.providers.kinds import ProviderKind 9 | 10 | 11 | class V1ConnectionResponse(BaseAllowSchemaModel): 12 | uuid: Optional[UUIDStr] = None 13 | name: Optional[StrictStr] = None 14 | user: Optional[StrictStr] = None 15 | agent: Optional[StrictStr] = None 16 | description: Optional[StrictStr] = None 17 | tags: Optional[List[StrictStr]] = None 18 | created_at: Optional[datetime.datetime] = None 19 | updated_at: Optional[datetime.datetime] = None 20 | live_state: Optional[int] = None 21 | kind: Optional[ProviderKind] = None 22 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_dashboard.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import List, Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | 9 | from polyaxon._sdk.schemas.v1_dashboard_spec import V1DashboardSpec 10 | 11 | 12 | class V1Dashboard(BaseAllowSchemaModel): 13 | uuid: Optional[UUIDStr] = None 14 | name: Optional[StrictStr] = None 15 | description: Optional[StrictStr] = None 16 | user: Optional[StrictStr] = None 17 | tags: Optional[List[StrictStr]] = None 18 | live_state: Optional[int] = None 19 | spec: Optional[V1DashboardSpec] = None 20 | org_level: Optional[bool] = None 21 | created_at: Optional[datetime.datetime] = None 22 | updated_at: Optional[datetime.datetime] = None 23 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_dashboard_spec.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | 5 | from polyaxon._sdk.schemas.v1_section_spec import V1SectionSpec 6 | 7 | 8 | class V1DashboardSpec(BaseAllowSchemaModel): 9 | xaxis: Optional[str] = None 10 | smoothing: Optional[int] = None 11 | ignore_outliers: Optional[bool] = None 12 | sample_size: Optional[int] = None 13 | sections: Optional[List[V1SectionSpec]] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_entities_tags.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | 8 | class V1EntitiesTags(BaseAllowSchemaModel): 9 | uuids: Optional[List[UUIDStr]] = None 10 | tags: Optional[List[StrictStr]] = None 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_entities_transfer.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | 8 | class V1EntitiesTransfer(BaseAllowSchemaModel): 9 | uuids: Optional[List[UUIDStr]] = None 10 | project: Optional[StrictStr] = None 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_entity_notification_body.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | from polyaxon._schemas.lifecycle import V1StatusCondition 8 | 9 | 10 | class V1EntityNotificationBody(BaseAllowSchemaModel): 11 | namespace: Optional[StrictStr] = None 12 | owner: Optional[StrictStr] = None 13 | project: Optional[StrictStr] = None 14 | uuid: Optional[UUIDStr] = None 15 | name: Optional[StrictStr] = None 16 | condition: Optional[V1StatusCondition] = None 17 | connections: Optional[List[StrictStr]] = None 18 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_entity_stage_body_request.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._schemas.lifecycle import V1StageCondition 7 | 8 | 9 | class V1EntityStageBodyRequest(BaseAllowSchemaModel): 10 | owner: Optional[StrictStr] = None 11 | entity: Optional[StrictStr] = None 12 | kind: Optional[StrictStr] = None 13 | name: Optional[StrictStr] = None 14 | condition: Optional[V1StageCondition] = None 15 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_entity_status_body_request.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | from polyaxon._schemas.lifecycle import V1StatusCondition 8 | 9 | 10 | class V1EntityStatusBodyRequest(BaseAllowSchemaModel): 11 | owner: Optional[StrictStr] = None 12 | project: Optional[StrictStr] = None 13 | uuid: Optional[UUIDStr] = None 14 | condition: Optional[V1StatusCondition] = None 15 | force: Optional[bool] = None 16 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_events_response.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, List, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | 5 | 6 | class V1EventsResponse(BaseAllowSchemaModel): 7 | data: Optional[List[Dict[str, Any]]] = None 8 | 9 | 10 | class V1MultiEventsResponse(BaseAllowSchemaModel): 11 | data: Optional[Dict[str, Any]] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_activities_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_activity import V1Activity 7 | 8 | 9 | class V1ListActivitiesResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Activity]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_agents_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_agent import V1Agent 7 | 8 | 9 | class V1ListAgentsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Agent]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_bookmarks_response.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1ListBookmarksResponse(BaseAllowSchemaModel): 8 | count: Optional[int] = None 9 | results: Optional[List[Dict[str, Any]]] = None 10 | previous: Optional[StrictStr] = None 11 | next: Optional[StrictStr] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_connections_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_connection_response import V1ConnectionResponse 7 | 8 | 9 | class V1ListConnectionsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1ConnectionResponse]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_dashboards_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_dashboard import V1Dashboard 7 | 8 | 9 | class V1ListDashboardsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Dashboard]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_organization_members_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_organization_member import V1OrganizationMember 7 | 8 | 9 | class V1ListOrganizationMembersResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1OrganizationMember]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_organizations_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_organization import V1Organization 7 | 8 | 9 | class V1ListOrganizationsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Organization]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_presets_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_preset import V1Preset 7 | 8 | 9 | class V1ListPresetsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Preset]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_project_versions_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_project_version import V1ProjectVersion 7 | 8 | 9 | class V1ListProjectVersionsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1ProjectVersion]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_projects_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_project import V1Project 7 | 8 | 9 | class V1ListProjectsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Project]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_queues_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_queue import V1Queue 7 | 8 | 9 | class V1ListQueuesResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Queue]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_run_artifacts_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from traceml.artifacts import V1RunArtifact 7 | 8 | 9 | class V1ListRunArtifactsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1RunArtifact]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_run_connections_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_run_connection import V1RunConnection 7 | 8 | 9 | class V1ListRunConnectionsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1RunConnection]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_run_edges_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_run_edge import V1RunEdge 7 | 8 | 9 | class V1ListRunEdgesResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1RunEdge]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_runs_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_run import V1Run 7 | 8 | 9 | class V1ListRunsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Run]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_searches_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_search import V1Search 7 | 8 | 9 | class V1ListSearchesResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Search]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_service_accounts_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_service_account import V1ServiceAccount 7 | 8 | 9 | class V1ListServiceAccountsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1ServiceAccount]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_tags_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_tag import V1Tag 7 | 8 | 9 | class V1ListTagsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Tag]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_team_members_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_team_member import V1TeamMember 7 | 8 | 9 | class V1ListTeamMembersResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1TeamMember]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_teams_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_team import V1Team 7 | 8 | 9 | class V1ListTeamsResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Team]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_list_token_response.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_token import V1Token 7 | 8 | 9 | class V1ListTokenResponse(BaseAllowSchemaModel): 10 | count: Optional[int] = None 11 | results: Optional[List[V1Token]] = None 12 | previous: Optional[StrictStr] = None 13 | next: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_operation_body.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._flow import V1RunPending 7 | from polyaxon._schemas.lifecycle import ManagedBy 8 | 9 | 10 | class V1OperationBody(BaseAllowSchemaModel): 11 | content: Optional[StrictStr] = None 12 | is_managed: Optional[bool] = None 13 | managed_by: Optional[ManagedBy] = None 14 | pending: Optional[V1RunPending] = None 15 | name: Optional[StrictStr] = None 16 | description: Optional[StrictStr] = None 17 | tags: Optional[List[StrictStr]] = None 18 | meta_info: Optional[Dict[str, Any]] = None 19 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_organization_member.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.email import EmailStr 8 | 9 | 10 | class V1OrganizationMember(BaseAllowSchemaModel): 11 | user: Optional[StrictStr] = None 12 | user_email: Optional[EmailStr] = None 13 | role: Optional[StrictStr] = None 14 | kind: Optional[StrictStr] = None 15 | created_at: Optional[datetime.datetime] = None 16 | updated_at: Optional[datetime.datetime] = None 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_password_change.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1PasswordChange(BaseAllowSchemaModel): 8 | old_password: Optional[StrictStr] = None 9 | new_password1: Optional[StrictStr] = None 10 | new_password2: Optional[StrictStr] = None 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_pipeline.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | from polyaxon._flow import V1PipelineKind 8 | 9 | 10 | class V1Pipeline(BaseAllowSchemaModel): 11 | uuid: Optional[UUIDStr] = None 12 | name: Optional[StrictStr] = None 13 | kind: Optional[V1PipelineKind] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_project_settings.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_user_access import V1UserAccess 7 | 8 | 9 | class V1ProjectSettings(BaseAllowSchemaModel): 10 | connections: Optional[List[StrictStr]] = None 11 | default_presets: Optional[List[StrictStr]] = None 12 | default_presets_ordered: Optional[List[StrictStr]] = None 13 | presets: Optional[List[StrictStr]] = None 14 | queue: Optional[StrictStr] = None 15 | queues: Optional[List[StrictStr]] = None 16 | agents: Optional[List[StrictStr]] = None 17 | namespaces: Optional[List[StrictStr]] = None 18 | user_accesses: Optional[List[V1UserAccess]] = None 19 | teams: Optional[List[StrictStr]] = None 20 | projects: Optional[List[StrictStr]] = None 21 | policy: Optional[StrictStr] = None 22 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_queue.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import Any, Dict, List, Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | 9 | 10 | class V1Queue(BaseAllowSchemaModel): 11 | uuid: Optional[UUIDStr] = None 12 | agent: Optional[StrictStr] = None 13 | name: Optional[StrictStr] = None 14 | description: Optional[StrictStr] = None 15 | tags: Optional[List[StrictStr]] = None 16 | user: Optional[StrictStr] = None 17 | priority: Optional[int] = None 18 | concurrency: Optional[int] = None 19 | resource: Optional[StrictStr] = None 20 | quota: Optional[StrictStr] = None 21 | stats: Optional[Dict[str, Any]] = None 22 | created_at: Optional[datetime.datetime] = None 23 | updated_at: Optional[datetime.datetime] = None 24 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_run_connection.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | 8 | class V1RunConnection(BaseAllowSchemaModel): 9 | uuid: Optional[UUIDStr] = None 10 | name: Optional[StrictStr] = None 11 | kind: Optional[StrictStr] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_run_edge.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, List, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | 5 | from polyaxon._flow import V1RunEdgeKind 6 | from polyaxon._schemas.lifecycle import V1Statuses 7 | from polyaxon._sdk.schemas.v1_run import V1Run 8 | 9 | 10 | class V1RunEdge(BaseAllowSchemaModel): 11 | upstream: Optional[V1Run] = None 12 | downstream: Optional[V1Run] = None 13 | kind: Optional[V1RunEdgeKind] = None 14 | values: Optional[Dict[str, Any]] = None 15 | statuses: Optional[List[V1Statuses]] = None 16 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_run_edge_lineage.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | from clipped.types.uuids import UUIDStr 5 | 6 | 7 | class V1RunEdgeLineage(BaseAllowSchemaModel): 8 | """ 9 | V1RunEdgeLineage 10 | """ 11 | 12 | uuid: Optional[UUIDStr] = None 13 | is_upstream: Optional[bool] = None 14 | values: Optional[Dict[str, Any]] = None 15 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_run_edges_graph.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | 5 | from polyaxon._sdk.schemas.v1_run_edge_lineage import V1RunEdgeLineage 6 | 7 | 8 | class V1RunEdgesGraph(BaseAllowSchemaModel): 9 | edges: Optional[List[V1RunEdgeLineage]] = None 10 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_run_reference_catalog.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1RunReferenceCatalog(BaseAllowSchemaModel): 8 | owner: Optional[StrictStr] = None 9 | project: Optional[StrictStr] = None 10 | name: Optional[StrictStr] = None 11 | state: Optional[StrictStr] = None 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_run_settings.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | from polyaxon._sdk.schemas.v1_run_reference_catalog import V1RunReferenceCatalog 7 | from polyaxon._sdk.schemas.v1_settings_catalog import V1SettingsCatalog 8 | 9 | 10 | class V1RunSettings(BaseAllowSchemaModel): 11 | namespace: Optional[StrictStr] = None 12 | agent: Optional[V1SettingsCatalog] = None 13 | queue: Optional[V1SettingsCatalog] = None 14 | artifacts_store: Optional[V1SettingsCatalog] = None 15 | tensorboard: Optional[Dict[str, Any]] = None 16 | build: Optional[Dict[str, Any]] = None 17 | component: Optional[Dict[str, Any]] = None 18 | models: Optional[List[V1RunReferenceCatalog]] = None 19 | artifacts: Optional[List[V1RunReferenceCatalog]] = None 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_search.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import List, Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | 9 | from polyaxon._sdk.schemas.v1_search_spec import V1SearchSpec 10 | from traceml.events.schemas import SearchView 11 | 12 | 13 | class V1Search(BaseAllowSchemaModel): 14 | uuid: Optional[UUIDStr] = None 15 | name: Optional[StrictStr] = None 16 | description: Optional[StrictStr] = None 17 | tags: Optional[List[StrictStr]] = None 18 | user: Optional[StrictStr] = None 19 | live_state: Optional[int] = None 20 | view: Optional[SearchView] = None 21 | spec: Optional[V1SearchSpec] = None 22 | org_level: Optional[bool] = None 23 | created_at: Optional[datetime.datetime] = None 24 | updated_at: Optional[datetime.datetime] = None 25 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_section_spec.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1SectionSpec(BaseAllowSchemaModel): 8 | name: Optional[StrictStr] = None 9 | is_minimized: Optional[bool] = None 10 | is_frozen: Optional[str] = None 11 | columns: Optional[int] = None 12 | height: Optional[int] = None 13 | xaxis: Optional[str] = None 14 | smoothing: Optional[int] = None 15 | ignore_outliers: Optional[bool] = None 16 | sample_size: Optional[int] = None 17 | widgets: Optional[List[Dict[str, Any]]] = None 18 | page_index: Optional[int] = None 19 | page_size: Optional[int] = None 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_service_account.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import List, Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | 9 | 10 | class V1ServiceAccount(BaseAllowSchemaModel): 11 | uuid: Optional[UUIDStr] = None 12 | name: Optional[StrictStr] = None 13 | description: Optional[StrictStr] = None 14 | tags: Optional[List[StrictStr]] = None 15 | live_state: Optional[int] = None 16 | created_at: Optional[datetime.datetime] = None 17 | updated_at: Optional[datetime.datetime] = None 18 | scopes: Optional[List[StrictStr]] = None 19 | services: Optional[List[StrictStr]] = None 20 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_settings_catalog.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | 8 | class V1SettingsCatalog(BaseAllowSchemaModel): 9 | uuid: Optional[UUIDStr] = None 10 | name: Optional[StrictStr] = None 11 | version: Optional[StrictStr] = None 12 | url: Optional[StrictStr] = None 13 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_tag.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.uuids import UUIDStr 6 | 7 | 8 | class V1Tag(BaseAllowSchemaModel): 9 | uuid: Optional[UUIDStr] = None 10 | name: Optional[StrictStr] = None 11 | color: Optional[StrictStr] = None 12 | description: Optional[StrictStr] = None 13 | icon: Optional[StrictStr] = None 14 | stats: Optional[Dict[str, Any]] = None 15 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_team.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import List, Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | 9 | from polyaxon._sdk.schemas.v1_team_settings import V1TeamSettings 10 | 11 | 12 | class V1Team(BaseAllowSchemaModel): 13 | uuid: Optional[UUIDStr] = None 14 | owner: Optional[StrictStr] = None 15 | name: Optional[StrictStr] = None 16 | user: Optional[StrictStr] = None 17 | projects: Optional[List[StrictStr]] = None 18 | component_hubs: Optional[List[StrictStr]] = None 19 | model_registries: Optional[List[StrictStr]] = None 20 | settings: Optional[V1TeamSettings] = None 21 | policy: Optional[StrictStr] = None 22 | role: Optional[StrictStr] = None 23 | created_at: Optional[datetime.datetime] = None 24 | updated_at: Optional[datetime.datetime] = None 25 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_team_member.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.email import EmailStr 8 | 9 | 10 | class V1TeamMember(BaseAllowSchemaModel): 11 | user: Optional[StrictStr] = None 12 | user_email: Optional[EmailStr] = None 13 | role: Optional[StrictStr] = None 14 | org_role: Optional[StrictStr] = None 15 | created_at: Optional[datetime.datetime] = None 16 | updated_at: Optional[datetime.datetime] = None 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_team_settings.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | 5 | from polyaxon._sdk.schemas.v1_settings_catalog import V1SettingsCatalog 6 | 7 | 8 | class V1TeamSettings(BaseAllowSchemaModel): 9 | projects: Optional[List[V1SettingsCatalog]] = None 10 | hubs: Optional[List[V1SettingsCatalog]] = None 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_token.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | from typing import List, Optional 4 | 5 | from clipped.compact.pydantic import StrictStr 6 | from clipped.config.schema import BaseAllowSchemaModel 7 | from clipped.types.uuids import UUIDStr 8 | 9 | 10 | class V1Token(BaseAllowSchemaModel): 11 | uuid: Optional[UUIDStr] = None 12 | key: Optional[StrictStr] = None 13 | name: Optional[StrictStr] = None 14 | scopes: Optional[List[StrictStr]] = None 15 | services: Optional[List[StrictStr]] = None 16 | started_at: Optional[datetime.datetime] = None 17 | expires_at: Optional[datetime.datetime] = None 18 | created_at: Optional[datetime.datetime] = None 19 | updated_at: Optional[datetime.datetime] = None 20 | expiration: Optional[int] = None 21 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_trial_start.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.email import EmailStr 6 | 7 | 8 | class V1TrialStart(BaseAllowSchemaModel): 9 | name: Optional[StrictStr] = None 10 | email: Optional[EmailStr] = None 11 | organization: Optional[StrictStr] = None 12 | plan: Optional[StrictStr] = None 13 | seats: Optional[int] = None 14 | details: Optional[Dict[str, Any]] = None 15 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_user.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1User(BaseAllowSchemaModel): 8 | username: Optional[StrictStr] = None 9 | email: Optional[StrictStr] = None 10 | name: Optional[StrictStr] = None 11 | kind: Optional[StrictStr] = None 12 | theme: Optional[int] = None 13 | organization: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_user_access.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | 6 | 7 | class V1UserAccessData(BaseAllowSchemaModel): 8 | username: Optional[StrictStr] = None 9 | is_sa: Optional[bool] = None 10 | 11 | 12 | class V1UserAccess(BaseAllowSchemaModel): 13 | user: Optional[StrictStr] = None 14 | user_data: Optional[V1UserAccessData] = None 15 | queue: Optional[StrictStr] = None 16 | default_presets: Optional[List[StrictStr]] = None 17 | default_presets_ordered: Optional[List[StrictStr]] = None 18 | namespace: Optional[StrictStr] = None 19 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_user_email.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | from clipped.types.email import EmailStr 5 | 6 | 7 | class V1UserEmail(BaseAllowSchemaModel): 8 | email: Optional[EmailStr] = None 9 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_user_singup.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from clipped.compact.pydantic import StrictStr 4 | from clipped.config.schema import BaseAllowSchemaModel 5 | from clipped.types.email import EmailStr 6 | 7 | 8 | class V1UserSingup(BaseAllowSchemaModel): 9 | username: Optional[StrictStr] = None 10 | email: Optional[EmailStr] = None 11 | organization: Optional[StrictStr] = None 12 | password: Optional[StrictStr] = None 13 | invitation_key: Optional[StrictStr] = None 14 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/schemas/v1_uuids.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from clipped.config.schema import BaseAllowSchemaModel 4 | from clipped.types.uuids import UUIDStr 5 | 6 | 7 | class V1Uuids(BaseAllowSchemaModel): 8 | uuids: Optional[List[UUIDStr]] = None 9 | -------------------------------------------------------------------------------- /cli/polyaxon/_sdk/sync_client/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_services/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._services.auth import AuthenticationError, AuthenticationTypes 2 | from polyaxon._services.headers import PolyaxonServiceHeaders 3 | from polyaxon._services.values import PolyaxonServices 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_services/auth.py: -------------------------------------------------------------------------------- 1 | class AuthenticationError(Exception): 2 | pass 3 | 4 | 5 | class AuthenticationTypes: 6 | TOKEN = "Token" 7 | INTERNAL_TOKEN = "InternalToken" 8 | EPHEMERAL_TOKEN = "EphemeralToken" 9 | 10 | VALUES = {TOKEN, INTERNAL_TOKEN, EPHEMERAL_TOKEN} 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_services/headers.py: -------------------------------------------------------------------------------- 1 | from typing import Tuple 2 | 3 | from clipped.utils.enums import PEnum, get_enum_value 4 | 5 | 6 | class PolyaxonServiceHeaders(str, PEnum): 7 | CLI_VERSION = "X_POLYAXON_CLI_VERSION" 8 | CLIENT_VERSION = "X_POLYAXON_CLIENT_VERSION" 9 | INTERNAL = "X_POLYAXON_INTERNAL" 10 | SERVICE = "X_POLYAXON_SERVICE" 11 | 12 | @staticmethod 13 | def get_header(header) -> str: 14 | return get_enum_value(header).replace("_", "-") 15 | 16 | @classmethod 17 | def get_headers(cls) -> Tuple[str]: 18 | return tuple(cls.to_set() | {cls.get_header(h) for h in cls.to_set()}) 19 | -------------------------------------------------------------------------------- /cli/polyaxon/_sidecar/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_sidecar/container/intervals.py: -------------------------------------------------------------------------------- 1 | def get_sync_interval(interval: int, sleep_interval: int) -> int: 2 | # Infinite counter (wait until the end) 3 | if interval <= 0: 4 | return -1 5 | 6 | # Infinite counter 7 | if interval < sleep_interval: 8 | return 0 9 | 10 | # Use division to get counter 11 | return (interval // sleep_interval) + 1 12 | -------------------------------------------------------------------------------- /cli/polyaxon/_sidecar/container/monitors/__init__.py: -------------------------------------------------------------------------------- 1 | from polyaxon._sidecar.container.monitors.artifacts import sync_artifacts 2 | from polyaxon._sidecar.container.monitors.logs import sync_logs 3 | from polyaxon._sidecar.container.monitors.spec import sync_spec 4 | -------------------------------------------------------------------------------- /cli/polyaxon/_sidecar/ignore.py: -------------------------------------------------------------------------------- 1 | IGNORE_FOLDERS = [".git"] 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_utils/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/_utils/fixtures/build.py: -------------------------------------------------------------------------------- 1 | def set_build_fixture(config, owner): 2 | config["build"] = { 3 | "params": { 4 | "context": {"value": "/path/context"}, 5 | }, 6 | "runPatch": { 7 | "init": [ 8 | { 9 | "git": {"revision": "branch2"}, 10 | "connection": "connection-repo", 11 | } 12 | ] 13 | }, 14 | "hubRef": f"{owner}/kaniko", 15 | } 16 | return config 17 | -------------------------------------------------------------------------------- /cli/polyaxon/_utils/host_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from clipped.utils.http import clean_host 4 | 5 | from polyaxon._env_vars.keys import ENV_KEYS_PLATFORM_HOST 6 | from polyaxon.api import LOCALHOST 7 | 8 | 9 | def get_api_host(default: str = LOCALHOST): 10 | return clean_host(os.environ.get(ENV_KEYS_PLATFORM_HOST, default)) 11 | -------------------------------------------------------------------------------- /cli/polyaxon/_vendor/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/docker.py: -------------------------------------------------------------------------------- 1 | from polyaxon._docker.agent import Agent 2 | from polyaxon._docker.executor import Executor 3 | -------------------------------------------------------------------------------- /cli/polyaxon/fs.py: -------------------------------------------------------------------------------- 1 | from polyaxon._fs.fs import ( 2 | get_artifacts_connection, 3 | get_fs_from_name, 4 | get_sync_fs_from_connection, 5 | ) 6 | from polyaxon._fs.utils import get_store_path 7 | 8 | # Backward compatibility 9 | get_artifacts_connection_type = get_artifacts_connection 10 | -------------------------------------------------------------------------------- /cli/polyaxon/pkg.py: -------------------------------------------------------------------------------- 1 | NAME = "polyaxon" 2 | VERSION = "2.11.1" 3 | SCHEMA_VERSION = 1.1 4 | DESC = "Command Line Interface (CLI) and client to interact with Polyaxon API." 5 | URL = "https://github.com/polyaxon/polyaxon" 6 | AUTHOR = "Polyaxon, Inc." 7 | EMAIL = "contact@polyaxon.com" 8 | LICENSE = "Apache 2.0" 9 | -------------------------------------------------------------------------------- /cli/polyaxon/polyaxonfile.py: -------------------------------------------------------------------------------- 1 | from polyaxon._polyaxonfile import ( 2 | DEFAULT_POLYAXON_FILE_EXTENSION, 3 | DEFAULT_POLYAXON_FILE_NAME, 4 | BaseSpecification, 5 | CompiledOperationSpecification, 6 | ComponentSpecification, 7 | OperationSpecification, 8 | check_default_path, 9 | check_polyaxonfile, 10 | get_op_from_schedule, 11 | get_op_specification, 12 | get_ops_from_suggestions, 13 | get_specification, 14 | parse_hparams, 15 | parse_params, 16 | spec_kinds, 17 | ) 18 | -------------------------------------------------------------------------------- /cli/polyaxon/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/polyaxon/py.typed -------------------------------------------------------------------------------- /cli/polyaxon/tracking/__init__.py: -------------------------------------------------------------------------------- 1 | from traceml import tracking 2 | 3 | from traceml.tracking import * # noqa 4 | 5 | 6 | def __getattr__(name): 7 | if name == "TRACKING_RUN": 8 | return tracking.TRACKING_RUN 9 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/fastai.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.fastai import Callback 4 | 5 | # alias 6 | PolyaxonCallback = Callback 7 | PolyaxonFastaiCallback = Callback 8 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/fastai_v1.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.fastai_v1 import Callback 4 | 5 | # alias 6 | PolyaxonCallback = Callback 7 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/hugging_face.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.hugging_face import Callback 4 | 5 | # alias 6 | PolyaxonCallback = Callback 7 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/ignite.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.ignite import Logger 4 | 5 | # alias 6 | PolyaxonLogger = Logger 7 | PolyaxonIgniteLogger = Logger 8 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/keras.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.keras import Callback 4 | 5 | # alias 6 | PolyaxonCallback = Callback 7 | PolyaxonKerasCallback = Callback 8 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/lightgbm.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.lightgbm import callback 4 | 5 | # alias 6 | polyaxon_callback = callback 7 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/pytorch_lightning.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.pytorch_lightning import Callback 4 | 5 | # alias 6 | PolyaxonCallback = Callback 7 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/scikit.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.scikit import log_classifier, log_regressor 4 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/tensorboard.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.tensorboard import Logger 4 | 5 | # alias 6 | PolyaxonTensorboardLogger = Logger 7 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/tensorflow.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.tensorflow import Callback 4 | 5 | # alias 6 | PolyaxonCallback = Callback 7 | PolyaxonSessionRunHook = Callback 8 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/contrib/xgboost.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.integrations.xgboost import Callback, callback 4 | 5 | # alias 6 | polyaxon_callback = callback 7 | PolyaxonCallback = Callback 8 | -------------------------------------------------------------------------------- /cli/polyaxon/tracking/run.py: -------------------------------------------------------------------------------- 1 | # To keep backwards compatibility 2 | 3 | from traceml.tracking.run import Run 4 | -------------------------------------------------------------------------------- /cli/polyaxon/tuners/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/polyaxon/tuners/bayesian_optimization.py: -------------------------------------------------------------------------------- 1 | from hypertune.search_managers.bayesian_optimization.manager import BayesSearchManager 2 | -------------------------------------------------------------------------------- /cli/polyaxon/tuners/grid_search.py: -------------------------------------------------------------------------------- 1 | from hypertune.search_managers.grid_search.manager import GridSearchManager 2 | -------------------------------------------------------------------------------- /cli/polyaxon/tuners/hyperband.py: -------------------------------------------------------------------------------- 1 | from hypertune.search_managers.hyperband.manager import HyperbandManager 2 | -------------------------------------------------------------------------------- /cli/polyaxon/tuners/hyperopt.py: -------------------------------------------------------------------------------- 1 | from hypertune.search_managers.hyperopt.manager import HyperoptManager 2 | -------------------------------------------------------------------------------- /cli/polyaxon/tuners/mapping.py: -------------------------------------------------------------------------------- 1 | from hypertune.search_managers.mapping.manager import MappingManager 2 | -------------------------------------------------------------------------------- /cli/polyaxon/tuners/random_search.py: -------------------------------------------------------------------------------- 1 | from hypertune.search_managers.random_search.manager import RandomSearchManager 2 | -------------------------------------------------------------------------------- /cli/polyaxon_sdk/__init__.py: -------------------------------------------------------------------------------- 1 | # import apis into sdk package 2 | from polyaxon.client import * 3 | from polyaxon.schemas import * 4 | -------------------------------------------------------------------------------- /cli/requirements/dev.txt: -------------------------------------------------------------------------------- 1 | moto==5.0.13 2 | -------------------------------------------------------------------------------- /cli/requirements/fs.txt: -------------------------------------------------------------------------------- 1 | adlfs==2024.12.0 2 | fsspec==2025.7.0 3 | gcsfs==2025.7.0 4 | s3fs==2025.7.0 5 | -------------------------------------------------------------------------------- /cli/requirements/init.txt: -------------------------------------------------------------------------------- 1 | docker 2 | GitPython<3.2.0 3 | aiofiles==24.1.0 4 | -------------------------------------------------------------------------------- /cli/requirements/k8s_async.txt: -------------------------------------------------------------------------------- 1 | kubernetes_asyncio>=28.2.1 2 | aiohttp>=3.0.0 3 | anyio 4 | -------------------------------------------------------------------------------- /cli/requirements/master.txt: -------------------------------------------------------------------------------- 1 | -e git+https://github.com/polyaxon/traceml.git@master#egg=traceml&subdirectory=traceml 2 | -e git+https://github.com/polyaxon/hypertune.git@master#egg=hypertune&subdirectory=hypertune 3 | -------------------------------------------------------------------------------- /cli/requirements/prod.txt: -------------------------------------------------------------------------------- 1 | traceml==1.2.* 2 | hypertune==1.2.* 3 | -------------------------------------------------------------------------------- /cli/requirements/requirements.txt: -------------------------------------------------------------------------------- 1 | click>=7.1.1,<9.0.0 2 | clipped==0.10.* 3 | vents==0.6.* 4 | Jinja2>=2.10.3,<3.1.5 5 | kubernetes>=10.0.1 6 | python-dateutil>=2.7.3 7 | pytz>=2019.2 8 | PyYAML>=5.1 9 | orjson>=3.7 10 | psutil>=5.4.7 11 | requests>=2.20.1 12 | requests-toolbelt>=0.8.0 13 | rich>=12.0.0 14 | sentry-sdk>=1.2.0 15 | urllib3>=1.25.6 16 | certifi>=2022.12.7 17 | pydantic>=1.10.2 18 | -------------------------------------------------------------------------------- /cli/requirements/sidecar.txt: -------------------------------------------------------------------------------- 1 | aiofiles==24.1.0 2 | pandas 3 | anyio 4 | -------------------------------------------------------------------------------- /cli/requirements/test.txt: -------------------------------------------------------------------------------- 1 | coverage<7.5 2 | faker<24.0.0 3 | flaky<3.8.0 4 | mock<5.2.0 5 | pytest<8.1.0 6 | pytest-asyncio<0.23.0 7 | ruff 8 | 9 | mypy<1.9 10 | types-aiofiles 11 | types-certifi 12 | types-protobuf 13 | types-python-dateutil 14 | types-pytz 15 | types-PyYAML 16 | types-requests 17 | types-setuptools 18 | types-six 19 | types-orjson 20 | -------------------------------------------------------------------------------- /cli/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/conftest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import tempfile 3 | 4 | 5 | def pytest_configure(): 6 | os.environ["POLYAXON_NO_CONFIG"] = "true" 7 | os.environ["POLYAXON_CONTEXT_ROOT"] = tempfile.mkdtemp() 8 | os.environ["POLYAXON_OFFLINE_ROOT"] = tempfile.mkdtemp() 9 | os.environ["POLYAXON_ARTIFACTS_ROOT"] = tempfile.mkdtemp() 10 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/external_pgsql_values.yml: -------------------------------------------------------------------------------- 1 | rbac: 2 | enabled: true 3 | 4 | gateway: 5 | service: 6 | type: ClusterIP 7 | 8 | environment: staging 9 | 10 | user: 11 | password: root 12 | 13 | postgresql: 14 | enabled: false 15 | 16 | encryptionSecret: test 17 | agentSecret: test 18 | platformSecret: test 19 | 20 | externalServices: 21 | postgresql: 22 | user: polyaxon 23 | password: polyaxon 24 | database: postgres 25 | host: 35.226.163.84 26 | port: 1111 27 | connMaxAge: null 28 | options: 29 | sslmode: require 30 | pgbouncer: 31 | foo: bar 32 | image: test 33 | 34 | artifactsStore: 35 | name: test 36 | kind: host_path 37 | schema: {"hostPath": "/tmp", "mountPath": "/tmp"} 38 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/external_rabbitmq_values.yml: -------------------------------------------------------------------------------- 1 | rbac: 2 | enabled: true 3 | 4 | gateway: 5 | service: 6 | type: ClusterIP 7 | 8 | environment: staging 9 | 10 | user: 11 | password: root 12 | 13 | rabbitmq: 14 | enabled: false 15 | 16 | externalServices: 17 | rabbitmq: 18 | user: polyaxon 19 | password: polyaxon 20 | host: 35.226.163.84 21 | port: 111 22 | 23 | artifactsStore: 24 | name: test 25 | kind: host_path 26 | schema: {"hostPath": "/tmp", "mountPath": "/tmp"} 27 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/external_redis_values.yml: -------------------------------------------------------------------------------- 1 | rbac: 2 | enabled: true 3 | 4 | gateway: 5 | service: 6 | type: ClusterIP 7 | 8 | environment: staging 9 | 10 | user: 11 | password: root 12 | 13 | broker: redis 14 | 15 | redis: 16 | enabled: false 17 | 18 | externalServices: 19 | redis: 20 | usePassword: true 21 | password: polyaxon 22 | host: 35.226.163.84 23 | port: 111 24 | 25 | artifactsStore: 26 | name: test 27 | kind: host_path 28 | schema: {"hostPath": "/tmp", "mountPath": "/tmp"} 29 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/internal_redis_rabbitmq_values.yml: -------------------------------------------------------------------------------- 1 | rbac: 2 | enabled: true 3 | 4 | gateway: 5 | service: 6 | type: ClusterIP 7 | 8 | environment: staging 9 | 10 | user: 11 | password: root 12 | 13 | rabbitmq: 14 | enabled: true 15 | 16 | redis: 17 | enabled: true 18 | nonBroker: true 19 | 20 | broker: rabbitmq 21 | 22 | artifactsStore: 23 | name: test 24 | kind: host_path 25 | schema: {"hostPath": "/tmp", "mountPath": "/tmp"} 26 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/monitoring_values.yml: -------------------------------------------------------------------------------- 1 | rbac: 2 | enabled: true 3 | 4 | gateway: 5 | service: 6 | type: ClusterIP 7 | 8 | environment: staging 9 | 10 | user: 11 | password: root 12 | 13 | broker: redis 14 | 15 | redis: 16 | enabled: false 17 | 18 | externalServices: 19 | redis: 20 | usePassword: true 21 | password: polyaxon 22 | host: 35.226.163.84 23 | port: 111 24 | 25 | metrics: 26 | enabled: true 27 | backend: statsd 28 | options: {foo: bar} 29 | errors: 30 | enabled: true 31 | backend: sentry 32 | options: {foo: bar} 33 | 34 | artifactsStore: 35 | name: test 36 | kind: host_path 37 | schema: {"hostPath": "/tmp", "mountPath": "/tmp"} 38 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/values1.yml: -------------------------------------------------------------------------------- 1 | rbac: 2 | enabled: true 3 | 4 | ingress: 5 | enabled: true 6 | path: /* 7 | tls: 8 | - secretName: polyaxon.cluster.local-tls 9 | hosts: 10 | - polyaxon.cluster.local 11 | 12 | gateway: 13 | service: 14 | type: ClusterIP 15 | 16 | environment: staging 17 | 18 | user: 19 | password: root 20 | 21 | postgresql: 22 | enabled: false 23 | auth: 24 | enablePostgresUser: true 25 | username: polyaxon 26 | password: polyaxon 27 | database: polyaxon 28 | postgresPassword: polyaxon 29 | existingSecret: "" 30 | 31 | externalServices: 32 | postgresql: 33 | host: https://foo.com 34 | 35 | artifactsStore: 36 | name: azure 37 | kind: wasb 38 | schema: {"bucket": "wasbs://bucket@owner.blob.core.windows.net/"} 39 | secret: 40 | name: "az-secret" 41 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values1.yml: -------------------------------------------------------------------------------- 1 | rbac: 2 | enabled: true 3 | 4 | ingress: 5 | enabled: true 6 | 7 | gateway: 8 | service: 9 | type: ClusterIP 10 | 11 | environment: staging 12 | 13 | user: 14 | password: root 15 | 16 | postgresql: 17 | enabled: true # Error 18 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values10.yml: -------------------------------------------------------------------------------- 1 | api: 2 | service: 3 | type: ClusterIP 4 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values11.yml: -------------------------------------------------------------------------------- 1 | deploymentChart: "agent" 2 | streams: 3 | service: 4 | type: ClusterIP 5 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values3.yml: -------------------------------------------------------------------------------- 1 | deploymentType: docker-compose 2 | 3 | rbac: 4 | enabled: true 5 | 6 | gateway: 7 | service: 8 | type: ClusterIP 9 | 10 | environment: staging 11 | 12 | user: 13 | password: root 14 | 15 | broker: redis 16 | 17 | redis: 18 | enabled: false # Requires external service 19 | 20 | scheduler: 21 | enabled: true 22 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values4.yml: -------------------------------------------------------------------------------- 1 | deploymentType: kubernetes 2 | deploymentChart: agent 3 | 4 | rbac: 5 | enabled: true 6 | 7 | gateway: 8 | service: 9 | type: ClusterIP 10 | 11 | environment: staging 12 | 13 | user: 14 | password: root 15 | 16 | scheduler: 17 | enabled: true 18 | 19 | rabbitmq: 20 | enabled: false # Requires external service 21 | 22 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values5.yml: -------------------------------------------------------------------------------- 1 | deploymentType: docker-compose 2 | 3 | rbac: 4 | enabled: true 5 | 6 | gateway: 7 | service: 8 | type: ClusterIP 9 | 10 | environment: staging 11 | 12 | user: 13 | password: root 14 | 15 | postgresql: 16 | enabled: false # Requires external service 17 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values6.yml: -------------------------------------------------------------------------------- 1 | deploymentType: docker-compose 2 | 3 | rbac: 4 | enabled: true 5 | 6 | gateway: 7 | service: 8 | type: ClusterIP 9 | 10 | environment: staging 11 | 12 | user: 13 | password: root 14 | 15 | scheduler: 16 | enabled: true 17 | 18 | rabbitmq: 19 | enabled: false # Requires external service 20 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values7.yml: -------------------------------------------------------------------------------- 1 | deploymentType: docker-compose 2 | 3 | rbac: 4 | enabled: true 5 | 6 | gateway: 7 | service: 8 | type: ClusterIP 9 | 10 | environment: staging 11 | 12 | user: 13 | password: root 14 | 15 | postgresql: 16 | enabled: false # Requires external service 17 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values8.yml: -------------------------------------------------------------------------------- 1 | deploymentType: docker-compose 2 | 3 | rbac: 4 | enabled: true 5 | 6 | gateway: 7 | service: 8 | type: ClusterIP 9 | 10 | environment: staging 11 | 12 | user: 13 | password: root 14 | 15 | postgresql: 16 | enabled: true 17 | 18 | redis: 19 | enabled: true 20 | 21 | rabbitmq: 22 | enabled: true 23 | 24 | scheduler: 25 | enabled: true 26 | -------------------------------------------------------------------------------- /cli/tests/fixtures/deployment/wrong_values9.yml: -------------------------------------------------------------------------------- 1 | email: 2 | host: "smtp.gmail.com" 3 | port: 587 4 | useTLS: true # must be useTls 5 | hostUser: "foo" 6 | hostPassword: "bar" 7 | -------------------------------------------------------------------------------- /cli/tests/fixtures/pipelines/cyclic_pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | name: test-pipeline 7 | 8 | run: 9 | kind: dag 10 | operations: 11 | - name: A 12 | dagRef: experiment-template 13 | dependencies: [B] 14 | - name: B 15 | dagRef: experiment-template 16 | dependencies: [A] 17 | - name: C 18 | dagRef: experiment-template 19 | dependencies: [B] 20 | 21 | components: 22 | - name: experiment-template 23 | run: 24 | kind: job 25 | container: 26 | image: test 27 | -------------------------------------------------------------------------------- /cli/tests/fixtures/pipelines/matrix_file_with_int_float_types.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | kind: component 4 | run: 5 | kind: dag 6 | concurrency: 4 7 | operations: 8 | - name: build 9 | hubRef: kaniko 10 | component: 11 | name: kaniko 12 | run: 13 | kind: job 14 | - name: experiment-group 15 | dagRef: grid-experiment 16 | matrix: 17 | kind: grid 18 | concurrency: 2 19 | params: 20 | param1: 21 | kind: choice 22 | value: [1, 2] 23 | param2: 24 | kind: choice 25 | value: [3.3, 4.4] 26 | components: 27 | - name: grid-experiment 28 | description: hypertuning params experiment 29 | run: 30 | kind: job 31 | container: 32 | image: foo:latest 33 | command: train --param1={{ param1 }} --param2={{ param2 }} 34 | ... 35 | -------------------------------------------------------------------------------- /cli/tests/fixtures/pipelines/pipeline_ops_not_corresponding_to_components.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | name: test-pipeline 7 | 8 | tags: [native] 9 | 10 | run: 11 | kind: dag 12 | operations: 13 | - name: job1 14 | dagRef: job-template 15 | params: 16 | input1: {value: "s3://foo"} 17 | 18 | components: 19 | - name: experiment-template 20 | description: experiment to predict something 21 | tags: [tag11, tag12] 22 | run: 23 | kind: job 24 | container: 25 | image: test 26 | -------------------------------------------------------------------------------- /cli/tests/fixtures/pipelines/pipeline_with_no_components.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | name: test-pipeline 7 | 8 | tags: [native] 9 | 10 | run: 11 | kind: dag 12 | operations: 13 | - name: job1 14 | dagRef: job-template 15 | params: 16 | input1: {value: "s3://foo"} 17 | - name: job2 18 | dagRef: job-template 19 | params: 20 | input1: {value: "s3://bar"} 21 | dependencies: [job1] 22 | - name: experiment1 23 | dagRef: experiment-template 24 | dependencies: [job2] 25 | - name: experiment2 26 | dagRef: experiment-template 27 | dependencies: [experiment1] 28 | -------------------------------------------------------------------------------- /cli/tests/fixtures/pipelines/pipeline_with_no_ops.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | name: test-pipeline 7 | 8 | tags: [native] 9 | 10 | run: 11 | kind: dag 12 | components: 13 | - name: job-template 14 | description: job to process something 15 | tags: [tag11, tag12] 16 | inputs: 17 | - name: bucket 18 | type: s3 19 | termination: 20 | maxRetries: 2 21 | ttl: 3600 22 | run: 23 | kind: job 24 | init: 25 | - container: 26 | name: test 27 | image: dockerfile 28 | args: "--run=pip install package1" 29 | environment: 30 | nodeSelector: {polyaxon: experiments} 31 | serviceAccountName: service 32 | imagePullSecrets: [secret1, secret2] 33 | container: 34 | image: test 35 | resources: {requests: {cpu: 1}} 36 | -------------------------------------------------------------------------------- /cli/tests/fixtures/pipelines/ref_pipeline.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | name: test-refs 7 | 8 | tags: [native] 9 | 10 | run: 11 | kind: dag 12 | operations: 13 | - name: ref-path-op 14 | pathRef: path/to/component 15 | params: 16 | str-input: 17 | value: some-value 18 | - name: ref-url-op 19 | urlRef: https://foo.bar 20 | dependencies: [ref-path-op] 21 | params: 22 | str-input: 23 | ref: ops.ref-path-op 24 | value: inputs.str-input 25 | - name: ref-hub-op 26 | hubRef: ref-hub 27 | component: 28 | name: ref-hub 29 | run: 30 | kind: job 31 | events: [{ref: ref-url-op, kinds: [run_status_done]}] 32 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/distributed_mpi_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [mpi, tensorflow] 7 | 8 | run: 9 | kind: mpijob 10 | launcher: 11 | replicas: 1 12 | container: 13 | image: mpioperator/tensorflow-benchmarks:latest 14 | command: [mpirun, python, run.py] 15 | 16 | worker: 17 | replicas: 2 18 | environment: 19 | nodeSelector: 20 | polyaxon.com: node_for_worker_tasks 21 | tolerations: 22 | - key: "key" 23 | operator: "Exists" 24 | effect: "NoSchedule" 25 | container: 26 | image: mpioperator/tensorflow-benchmarks:latest 27 | command: [mpirun, python, run.py] 28 | resources: 29 | limits: 30 | nvidia.com/gpu: 1 31 | ... 32 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/job_file_with_environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | plugins: 6 | logLevel: DEBUG 7 | run: 8 | kind: job 9 | 10 | environment: 11 | nodeSelector: 12 | polyaxon.com: core 13 | 14 | affinity: 15 | nodeAffinity: 16 | requiredDuringSchedulingIgnoredDuringExecution: {} 17 | 18 | tolerations: 19 | - key: "key" 20 | operator: "Exists" 21 | 22 | labels: 23 | label_key1: val1 24 | label_key2: val2 25 | 26 | annotations: 27 | annotation_key1: val1 28 | annotation_key2: val2 29 | 30 | serviceAccountName: new_sa 31 | 32 | imagePullSecrets: [secret1, secret2] 33 | 34 | securityContext: 35 | runAsUser: 1000 36 | runAsGroup: 3000 37 | 38 | container: 39 | image: my_image 40 | command: echo 41 | resources: 42 | requests: 43 | cpu: 1 44 | memory: 200 45 | limits: 46 | cpu: 2 47 | memory: 200 48 | ... 49 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/job_file_with_termination.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | termination: 7 | ttl: 400 8 | timeout: 500 9 | maxRetries: 5 10 | run: 11 | kind: job 12 | environment: 13 | restartPolicy: Never 14 | container: 15 | image: my_image 16 | command: echo 17 | ... 18 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/job_missing_container.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | kind: component 4 | ... 5 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/mapping_job_file_early_stopping.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: operation 5 | 6 | matrix: 7 | kind: mapping 8 | concurrency: 2 9 | values: 10 | - lr: 0.001 11 | loss: MeanSquaredError 12 | - lr: 0.1 13 | loss: AbsoluteDifference 14 | earlyStopping: 15 | - kind: metric_early_stopping 16 | metric: loss 17 | value: 0.01 18 | optimization: maximize 19 | 20 | component: 21 | run: 22 | kind: job 23 | container: 24 | image: foo:latest 25 | command: train --lr={{ lr }} --loss={{ loss }} 26 | ... 27 | 28 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/matrix_job_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: operation 5 | 6 | matrix: 7 | kind: hyperband 8 | concurrency: 2 9 | maxIterations: 10 10 | eta: 3 11 | resource: 12 | name: steps 13 | type: int 14 | resume: False 15 | metric: 16 | name: loss 17 | optimization: minimize 18 | params: 19 | lr: 20 | kind: linspace 21 | value: 0.01:0.1:5 22 | loss: 23 | kind: choice 24 | value: [MeanSquaredError, AbsoluteDifference] 25 | normal_rate: 26 | kind: normal 27 | value: [0, 0.9] 28 | dropout: 29 | kind: qloguniform 30 | value: [0, 0.8, 0.1] 31 | activation: 32 | kind: pchoice 33 | value: [[relu, 0.1], [sigmoid, 0.8]] 34 | model: 35 | kind: choice 36 | value: [CDNA, DNA, STP] 37 | 38 | component: 39 | run: 40 | kind: job 41 | container: 42 | image: foo:latest 43 | command: train --lr={{ lr }} --loss={{ loss }} 44 | ... 45 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/matrix_job_file_early_stopping.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | kind: operation 4 | 5 | matrix: 6 | kind: random 7 | concurrency: 2 8 | numRuns: 300 9 | params: 10 | lr: 11 | kind: linspace 12 | value: 0.01:0.1:5 13 | loss: 14 | kind: choice 15 | value: [MeanSquaredError, AbsoluteDifference] 16 | 17 | earlyStopping: 18 | - kind: metric_early_stopping 19 | metric: loss 20 | value: 0.01 21 | optimization: maximize 22 | 23 | component: 24 | run: 25 | kind: job 26 | container: 27 | image: foo:latest 28 | command: train --lr={{ lr }} --loss={{ loss }} 29 | ... 30 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/matrix_job_file_with_int_float_types.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | kind: operation 4 | matrix: 5 | kind: grid 6 | concurrency: 2 7 | params: 8 | param1: 9 | kind: choice 10 | value: [1, 2] 11 | param2: 12 | kind: choice 13 | value: [3.3, 4.4] 14 | 15 | component: 16 | run: 17 | kind: job 18 | container: 19 | image: foo:latest 20 | command: train --param1={{ param1 }} --param2={{ param2 }} 21 | ... 22 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/missing_kind.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | ... 4 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/missing_version.yml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: operation 3 | ... 4 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/non_supported_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 0.4 3 | 4 | kind: component 5 | 6 | run: 7 | kind: job 8 | container: 9 | image: test:latest 10 | command: [docker, build, /plx-context/build/Dockerfile] 11 | ... 12 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/polyaxonfile_with_contexts_requirements.yaml: -------------------------------------------------------------------------------- 1 | version: 1.1 2 | 3 | kind: component 4 | 5 | run: 6 | kind: job 7 | init: 8 | - artifacts: {"files": ['{{globals.run_outputs_path}}/foo']} 9 | connection: "{{connections['foo']['key']}}" 10 | container: 11 | image: continuumio/miniconda3 12 | workingDir: '{{ globals.artifacts_path }}/repo' 13 | command: 14 | - python 15 | args: 16 | - -c "print('Tweet tweet')" 17 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/polyaxonfile_with_quotes.yaml: -------------------------------------------------------------------------------- 1 | version: 1.1 2 | 3 | kind: component 4 | 5 | run: 6 | kind: job 7 | container: 8 | image: continuumio/miniconda3 9 | command: 10 | - python 11 | args: 12 | - -c "print('Tweet tweet')" 13 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/simple_job.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | kind: component 4 | plugins: 5 | collectArtifacts: False 6 | run: 7 | kind: job 8 | environment: 9 | annotations: 10 | tf-version.cloud-tpus.google.com: '2.2' 11 | volumes: 12 | - name: foo 13 | secret: 14 | secretName: mysecret 15 | container: 16 | name: test 17 | image: python-with-boto3 18 | command: python download-s3-bucket 19 | resources: 20 | requests: 21 | nvidia.com/gpu: 1 22 | limits: 23 | nvidia.com/gpu: 1 24 | volume_mounts: 25 | - name: foo 26 | mount_path: ~/.aws/credentials 27 | readOnly: true 28 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/simple_job_run_patch.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | kind: operation 4 | plugins: 5 | collectArtifacts: False 6 | runPatch: 7 | environment: 8 | annotations: 9 | tf-version.cloud-tpus.google.com: '2.2' 10 | component: 11 | run: 12 | kind: job 13 | volumes: 14 | - name: foo 15 | secret: 16 | secretName: mysecret 17 | container: 18 | name: test 19 | image: python-with-boto3 20 | command: python download-s3-bucket 21 | resources: 22 | requests: 23 | nvidia.com/gpu: 1 24 | limits: 25 | nvidia.com/gpu: 1 26 | volume_mounts: 27 | - name: foo 28 | mount_path: ~/.aws/credentials 29 | readOnly: true 30 | -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/simple_json_file.json: -------------------------------------------------------------------------------- 1 | {"x": "y"} -------------------------------------------------------------------------------- /cli/tests/fixtures/plain/tensorboard_with_custom_environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [bar] 7 | 8 | inputs: 9 | - name: log_dir 10 | type: path 11 | value: /path/my/outputs 12 | isOptional: true 13 | 14 | environment: 15 | nodeSelector: 16 | polyaxon.com: node_for_tensorboard_jobs 17 | 18 | resources: 19 | cpu: 20 | requests: 1 21 | limits: 2 22 | memory: 23 | requests: 200 24 | limits: 200 25 | 26 | affinity: 27 | nodeAffinity: 28 | requiredDuringSchedulingIgnoredDuringExecution: {} 29 | 30 | tolerations: 31 | - key: "key" 32 | operator: "Exists" 33 | 34 | run: 35 | kind: job 36 | container: 37 | image: my_image 38 | command: ["/bin/sh", "-c"] 39 | args: "tensorboard --logdir={{log_dir}} --port=6006" 40 | 41 | ports: [6006, 6006] 42 | 43 | -------------------------------------------------------------------------------- /cli/tests/fixtures/samples/artifaction_location.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.0 3 | 4 | kind: component 5 | 6 | name: artifact_locatoion 7 | 8 | tags: [samples] 9 | 10 | environment: 11 | secrets: 12 | - name: s3_secret 13 | items: [foo, bar] 14 | 15 | connections: 16 | - ref: foo 17 | - name: s3_connections 18 | kind: s3 19 | bucket: bucket 20 | secretResources: s3_secret 21 | 22 | - kind: host_path 23 | name: foo 24 | hostPath: /foo/bar 25 | mountPath: /foo/bar 26 | 27 | run: 28 | kind: job 29 | container: 30 | image: "test" 31 | command: [python3, main.py] 32 | args: "--lr={{ lr }}" 33 | 34 | -------------------------------------------------------------------------------- /cli/tests/fixtures/samples/image_pull_secret.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | name: use_image_pull_secret 7 | 8 | tags: [samples] 9 | 10 | secretResources: 11 | - kind: image_pull_secret 12 | name: foo 13 | - kind: hub 14 | name: test 15 | 16 | run: 17 | kind: job 18 | container: 19 | image: "python:alpine3.6" 20 | command: ['sh', '-c'] 21 | args: ['echo Hello'] 22 | 23 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/auto_delayed_validation_with_jinja.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: operation 5 | 6 | params: 7 | loss: {value: "{{ future_context_value }}"} 8 | steps: {value: "{{ future_context_value }}"} 9 | 10 | component: 11 | tags: [foo, bar] 12 | inputs: 13 | - name: loss 14 | type: str 15 | - name: steps 16 | type: int 17 | run: 18 | kind: job 19 | container: 20 | image: my_image 21 | command: ["/bin/sh", "-c"] 22 | args: video_prediction_train --loss={{loss}} --steps={{steps}} 23 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/inputs_delayed_validation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [foo, bar] 7 | 8 | inputs: 9 | - name: loss 10 | type: str 11 | delayValidation: true 12 | - name: flag 13 | type: bool 14 | isFlag: true 15 | delayValidation: true 16 | - name: steps 17 | type: int 18 | delayValidation: true 19 | 20 | run: 21 | kind: job 22 | container: 23 | image: my_image 24 | command: ["/bin/sh", "-c"] 25 | args: video_prediction_train --loss={{loss}} --steps={{steps}} {{ flag }} 26 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/matrix_file_with_int_float_types.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: operation 5 | 6 | matrix: 7 | kind: grid 8 | concurrency: 2 9 | params: 10 | param1: 11 | kind: choice 12 | value: [1, 2] 13 | param2: 14 | kind: choice 15 | value: [3.3, 4.4] 16 | 17 | component: 18 | inputs: 19 | - name: input1 20 | type: int 21 | value: 23423 22 | isOptional: true 23 | run: 24 | kind: job 25 | container: 26 | image: my_image 27 | command: ["/bin/sh", "-c"] 28 | args: 29 | - train 30 | - --param1={{ param1 }} 31 | - --param2={{ param2 }} 32 | - --param3={{ input1 }} 33 | ... 34 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/matrix_job_file_with_int_float_types.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: operation 5 | 6 | matrix: 7 | kind: grid 8 | concurrency: 2 9 | params: 10 | param1: 11 | kind: choice 12 | value: [1, 2] 13 | param2: 14 | kind: choice 15 | value: [3.3, 4.4] 16 | 17 | component: 18 | inputs: 19 | - name: input1 20 | type: int 21 | value: 23423 22 | isOptional: true 23 | run: 24 | kind: job 25 | container: 26 | image: my_image 27 | command: ["/bin/sh", "-c"] 28 | args: 29 | - train 30 | - --param1={{ param1 }} 31 | - --param2={{ param2 }} 32 | - --param3={{ input1 }} 33 | ... 34 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/matrix_job_required_inputs_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: operation 5 | 6 | matrix: 7 | kind: hyperband 8 | concurrency: 2 9 | maxIterations: 10 10 | eta: 3 11 | resource: 12 | name: steps 13 | type: int 14 | resume: False 15 | metric: 16 | name: loss 17 | optimization: minimize 18 | params: 19 | lr: 20 | kind: linspace 21 | value: 0.01:0.1:5 22 | loss: 23 | kind: choice 24 | value: [MeanSquaredError, AbsoluteDifference] 25 | component: 26 | inputs: 27 | - name: lr 28 | type: int 29 | isOptional: false 30 | run: 31 | kind: job 32 | container: 33 | image: foo:latest 34 | command: train --lr={{ lr }} --loss={{ loss }} 35 | ... 36 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/matrix_job_required_inputs_file_wrong_matrix_type.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: operation 5 | 6 | matrix: 7 | kind: hyperband 8 | concurrency: 2 9 | maxIterations: 10 10 | eta: 3 11 | resource: 12 | name: steps 13 | type: int 14 | resume: False 15 | metric: 16 | name: loss 17 | optimization: minimize 18 | params: 19 | lr: 20 | kind: activation 21 | value: 0.01:0.1:5 22 | loss: 23 | kind: choice 24 | value: [MeanSquaredError, AbsoluteDifference] 25 | 26 | component: 27 | inputs: 28 | - name: activation 29 | type: string 30 | isOptional: false 31 | run: 32 | kind: job 33 | container: 34 | image: foo:latest 35 | command: train --lr={{ lr }} --loss={{ loss }} 36 | ... 37 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/required_inputs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [foo, bar] 7 | 8 | inputs: 9 | - name: loss 10 | type: str 11 | - name: flag 12 | type: bool 13 | isFlag: true 14 | 15 | run: 16 | kind: job 17 | container: 18 | image: my_image 19 | command: ["/bin/sh", "-c"] 20 | args: video_prediction_train --loss={{loss}} {{ flag }} 21 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/required_inputs_with_arg_format.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [foo, bar] 7 | 8 | inputs: 9 | - name: loss 10 | type: str 11 | - name: flag 12 | type: bool 13 | isFlag: true 14 | 15 | run: 16 | kind: job 17 | container: 18 | image: my_image 19 | command: ["/bin/sh", "-c"] 20 | args: video_prediction_train {{ params.loss.as_arg }} {{ params.flag.as_arg }} 21 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/required_outputs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [foo, bar] 7 | 8 | outputs: 9 | - name: path 10 | type: path 11 | 12 | run: 13 | kind: job 14 | init: 15 | - container: 16 | name: test 17 | image: dockerfile 18 | args: 19 | - "--run=pip install package1" 20 | - "--env={'KEY1', 'en_US.UTF-8', 'KEY2', 2}" 21 | container: 22 | image: my_image 23 | command: ["/bin/sh", "-c"] 24 | args: build -c /plx-context/build 25 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/run_cmd_simple_file.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [foo, bar] 7 | 8 | inputs: 9 | - name: loss 10 | type: str 11 | value: MeanSquaredError 12 | isOptional: true 13 | - name: num_masks 14 | type: int 15 | 16 | run: 17 | kind: job 18 | container: 19 | image: my_image 20 | command: ["/bin/sh", "-c"] 21 | args: 22 | - video_prediction_train 23 | - --num_masks={{num_masks}} 24 | - --loss={{loss}} 25 | ... 26 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/run_with_refs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.1 3 | 4 | kind: component 5 | 6 | tags: [foo, bar] 7 | 8 | inputs: 9 | - name: model_path 10 | type: path 11 | - name: num_masks 12 | type: int 13 | 14 | run: 15 | kind: job 16 | container: 17 | image: my_image 18 | command: ["/bin/sh", "-c"] 19 | args: 20 | - video_prediction_train 21 | - --num_masks={{num_masks}} 22 | - --model_path={{model_path}} 23 | ... 24 | -------------------------------------------------------------------------------- /cli/tests/fixtures/typing/untyped_params.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1.0 3 | 4 | kind: operation 5 | 6 | tags: [foo, bar] 7 | 8 | inputs: 9 | - name: loss 10 | type: str 11 | value: MeanSquaredError 12 | isOptional: true 13 | 14 | params: 15 | num_masks: {value: 2} 16 | 17 | run: 18 | kind: job 19 | container: 20 | image: my_image 21 | command: ["/bin/sh", "-c"] 22 | args: 23 | - video_prediction_train 24 | - --num_masks={{num_masks}} 25 | - --loss={{loss}} 26 | ... 27 | -------------------------------------------------------------------------------- /cli/tests/fixtures_static/repo.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/tests/fixtures_static/repo.tar.gz -------------------------------------------------------------------------------- /cli/tests/test_api/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_api/test_home.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._env_vars.keys import ENV_KEYS_HOME 4 | from polyaxon._schemas.home import HomeConfig 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.api_mark 9 | class TestHomeConfig(BaseTestCase): 10 | def test_home_wrong_config(self): 11 | config_dict = {ENV_KEYS_HOME: "foo/bar/moo", "foo": "bar"} 12 | config = HomeConfig.from_dict(config_dict) 13 | assert config.to_dict() != config_dict 14 | config_dict.pop("foo") 15 | assert config.to_dict() == config_dict 16 | 17 | def test_home_config(self): 18 | config_dict = {ENV_KEYS_HOME: "foo/bar/moo"} 19 | config = HomeConfig.from_dict(config_dict) 20 | assert config.to_dict() == config_dict 21 | -------------------------------------------------------------------------------- /cli/tests/test_api/test_log_handler.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._schemas.log_handler import V1LogHandler 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | @pytest.mark.api_mark 8 | class TestV1LogHandler(BaseTestCase): 9 | def test_log_handler_config(self): 10 | config_dict = {"dsn": "https//foo:bar", "environment": "staging"} 11 | config = V1LogHandler.from_dict(config_dict) 12 | assert config.to_dict() == config_dict 13 | -------------------------------------------------------------------------------- /cli/tests/test_api/test_user.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._schemas.user import UserConfig 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | @pytest.mark.api_mark 8 | class TestUserConfigs(BaseTestCase): 9 | def test_user_config(self): 10 | config_dict = { 11 | "username": "username", 12 | "email": "user@domain.com", 13 | "name": "foo bat", 14 | "theme": 1, 15 | } 16 | config = UserConfig.from_dict(config_dict) 17 | assert config.to_dict() == config_dict 18 | -------------------------------------------------------------------------------- /cli/tests/test_cli/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_cli/test_auth.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from mock import patch 4 | 5 | from polyaxon._cli.auth import logout, whoami 6 | from tests.test_cli.utils import BaseCommandTestCase 7 | 8 | 9 | @pytest.mark.cli_mark 10 | class TestCliAuth(BaseCommandTestCase): 11 | @patch("polyaxon._managers.auth.AuthConfigManager.purge") 12 | @patch("polyaxon._managers.user.UserConfigManager.purge") 13 | def test_logout(self, get_user, get_auth): 14 | self.runner.invoke(logout) 15 | assert get_auth.call_count == 1 16 | assert get_user.call_count == 1 17 | 18 | @patch("polyaxon._sdk.api.UsersV1Api.get_user") 19 | def test_whoami(self, get_user): 20 | self.runner.invoke(whoami) 21 | assert get_user.call_count == 1 22 | -------------------------------------------------------------------------------- /cli/tests/test_cli/test_check.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from mock import patch 4 | 5 | from polyaxon._cli.check import check 6 | from tests.test_cli.utils import BaseCommandTestCase 7 | 8 | 9 | @pytest.mark.cli_mark 10 | class TestCliCheck(BaseCommandTestCase): 11 | @patch("polyaxon._cli.check.check_polyaxonfile") 12 | def test_check_file(self, check_polyaxonfile): 13 | self.runner.invoke(check) 14 | assert check_polyaxonfile.call_count == 1 15 | 16 | @patch("polyaxon._cli.check.check_polyaxonfile") 17 | @patch("polyaxon._cli.check.Printer.decorate_format_value") 18 | def test_check_file_version(self, decorate_format_value, check_polyaxonfile): 19 | self.runner.invoke(check, ["--version"]) 20 | assert check_polyaxonfile.call_count == 1 21 | assert decorate_format_value.call_count == 1 22 | -------------------------------------------------------------------------------- /cli/tests/test_cli/test_docker.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from mock import patch 4 | 5 | from polyaxon._cli.services.docker import docker 6 | from polyaxon._schemas.types.dockerfile import V1DockerfileType 7 | from tests.test_cli.utils import BaseCommandTestCase 8 | 9 | 10 | @pytest.mark.cli_mark 11 | class TestCliDocker(BaseCommandTestCase): 12 | @patch("polyaxon._docker.builder.generator.DockerFileGenerator.create") 13 | def test_docker_build_context(self, generate_create): 14 | build_context = V1DockerfileType(image="foo") 15 | self.runner.invoke( 16 | docker, 17 | ["generate", "--build-context={}".format(build_context.to_json())], 18 | ) 19 | assert generate_create.call_count == 1 20 | -------------------------------------------------------------------------------- /cli/tests/test_cli/utils.py: -------------------------------------------------------------------------------- 1 | from mock import patch 2 | 3 | from click.testing import CliRunner 4 | 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | class BaseCommandTestCase(BaseTestCase): 9 | def setUp(self): 10 | super().setUp() 11 | self.runner = CliRunner() 12 | self.mock_config() 13 | 14 | def mock_config(self): 15 | patcher = patch("polyaxon._managers.client.ClientConfigManager.get_value") 16 | patcher.start() 17 | self.addCleanup(patcher.stop) 18 | -------------------------------------------------------------------------------- /cli/tests/test_client/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_client/test_run_client.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import uuid 3 | 4 | from mock import mock 5 | 6 | from polyaxon._utils.test_utils import BaseTestCase 7 | from polyaxon.client import RunClient 8 | 9 | 10 | @pytest.mark.client_mark 11 | class TestRunClient(BaseTestCase): 12 | @mock.patch("polyaxon._sdk.api.RunsV1Api.patch_run") 13 | def test_get_statuses(self, sdk_patch_run): 14 | client = RunClient(owner="owner", project="project", run_uuid=uuid.uuid4().hex) 15 | assert client.run_data.tags is None 16 | client.log_tags(["foo", "bar"]) 17 | assert client.run_data.tags == ["foo", "bar"] 18 | assert sdk_patch_run.call_count == 1 19 | -------------------------------------------------------------------------------- /cli/tests/test_compiler/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_compiler/test_lineage/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_compiler/test_resolvers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_config/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_deploy/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_deploy/test_ingress.py: -------------------------------------------------------------------------------- 1 | from clipped.compact.pydantic import ValidationError 2 | 3 | from polyaxon._deploy.schemas.ingress import IngressConfig 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | class TestIngressConfig(BaseTestCase): 8 | def test_ingress_config(self): 9 | config_dict = {"enabled": "sdf"} 10 | 11 | with self.assertRaises(ValidationError): 12 | IngressConfig.from_dict(config_dict) 13 | 14 | config_dict = {"enabled": False} 15 | 16 | config = IngressConfig.from_dict(config_dict) 17 | assert config.to_light_dict() == config_dict 18 | 19 | config_dict = { 20 | "enabled": False, 21 | "path": "/*", 22 | "tls": [{"hosts": "bar.com"}], 23 | "annotations": {"a": "b"}, 24 | } 25 | 26 | config = IngressConfig.from_dict(config_dict) 27 | 28 | assert config.to_light_dict() == config_dict 29 | -------------------------------------------------------------------------------- /cli/tests/test_deploy/test_intervals.py: -------------------------------------------------------------------------------- 1 | from clipped.compact.pydantic import ValidationError 2 | 3 | from polyaxon._deploy.schemas.intervals import IntervalsConfig 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | class TestIntervalsConfig(BaseTestCase): 8 | def test_intervals_config(self): 9 | bad_config_dicts = [ 10 | {"compatibilityCheck": "dsf"}, 11 | ] 12 | 13 | for config_dict in bad_config_dicts: 14 | with self.assertRaises(ValidationError): 15 | IntervalsConfig.from_dict(config_dict) 16 | 17 | config_dict = { 18 | "compatibilityCheck": 12, 19 | } 20 | config = IntervalsConfig.from_dict(config_dict) 21 | assert config.to_light_dict() == config_dict 22 | -------------------------------------------------------------------------------- /cli/tests/test_deploy/test_rbac.py: -------------------------------------------------------------------------------- 1 | from polyaxon._deploy.schemas.rbac import RBACConfig 2 | from polyaxon._utils.test_utils import BaseTestCase 3 | 4 | 5 | class TestRBACConfig(BaseTestCase): 6 | def test_rbac_config(self): 7 | config_dict = {"enabled": True} 8 | config = RBACConfig.from_dict(config_dict) 9 | assert config.to_dict() == config_dict 10 | 11 | config_dict = {"enabled": False} 12 | config = RBACConfig.from_dict(config_dict) 13 | assert config.to_dict() == config_dict 14 | 15 | config = RBACConfig.from_dict({}) 16 | assert config.to_dict() == {} 17 | assert config.to_light_dict() == {} 18 | -------------------------------------------------------------------------------- /cli/tests/test_deploy/test_ssl.py: -------------------------------------------------------------------------------- 1 | from polyaxon._deploy.schemas.ssl import SSLConfig 2 | from polyaxon._utils.test_utils import BaseTestCase 3 | 4 | 5 | class TestSSLConfig(BaseTestCase): 6 | def test_ssl_config(self): 7 | config_dict = {"enabled": True, "secretName": "foo", "path": "/etc/ssl"} 8 | config = SSLConfig.from_dict(config_dict) 9 | assert config.to_dict() == config_dict 10 | -------------------------------------------------------------------------------- /cli/tests/test_docker/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_docker/test_converters/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_docker/test_converters/base.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._docker.converter.converters.job import JobConverter 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | class DummyConverter(JobConverter): 8 | SPEC_KIND = "dumy" 9 | MAIN_CONTAINER_ID = "dummy" 10 | 11 | 12 | @pytest.mark.converter_mark 13 | class BaseConverterTest(BaseTestCase): 14 | SET_AGENT_SETTINGS = True 15 | 16 | def setUp(self): 17 | super().setUp() 18 | self.converter = DummyConverter( 19 | owner_name="owner-name", 20 | project_name="project-name", 21 | run_name="run-name", 22 | run_uuid="run_uuid", 23 | ) 24 | -------------------------------------------------------------------------------- /cli/tests/test_docker/test_converters/test_base/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_docker/test_converters/test_base/test_init/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_docker/test_converters/test_base/test_main/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_docker/test_converters/test_converters/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_fixtures/test_backfill.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1Operation 4 | from polyaxon._utils.fixtures.backfill import get_fxt_backfill_with_inputs_outputs 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.fixtures_mark 9 | class TestBackfillsFixtures(BaseTestCase): 10 | def test_fxt_backfill_with_inputs_outputs(self): 11 | config = get_fxt_backfill_with_inputs_outputs() 12 | result = V1Operation.read(config).to_dict() 13 | assert result == config 14 | -------------------------------------------------------------------------------- /cli/tests/test_fixtures/test_bo.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1Operation 4 | from polyaxon._utils.fixtures import ( 5 | get_fxt_bo_with_inputs_outputs, 6 | get_fxt_bo_with_run_patch, 7 | ) 8 | from polyaxon._utils.test_utils import BaseTestCase 9 | 10 | 11 | @pytest.mark.fixtures_mark 12 | class TestBoFixtures(BaseTestCase): 13 | def test_fxt_bo_with_inputs_outputs(self): 14 | config = get_fxt_bo_with_inputs_outputs(tuner="foo/bar") 15 | assert V1Operation.read(config).to_dict() == config 16 | 17 | def test_fxt_bo_with_run_patch(self): 18 | config = get_fxt_bo_with_run_patch() 19 | assert V1Operation.read(config).to_dict() == config 20 | -------------------------------------------------------------------------------- /cli/tests/test_fixtures/test_build.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1Operation 4 | from polyaxon._flow.run.enums import V1RunKind 5 | from polyaxon._utils.fixtures import set_build_fixture 6 | from polyaxon._utils.test_utils import BaseTestCase 7 | 8 | 9 | @pytest.mark.fixtures_mark 10 | class TestBuildsFixtures(BaseTestCase): 11 | def test_build_fixture(self): 12 | config = { 13 | "version": 1.1, 14 | "kind": "operation", 15 | "component": { 16 | "run": { 17 | "kind": V1RunKind.JOB, 18 | "container": {"image": "test"}, 19 | }, 20 | }, 21 | } 22 | config = set_build_fixture(config, "test") 23 | assert V1Operation.read(config).to_dict() == config 24 | -------------------------------------------------------------------------------- /cli/tests/test_fixtures/test_grid.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1Operation 4 | from polyaxon._utils.fixtures import get_fxt_grid_with_inputs_outputs 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.fixtures_mark 9 | class TestGridsFixtures(BaseTestCase): 10 | def test_fxt_grid_with_inputs_outputs(self): 11 | config = get_fxt_grid_with_inputs_outputs() 12 | assert V1Operation.read(config).to_dict() == config 13 | -------------------------------------------------------------------------------- /cli/tests/test_fixtures/test_mapping.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1Operation 4 | from polyaxon._utils.fixtures import ( 5 | get_fxt_mapping_with_inputs_outputs, 6 | get_fxt_mapping_with_run_patch, 7 | ) 8 | from polyaxon._utils.test_utils import BaseTestCase 9 | 10 | 11 | @pytest.mark.fixtures_mark 12 | class TestMappingsFixtures(BaseTestCase): 13 | def test_fxt_mapping_with_inputs_outputs(self): 14 | config = get_fxt_mapping_with_inputs_outputs() 15 | assert V1Operation.read(config).to_dict() == config 16 | 17 | def test_fxt_mapping_with_run_patch(self): 18 | config = get_fxt_mapping_with_run_patch() 19 | assert V1Operation.read(config).to_dict() == config 20 | -------------------------------------------------------------------------------- /cli/tests/test_fixtures/test_schedule.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1Operation 4 | from polyaxon._utils.fixtures import get_fxt_schedule_with_inputs_outputs 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.fixtures_mark 9 | class TestSchedulesFixtures(BaseTestCase): 10 | def test_fxt_schedule_with_inputs_outputs(self): 11 | config = get_fxt_schedule_with_inputs_outputs() 12 | assert V1Operation.read(config).to_dict() == config 13 | -------------------------------------------------------------------------------- /cli/tests/test_init/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/base.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._k8s.converter.converters.job import JobConverter 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | class DummyConverter(JobConverter): 8 | SPEC_KIND = "dumy" 9 | K8S_ANNOTATIONS_KIND = "dummy-name" 10 | MAIN_CONTAINER_ID = "dummy" 11 | 12 | 13 | @pytest.mark.converter_mark 14 | class BaseConverterTest(BaseTestCase): 15 | SET_AGENT_SETTINGS = True 16 | 17 | def setUp(self): 18 | super().setUp() 19 | self.converter = DummyConverter( 20 | owner_name="owner-name", 21 | project_name="project-name", 22 | run_name="run-name", 23 | run_uuid="run_uuid", 24 | ) 25 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/test_base/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/test_base/test_init/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/test_base/test_main/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/test_base/test_sidecar/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/test_common/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/test_converters/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_converters/test_pods/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_crd.py: -------------------------------------------------------------------------------- 1 | from polyaxon._k8s.custom_resources.crd import get_custom_object 2 | from polyaxon._utils.test_utils import BaseTestCase 3 | 4 | 5 | class TestCRD(BaseTestCase): 6 | def test_get_custom_object(self): 7 | crd = get_custom_object( 8 | namespace="default", 9 | resource_name="foo", 10 | kind="job", 11 | api_version="v1", 12 | labels={"foo": "bar"}, 13 | annotations={"foo": "bar"}, 14 | custom_object={"some_spec": {"foo": "bar"}}, 15 | ) 16 | assert crd["kind"] == "job" 17 | assert crd["apiVersion"] == "v1" 18 | assert crd["metadata"].name == "foo" 19 | assert crd["metadata"].labels == {"foo": "bar"} 20 | assert crd["metadata"].annotations == {"foo": "bar"} 21 | assert crd["metadata"].namespace == "default" 22 | assert crd["some_spec"] == {"foo": "bar"} 23 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_custom_resources/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_k8s/test_executor/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_lifecycles/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_managers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_managers/test_agent.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._managers.agent import AgentConfigManager 4 | from polyaxon._schemas.agent import AgentConfig 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.managers_mark 9 | class TestAgentConfigManager(BaseTestCase): 10 | def test_default_props(self): 11 | assert AgentConfigManager.is_global() is True 12 | assert AgentConfigManager.CONFIG_PATH is None 13 | assert AgentConfigManager.IN_PROJECT_DIR is False 14 | assert AgentConfigManager.CONFIG_FILE_NAME == ".agent" 15 | assert AgentConfigManager.CONFIG == AgentConfig 16 | -------------------------------------------------------------------------------- /cli/tests/test_managers/test_auth.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._managers.auth import AuthConfigManager 4 | from polyaxon._schemas.authentication import AccessTokenConfig 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.managers_mark 9 | class TestAuthConfigManager(BaseTestCase): 10 | def test_default_props(self): 11 | assert AuthConfigManager.is_global() is True 12 | assert AuthConfigManager.is_local() is False 13 | assert AuthConfigManager.IN_PROJECT_DIR is False 14 | assert AuthConfigManager.CONFIG_FILE_NAME == ".auth" 15 | assert AuthConfigManager.CONFIG == AccessTokenConfig 16 | -------------------------------------------------------------------------------- /cli/tests/test_managers/test_git.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1Init 4 | from polyaxon._managers.git import GitConfigManager 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.managers_mark 9 | class TestGitConfigManager(BaseTestCase): 10 | def test_default_props(self): 11 | assert GitConfigManager.is_global() is False 12 | assert GitConfigManager.is_local() is True 13 | assert GitConfigManager.IN_PROJECT_DIR is False 14 | assert GitConfigManager.CONFIG_FILE_NAME == "polyaxongit.yaml" 15 | assert GitConfigManager.CONFIG == V1Init 16 | -------------------------------------------------------------------------------- /cli/tests/test_managers/test_home.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._managers.home import HomeConfigManager 4 | from polyaxon._schemas.home import HomeConfig 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.managers_mark 9 | class TestHomeConfigManager(BaseTestCase): 10 | def test_default_props(self): 11 | assert HomeConfigManager.is_global() is True 12 | assert HomeConfigManager.is_local() is False 13 | assert HomeConfigManager.IN_PROJECT_DIR is False 14 | assert HomeConfigManager.CONFIG_FILE_NAME == ".home" 15 | assert HomeConfigManager.CONFIG == HomeConfig 16 | -------------------------------------------------------------------------------- /cli/tests/test_managers/test_project.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._managers.project import ProjectConfigManager 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | from polyaxon.client import V1Project 6 | 7 | 8 | @pytest.mark.managers_mark 9 | class TestProjectConfigManager(BaseTestCase): 10 | def test_default_props(self): 11 | assert ProjectConfigManager.is_all_visibility() is True 12 | assert ProjectConfigManager.IN_PROJECT_DIR is True 13 | assert ProjectConfigManager.CONFIG_FILE_NAME == ".project" 14 | assert ProjectConfigManager.CONFIG == V1Project 15 | -------------------------------------------------------------------------------- /cli/tests/test_managers/test_run.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._managers.run import RunConfigManager 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | from polyaxon.client import V1Run 6 | 7 | 8 | @pytest.mark.managers_mark 9 | class TestRunConfigManager(BaseTestCase): 10 | def test_default_props(self): 11 | assert RunConfigManager.is_all_visibility() is True 12 | assert RunConfigManager.IN_PROJECT_DIR is True 13 | assert RunConfigManager.CONFIG_FILE_NAME == ".run" 14 | assert RunConfigManager.CONFIG == V1Run 15 | -------------------------------------------------------------------------------- /cli/tests/test_managers/test_user.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._managers.user import UserConfigManager 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | from polyaxon.client import V1User 6 | 7 | 8 | @pytest.mark.managers_mark 9 | class TestUserConfigManager(BaseTestCase): 10 | def test_default_props(self): 11 | assert UserConfigManager.is_global() is True 12 | assert UserConfigManager.IN_PROJECT_DIR is True 13 | assert UserConfigManager.CONFIG_FILE_NAME == ".user" 14 | assert UserConfigManager.CONFIG == V1User 15 | -------------------------------------------------------------------------------- /cli/tests/test_notifiers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polyaxon/cli/45160deb3e093e3a3d6b64539e9a503c0d9a5b7c/cli/tests/test_notifiers/__init__.py -------------------------------------------------------------------------------- /cli/tests/test_operators/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyaxonfile/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyaxonfile/test_default.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import tempfile 3 | 4 | from polyaxon._polyaxonfile import ( 5 | DEFAULT_POLYAXON_FILE_EXTENSION, 6 | DEFAULT_POLYAXON_FILE_NAME, 7 | check_default_path, 8 | ) 9 | from polyaxon._utils.test_utils import BaseTestCase 10 | 11 | 12 | @pytest.mark.polyaxonfile_mark 13 | class TestDefaultFile(BaseTestCase): 14 | def test_default_not_found(self): 15 | path = tempfile.mkdtemp() 16 | assert check_default_path(path=path) is None 17 | 18 | def test_polyaxon_found(self): 19 | def create_file(path, filename, ext): 20 | fpath = "{}/{}.{}".format(path, filename, ext) 21 | open(fpath, "w") 22 | 23 | for filename in DEFAULT_POLYAXON_FILE_NAME: 24 | for ext in DEFAULT_POLYAXON_FILE_EXTENSION: 25 | path = tempfile.mkdtemp() 26 | create_file(path, filename, ext) 27 | assert check_default_path(path=path) 28 | -------------------------------------------------------------------------------- /cli/tests/test_polyaxonfile/test_parser.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._polyaxonfile.specs.libs.parser import PolyaxonfileParser 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | @pytest.mark.polyaxonfile_mark 8 | class TestPolyaxonfileParser(BaseTestCase): 9 | def test_parse_base_expressions(self): 10 | data = [ 11 | 1, 12 | 10.0, 13 | [1, 1], 14 | (1, 1), 15 | "string", 16 | ["str1", "str2"], 17 | {1: 2, "a": "a", "dict": {1: 1}}, 18 | ] 19 | 20 | parser = PolyaxonfileParser() 21 | for d in data: 22 | assert d == parser.parse_expression(d, {}) 23 | 24 | def test_parse_context_expression(self): 25 | parser = PolyaxonfileParser() 26 | assert parser.parse_expression("{{ something }}", {}) == "" 27 | assert parser.parse_expression("{{ something }}", {"something": 1}) == 1 28 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_builds/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_cache/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_components/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_container/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_environments/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_events/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_hooks/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_init/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_io/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_joins/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_mounts/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_notifications/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_ops/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_plugins/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_schedules/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_sidecars/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_sidecars/test_sidecars.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._flow import V1CompiledOperation, V1RunKind 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | @pytest.mark.sidecars_mark 8 | class TestSidecars(BaseTestCase): 9 | def test_sidecars_config(self): 10 | config_dict = { 11 | "kind": "compiled_operation", 12 | "run": { 13 | "kind": V1RunKind.JOB, 14 | "container": {"image": "foo/bar"}, 15 | "sidecars": [ 16 | {"name": "sidecar1", "args": ["/subpath1", "subpath2"]}, 17 | {"name": "sidecar2", "args": ["/subpath1", "subpath2"]}, 18 | ], 19 | }, 20 | } 21 | config = V1CompiledOperation.from_dict(config_dict) 22 | assert config.to_light_dict() == config_dict 23 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_termination/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_polyflow/test_workflows/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_pql/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_runner/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_runner/test_init_utils.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._auxiliaries import get_init_resources 4 | from polyaxon._k8s import k8s_schemas 5 | from polyaxon._utils.test_utils import BaseTestCase 6 | 7 | 8 | @pytest.mark.converter_mark 9 | class TestInitUtils(BaseTestCase): 10 | def test_get_init_resources(self): 11 | assert get_init_resources() == k8s_schemas.V1ResourceRequirements( 12 | limits={"cpu": "1", "memory": "500Mi"}, 13 | requests={"cpu": "0.1", "memory": "60Mi"}, 14 | ) 15 | -------------------------------------------------------------------------------- /cli/tests/test_schemas/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_schemas/test_cli/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_schemas/test_cli/test_cli_config.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._schemas.cli import CliConfig 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | @pytest.mark.schemas_mark 8 | class TestCliConfig(BaseTestCase): 9 | def test_cli_config(self): 10 | config_dict = { 11 | "current_version": "0.0.1", 12 | "installation": {"key": "uuid", "version": "1.1.4-rc11", "dist": "foo"}, 13 | "compatibility": {"cli": {"min": "0.0.4", "latest": "1.1.4"}}, 14 | "log_handler": None, 15 | } 16 | config = CliConfig.from_dict(config_dict) 17 | config_to_dict = config.to_dict() 18 | config_to_dict.pop("last_check") 19 | assert config._INTERVAL == 30 * 60 20 | assert config_to_dict != config_dict 21 | config_dict.pop("log_handler") 22 | assert config_to_dict == config_dict 23 | -------------------------------------------------------------------------------- /cli/tests/test_schemas/test_types/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_schemas/test_types/test_file.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._schemas.types.file import V1FileType 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | @pytest.mark.init_mark 8 | class TestFileInitConfigs(BaseTestCase): 9 | def test_file_type(self): 10 | config_dict = { 11 | "filename": "script.py", 12 | "kind": "file", 13 | "chmod": "+x", 14 | "content": "test", 15 | } 16 | config = V1FileType.from_dict(config_dict) 17 | assert config.to_dict() == config_dict 18 | -------------------------------------------------------------------------------- /cli/tests/test_schemas/test_types/test_tensorboard.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from polyaxon._schemas.types.tensorboard import V1TensorboardType 4 | from polyaxon._utils.test_utils import BaseTestCase 5 | 6 | 7 | @pytest.mark.init_mark 8 | class TestTensorboardInitConfigs(BaseTestCase): 9 | def test_tb_type(self): 10 | config_dict = { 11 | "port": 6006, 12 | "uuids": [ 13 | "d1410a914d18457589b91926d8c23db4", 14 | "56f1a7f20f1d4f7f9e1a108b3c6b6031", 15 | ], 16 | "useNames": True, 17 | "plugins": ["tensorboard-plugin-profile"], 18 | } 19 | config = V1TensorboardType.from_dict(config_dict) 20 | assert config.to_dict() == config_dict 21 | -------------------------------------------------------------------------------- /cli/tests/test_sidecar/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_sidecar/test_interval.py: -------------------------------------------------------------------------------- 1 | from polyaxon._sidecar.container.intervals import get_sync_interval 2 | from polyaxon._utils.test_utils import BaseTestCase 3 | 4 | 5 | class TestSidecar(BaseTestCase): 6 | def test_get_interval_counter(self): 7 | assert get_sync_interval(0, 0) == -1 8 | assert get_sync_interval(1, 2) == 0 9 | assert get_sync_interval(2, 2) == 2 10 | assert get_sync_interval(3, 2) == 2 11 | assert get_sync_interval(4, 2) == 3 12 | assert get_sync_interval(4, 2) == 3 13 | assert get_sync_interval(6, 2) == 4 14 | -------------------------------------------------------------------------------- /cli/tests/test_stores/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_transports/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/test_transports/test_http_transport.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from polyaxon._client.transport import Transport 4 | from tests.test_transports.utils import BaseTestCaseTransport 5 | 6 | 7 | class TestHttpTransport(BaseTestCaseTransport): 8 | # pylint:disable=protected-access 9 | def setUp(self): 10 | super().setUp() 11 | self.transport = Transport() 12 | 13 | def test_session(self): 14 | assert hasattr(self.transport, "_session") is False 15 | assert isinstance(self.transport.session, requests.Session) 16 | assert isinstance(self.transport._session, requests.Session) 17 | -------------------------------------------------------------------------------- /cli/tests/test_transports/utils.py: -------------------------------------------------------------------------------- 1 | from polyaxon import settings 2 | from polyaxon._utils.test_utils import BaseTestCase 3 | 4 | 5 | class BaseTestCaseTransport(BaseTestCase): 6 | def setUp(self): 7 | super().setUp() 8 | settings.MIN_TIMEOUT = 0.001 9 | -------------------------------------------------------------------------------- /cli/tests/test_utils/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/tests_env_vars/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cli/tests/tests_env_vars/test_queue.py: -------------------------------------------------------------------------------- 1 | from polyaxon._env_vars.getters.queue import get_queue_info 2 | from polyaxon._utils.test_utils import BaseTestCase 3 | from polyaxon.exceptions import PolyaxonSchemaError 4 | 5 | 6 | class TestQueueEnvVars(BaseTestCase): 7 | def test_get_queue_info(self): 8 | with self.assertRaises(PolyaxonSchemaError): 9 | get_queue_info(None) 10 | 11 | with self.assertRaises(PolyaxonSchemaError): 12 | get_queue_info("") 13 | 14 | with self.assertRaises(PolyaxonSchemaError): 15 | get_queue_info("foo/bar/noo") 16 | 17 | with self.assertRaises(PolyaxonSchemaError): 18 | get_queue_info("foo.bar.noo") 19 | 20 | assert get_queue_info("test") == (None, "test") 21 | assert get_queue_info("agent.queue") == ("agent", "queue") 22 | assert get_queue_info("agent/queue") == ("agent", "queue") 23 | -------------------------------------------------------------------------------- /cli/tests/tests_env_vars/test_versioned_entity.py: -------------------------------------------------------------------------------- 1 | from polyaxon._env_vars.getters import get_component_info 2 | from polyaxon._utils.test_utils import BaseTestCase 3 | from polyaxon.exceptions import PolyaxonSchemaError 4 | 5 | 6 | class TestComponentEnvVars(BaseTestCase): 7 | def test_get_component_info(self): 8 | with self.assertRaises(PolyaxonSchemaError): 9 | get_component_info(None) 10 | 11 | with self.assertRaises(PolyaxonSchemaError): 12 | get_component_info("") 13 | 14 | assert get_component_info("hub") == ("polyaxon", "hub", "latest") 15 | assert get_component_info("hub:ver") == ("polyaxon", "hub", "ver") 16 | assert get_component_info("owner.hub") == ("owner", "hub", "latest") 17 | assert get_component_info("owner/hub") == ("owner", "hub", "latest") 18 | assert get_component_info("owner.hub:ver") == ("owner", "hub", "ver") 19 | assert get_component_info("owner/hub:ver") == ("owner", "hub", "ver") 20 | -------------------------------------------------------------------------------- /polyaxon-complete.sh: -------------------------------------------------------------------------------- 1 | eval "$(_POLYAXON_COMPLETE=source polyaxon)" 2 | --------------------------------------------------------------------------------