-
Notifications
You must be signed in to change notification settings - Fork 9
HOWTO: Setup provider: Google Cloud Platform (GCP)
This document describes how to setup your GCP account to use it in BlendNet. Overall the steps are quite the same as in Google documentation, but this document is more specific for BlendNet.
Useful info to compare with the other providers:
- Configs:
- Manager: 1CPU (n1-standard-1 $0.095/H)
- Agents: 3x, 2CPU (n1-highcpu-2 $0.142/H)
- Cheap agents disabled
- Upload blendnet to storage: 7s
- Manager run: 99s
- Manager rerun (already existing instance): 38s
- Render frame blendnet-test-project (upload, run agents, render, get compose): 447s
- Rerender frame blendnet-test-project (same but agents active and cache here): 343s
You will need to have a registered GCP email to activate Console https://console.cloud.google.com/ - login with the existing account or create a new one. If you don't have GCP activated - Google will ask you to enroll to Free tier. It's free $300 to check the GCP with some limitations (for example cheap CPU's will not be available).
It's a good idea to create the new project and use it for your rendering. Just click on the project
name in Cloud Console and use NEW PROJECT
button to do that.
BlendNet reuses logic from the Google provided gcloud SDK to interface with GCP API - so you need to install it on your computer (just follow https://cloud.google.com/sdk/docs/downloads-versioned-archives documentation). After that you will need to initialize it (and make sure your system PATH env variable is changed to point to sdk bin dir, without it BlendNet can't find the gcloud utility and properly connect the provider), choose the default project & region/zone. Execute those commands in your terminal:
- Connect your GCP account and choose the project to use (not needed for those users who enabled
"Run
gcloud init
..." flag during installation)$ gcloud init
- List the available regions and zones - you can choose the right ones for you - just read about
that in google cloud documentation:
$ gcloud compute regions list $ gcloud compute zones list
- Setup your region and zone - both will be used to run the BlendNet Manager and Agents.
$ gcloud config set compute/region us-central1 $ gcloud config set compute/zone us-central1-f
By default tools installs their binary path in .bashrc config, but this is working only for terminal. In case of launcher (UI one) - BlendNet will not be able to find the tool binary, but you can help it with changing the lauchctl configuration: https://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks (or just run Blender from terminal to save some hair till v0.4 of BlendNet will come out).
You will need to enable the Compute API in Cloud Console -
just go into Navigation Menu --> Compute Engine --> VM Instances
and wait until the page will
notify you that the operation is completed (should take ~2 mins).
Now gcloud is ok and BlendNet should be able to perform the first render with GCP provider. Default parameters allows to run 1 Manager (1CPU) and 3 Agents (2CPU each) - just about the limit Google gives you by default.
In case you need more - you can go to BlendNet addon settings, check the quotas info and maybe some warnings if the quotas is not good. And you can go to quotas page and request the quotas to be increased (and probably had a conversation with sales about that).
-
Let's go and check what you should see in the BlendNet addon preferences now:
-
The settings by default should be good enough for the first run.
-
Close the preferences and switch to your Scene
Render Properties
tab. Make sureCycles
is choosen as the Render Engine. If everything is setup properly - you will see the next pic: -
First of all you will need to start the Manager by pressing
+
button on theManager
panel, that will allocate the instance in GCP cloud (statusStarted
- it takes time to setup & run the service) and when the Addon will be able to connect to the Manager - it will change status toActive
, so you can see it's its info: -
If you see that - it's time to open your project and click
Run Image Task
to get the results of your hard work (please check the general practices on the First steps page to get how to do that).
- Command
gcloud init
will allow to initialize the configuration the first time - Command
gcloud compute regions list
will show the available regions - Command
gcloud config set compute/region us-central1
will set the region to "us-central1" - Command
gcloud compute zones list
will show the available regions - Command
gcloud config set compute/zone us-central1-f
will set the zone to "us-central1-f" - Command
gcloud info
should print out where SDK is installed - Command
gcloud auth list
should show the currently selected account - Command
gcloud compute instances create test-instance
should actually create a new instance (you can check that using google cloud web console at https://console.cloud.google.com/compute/instances) - Command
gcloud compute instances delete test-instance
should actually delete the instance - Command
gsutil mb gs://test-bucket-jsfkhbqfhbqw
should create a test bucket - Command
gsutil rm -r gs://test-bucket-jsfkhbqfhbqw
should clean and delete the test bucket