Hardware Constraints

Module to handle hardware constraints

class qarnot.hardware_constraint.HardwareConstraint[source]

Bases: object

Represents a hardware constraint.

classmethod from_json(json: Dict[str, Any])[source]

Create an hardware constraint from json.

Parameters
Returns

The created HardwareConstraint.

abstract to_json()[source]

Get a dict ready to be json packed.

Raises

NotImplementedError – this is an abstract method, it should be overridden in child classes

class qarnot.hardware_constraint.MinimumCoreHardware(coreCount: int)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit the minimum number of cores

__init__(coreCount: int)[source]

Create a new hardware constraint to limit the minimum number of cores the hardware should have.

Parameters

ram (str) – the minimum number of cores the hardware should have

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.MaximumCoreHardware(coreCount: int)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit the maximum number of cores

__init__(coreCount: int)[source]

Create a new hardware constraint to limit the maximum number of cores the hardware should have.

Parameters

ram (str) – the maximum number of cores the hardware should have

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.MinimumRamCoreRatioHardware(ram: float)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit the minimum memory core ratio

__init__(ram: float)[source]

Create a new hardware constraint to limit the minimum ram/core ratio the hardware should have.

Parameters

ram (str) – the minimum memory/core ratio the hardware should have (in GB/core)

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.MaximumRamCoreRatioHardware(ram: float)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit the maximum memory core ratio

__init__(ram: float)[source]

Create a new hardware constraint to limit the maximum ram/core ratio the hardware should have.

Parameters

ram (str) – the maximum memory/core ratio the hardware should have (in GB/core)

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.MinimumRamHardware(ram: float)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit the minimum memory

__init__(ram: float)[source]

Create a new hardware constraint to limit the minimum ram the hardware should have.

Parameters

ram (str) – the minimum memory the hardware should have (in MB)

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.MaximumRamHardware(ram: float)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit the maximum memory

__init__(ram: float)[source]

Create a new hardware constraint to limit the maximum ram the hardware should have.

Parameters

ram (str) – the maximum memory the hardware should have (in MB)

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.SpecificHardware(key: str)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit to a specific hardware

__init__(key: str)[source]

Create a new hardware constraint for a specific hardware using its specification key.

Parameters

key (str) – the specification key of the hardware which should be used

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.GpuHardware[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit hardware with gpu

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.SSDHardware[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit hardware with SSD

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.NoSSDHardware[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit hardware without SSD

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.NoGpuHardware[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents an hardware constraint to limit hardware without gpu

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict

class qarnot.hardware_constraint.CpuModelHardware(cpu_model: str)[source]

Bases: qarnot.hardware_constraint.HardwareConstraint

Represents a hardware constraint to limit with a specific CPU

__init__(cpu_model: str)[source]

Create a new hardware constraint for a specific cpu model.

Parameters

cpu_model (str) – the cpu model which should be used

to_json() object[source]

Get a dict ready to be json packed.

Returns

the json elements of the class.

Return type

dict