6. fugaku package

A simple python library to interact with Fugaku WebAPI.

6.1. Submodules

6.1.1. fugaku.client module

fugaku.client

This module provides a client to access Fugaku WebAPI.

class fugaku.client.Client(auth_code, client_config=None, provider_metadata_url=None, authorization_endpoint=None, token_endpoint=None, request_config=None)

Bases: object

cancel_job(machine, jobid)

Cancel a job.

Parameters:
  • machine (str) – the specific machine.

  • jobid (str) – the jobid to cancel.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#delete–queue-machine-jobid)

Return type:

requests.Response

download_fileList(machine, file_path)

Download file list.

Parameters:
  • machine (str) – the specific machine.

  • file_path (str) – the file_path to get the file list.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get–file-machine-file_path)

Return type:

requests.Response

download_filedata(machine, file_path)

Download files.

Parameters:
  • machine (str) – the specific machine.

  • file_path (str) – the download file.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get–file-machine-file_path)

Return type:

requests.Response

exec_command(machine, command)

Execute a command.

Parameters:
  • machine (str) – the specific machine.

  • command (str) – the command to exec.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#post–command-machine)

Return type:

requests.Response

get_authentication_url(redirect_url)

Get URL for user authentication.

If neither authorization_endpoint nor provider_metadata_url is set, only queries can be fetched.

Parameters:

redirect_url (str) – the redirect URL to receive authorization code.

Returns:

return the authentication url.

Return type:

str

get_disk_usage(machine)

Get disk usage.

Parameters:

machine (str) – the specific machine.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

Return type:

requests.Response

get_job_detail(machine, jobid)

Get detailed job information.

Parameters:
  • machine (str) – the specific machine.

  • jobid (str) – the jobid is used to get a list of sub-jobs.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get–queue-machine-jobid)

Return type:

requests.Response

get_job_status(machine, index=None, limit=None, status=None, jobid=None)

Get list of running jobs.

Parameters:
  • machine (str) – the specific machine.

  • index (int) – the index for first record.

  • limit (int) – the limit for number of records.

  • status (str) – the status is userd filter jobs.

  • jobid (str) – the jobid is used to get a list of sub-jobs.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get–queue-machine)

Return type:

requests.Response

get_job_status_sacct(machine, index=None, limit=None, status=None, jobid=None)

Get list of completed jobs.

Obtain a list of jobs completed within 24 hours from the job scheduler on the target machine.

Parameters:
  • machine (str) – the specific machine.

  • index (int) – the index for first record.

  • limit (int) – the limit for number of records.

  • status (str) – the status is userd filter jobs.

  • jobid (str) – the jobid is used to get a list of sub-jobs.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get–queue-machine-sacct)

Return type:

requests.Response

get_machine_status()

Get status of all machines. Outputs the status of all machines managed by the server.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get–status-)

Return type:

requests.Response

get_specific_machine_status(machine)

Get specified machine status. Output the status of the specified machine.

Parameters:

machine (str) – the specific machine. specify the machine name obtained by getting the status of all machines (get_machine_status). Normally, specify “computer”.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get–status-machine)

Return type:

requests.Response

make_Jobscript(machine, filename, script)

Generate job execution script.

Parameters:
  • machine (str) – the specific machine.

  • filename (str) – the filename is file path of the script file on the target machine.

  • script (str) – the script is used to create job exection script.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#put–queue-machine-jobscript)

Return type:

requests.Response

modify_file(machine, file_path, file)

Modify file.

Parameters:
  • machine (str) – the specific machine.

  • file_path (str) – the file_path specifies the upload destination.

  • file (str) – the upload file.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#put–file-machine-file_path)

Return type:

requests.Response

submit_job(machine, jobfile=None, jobscript=None, qopt=None)

Submit a job.

Parameters:
  • machine (str) – the specific machine.

  • jobfile (str) – the jobfile to submit.

  • jobscript (str) – the jobscript to submit.

  • qopt (str) – the qopt to be passed to the Job Scheduler.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#post–queue-machine)

Return type:

requests.Response

upload_file(machine, file_path, file)

Upload file.

Parameters:
  • machine (str) – the specific machine.

  • file_path (str) – the file_path specifies the upload destination.

  • file (str) – the upload file.

Raises:

NoAccessCode – when there is no access_token.

Returns:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#post–file-machine-file_path)

Return type:

requests.Response

6.1.2. fugaku.error module

fugaku.error

This module contains the set of fugaku’ exceptions.

exception fugaku.error.FugakuClientError

Bases: Exception

An ambiguous exception occurred during processing of the fugaku client.

exception fugaku.error.NoAccessCode

Bases: FugakuClientError

if access_code is not set

exception fugaku.error.NoTokenEndpoint

Bases: FugakuClientError

if token_endpoint is not set