Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parallel deployments and SDL group deployments #8

Open
3 tasks
cloud-j-luna opened this issue Jul 25, 2022 · 1 comment
Open
3 tasks

Support parallel deployments and SDL group deployments #8

cloud-j-luna opened this issue Jul 25, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@cloud-j-luna
Copy link
Member

cloud-j-luna commented Jul 25, 2022

This provider needs to be performant and allow deployments to happen in parallel. Several resources can be created without specifying all of them in a single SDL. This allows for fine grained control over the resources through the Terraform state.

This issue will be updated with more detailed information as this gets investigated.

Limitations

Due to the way the Akash Network works, the DSEQ value is changed every block which is ~6 seconds at the time of this writing, thus for every deployment creation in that time frame the DSEQ is the same.

Cosmos SDK anti-replay

If the same account attempts multiple transactions within the same block - the account sequence mismatch message will be triggered. This safeguard is explained in this document:

https://docs.cosmos.network/v0.44/modules/auth/02_state.html

To counter this a locking mechanism in a per-block basis could be implemented so that operations could happen in parallel with a ~1 block (~6 seconds) interval between them. This solution is detailed below.
Akash Terraform Provider-Block Anti-Replay Locking drawio

Features

The provider must:

  • Handle deployments on the same block from the same account
  • Handle deployment groups on the same/different providers (check Multiple Providers Deployment)
  • Provide filtering of providers in a per GSEQ fashion.

Multiple Providers Deployment

A deployment could be deployed to multiple providers in this type of example SDL:

---
version: "2.0"

services:
  supermario:
    image: pengbai/docker-supermario 
    expose:
      - port: 8080
        as: 80
        to:
          - global: true

profiles:
  compute:
    supermario:
      resources:
        cpu:
          units: 0.1
        memory:
          size: 256Mi
        storage:
          size: 256Mi
  placement:
    akash:
      pricing:
        supermario: 
          denom: uakt
          amount: 10000
    akash2:
      pricing:
        supermario: 
          denom: uakt
          amount: 10000
    akash3:
      pricing:
        supermario: 
          denom: uakt
          amount: 10000

deployment:
  supermario:
    akash:
      profile: supermario
      count: 1
    akash2:
      profile: supermario
      count: 1
    akash3:
      profile: supermario
      count: 1

In order to support this SDL the provider must know how to handle multiple GSEQs for a given DSEQ, this requires a change in the structure used to identify deployments in the deployment which consists of 1 DSEQ, 1 GSEQ and 1 OSEQ. It must now support many GSEQ and treat each one as a bidding and leasing target (to be confirmed).

@cloud-j-luna cloud-j-luna added the enhancement New feature or request label Jul 25, 2022
@cloud-j-luna cloud-j-luna self-assigned this Jul 25, 2022
@cloud-j-luna
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant