pyepic.client package

Submodules

pyepic.client.base module

class pyepic.client.base.Client(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: object

Base client class for API wrappers

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

set_limt(limit)
class pyepic.client.base.EPICClient(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: object

A wrapper class around the epiccore API.

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

Variables
  • job (JobClient) – API to Job functions

  • catalog (CatalogClient) – API to Catalog functions

  • desktops (DesktopClient) – API to Desktops functions

  • projects (ProjectClient) – API to Projects functions

  • teams (TeamsClient) – API to Teams functions

pyepic.client.catalog module

class pyepic.client.catalog.CatalogClient(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: pyepic.client.base.Client

A wrapper class around the epiccore Catalog API.

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

application_details(application_id)

Get the details of application with id application_id

Parameters

application_id (int) – ID of application to get details for

Returns

BatchQueueDetails

Return type

epiccore.models.BatchApplicationDetails

list_applications(product_name=None)

List the applications available in EPIC

Parameters

product_name (str, optional) – Filter clusters by application name.

Returns

Iterable collection of BatchApplicationDetails

Return type

collections.Iterable[epiccore.models.BatchApplicationDetails]

list_clusters(cluster_name=None, queue_name=None, allowed_apps=None)

List the clusters available in EPIC

Parameters
  • cluster_name (str, optional) – Filter clusters by cluster name.

  • queue_name (str, optional) – Filter clusters by queue name.

  • allowed_apps (str, optional) – Filter clusters by those with application code available.

Returns

Iterable collection of BatchQueueDetails

Return type

collections.Iterable[epiccore.models.BatchQueueDetails]

list_desktops()

List the available Desktops in EPIC

Returns

Iterable collection of DesktopNodeApp

Return type

collections.Iterable[epiccore.models.DesktopNodeApp]

queue_details(queue_id)

Get the details of queue with id queue_id

Parameters

queue_id (int) – ID of queue to get details for

Returns

BatchQueueDetails

Return type

epiccore.models.BatchQueueDetails

pyepic.client.data module

class pyepic.client.data.DataClient(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: pyepic.client.base.Client

A wrapper class around the epiccore Data API.

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

delete(epic_path, dryrun=False)
Delete the file of folder at epic_path
param epic_path

Path of a file or folder to delete in the form epic://[<folder>]/<file>

type epic_path

str

param dryrun

If dryrun is True then return a list of files that would be deleted without actually deleting them

type dryrun

bool

return

List of the files deleted

rtype

List[str]

download_file(epic_path, destination)
Download the contents of epic_path
param epic_path

Path of a file in the form epic://[<folder>]/<file>

type epic_path

str

param destination

Location to download file to, can be a string or a writable file-like object

type destination

str

ls(epic_path)
List the files and folders at the given path
param epic_path

Path in the form epic://[<folder>]/

type epic_path

str

return

Iterable collection of DataObject

rtype

collections.Iterable[pyepic.client.data.DataObject]

meta_source = 'SDK'
sync(source_path, target_path, dryrun=False, overwrite_existing=False, callback=None, threads=3, cancel_event=None)
Synchronize the data from one directory to another, source_path or target_path can be a remote folder or a local folder.
param source_path

Source folder to syncronise from. For remote folders use form epic://[<folder>]/<file>.

type source_path

str

param target_path

Target folder to syncronise to. For remote folders use form epic://[<folder>]/<file>.

type target_path

str

param dryrun

If dryrun == True then no actual copy will take place but the callback will be called with the generated source and target paths. This can be useful for checking before starting a large upload/download.

type dryrun

bool, optional

param overwrite_existing

If overwrite_existing == True then files with newer modification timestamps in source_path will replace existing files in target_path

type overwrite_existing

bool, optional

param callback

A callback method that accepts four parameters. These are source, destination, a boolean indicating if a copy has taken place and a boolean to indicate if the copy was a dryrun. The callback is called after each file is processed.

type callback

method, optional

param threads

Number of threads to use for sync

type threads

int, optional

param cancel_event

An instance of threading.Event that can be set to cancel the sync.

type cancel_event

threading.Event

upload_file(file, epic_path)
Upload the contents of file to epic_path
param destination

Location of the file to upload OR a readable file-like object

type destination

str

param epic_path

Destination path of a file in the form epic://[<folder>]/<file>

type epic_path

str

class pyepic.client.data.DataObject(name, obj_path, folder=False, size=None, last_modified=None)

Bases: object

Class representing a file or folder

Parameters
  • name (int) – Name of the file/folder

  • obj_path (str) – Path of the file/folder

  • folder (bool) – Is the object a folder?

  • name – Size of the object if available

  • last_modified (str) – Last modified time if available. Datetime in ISO 8601 format, UTC timezone.

class pyepic.client.data.DataThread(s3_client, bucket_name, s3_prefix, local_path, file_queue, cancel_event=None, dryrun=False, callback=None, download_thread=True, overwrite_existing=False, meta_data={})

Bases: threading.Thread

Thread class used internally by pyepic for managaing upload/download functions

download_key(key_name)
run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

upload_file(file_full_path)

pyepic.client.desktop module

class pyepic.client.desktop.DesktopClient(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: pyepic.client.base.Client

A wrapper class around the epiccore Desktop API.

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

get_details(id)

Get details of desktop with ID id

Parameters

id (int) – The ID of the desktop to fetch details on

Returns

A desktop instance

Return type

class:epiccore.models.DesktopInstance

get_quote(desktop_spec)

Get a Quote for launching the desktop on EPIC

Parameters

desktop_spec (class:epiccore.models.DesktopNodeQuote) – The EPIC Desktop Quote specification

Returns

A quote giving the price for the job on the available HPC queues

Return type

class:epiccore.models.PriceQuote

launch(desktop_spec)

Launch the Desktop described by desktop_spec in EPIC

Parameters

desktop_spec (class:epiccore.models.DesktopNodeQuote) – The EPIC Desktop Launch specification

Returns

A quote giving the price for the job on the available HPC queues

Return type

class:epiccore.models.DesktopInstance

list()

List all of your Desktops in EPIC.

Returns

Iterable collection of DesktopInstance

Return type

collections.Iterable[epiccore.models.DesktopInstance]

terminate(id)

Terminate Desktop job with ID id

Parameters

id (int) – The ID of the Desktop to terminate

pyepic.client.job module

class pyepic.client.job.JobClient(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: pyepic.client.base.Client

A wrapper class around the epiccore Job API.

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

cancel(job_id)

Cancel job with ID job_id

Parameters

job_id (int) – The ID of the job to cancel

get_details(job_id)

Get details of job with ID job_id

Parameters

job_id (int) – The ID of the job to fetch details on

Returns

A Job instance

Return type

class:epiccore.models.Job

get_job_residual_names(job_id)

Get the names of the residual variables available forjob with id job_id

Parameters

job_id (int) – The ID of the job to get the residual list for

Returns

A list of variable names

Return type

List[str]

get_job_residual_values(job_id, variable_list)

Get the names of the residual variables available forjob with id job_id

Parameters
  • job_id (int) – The ID of the job to get the variables for

  • variable_names (List[str]) – A list of the variables to return

Returns

A JobResidualData object

Return type

class:epiccore.models.JobResidualData

get_quote(job_spec)

Get a Quote for running a series of tasks on EPIC.

Parameters

job_spec (class:epiccore.models.JobSpec) – The EPIC job specification

Returns

A quote giving the price for the job on the available HPC queues

Return type

class:epiccore.models.JobQuote

get_step_details(step_id)

Get the details of the step ID step_id

Parameters

step_id (int) – The ID of the job step to fetch

Returns

A Job Step instance

Return type

class:epiccore.models.JobStep

get_step_logs(step_id, refresh=True, refresh_timeout=10)

Get the step logs for step with id step_id

Parameters
  • step_id (int) – The ID of the step to fetch the logs for

  • dryrun (int, optional) – If refresh is True then the request will attempt to refresh the logs before returning the latest update

  • dryrun – How many seconds should we wait for a refresh before giving up, default 10 seconds

Returns

A Job Log instance

Return type

class:epiccore.models.JobLog

list(limit=10)

List all of the jobs in EPIC.

Parameters

limit (int) – Maximum number of jobs to list

Returns

Iterable collection of Jobs

Return type

collections.Iterable[epiccore.models.Job]

list_steps(parent_job=None)

List all of the job steps in EPIC.

Parameters

parent_job (int, optional) – The ID of the parent job to list the steps for

Returns

Iterable collection of Job Steps

Return type

collections.Iterable[epiccore.models.JobStep]

submit(job_array_spec)

Submit new job in EPIC as described by job_array_spec.

Parameters

job_array_spec (class:epiccore.models.JobArraySpec) – The EPIC job specification

Returns

The newly created job instance

Return type

class:epiccore.models.Job

pyepic.client.projects module

class pyepic.client.projects.ProjectClient(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: pyepic.client.base.Client

A wrapper class around the epiccore Projects API.

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

get_details(id: int)

Get the details for project with ID id

Returns

The Project

Return type

epiccore.models.ProjectDetails

list()

List all of the projects you have access to on EPIC.

Returns

An interable list of Projects

Return type

collections.Iterable[epiccore.models.Project]

pyepic.client.teams module

class pyepic.client.teams.TeamsClient(connection_token, connection_url='https://epic.zenotech.com/api/v2')

Bases: pyepic.client.base.Client

A wrapper class around the epiccore Teams API.

Parameters
  • connection_token (str) – Your EPIC API authentication token

  • connection_url (str, optional) – The API URL for EPIC, defaults to “https://epic.zenotech.com/api/v2

get_details(id: int)

Get the details for team with ID id

Returns

The Team details

Return type

epiccore.models.TeamDetails

list()

List all of the teams you have access to on EPIC.

Returns

An interable list of Teams

Return type

collections.Iterable[epiccore.models.Team]

Module contents