Skip to content

The custom template container disk size is overwritten by python default code #155

@tleyden

Description

@tleyden

Describe the bug
When a custom template ID is provided, the python code will use the default value:

container_disk_in_gb:int=5

instead of using the value in the custom template.

A workaround is to do a graphql query to get the template containerInGb field, then pass that to runpod.create_pod().

    def get_custom_template(self, template_name: str):
        # Call the "me" api and ask for the list of templates
        QUERY_POD = """
            query myTemplates {
                myself {
                    podTemplates {
                        id
                        name
                        imageName
                        containerDiskInGb
                    }
                }
            }
            """
        result = run_graphql_query(QUERY_POD)
        pod_templates = result["data"]["myself"]["podTemplates"]
        for pod_template in pod_templates:
            if pod_template["name"] == template_name:
                return {
                    "containerDiskInGb": pod_template["containerDiskInGb"], 
                    "id:pod_template["id"], 
                    imageName:pod_template["imageName"]
                }
                return custom_template

        raise Exception("Could not find pod template id for template name: " + template_name)

Expected behavior
When a template ID is passed, use the container disk size specified in the template

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions