Is Google Cloud Trial enough for academic project? - google-cloud-platform

We are going to use Kubernetes Engine, Cloud SQL, Storage, and possibly Nosql and cache services for our academic project.
So far we'll have 5 accounts and the project has to be running for 3 months.
Will it be enough for us? Is it possible, for example, to stop project and billing every night or even stop and start at any time?

The Google Cloud Platform (GCP) Free Tier includes $300.00 USD in credits to get started with any GCP product. Since this is an academic project, I recommend using the Google Cloud Platform Pricing Calculator to learn how to price GCP products and services - link. Also review what is included in the "Always Free Products" - link. Then there are discounts for services that run for a majority of the month - "Sustained Usage Discounts" - link.
Google Kubernetes Engine:
Kubernetes Engine is free (the worker nodes are not free).
If you select n1-standard-1 (1 vCPU, 3.75 GB mem) the cost is $24.27 per month per node. Typically you will create a three node cluster: round up to $75.00 per month.
Google Cloud SQL:
Selecting a db-pg-f1-micro (PostgreSQL) with 32 GB of SSD storage: $24.27 per month
Will it be enough for us?
As you can see, you will quickly burn thru $300.00 in credit in only three months.
Take into consideration that Google's goal is not to give away services. The goal is to introduce you to Google Cloud and provide enough services at zero or low cost so that you can complete an evaluation of Google Cloud.
Is it possible, for example, to stop project and billing every night
or even stop and start at any time?
No, you cannot start and stop billing every night. In order to stop billing for a project you must delete the project and everything in it. Some services such as Google Compute Engine (GCE) can be stopped. This stops billing for the VM instance but billing for storage, snapshots, IP addresses, etc. continues unless you delete your instances every night and recreate them each morning.
Services such as Kubernetes or Google Cloud SQL cannot be completely shutdown. Technically you could by deleting everything but then recreating everything takes more time than the savings gained. Very good for practice however.

Google Cloud services would be a great option for your circumstances.
If its budgetary constraint you may want to look into using AWS, AWS will provde you with a years time for free which would be good for your horizontal scaling with k8s
Amazon and Kubernetes

Related

GCP - Cluster and database are turned off, but I am still charged

Please, I have a problem, that I have turned off my database and cluster, but I am still charged with only small price difference.
Commnand for turning off Cluster:
gcloud container clusters resize dev-cluster --num-nodes=0
--zone=europe-west3
For database:
gcloud sql instances patch app-dataase-dev --activation-policy NEVER
The one cluster and Sql database is only one and one. Yesterday 7th Jan., it was whole day turned off and I am still charged for almost same price, like it was not. I am sure that pool was empty and database was turned off. Also check the days before. At 3 - 5. Jan it was running like 5 hours per day and price difference is almost nothing.
I am not able to reach GCP support, because I am not on paid program.
Please could anyone help me find solution for this?
From Pricing:
GKE clusters accrue a management fee of $0.10 per cluster per hour, irrespective of cluster size or topology
This is probably the cause of the continued charges you are seeing for your cluster. Although one zonal cluster per billing account should be free according to the same documentation.
I would suggest contacting Billing Support, which is available for all Google Cloud accounts irrespective of any Technical Support plan you may or may not have.
If you are not using your Cluster you can delete it to avoid future charges:
gcloud container clusters delete
gcloud container clusters delete NAME [NAME …] [--async] [--region=REGION | --zone=ZONE, -z ZONE] [GCLOUD_WIDE_FLAG …]
Same thing for your sql instance, you can delete your instance:
gcloud sql instances delete [INSTANCE_NAME]
Even though your Cluster has 0 nodes and your instance is not receiving data, they are still using resources that is why you see that charge.
Additionally, Keep in mind that your Billing report is associated with your Billing Account, and if this Billing Account is linked to other projects that are generating costs, those costs will be reflected in the Billing Report.
To confirm if billing is enabled on a project you could consult the following documentation
Its long responses. I will add only results:
Its true, that you are billed $0.10 per cluster hour. #Nahuel.
To disable all paid features you need to disable billing for a project:
disable billing
then
enable billing, but After 30 days with disabled billing, all resources will be destroyed.
Also they said, that if you want to keep your project running, and fully turn off, you need to destroy it all.
I will go with turning off whole project, which is ok now for me. I have there only dev things. I hope this could be helpful for others, who would like to save some money.
Thanks to responders for help! :)

Is it possible to use ON_DEMAND pricing for Cloud SQL any longer?

I keep finding old posts about an on demand pricing option for Cloud SQL, but I see no more references in Google's documentation on how to enable it? Did this feature go away?
If so, can someone provide me a recommendation on an alternative for hosting a MySQL DB? Cloud SQL is just too much if I have to always be running the instance.
As per the GCP doc Cloud SQL for MySQL pricing is charged for every second. This means that each second of usage counts towards a full billable minute. For example, If you use an instance for 1.5 seconds or 2.49 seconds, in both cases you are billed for 2 seconds.

Google cloud platform free tier limits from compute engine

In GCP, it is not notified when a virtual machine of with resources higher than the free tier limit is created. An error message of following pattern arises in the notification. So, what is the maximum allowed resourced for Google cloud platform virtual machine?
Create VM instance "instance-2" and its boot disk "instance-2"
Quota 'C2_CPUS' exceeded. Limit: 0.0 in region asia-south1.
As written in the documentation:
Compute Engine
1 non-preemptible e2-micro VM instance per month in one of the following US regions:.
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
30 GB-months HDD.
5 GB-month snapshot storage in the following regions:.
Oregon: us-west1
Iowa: us-central1
South Carolina: us-east1
Taiwan: asia-east1
Belgium: europe-west1
1 GB network egress from North America to all region destinations (excluding China and Australia) per month
Your Free Tier e2-micro instance limit is by time, not by instance. Each month, eligible use of all of your e2-micro instances is free until you have used a number of hours equal to the total hours in the current month. Usage calculations are combined across the supported regions.
Google Cloud Free Tier does not include external IP addresses.
Compute Engine offers discounts for sustained use of virtual machines. Your Free Tier use doesn't factor into sustained use.
GPUs and TPUs are not included in the Free Tier offer. You are always charged for GPUs and TPUs that you add to VM instances.
NB: This is subject to changes, check the link for up-to-date information.
Step-by-Step guide to create a free instance:
Create instance
Now go create the instance at https://console.cloud.google.com/compute/instancesAdd
region: us-east1 or one of the region indicated in the documentation.
Select General Purpose -> N2 -> e2-micro. You will see "Your first 744 hours of e2-micro instance usage are free this month"
Select Boot disk -> public image -> ubuntu -> 20.04LS -> boot disk type: Standard persistent disk (HDD) -> size 30gb (or as per documentation)
Allow http and https traffic (or don't check the boxes, if you don't intend to use port 80 and 443)
Click on Create
You can check "view billing report" to make sure you did it right.
You can found more information at the documentation Google Cloud Free Tier:
The Google Cloud Free Tier has two parts:
A 3-month(previously 12) free trial with $300 credit to use with any Google Cloud services.
Always Free, which provides limited access to many common Google Cloud resources, free of charge.
At the section 12-month, $300 free trial you can find Program coverage details:
Your free trial credit applies to all Google Cloud resources, with the
following exceptions:
You can't have more than 8 cores (or virtual CPUs) running at the same time.
You can't add GPUs to your VM instances.
You can't request a quota increase. For an overview of Compute Engine quotas, see Resource quotas.
You can't create VM instances that are based on Windows Server images.
You must upgrade your account to perform any of the actions in the preceding list.
In addition, have a look at the End of the free trial:
The free trial ends when you use all of your credit, or after 12
months, whichever happens first. At that time, the following
conditions apply:
You must upgrade to a paid account to continue using Google Cloud.
All resources you created during the trial are stopped.
Any data you stored in Compute Engine is lost.
Your account enters a 30-day grace period, during which you can recover resources and data you stored in any Google Cloud services
during the trial period.
You might receive a message stating that your account has been canceled, which only indicates that your account has been suspended to
prevent charges.
and at the Recovering data:
Caution: There is no automated way to recover data that you used on VM instances you created with Compute Engine. You must manually
export any data that you want to keep from your Compute Engine VM
instances before the trial period ends.
I do recommend you to upgrade your account before free trial ends.
After the free trial period ends you just have to register a credit card to continue to use their services if/when you accrue charges from them. If you set it up right it might charge you .02 cents every now and then. I just set up my first one with wordpress and at first I would get charged .02cents/month but once I updated the software and the config it rarely charges me. p.s. I started getting hack attempts pretty quickly.

How to add the GPU in compute engine instance of google ML engine for free tier?

I try to use the google machine learning engine to train my tensorflow model. I want to use the free tier.
When I set the configuration and create new compute engine instance ( Google compute engine), I try to add the GPU too. But this gives me an error because the Google cloud give just $300 credit free tier without GPU.
Is there any way to use the GPU in free tier?
As per the Google's doc
New projects and Free Trial accounts do not receive GPU quota by default.
You must have GPU quota before you can create instances with GPUs.
All free tiers users are initiated with 0 GPU, which they will have to submit a request to increase the quota. However, to file a request, one has to upgrade his account to a paid account.
10 minutes ago, I am still in the free tier and all my projects will be billed for the $300 free trial promotion credits.
I had to upgrade my account to submit a request for GPUs. A minute later my request was approved. When I try to create an instance again, I am charged according to the price sheet.
Updates
I have just reached out to a Google Cloud Support member and here's the result.
After an account has been upgraded, the unconsumed promotion $300 credits will be consumed first. Once the credits have been consumed, the charges will automatically then charged to your payment method on file. Since you have upgraded your billing account, you will not be notified that your free trial credits are consumed and that charges will be taken on your credit card. However, you can actually monitor your charges on your account by simply logging in to your console and check usage in the billing section.
In short, you may upgrade your account first and train your machine learning model and monitor the charges in the meantime to avoid unintended charges.
Meanwhile, Google has just released out the Colab sometime earlier to the general public with a noble goal of dissemination of machine learning education and research.
You can use GPU as a backend for free for 12 hours at a time.
The GPU used in the backend is K80(at this moment).
The 12-hour limit is for a continuous assignment of VM. It means we can use GPU compute even after the end of 12 hours by connecting to a different VM.
This essentially means you can train your ML model for free! Hurray!
Hope my findings help.
Update as on 3/14/18:
Google Cloud ML Engine now allows you to use GPUs with your jobs in the free tier. I am currently training using the BASIC_GPU scale tier, which uses a single standard-gpu instance as master machine. I haven't yet tried using cluster of multiple GPUs though, will update when I find information on this.
Edit: If you are learning and want to experiment with your Machine/Deep learning models, you can give Google's Colab a try, which provides free GPU access for the same purpose.
You can't choose a GPU because, as a free trial your GPU quota is set to 0. Simply go to the quotas panel on your Google Cloud Console, then you will be able to edit you quota there to some value other than 0 by clicking on "Edit quotas" and selecting the kind of GPU you want to use.

Using Google Container Engine with GCP free tier

Is it possible to use Google Container Engine with Google Cloud free tier?
(I mean the "Always Free" usage limit, not the $300 free credit)
The docs for GKE says:
The basic cluster is free but each node is charged at standard Compute
Engine pricing
But the Compute Engine also have a free instance. Is it possible to use them together?
Unfortuniately, this is no longer a correct answer, as GKE no longer (as of December 2020 if not earlier) supports f1-micro instances for node pools as they do not have sufficient memory (as alluded to in my original answer below where enabling stackdrier would make the cluster unstable). Therefore, it is not possible to run a GKE cluster fully within the free tier.
Previously, this was possible. See explanation below.
Yes, you can use GKE with the free tier. GKE only charges for the underlying compute engine resources, which are directly billed by compute engine. (Note that after June 6, 2020, the free tier only includes one free GKE zonal cluster -- not an unlimited number of clusters).
GKE will likely require you to run 3 free f1-micro instances concurrently to get the cluster to a minimum size, but as long as the cluster is in one of the free regions and the total usage in a month is under the total number of hours per month it will still be free (that is, you can run 3 f1-micros for a bit under 250 hours and still be in the free tier). Make sure to shut off your instances when you are not using them. See more at https://cloud.google.com/free/docs/gcp-free-tier#always-free-usage-limits (especially the notes about the limit being time rather than instance count).
You may also want to ensure that the persistant disks are not kept around while the cluster isn't running, as the free tier only allows 3 10GB disks over the course of the month.
If you happen to run over the usage, you will only be charged for the usage beyond the free tier.
Of course, this all assumes that f1-micro instances are suitable to your use case. They are quite limited, and once GKE is on them, they have almost nothing remaining in terms of RAM: https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#memory_cpu
Finally, it has been my experience that setting up the stackdriver support when you create the cluster if you only have micro instances can cause the cluster to struggle greatly -- the stackdriver monitoring alone (or with even minimal other applications) start to cause the nodes to be throttled and time out.
For now It's not possible to create kubernates cluster with one f1-micro. It requires minimum 3 f1-micro instances:
ERROR: (gcloud.container.clusters.create) ResponseError: code=400,
message=Clusters of f1-micro instances must contain at least 3 nodes.
Please make the cluster larger or use a different machine type
This is how I made mine. I created a cluster named 'free-cluster' which runs 2 nodes. These nodes are in 'us-west1-a' as the 'free' tier only allows for the us-east, us-west and us-central zones only. also the VM instance-type should only use 'f1-micro' as that is the freebie they give. the rest are paid.
As is pointed out, GCP does force us to create 3 nodes and no option to state this in the dashboard. But after that you can just go to the nodes and "cordon" and "drain" them so they will not consume the free compute fast. You can leave just one node for the free-tier... this however makes less sense as you will not take advantage of load balancing, self-healing and other features as to why we use kubernetes clusters to begin with. for me I am good testing on 2 nodes as I only need to pay for that 1 cheap monthly f1-micro for my hobby and learning. make sure to go to Google Compute Engine in the dashboard and open the 'Instance groups' in the sidebar, you will find the VM instances in that cluster which you can just delete by selecting and clicking the "Delete Instance" button.
There is no way to get a free GKE cluster on GCP, but you can get a very cheap one by following the instructions at https://github.com/Neutrollized/free-tier-gke.
Using a combination of GKE's free management tier and a low cost machine type, the cost estimate is less than $5 per month: .
More details on what is available as part of the free tier can be found here: https://cloud.google.com/free.
tl;dr
gcloud container clusters create cheap-cluster \
--zone us-west1-a \
--node-locations us-west1-a \
--machine-type=e2-small \
--max-nodes=1 \
--num-nodes=1
As I understand, Google allows 1 f1-micro instance to be used for free even after the 12 month free period.