idmtools_platform_comps.utils.python_requirements_ac.requirements_to_asset_collection module

class idmtools_platform_comps.utils.python_requirements_ac.requirements_to_asset_collection.RequirementsToAssetCollection(platform: idmtools_platform_comps.comps_platform.COMPSPlatform = None, requirements_path: str = None, pkg_list: list = None, local_wheels: list = None)

Bases: object

platform: idmtools_platform_comps.comps_platform.COMPSPlatform = None

Platform object

requirements_path: str = None

Path to requirements file

pkg_list: list = None

list of packages

local_wheels: list = None

list of wheel files locally to upload and install

property checksum
Returns

The md5 of the requirements.

property requirements
Returns

Consolidated requirements.

run(rerun=False)
The working logic of this utility:
  1. check if asset collection exists for given requirements, return ac id if exists

  2. create an Experiment to install the requirements on COMPS

  3. create a WorkItem to create a Asset Collection

Returns: return ac id based on the requirements if Experiment and WorkItem Succeeded

save_updated_requirements()

Save consolidated requirements to a file requirements_updated.txt Returns:

retrieve_ac_by_tag(md5_check=None)

Retrieve comps asset collection given ac tag :param md5_check: also can use custom md5 string as search tag

Returns: comps asset collection

retrieve_ac_from_wi(wi)

Retrieve ac id from file ac_info.txt saved by WI :param wi: SSMTWorkItem (which was used to create ac from library)

Returns: COMPS asset collection

add_wheels_to_assets(experiment)
run_experiment_to_install_lib()

Create an Experiment which will run another py script to install requirements Returns: Experiment created

run_wi_to_create_ac(exp_id)

Create an WorkItem which will run another py script to create new asset collection :param exp_id: the Experiment id (which installed requirements)

Returns: work item created

static get_latest_version(pkg_name, display_all=False)

Utility to get the latest version for a given package name :param pkg_name: package name given :param display_all: determine if output all package releases

Returns: the latest version of ven package

consolidate_requirements()
Combine requiremtns and dynamic requirements (a list):
  • get the latest version of package if version is not provided

  • dynamic requirements will overwrites the requirements file

Returns: the consolidated requirements (as a list)