HTC Projects

This module holds functions that deal with Rescale Projects. Projects are returned as a HtcProject object, which can be used for later library calls.

class rescalehtc.htcprojects.HtcProject(json: dict)

Class which represents a single Rescale Project. Use the functions in rescalehtc.projects to create this object.

json: dict

The raw dictionary describing this Project. The dictionary follows the HTCProject schema in the Rescale HTC API documentation. Example contents:

{
    "projectId": "project-12345",
    "projectName": "my-project",
    "projectDescription": "my-first-project",
    "createdBy": "qWoUF",
    "workspaceId": "04-8473942",
    "organizationCode": "my-org",
    "createdAt": "2023-10-19T10:01:40.471Z",
    "containerRegistry": "123456789.dkr.ecr.us-west-2.amazonaws.com/rescale/project-12345/",
    "repositories": [
        "repo1",
        "repo2"
    ],
    "regions": [
        "AWS_US_EAST_2",
        "AWS_US_WEST_2"
    ],
    "regionSettings": [
        {
        "computeSettings": {
            "computeRegion": "AWS_AP_SOUTHEAST_1"
        },
        "storageSettings": {
            "storageRegion": "AWS_AP_SOUTHEAST_1"
        }
        }
    ],
    "projectFolderPath": "projects/project-12345/"
}

Access this member variable to extract information about a project.

get_limits(rescale: HtcSession) list[dict]

Return the limits that are applied to this project, for example the maximum concurrect vCPU count that can be used. Returns a list of limits, as multiple kinds of limits may be applied at once.

set_vcpu_limit(rescale: HtcSession, modifier_role: str, vcpu_limit: int)

Set the maximum concurrent number of vCPUs for this project. This may require certain privileges.

rescalehtc.htcprojects.get_projects(rescale: HtcSession) list[HtcProject]

Get all the projects available in the current workspace. Return the projects as HtcProject objects.

rescalehtc.htcprojects.get_project_with_name(rescale: HtcSession, project_name: str) HtcProject

Get a single project within this workspace that matches the given name. Return the project as a HtcProject. Returns None if no matching project was found. Throws an exception if the workspace contains several projects with the same name.

rescalehtc.htcprojects.get_project_with_id(rescale: HtcSession, project_id: str) HtcProject

Get a single project within this workspace with a specific ID. Return the project as a HtcProject. Returns None if no matching project was found.