Skip to content

Commit

Permalink
fix: fix schedule and cost cal
Browse files Browse the repository at this point in the history
Signed-off-by: Kami Wan <kamiwan@iMac-Pro.local>
  • Loading branch information
KaimingWan authored and Kami Wan committed Jun 6, 2024
1 parent 50443f3 commit e25f89b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/prepare-vs-benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Prepare Streaming Cluster [Benchmark]
name: Prepare-Streaming-Cluster-Benchmark

on:
workflow_run:
workflows: ["Prepare Streaming Cluster [Install]"]
workflows: [ Prepare-Streaming-Cluster-Install ]
types:
- completed
schedule:
- cron: '0 14 * * *'
- cron: '37 4 * * *'
workflow_dispatch:
inputs:
cloud_provider:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
run: |
echo "[INFO] Provider is AutoMQ"
cd driver-shared/deploy/${{ env.CLOUD_PROVIDER }}
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml >> /tmp/aws-cost.txt
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml --terraform-var-file driver-automq/deploy/aws-cn/var.tfvars >> /tmp/aws-cost.txt
COST_DETAIL_FILE=/tmp/aws-cost.txt
cat $COST_DETAIL_FILE
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
run: |
echo "[INFO] Provider is AutoMQ"
cd driver-shared/deploy/${{ env.CLOUD_PROVIDER }}
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml >> /tmp/aws-cost.txt
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml --terraform-var-file driver-kafka/deploy/aws-cn/var.tfvars >> /tmp/aws-cost.txt
COST_DETAIL_FILE=/tmp/aws-cost.txt
cat $COST_DETAIL_FILE
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prepare-vs-install.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Prepare Streaming Cluster [Install]
name: Prepare-Streaming-Cluster-Install

on:
schedule:
- cron: '41 13 * * *'
- cron: '37 4 * * *'
workflow_dispatch:
inputs:
cloud_provider:
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
run: |
echo "[INFO] Provider is AutoMQ"
cd driver-shared/deploy/${{ env.CLOUD_PROVIDER }}
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml >> /tmp/aws-cost.txt
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml --terraform-var-file driver-automq/deploy/aws-cn/var.tfvars >> /tmp/aws-cost.txt
COST_DETAIL_FILE=/tmp/aws-cost.txt
cat $COST_DETAIL_FILE
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
run: |
echo "[INFO] Provider is AutoMQ"
cd driver-shared/deploy/${{ env.CLOUD_PROVIDER }}
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml >> /tmp/aws-cost.txt
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml --terraform-var-file driver-kafka/deploy/aws-cn/var.tfvars >> /tmp/aws-cost.txt
COST_DETAIL_FILE=/tmp/aws-cost.txt
cat $COST_DETAIL_FILE
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/prepare-vs-uninstall.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Prepare Streaming Cluster [Uninstall]
name: Prepare-Streaming-Cluster-Uninstall

on:
workflow_run:
workflows: ["Prepare Streaming Cluster [Benchmark]"]
workflows: [ Prepare-Streaming-Cluster-Benchmark ]
types:
- completed
schedule:
- cron: '5 14 * * *'
- cron: '37 4 * * *'
workflow_dispatch:
inputs:
cloud_provider:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
run: |
echo "[INFO] Provider is AutoMQ"
cd driver-shared/deploy/${{ env.CLOUD_PROVIDER }}
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml >> /tmp/aws-cost.txt
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml --terraform-var-file driver-automq/deploy/aws-cn/var.tfvars >> /tmp/aws-cost.txt
COST_DETAIL_FILE=/tmp/aws-cost.txt
cat $COST_DETAIL_FILE
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
run: |
echo "[INFO] Provider is AutoMQ"
cd driver-shared/deploy/${{ env.CLOUD_PROVIDER }}
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml >> /tmp/aws-cost.txt
infracost breakdown --path . --usage-file infracost/${{ env.CLOUD_PROVIDER }}-medium-500m-21600g.yml --terraform-var-file driver-kafka/deploy/aws-cn/var.tfvars >> /tmp/aws-cost.txt
COST_DETAIL_FILE=/tmp/aws-cost.txt
cat $COST_DETAIL_FILE
Expand Down
2 changes: 1 addition & 1 deletion driver-automq/deploy/aws-cn/var.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ user = "ubuntu"
instance_type = {
"server" = "r6i.large"
"broker" = "r6i.large"
"client" = "r6i.xlarge"
"client" = "r6i.large"
}

instance_cnt = {
Expand Down
2 changes: 1 addition & 1 deletion driver-kafka/deploy/aws-cn/var.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ user = "ubuntu"
instance_type = {
"server" = "r6i.large"
"broker" = "r6i.large"
"client" = "m6i.xlarge"
"client" = "r6i.large"
}

instance_cnt = {
Expand Down
6 changes: 3 additions & 3 deletions workflow_scripts/python/extract_cost_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
usage_cost_str = re.sub(r'[^\d.]', '', match.group(2))
total_cost_str = re.sub(r'[^\d.]', '', match.group(3))

# decrease client cost
baseline_cost = float(baseline_cost_str) - 286.54
# decrease client cost 5*92.93 USD = 464.65 (decrease 5 client's cost)
baseline_cost = float(baseline_cost_str) - 464.65
usage_cost = float(usage_cost_str)
total_cost = float(total_cost_str) - 286.54
total_cost = float(total_cost_str) - 464.65

print(f"Baseline cost: ${baseline_cost}")
print(f"Usage cost: ${usage_cost}")
Expand Down

0 comments on commit e25f89b

Please sign in to comment.