Hello folks. I've been figuring out how to set up ...
# ask-metaflow
e
Hello folks. I've been figuring out how to set up Metaflow for AWS using the "Deploying to AWS Managed Services"::"Cloud Formation" approach. As has been pointed out, that method is not used much, but I decided to give it a go. And I did get things running. But, I happened to check my AWS Billing page, and in the just over a month of successfully demo'ing on AWS, I've racked up a $1200 bill. OOPS! Apparently what happens is that, in the course of setting up in this way, or maybe running code, a whole bunch of stuff is left running (forever if one doesn't catch it.) In my case I had running instances from ECC, SageMaker Notebooks, Relational Database Services. Those where the big charges, but I had a lot more smaller charges from various tools. I'm presuming that such an arrangement, where once services are brought up they stay running, is not what anyone would want. So I have two questions: 1. Is there a "shutdown" command that I'm not using but should? 2. Should I switch gears and us the method "Deploying to AWS with Kubernetes"? 3. Or any other advice or comments you might make? Thanks!!
s
hi @eager-activity-66247 using the AWS with K8s is a better paved path. Also, you can then control your resources via TF.. So if you need to bring down things - you can just do a tf destroy
h
Just fyi RDS is used to store all the metadata, so if you destroy that you wouldn't be able to retrieve older flow runs
e
Thanks! I had made use of tf destroy in a different circumstance and it is very thorough. Nissan, your comment about metadata is crucial and throwing it away sounds problematic. Actually, I could tolerate the RDS uptime if the compute resources would shut down. Does K8s do that in its normal flow? Thanks again.
s
not out of the box afaik. You will have to add/maintain additional components ( autoscaler ) to achieve that
also by compute resources am assuming - you are referring to the worker nodes running metaflow code
e
@shy-address-41011, your question about what I meant by compute resources is a good one and worth answering in a bit of detail. In descending order of daily expense [$/day, % of daily total], I had: • EC2-Inst's 9.50, 47% • SageMaker. 5.40, 26% • EC2-Other. 2.30, 11% • RDS. 1.00, 5% • (the rest). 2.10, 10% • Total. 20.30 So, just by eliminating the first 3 items, I can go from $20 / day to $3/day: much more tolerable. Actually, this is probably a lower bound on the EC2-Instances piece. A bigger instance or more than one will cause that number to go up: all the more important. And, again, I'll claim that it is worth preserving the metadata database, at least for the duration of the project. Does this seem feasible using the kubernetes setup? Thanks.
s
well - there are certain knobs you can turn .. EC2 - use spot instances instead of on-demand. Depending on the workloads you want to run, you could use smaller instances. If you want GPUs then those are costly.
In any case, you could scale down the instances overnight if you choose - but I guess there will still be EKS