Job Services

This is the documentation for the methods in the module job_service

Interpret APBS/PDBP2QR job configurations and submit to SQS.

lambda_services.job_service.job_service.build_status_dict(job_id: str, job_tag: str, job_type: str, status: str, inputfile_list: list, outputfile_list: list, message: Optional[str] = None) dict[source]

Build a dictionary for the initial status

Parameters
  • str (status) – Identifier string for specific job

  • str – Name of job type (e.g. ‘apbs’, ‘pdb2pqr’)

  • str – A string indicating initial status of job

  • list (outputfile_list) – List of current input files

  • list – List of current output files

  • message (optional) – Optional message to add to status

Returns

a JSON-compatible dictionary containing initial status info of the job

Return type

dict

lambda_services.job_service.job_service.get_job_info(job_tag: str, bucket_name: str, info_object_name: str) dict[source]

Retrieve job configuraiton JSON object from S3, and return as dict.

Parameters
  • str (info_object_name) – Unique ID for this job

  • str – AWS S3 bucket to retrieve file from

  • str – The name of the file to download

Returns

A dictionary of the JSON object representing a job configuration

Return type

dict

lambda_services.job_service.job_service.interpret_job_submission(event: dict, context)[source]

Interpret contents of job configuration, triggered from S3 event.

Parameters
  • dict (event) – Amazon S3 event, containing info to retrieve contents

  • context – context object for AWS Lambda handler, containing info about the invocation, function, and execution environment

lambda_services.job_service.job_service.upload_status_file(object_filename: str, initial_status_dict: dict)[source]

Upload the initial status object to S3

Parameters
  • str (object_filename) – the S3 object key of the file to download

  • dict (initial_status_dict) – a JSON-compatible dictionary containing initial status info of the job