This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import google.auth | |
| import google.auth.transport.requests | |
| import requests | |
| import google.oauth2.id_token | |
| auth_req = google.auth.transport.requests.Request() | |
| # Get GCP Id Token, with an audience of 'gcp-aws-access' | |
| credentials = google.oauth2.id_token.fetch_id_token_credentials('gcp-aws-access', request=auth_req) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void upload() { | |
| byte[] buffer = new byte[4096]; | |
| BlobInfo build = BlobInfo.newBuilder("some-bucket", "samplefile1.txt").build(); | |
| Field uploadIdField = BaseWriteChannel.class.getDeclaredField("uploadId"); | |
| ReflectionUtils.makeAccessible(uploadIdField); | |
| try (WriteChannel writer = storage.writer(build)) { | |
| String uploadId = (String) ReflectionUtils.getField(uploadIdField, writer); | |
| String changedHostUploadId = changeHost(uploadId, "myinternalhost.test.com"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.bk.gcs; | |
| import com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem; | |
| import org.apache.hadoop.conf.Configuration; | |
| import org.apache.hadoop.fs.FSDataOutputStream; | |
| import org.apache.hadoop.fs.Path; | |
| import org.junit.jupiter.api.Test; | |
| import java.net.URI; | |
| import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.cloud.bigtable.data.v2.BigtableDataClient; | |
| import com.google.cloud.bigtable.data.v2.BigtableDataSettings; | |
| import com.google.cloud.bigtable.data.v2.models.Mutation; | |
| import com.google.cloud.bigtable.data.v2.models.Row; | |
| import com.google.cloud.bigtable.data.v2.models.RowCell; | |
| import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: deploy.cloud.google.com/v1 | |
| kind: DeliveryPipeline | |
| metadata: | |
| name: clouddeploy-cloudrun-sample | |
| description: Delivery Pipeline for a sample java app | |
| serialPipeline: | |
| stages: | |
| - targetId: dev | |
| profiles: [dev] | |
| - targetId: prod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: deploy.cloud.google.com/v1 | |
| --- | |
| kind: Target | |
| metadata: | |
| name: dev | |
| description: Cloud Run Dev environment | |
| run: | |
| location: projects/sampleproject/locations/us-west1 | |
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: skaffold/v3alpha1 | |
| kind: Config | |
| metadata: | |
| name: clouddeploy-cloudrun-skaffold | |
| manifests: | |
| kustomize: | |
| paths: | |
| - manifests/base | |
| build: | |
| artifacts: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namePrefix: dev- | |
| resources: | |
| - ../../base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: serving.knative.dev/v1 | |
| kind: Service | |
| metadata: | |
| name: cloudrun-sample | |
| spec: | |
| template: | |
| spec: | |
| containers: | |
| - image: clouddeploy-cloudrun-app-image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: hello-skaffold-gke-deployment | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: hello-skaffold-gke | |
| template: |
NewerOlder