hail icon indicating copy to clipboard operation
hail copied to clipboard

[batch] Automatic resource price updates for GCP

Open jigold opened this issue 2 years ago • 10 comments

jigold avatar May 16 '22 18:05 jigold

I'm going to rip out the currency code part because the ip fee and service fee are all in USD.

jigold avatar May 19 '22 21:05 jigold

This failed because of a Query bug. It's ready for another look. Once you're happy with the structure of the code, I'll do one last dev deploy and check everything is good.

jigold avatar May 26 '22 15:05 jigold

LGTM

daniel-goldstein avatar May 26 '22 20:05 daniel-goldstein

@danking I just want to double check you are okay with this change before it goes on. I'm going to do one more pass on dev deploy to make sure everything still looks good. I'll update the mailing list and then send out an announcement on both Zulip and the mailing list notifying everyone that the pricing is changing.

jigold avatar May 31 '22 15:05 jigold

I have no particular reservations. It seems to me that this change doesn't include the actual change to resources, is that right? Is there a follow up PR that will actually start using the latest resources?

danking avatar Jun 23 '22 14:06 danking

The resource names are changing to include the regions. So yes, this PR will use the latest resources. The backwards compatibility is for right when the front end starts up before the driver has the chance to fetch the latest products and their prices.

Besides not getting a chance to dev deploy this change and make sure it works is whether we need to have a solution for users being able to select us-central if they don't want to pay the 10% increase in costs. I wanted to spec out how much work that would be, but got distracted by other things.

jigold avatar Jun 23 '22 15:06 jigold

I added an optimization so we prefer the default location if we haven't had many failures creating instances. This will resolve my concerns about unnecessarily charging users more with this change without giving them a way to prefer a cheaper region.

jigold avatar Jun 29 '22 18:06 jigold

@lgruen @illusional @vladsaveliev I added a new API that's required in this PR: cloudbilling.googleapis.com

See infra/gcp/README.md in this PR for the gcloud command to enable it.

jigold avatar Jun 29 '22 18:06 jigold

I want to keep the WIP tag on until we've made an announcement. It would be nice to make a joint announcement about this change with #11884.

jigold avatar Jun 29 '22 21:06 jigold

Also, there were three updates to the prices when I checked earlier, but no values actually changed. All of the rates for us-central1 are the same as what we currently have in the database. I checked the other regions and they seemed good too.

jigold avatar Jun 29 '22 21:06 jigold

@jigold I had approved this before, but my review was dismissed. Is there additional context I need to review this again? Also because of the rebase I don't know if anything has substantially changed since that review in the code.

daniel-goldstein avatar Nov 09 '22 16:11 daniel-goldstein

Not for the feature. I'll double check that one more time. Just make sure I didn't do anything stupid with the last three commits.

jigold avatar Nov 09 '22 16:11 jigold

the requirements updates seem fine.

daniel-goldstein avatar Nov 09 '22 16:11 daniel-goldstein

@danking I still can't get the pinned requirements step to pass. I rebased onto latest main and ran the make target.

jigold avatar Nov 23 '22 17:11 jigold

It looks like you're running make -C docker generate-pip-lockfile which is rewriting linux-pinned-requirements.txt, but you modified hail/python/dev/requirements.txt which is linked to hail/python/dev/pinned-requirements.txt which is regenerated by make -C hail generate-pip-lockfile.

I'd git checkout hi/main docker/linux-pinned-requirements.txt and then make -C hail generate-pip-lockfile.

danking avatar Nov 23 '22 18:11 danking

cc: @daniel-goldstein is it possible to make the error more clear? The CI test job is a bit hard to read. Maybe the last line of the output should be something like "XXXX file is out of date, run YYYY"

danking avatar Nov 23 '22 18:11 danking

Thanks! It's passing now. Let's try and get this in early next week.

jigold avatar Nov 23 '22 19:11 jigold

@danking Issue with pd-ssds has been resolved. The sku name included "in Los Angeles" etc. for the missing regions.

mysql> select * from resources;
+---------------------------------------------------------+----------------------------------+-------------+
| resource                                                | rate                             | resource_id |
+---------------------------------------------------------+----------------------------------+-------------+
| boot-disk/pd-ssd/1                                      |  0.00000000000006312861244201081 |           1 |
| compute/n1-nonpreemptible/1                             |    0.000000000008780833333333336 |           2 |
| compute/n1-nonpreemptible/us-central1/1669637632518     |    0.000000000008780833333333336 |          13 |
| compute/n1-nonpreemptible/us-central1/1669723648276     |    0.000000000008780833333333336 |          59 |
| compute/n1-nonpreemptible/us-east1/1669637632518        |    0.000000000008780833333333336 |          14 |
| compute/n1-nonpreemptible/us-east1/1669723648276        |    0.000000000008780833333333336 |          60 |
| compute/n1-nonpreemptible/us-east4/1669637632518        |    0.000000000009890277777777778 |          12 |
| compute/n1-nonpreemptible/us-east4/1669723648276        |    0.000000000009890277777777778 |          58 |
| compute/n1-nonpreemptible/us-west1/1669637632518        |    0.000000000008780833333333336 |          15 |
| compute/n1-nonpreemptible/us-west1/1669723648276        |    0.000000000008780833333333336 |          61 |
| compute/n1-nonpreemptible/us-west2/1669637632518        |    0.000000000010547222222222221 |          38 |
| compute/n1-nonpreemptible/us-west2/1669723648276        |    0.000000000010547222222222221 |          86 |
| compute/n1-nonpreemptible/us-west3/1669637632518        |    0.000000000010547222222222221 |          34 |
| compute/n1-nonpreemptible/us-west3/1669723648276        |    0.000000000010547222222222221 |          82 |
| compute/n1-nonpreemptible/us-west4/1669637632518        |    0.000000000009890277777777778 |          47 |
| compute/n1-nonpreemptible/us-west4/1669723648276        |    0.000000000009890277777777778 |          96 |
| compute/n1-preemptible/1                                |   0.0000000000018486111111111112 |           3 |
| compute/n1-preemptible/us-central1/1669637632518        |   0.0000000000018486111111111112 |          43 |
| compute/n1-preemptible/us-central1/1669723648276        |   0.0000000000018486111111111112 |          92 |
| compute/n1-preemptible/us-east1/1669637632518           |   0.0000000000018486111111111112 |          44 |
| compute/n1-preemptible/us-east1/1669723648276           |   0.0000000000018486111111111112 |          93 |
| compute/n1-preemptible/us-east4/1669637632518           |    0.000000000001978013888888889 |          10 |
| compute/n1-preemptible/us-east4/1669723648276           |    0.000000000001978013888888889 |          55 |
| compute/n1-preemptible/us-west1/1669637632518           |   0.0000000000018486111111111112 |          45 |
| compute/n1-preemptible/us-west1/1669723648276           |   0.0000000000018486111111111112 |          94 |
| compute/n1-preemptible/us-west2/1669637632518           |   0.0000000000022183333333333335 |          53 |
| compute/n1-preemptible/us-west2/1669723648276           |   0.0000000000022183333333333335 |         102 |
| compute/n1-preemptible/us-west3/1669637632518           |    0.000000000001796388888888889 |          26 |
| compute/n1-preemptible/us-west3/1669723648276           |    0.000000000001796388888888889 |          72 |
| compute/n1-preemptible/us-west4/1669637632518           |   0.0000000000009419444444444444 |          32 |
| compute/n1-preemptible/us-west4/1669723648276           |   0.0000000000009419444444444444 |          80 |
| disk/local-ssd/1                                        | 0.000000000000017824549395391283 |           4 |
| disk/local-ssd/nonpreemptible/us-central1/1669637632518 | 0.000000000000029707582325652144 |          23 |
| disk/local-ssd/nonpreemptible/us-central1/1669723648276 | 0.000000000000029707582325652144 |          69 |
| disk/local-ssd/nonpreemptible/us-east1/1669637632518    | 0.000000000000029707582325652144 |          24 |
| disk/local-ssd/nonpreemptible/us-east1/1669723648276    | 0.000000000000029707582325652144 |          70 |
| disk/local-ssd/nonpreemptible/us-east4/1669637632518    |  0.00000000000003267834055821735 |          11 |
| disk/local-ssd/nonpreemptible/us-east4/1669723648276    |  0.00000000000003267834055821735 |          57 |
| disk/local-ssd/nonpreemptible/us-west1/1669637632518    | 0.000000000000029707582325652144 |          25 |
| disk/local-ssd/nonpreemptible/us-west1/1669723648276    | 0.000000000000029707582325652144 |          71 |
| disk/local-ssd/nonpreemptible/us-west2/1669637632518    |  0.00000000000003564909879078257 |          46 |
| disk/local-ssd/nonpreemptible/us-west2/1669723648276    |  0.00000000000003564909879078257 |          95 |
| disk/local-ssd/nonpreemptible/us-west3/1669637632518    |  0.00000000000003564909879078257 |          42 |
| disk/local-ssd/nonpreemptible/us-west3/1669723648276    |  0.00000000000003564909879078257 |          90 |
| disk/local-ssd/nonpreemptible/us-west4/1669637632518    |  0.00000000000003267834055821735 |          18 |
| disk/local-ssd/nonpreemptible/us-west4/1669723648276    |  0.00000000000003267834055821735 |          64 |
| disk/local-ssd/preemptible/us-central1/1669637632518    | 0.000000000000017824549395391283 |          49 |
| disk/local-ssd/preemptible/us-central1/1669723648276    | 0.000000000000017824549395391283 |          98 |
| disk/local-ssd/preemptible/us-east1/1669637632518       | 0.000000000000017824549395391283 |          50 |
| disk/local-ssd/preemptible/us-east1/1669723648276       | 0.000000000000017824549395391283 |          99 |
| disk/local-ssd/preemptible/us-east4/1669637632518       | 0.000000000000019681273290744546 |          35 |
| disk/local-ssd/preemptible/us-east4/1669723648276       | 0.000000000000019681273290744546 |          83 |
| disk/local-ssd/preemptible/us-west1/1669637632518       | 0.000000000000017824549395391283 |          51 |
| disk/local-ssd/preemptible/us-west1/1669723648276       | 0.000000000000017824549395391283 |         100 |
| disk/local-ssd/preemptible/us-west2/1669637632518       |  0.00000000000002138945927446954 |          33 |
| disk/local-ssd/preemptible/us-west2/1669723648276       |  0.00000000000002138945927446954 |          81 |
| disk/local-ssd/preemptible/us-west3/1669637632518       |  0.00000000000002138945927446954 |          16 |
| disk/local-ssd/preemptible/us-west3/1669723648276       |  0.00000000000002138945927446954 |          62 |
| disk/local-ssd/preemptible/us-west4/1669637632518       | 0.000000000000019681273290744546 |          37 |
| disk/local-ssd/preemptible/us-west4/1669723648276       | 0.000000000000019681273290744546 |          85 |
| disk/pd-ssd/1                                           |  0.00000000000006312861244201081 |           5 |
| disk/pd-ssd/us-central1/1669637632518                   |  0.00000000000006312861244201081 |          39 |
| disk/pd-ssd/us-central1/1669723648276                   |  0.00000000000006312861244201081 |          87 |
| disk/pd-ssd/us-east1/1669637632518                      |  0.00000000000006312861244201081 |          40 |
| disk/pd-ssd/us-east1/1669723648276                      |  0.00000000000006312861244201081 |          88 |
| disk/pd-ssd/us-east4/1669723648276                      |  0.00000000000006944147368621187 |          79 |
| disk/pd-ssd/us-west1/1669637632518                      |  0.00000000000006312861244201081 |          41 |
| disk/pd-ssd/us-west1/1669723648276                      |  0.00000000000006312861244201081 |          89 |
| disk/pd-ssd/us-west2/1669723648276                      |  0.00000000000007575433493041295 |          56 |
| disk/pd-ssd/us-west3/1669723648276                      |  0.00000000000007575433493041295 |          73 |
| disk/pd-ssd/us-west4/1669723648276                      |  0.00000000000006944147368621187 |          91 |
| ip-fee/1024/1                                           |   0.0000000000010850694444444444 |           6 |
| memory/n1-nonpreemptible/1                              |   0.0000000000011493598090277779 |           7 |
| memory/n1-nonpreemptible/us-central1/1669637632518      |   0.0000000000011493598090277779 |          28 |
| memory/n1-nonpreemptible/us-central1/1669723648276      |   0.0000000000011493598090277779 |          75 |
| memory/n1-nonpreemptible/us-east1/1669637632518         |   0.0000000000011493598090277779 |          29 |
| memory/n1-nonpreemptible/us-east1/1669723648276         |   0.0000000000011493598090277779 |          76 |
| memory/n1-nonpreemptible/us-east4/1669637632518         |   0.0000000000012942165798611112 |          31 |
| memory/n1-nonpreemptible/us-east4/1669723648276         |   0.0000000000012942165798611112 |          78 |
| memory/n1-nonpreemptible/us-west1/1669637632518         |   0.0000000000011493598090277779 |          30 |
| memory/n1-nonpreemptible/us-west1/1669723648276         |   0.0000000000011493598090277779 |          77 |
| memory/n1-nonpreemptible/us-west2/1669637632518         |   0.0000000000013804796006944447 |          17 |
| memory/n1-nonpreemptible/us-west2/1669723648276         |   0.0000000000013804796006944447 |          63 |
| memory/n1-nonpreemptible/us-west3/1669637632518         |   0.0000000000013804796006944447 |          52 |
| memory/n1-nonpreemptible/us-west3/1669723648276         |   0.0000000000013804796006944447 |         101 |
| memory/n1-nonpreemptible/us-west4/1669637632518         |   0.0000000000012942165798611112 |          22 |
| memory/n1-nonpreemptible/us-west4/1669723648276         |   0.0000000000012942165798611112 |          68 |
| memory/n1-preemptible/1                                 |   0.0000000000002419704861111111 |           8 |
| memory/n1-preemptible/us-central1/1669637632518         |   0.0000000000002419704861111111 |          19 |
| memory/n1-preemptible/us-central1/1669723648276         |   0.0000000000002419704861111111 |          65 |
| memory/n1-preemptible/us-east1/1669637632518            |   0.0000000000002419704861111111 |          20 |
| memory/n1-preemptible/us-east1/1669723648276            |   0.0000000000002419704861111111 |          66 |
| memory/n1-preemptible/us-east4/1669637632518            |  0.00000000000025890842013888896 |          27 |
| memory/n1-preemptible/us-east4/1669723648276            |  0.00000000000025890842013888896 |          74 |
| memory/n1-preemptible/us-west1/1669637632518            |   0.0000000000002419704861111111 |          21 |
| memory/n1-preemptible/us-west1/1669723648276            |   0.0000000000002419704861111111 |          67 |
| memory/n1-preemptible/us-west2/1669637632518            |   0.0000000000002918836805555556 |          36 |
| memory/n1-preemptible/us-west2/1669723648276            |   0.0000000000002918836805555556 |          84 |
| memory/n1-preemptible/us-west3/1669637632518            |  0.00000000000023654513888888886 |          48 |
| memory/n1-preemptible/us-west3/1669723648276            |  0.00000000000023654513888888886 |          97 |
| memory/n1-preemptible/us-west4/1669637632518            |  0.00000000000012315538194444447 |          54 |
| memory/n1-preemptible/us-west4/1669723648276            |  0.00000000000012315538194444447 |         103 |
| service-fee/1                                           |    0.000000000002777777777777778 |           9 |
+---------------------------------------------------------+----------------------------------+-------------+
103 rows in set (0.00 sec)

jigold avatar Nov 29 '22 20:11 jigold