Skip to content

Commit

Permalink
Merge pull request #1 from GoogleCloudPlatform/master
Browse files Browse the repository at this point in the history
Sync with original master
  • Loading branch information
ktchana committed Jul 6, 2021
2 parents 1d78d03 + 4f13006 commit f608113
Show file tree
Hide file tree
Showing 209 changed files with 9,581 additions and 4,028 deletions.
2 changes: 1 addition & 1 deletion archived/dotnet-mvms-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ date_published: 2019-03-22
<walkthrough-alt>
Take the interactive version of this tutorial, which runs in the Cloud Console:

[![Open in Cloud Console](https://walkthroughs.googleusercontent.com/tutorial/resources/open-in-console-button.svg)](https://console.cloud.google.com/getting-started?walkthrough_tutorial_id=dotnet_mvms_quickstart)
[![Open in Cloud Console](https://walkthroughs.googleusercontent.com/tutorial/resources/open-in-console-button.svg)](https://console.cloud.google.com/getting-started?tutorial=dotnet_mvms_quickstart)

</walkthrough-alt>

Expand Down
12 changes: 6 additions & 6 deletions archived/express-memcached-session-appengine/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ diff@1.4.0:
resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf"

dns-packet@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.1.1.tgz#2369d45038af045f3898e6fa56862aed3f40296c"
version "1.3.4"
resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f"
dependencies:
ip "^1.1.0"
safe-buffer "^5.0.1"
Expand Down Expand Up @@ -339,8 +339,8 @@ inherits@2.0.1:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"

ip@^1.1.0:
version "1.1.4"
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.4.tgz#de8247ffef940451832550fba284945e6e039bfb"
version "1.1.5"
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a"

ipaddr.js@1.2.0:
version "1.2.0"
Expand Down Expand Up @@ -595,8 +595,8 @@ resolve@~1.1.7:
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"

safe-buffer@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7"
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"

samsam@1.1.2, samsam@~1.1:
version "1.1.2"
Expand Down
2 changes: 1 addition & 1 deletion archived/go-gae-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ date_published: 2019-01-19
<walkthrough-alt>
Take the interactive version of this tutorial, which runs in the Cloud Console:

[![Open in Cloud Console](https://walkthroughs.googleusercontent.com/tutorial/resources/open-in-console-button.svg)](https://console.cloud.google.com/getting-started?walkthrough_tutorial_id=go_gae_quickstart)
[![Open in Cloud Console](https://walkthroughs.googleusercontent.com/tutorial/resources/open-in-console-button.svg)](https://console.cloud.google.com/getting-started?tutorial=go_gae_quickstart)

</walkthrough-alt>

Expand Down
50 changes: 48 additions & 2 deletions tutorials/appengine-ruby-rails-activejob-sidekiq.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,54 @@ instances together.

Replace `[REDIS_IP_ADDRESS]` and `[PASSWORD]` with the internal IP address of your Redis instance and its required password that you gave it,
respectively. Replace `[SECRET_KEY]` with a secret key for Rails sessions.

#### Sidekiq initializer file

1. Deploy to App Engine
If your application uses [Rails secret credentials](https://guides.rubyonrails.org/security.html#custom-credentials), then you can omit the `env_variable` field
in your `app.yaml` file, and instead supply the variables with the `credentials.enc.yml` file in an initializer.

1. Open the `credentials.enc.yml` file for editing:

rails credentials:edit

This takes your `master.key`, decodes the file, and opens it in your default text editor for you to edit.

1. Add the following entries:

redis_url: redis://[REDIS_IP_ADDRESS]:6379
redis_password: [PASSWORD]

1. Save the file.

It is re-encoded with your two new entries.

1. Create a new file called `sidekiq.rb` in `config/initializers/`, with the following content:

Sidekiq.configure_server do |config|
if Rails.env.production?
config.redis = {
url: Rails.application.credentials.redis_url,
password: Rails.application.credentials.redis_password
}
else
config.redis = { url: 'redis://localhost:6379/1' }
end
end

Sidekiq.configure_client do |config|
if Rails.env.production?
config.redis = {
url: Rails.application.credentials.redis_url,
password: Rails.application.credentials.redis_password
}
else
config.redis = { url: 'redis://localhost:6379/1' }
end
end

This ensures that Redis will seek the `localhost` port that Redis is using when you're testing locally in a development environment.

1. Deploy to App Engine:

gcloud app deploy app.yaml

Expand Down Expand Up @@ -258,7 +304,7 @@ request with a `200` HTTP status code.
If you choose an `automatic_scaling` option, be aware that scaling for the background processing is based off
of CPU utilization, not queue size.

1. Deploy both services to App Engine
1. Deploy both services to App Engine:

gcloud app deploy app.yaml worker.yaml

Expand Down
2 changes: 1 addition & 1 deletion tutorials/bigquery-from-excel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ instructions are also available in the

### Finish configuring the driver

1. Choose the [Google Cloud project ID](https://support.google.com/cloud/answer/6158840?hl=en) to use as the
1. Choose the [Google Cloud project ID](https://support.google.com/cloud/answer/6158840) to use as the
billing project for queries by clicking the arrow on the **Catalog (project)** selection box.

![Choose a billing project](https://storage.googleapis.com/gcp-community/tutorials/bigquery-from-excel/billing-project.png)
Expand Down
3 changes: 2 additions & 1 deletion tutorials/bigtable-memcached.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ configuration.

## Optionally connect to Memcached via Telnet

The [Memorystore for Memcached documentation](https://cloud.google.com/memorystore/docs/memcached/connecting-memcached-instance?hl=en_US) contains more information about this process, but you can just run the commands below to set and get a value in the cache:
The [Memorystore for Memcached documentation](https://cloud.google.com/memorystore/docs/memcached/connecting-memcached-instance) contains more information about
this process, but you can just run the commands below to set and get a value in the cache:

sudo apt-get install telnet
telnet $DISCOVERY_ENDPOINT_ID 11211
Expand Down
16 changes: 9 additions & 7 deletions tutorials/bigtable-oc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Drew Stevens | Solutions Architect | Google
<p style="background-color:#CAFACA;"><i>Contributed by Google employees.</i></p>

This tutorial shows how to implement client-side tracing and metrics recording in your Bigtable
workloads using OpenCensus and Cloud Trace. While Bigtable surfaces a number of helpful server-side
workloads using OpenCensus and Cloud Trace. Though Bigtable surfaces a number of helpful server-side
metrics through the Google Cloud operations suite, applications can realize added benefits by implementing client-side tracing and
application defined metrics. For example, server-side metrics do not give you a window into the round-trip
latency of calls made to your Bigtable endpoint and can only be surfaced using client-side tracing.
application-defined metrics. For example, server-side metrics do not give you information about the round-trip
latency of calls made to your Bigtable endpoint; this can only be seen using client-side tracing.

## Costs

Expand All @@ -29,7 +29,7 @@ estimate based on your projected usage.

New Google Cloud users might be eligible for a [free trial](https://cloud.google.com/free/).

We recommend that you deploy this tutorial into an ephemeral project, which can then be deleted once you’re done.
We recommend that you deploy this tutorial into an ephemeral project, which can then be deleted after you’re done.

## Before you begin

Expand Down Expand Up @@ -79,9 +79,9 @@ Create a Compute Engine VM with the necessary security scopes by running the fol

gcloud compute ssh trace-client --zone=us-central1-c
1. Run the following command to install Git, the Java 8 JDK, and Maven:
1. Run the following command to install Git, the Java 11 JDK, and Maven:

sudo apt-get install git openjdk-8-jdk maven -y
sudo apt-get install git openjdk-11-jdk maven -y

1. Clone the source repository for this tutorial:

Expand Down Expand Up @@ -133,11 +133,13 @@ occurred outside of the manually defined tracing scope, so these are included as

1. In the **Find resource type and metric** field, enter the following:

gce_instance

opencensus/btappmetrics/write_latency

1. Select this metric from the list.

1. In the right pane, the distribution heatmap graph is shown.
1. In the right pane, select **Heatmap** from the dropdown list, which shows the distribution heatmap graph:

![](https://storage.googleapis.com/gcp-community/tutorials/bigtable-oc/metrics-heatmap.png)

Expand Down
151 changes: 116 additions & 35 deletions tutorials/bigtable-oc/java/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example.bigtable</groupId>
Expand All @@ -11,20 +12,19 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>

<google-auth-library-oauth2-http.version>0.15.0</google-auth-library-oauth2-http.version>
<gax.version>1.43.0</gax.version>
<opencensus.version>0.19.2</opencensus.version>
<bigtable.version>1.10.0</bigtable.version>
<jetty.version>9.4.41.v20210516</jetty.version>
<opencensus.version>0.28.3</opencensus.version>
<grpc.version>1.34.1</grpc.version>
<bigtable.version>1.22.0</bigtable.version>
</properties>


<build>

<plugins>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -34,8 +34,6 @@
<target>1.8</target>
</configuration>
</plugin>


</plugins>

<pluginManagement>
Expand All @@ -55,21 +53,21 @@
<dependencies>

<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>${google-auth-library-oauth2-http.version}</version>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>${gax.version}</version>
</dependency>

<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>${gax.version}</version>
</dependency>

<dependency>
<groupId>com.google.cloud.bigtable</groupId>
<artifactId>bigtable-hbase-1.x</artifactId>
<version>${bigtable.version}</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -79,38 +77,121 @@
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-impl</artifactId>
<artifactId>opencensus-contrib-grpc-metrics</artifactId>
<version>${opencensus.version}</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-http-util</artifactId>
<version>${opencensus.version}</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-http-jetty-client</artifactId>
<version>${opencensus.version}</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-http-servlet</artifactId>
<version>${opencensus.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-exporter-stats-stackdriver</artifactId>
<version>${opencensus.version}</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-exporter-trace-stackdriver</artifactId>
<version>${opencensus.version}</version>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.26</version>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-census</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>0.6.0</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-impl</artifactId>
<version>${opencensus.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>2.0.8.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.26</version>
</dependency>

</dependencies>

</project>
Loading

0 comments on commit f608113

Please sign in to comment.