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

feat(bid-script): support setting price per specific GPU model requested and parametrize price targets via helm chart values #226

Conversation

andy108369
Copy link
Collaborator

@andy108369 andy108369 commented Sep 19, 2023

feat(bid-script): parametrize price targets via helm chart values
feat(bid-script): support setting price per specific GPU model requested


bid price script (price_script_generic.sh) is now taking the following env. variable attributes

PRICE_TARGET_CPU
PRICE_TARGET_MEMORY
PRICE_TARGET_HD_EPHEMERAL
PRICE_TARGET_HD_PERS_HDD
PRICE_TARGET_HD_PERS_SSD
PRICE_TARGET_HD_PERS_NVME
PRICE_TARGET_ENDPOINT
PRICE_TARGET_IP
PRICE_TARGET_GPU_MAPPINGS

When these keys aren't set, they will default to the following values:

PRICE_TARGET_CPU=1.60
PRICE_TARGET_MEMORY=0.80
PRICE_TARGET_HD_EPHEMERAL=0.02
PRICE_TARGET_HD_PERS_HDD=0.01
PRICE_TARGET_HD_PERS_SSD=0.03
PRICE_TARGET_HD_PERS_NVME=0.04
PRICE_TARGET_ENDPOINT=0.05
PRICE_TARGET_IP=5
PRICE_TARGET_GPU_MAPPINGS="a100=120,t4=80,*=130" 
  • Example: testing the bid price script against the order request with 3 services requesting different GPU models (a100, t4 and * GPU)
PRICE_TARGET_CPU=1.60 PRICE_TARGET_MEMORY=0.80 PRICE_TARGET_HD_EPHEMERAL=0.02 PRICE_TARGET_HD_PERS_HDD=0.01 PRICE_TARGET_HD_PERS_SSD=0.03 PRICE_TARGET_HD_PERS_NVME=0.04 PRICE_TARGET_ENDPOINT=0.05 PRICE_TARGET_IP=5 PRICE_TARGET_GPU_MAPPINGS="a100=120,t4=80,*=130" ./price_script_generic.sh <<< $(cat ibc-gpu-3-services-1-gpu-each-different.jq) ; echo
  • contents of order request with 3 GPU services (ibc-gpu-3-services-1-gpu-each-different.jq file):
{
  "resources": [
    {
      "memory": 1073741824,
      "cpu": 1000,
      "gpu": {
        "units": 1,
        "attributes": {
          "vendor": {
            "nvidia": {
              "model": "*"
            }
          }
        }
      },
      "storage": [
        {
          "class": "ephemeral",
          "size": 1073741824
        }
      ],
      "count": 1,
      "endpoint_quantity": 1,
      "ip_lease_quantity": 0
    },
    {
      "memory": 1073741824,
      "cpu": 1000,
      "gpu": {
        "units": 1,
        "attributes": {
          "vendor": {
            "nvidia": {
              "model": "a100"
            }
          }
        }
      },
      "storage": [
        {
          "class": "ephemeral",
          "size": 1073741824
        }
      ],
      "count": 1,
      "endpoint_quantity": 1,
      "ip_lease_quantity": 0
    },
    {
      "memory": 1073741824,
      "cpu": 1000,
      "gpu": {
        "units": 1,
        "attributes": {
          "vendor": {
            "nvidia": {
              "model": "t4"
            }
          }
        }
      },
      "storage": [
        {
          "class": "ephemeral",
          "size": 1073741824
        }
      ],
      "count": 1,
      "endpoint_quantity": 1,
      "ip_lease_quantity": 0
    }
  ],
  "price": {
    "denom": "uakt",
    "amount": "1000.000000000000000000"
  },
  "price_precision": 6
}

With uncommented DEBUG section in the script:

$ PRICE_TARGET_CPU=1.60 PRICE_TARGET_MEMORY=0.80 PRICE_TARGET_HD_EPHEMERAL=0.02 PRICE_TARGET_HD_PERS_HDD=0.01 PRICE_TARGET_HD_PERS_SSD=0.03 PRICE_TARGET_HD_PERS_NVME=0.04 PRICE_TARGET_ENDPOINT=0.05 PRICE_TARGET_IP=5 PRICE_TARGET_GPU_MAPPINGS="a100=120,t4=80,*=130" ./price_script_generic.sh <<< $(cat ibc-gpu-3-services-1-gpu-each-different.jq) ; echo
model *
price for this model 130
gpu_units 1
gpu_price_total 130

model a100
price for this model 120
gpu_units 1
gpu_price_total 250

model t4
price for this model 80
gpu_units 1
gpu_price_total 330

907.668556

The values can be set via the akash-provider helm-chart:

price_target_cpu: 1.60
price_target_memory: 0.80
price_target_hd_ephemeral: 0.02
price_target_hd_pers_hdd: 0.01
price_target_hd_pers_ssd: 0.03
price_target_hd_pers_nvme: 0.04
price_target_endpoint: 0.05
price_target_ip: 5
price_target_gpu_mappings: "a100=120,t4=80,*=130"

@andy108369 andy108369 force-pushed the issue-125-configure-bid-price-script-via-chart-flags branch from 373396f to aceecb0 Compare September 19, 2023 12:03
@andy108369 andy108369 merged commit 38bf25f into akash-network:main Sep 19, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant