"As our work with GCP scaled, we started looking for ways to streamline our projects, Thanks to Cloud Resource Manager, we now centrally control and monitor how resources are created and billed in our domain. We use IAM and Folders to provide our departments with the autonomy and velocity they need, without losing visibility into resource access and usage. This has significantly reduced our management overhead, and had a direct positive effect on our ability to support our customers at scale.” — Marcin Kołda, Senior Software Engineer at Ocado Technology.
# Find your Organization ID me@cloudshell:~$ gcloud organizations list DISPLAY_NAME ID DIRECTORY_CUSTOMER_ID myorganization.com 358981462196 C03ryezon # Create first level folder “Engineering” under the Organization node me@cloudshell:~$ gcloud alpha resource-manager folders create --display-name=Engineering --organization=358981462196 Waiting for [operations/fc.2201898884439886347] to finish...done. Created [<Folder createTime: u'2017-04-16T22:49:10.144Z' displayName: u'Engineering' lifecycleState: LifecycleStateValueValuesEnum(ACTIVE, 1) name: u'folders/1000107035726' parent: u'organizations/358981462196'>]. # Add a Folder Admin role to the “Engineering” folder me@cloudshell:~$ gcloud alpha resource-manager folders add-iam-policy-binding 1000107035726 --member=user:bob@myorganizayion.com --role=roles/resourcemanager.folderAdmin bindings: - members: - user:bob@myorganization.com - user:admin@myorganization.com role: roles/resourcemanager.folderAdmin - members: - user:alice@myorganization.com role: roles/resourcemanager.folderEditor etag: BwVNX61mPnc= # Check the IAM policy set on the “Engineering” folder me@cloudshell:~$ gcloud alpha resource-manager folders get-iam-policy 1000107035726 bindings: - members: - user:bob@myorganization.com - user:admin@myorganization.com role: roles/resourcemanager.folderAdmin - members: - user:alice@myorganization.com role: roles/resourcemanager.folderEditor etag: BwVNX61mPnc= # Create second level folder “Product_A” under folder “Engineering” me@cloudshell:~$ gcloud alpha resource-manager folders create --display-name=Product_A --folder=1000107035726 Waiting for [operations/fc.2194220672620579778] to finish...done. Created []. # Crate third level folder “Development” under folder “Product_A” me@cloudshell:~$ gcloud alpha resource-manager folders create --display-name=Development --folder=1000107035726 Waiting for [operations/fc.3497651884412259206] to finish...done. Created []. # List all the folders under the Organization me@cloudshell:~$ gcloud alpha resource-manager folders list --organization=358981462196 DISPLAY_NAME PARENT_NAME ID IT organizations/358981462196 575615098945 Engineering organizations/358981462196 661646869517 Operations organizations/358981462196 895951706304 # List all the folders under the “Engineering” folder me@cloudshell:~$ gcloud alpha resource-manager folders list --folder=1000107035726 DISPLAY_NAME PARENT_NAME ID Product_A folders/1000107035726 732853632103 Product_B folders/1000107035726 941564020040 # Create a new project in folder “Product_A” me@cloudshell:~$ gcloud alpha projects create my-awesome-service-2 --folder 732853632103 Create in progress for [https://cloudresourcemanager.googleapis.com/v1/projects/my-awesome-service-3].Waiting for [operations/pc.2821699584791562398] to finish...done. # List projects under folder “Production” me@cloudshell:~$ gcloud alpha projects list --filter 'parent.id=725271112613' PROJECT_ID NAME PROJECT_NUMBER my-awesome-service-1 my-awesome-service-1 869942226409 my-awesome-service-2 my-awesome-service-2 177629658252
"Recently we used the 64 vCPU instances during the building of both our global composite imagery layers and GeoVisual Search. In both cases, our parallel processing jobs needed tens of thousands of CPU hours to complete the task. The new 64 vCPU instances allow us to work across more satellite imagery scenes simultaneously on a single instance, dramatically speeding up our total processing times."
"We are a latency-sensitive business and the addition of the Northern Virginia region will allow us to expand our coverage area and reduce latency to our current users. This will also allow us to significantly increase the capability of our Data Lake platform, which we are looking at as a competitive advantage" — Linh Chung, CIO at Viant, a Time Inc. Company
“We are leveraging Google Cloud to deliver the experiences our customers demand, and we want to make sure that all our workloads can take advantage of Google Cloud’s unique infrastructure and services. Using the free Google Cloud migration tools, we’ve been able to easily move our Windows servers to Google Cloud with near-zero downtime.” — Rob Wilson, CTO at Smyths Toys
npm install --save @google-cloud/storage
const Storage = require('@google-cloud/storage'); // Instantiates a client const storage = Storage(); // References an existing bucket, e.g. “my-bucket” const bucket = storage.bucket(bucketName); // Upload a local file to the bucket, e.g. “./local/path/to/file.txt” return bucket.upload(fileName) .then((results) => { const file = results[0]; console.log(`File ${file.name} uploaded`); });
<dependency> <groupid>com.google.cloud</groupid> <artifactid>google-cloud-datastore</artifactid> <version>1.0.0</version> </dependency>
// Imports the Google Cloud Client Library import com.google.cloud.datastore.Datastore; import com.google.cloud.datastore.DatastoreOptions; import com.google.cloud.datastore.Entity; import com.google.cloud.datastore.Key; public class QuickstartSample { public static void main(String... args) throws Exception { // Instantiates a client Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); // The kind for the new entity String kind = "Task"; // The name/ID for the new entity String name = "sampletask1"; // The Cloud Datastore key for the new entity Key taskKey = datastore.newKeyFactory().setKind(kind).newKey(name); // Prepares the new entity Entity task = Entity.newBuilder(taskKey) .set("description", "Buy milk") .build(); // Saves the entity datastore.put(task); } }
pip install --upgrade google-cloud-logging
import logging import google.cloud.logging client = google.cloud.logging.Client() # Attaches a Google Stackdriver logging handler to the root logger client.setup_logging(logging.INFO)
import logging logging.error('This is an error')
Starting server on port 8080 Server started!
Sending request Received response: Hello there, Mete
ChatServerImpl.java
StreamObserver
ChatServerImpl.cs
FROM busybox COPY ./lots-of-data /data RUN rm -rf /data CMD ["/bin/sh"]
FROM java:8 COPY . workdir/ WORKDIR workdir RUN GRADLE_USER_HOME=cache ./gradlew buildDeb -x test RUN dpkg -i ./gate-web/build/distributions/*.deb CMD ["/opt/gate/bin/gate"]
FROM java:8 COPY . workdir/ WORKDIR workdir RUN GRADLE_USER_HOME=cache ./gradlew buildDeb -x test && \ dpkg -i ./gate-web/build/distributions/*.deb && \ cd .. && \ rm -rf workdir CMD ["/opt/gate/bin/gate"]
steps: - name: 'java:8' env: ['GRADLE_USER_HOME=cache'] entrypoint: 'bash' args: ['-c', './gradlew gate-web:installDist -x test'] - name: 'gcr.io/cloud-builders/docker' args: ['build', '-t', 'gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA', '-t', 'gcr.io/$PROJECT_ID/$REPO_NAME:latest', '-f', 'Dockerfile.slim', '.'] images: - 'gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA' - 'gcr.io/$PROJECT_ID/$REPO_NAME:latest'
- name: 'java:8' env: ['GRADLE_USER_HOME=cache'] entrypoint: 'bash' args: ['-c', './gradlew gate-web:installDist -x test']
- name: 'gcr.io/cloud-builders/docker' args: ['build', '-t', 'gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA', '-t', 'gcr.io/$PROJECT_ID/$REPO_NAME:latest', '-f', 'Dockerfile.slim', '.']
FROM openjdk:8u111-jre-alpine COPY ./gate-web/build/install/gate /opt/gate RUN apk --nocache add --update bash CMD ["/opt/gate/bin/gate"]
images: - 'gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA' - 'gcr.io/$PROJECT_ID/$REPO_NAME:latest'
Demonstrate your proficiency to design, build and manage solutions on Google Cloud Platform.