# Hive Proposal for Container Deployment and Scaling

A Hive file is a YAML document structured into three main sections: `containers`, `scaling`, and `geographical_scaling`.

#### Containers

The `containers` section allows you to define individual containers, each with its specific properties. For instance, `gpu_app_container` is a container profile representing an application requiring GPU resources to run. Alongside it, the `webapp_container` is also defined. This indicates that the Hive file can deploy multiple containers simultaneously, each with its own profile within a single Hive file.

**GPU-Enabled Container & Standard WebApp Container**

```yaml
containers:
  - name: gpu_app_container
    location: /path/to/Dockerfile
    profile:
      gpu:
        enabled: true
        type: Nvidia
        model: GeForce_RTX_3080
        memory: 10GB
        cores: 8704
        # Add other GPU properties for gpu_container here
    resources:
      cpu: 4
      memory: 8GB
    scaling:
      auto_scale: true

  - name: webapp_container
    location: /path/to/Dockerfile
    profile: null
    resources:
      cpu: 2
      memory: 4GB
    environment: null
    scaling:
      auto_scale: true
```

#### Scaling

The scaling section includes parameters for auto-scaling. If `auto_scale` is set to true, specifying `max_scale` becomes optional.

```yaml
scaling:
  auto_scale: true
  #max_scale: 10 # Optional when auto_scale is true
```

#### Geographical Scaling

The `geographical_scaling` section enables geographical scaling and specifies scaling amounts for each container based on location. It ensures data availability in specific regions.

```yaml
geographical_scaling:
  enabled: true
  scale_amount: 10 #only 10 copies of this app will be in the specified region 
    - container: gpu_container
      location: NA
      amount: $dynamic_amount
    - container: webapp_container
      location: EU
      amount: $dynamic_amount
```

#### Important Note

Resource Availability: Proposals may be rejected if the specified resources are unavailable in the network. Ensure alignment with the available resources in the decentralized infrastructure. Explore available nodes and their resources via the [network explorer](https://explorer.dockhive.io).
