In ColdFront, resource allocations are called subscriptions. The subscription app contains 11 models: SubscriptionStatusChoice, Subscription, SubscriptionUserStatusChoice, SubscriptionUser, AttributeType, SubscriptionAttributeType, SubscriptionAttribute, and SubscriptionAttributeUsage, SubscriptionAdminComment, and SubscriptionUserMessage. Figure subscription_uml shows a UML diagram of the Subscription app.

Subscription App UML

The Subscription model links to the Resource and Project models. A resource is linked to a subscription using a many-to-many relationship (M2M). The M2M relationship allows ColdFront to associate linked resources to a single subscription. The M2M field should not be used to associate different types of resources to a single subscription.

The Subscription model also links to the SubscriptionStatusChoice model. The SubscriptionStatusChoice model defines the status choices for the Subscription model. Default choices include: Active, Denied, Expired, Inactive (Renewed), New, Pending, Revoked, and Unpaid. Active means the subscription is active. Denied means the resource allocation request was denied. Expired means the subscription has expired. In case of a cluster subscription and the center uses the Slurm job scheduler and the slurm integration is enabled, resource access will automatically be disabled at subscription expiration. Inactive (Renewed) status indicates that the subscription was renewed. When a subscription is renewed, the expiring subscription’s status is set to Inactive (Renewed) and a new subscription is created with status pending. New means a new resource allocation request. Revoked means that the subscription was revoked. Finally, unpaid status is used when a resource requires payment and the account is not current.

The Subscription model uses the active_until field to specify the date when the subscription will expire. The justification field is used to save the reason that the user enters to demonstrate their need for the HPC center resource.

The AttributeType model along with SubscriptionAttributeType, SubscriptionAttribute and Subscription models are based on the entity–attribute–value model, where the Subscription model is the entity, the SubscriptionAttribute model is the value, and the SubscriptionAttributeType model is the attribute. This is similar to how metainformation for resources are stored. The AttributeType model defines the type of attribute such as Int, Float, Text, or choice between two strings such as Yes/No or Active/Inactive. These types are used by the backend to enforce the value entered in the SubscriptionAttribute matches the AttributeType expected.

The SubscriptionAttributeType model is the attribute or parameter in the entity–attribute–value model. It is linked to the AttributeType model. It defines the name of the attribute. It also specifies if the attribute has usage value using the has_usage field. Setting this field to True will automatically create a one-to-one relationship between a SubscriptionAttribute and SubscriptionAttributeUsage, which stores usage information, whenever a new SubscriptionAttribute is created. The SubscriptionAttribute model is the value in the entity–attribute–value model. It links the SubscriptionAttributeType and Subscription model. Its value field stores the attribute value. Its is_private field is used to control if users can see this attribute in the subscription’s detail page.

The SubscriptionUser model links the Django user model and subscription model. It is linked to the SubscriptionUserStatusChoice model. ColdFront has uses the following user status choices: active, removed, and error. Active means the user’s access to the subscription resource is active. Removed means the user no longer has access to the subscription resource. Error means there was some error in either adding or removing users’ access to the subscription resource.

The SubscriptionAdminComment model is used by center administrators to add comments to a subscription that are not visible to the users. Finally, the SubscriptionUserMessage model is used by center administrators to send messages to users that are visible on the subscription page.