better debugger integration
This commit is contained in:
parent
ca5d8155c4
commit
f82ac40dd0
6 changed files with 35 additions and 20 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ pkg/
|
||||||
.idea
|
.idea
|
||||||
.skaffold-*.yaml
|
.skaffold-*.yaml
|
||||||
.kubernetes-manifests-*/
|
.kubernetes-manifests-*/
|
||||||
|
**/source-context.json
|
||||||
|
|
12
README.md
12
README.md
|
@ -111,10 +111,9 @@ Find **Protocol Buffers Descriptions** at the [`./pb` directory](./pb).
|
||||||
|
|
||||||
gcloud auth configure-docker -q
|
gcloud auth configure-docker -q
|
||||||
|
|
||||||
4. (OPTIONAL) Allow GCP to access source code via Github. This step is necessary
|
4. (OPTIONAL) Run `./gen-debug-source-code.sh` if you want to use debugger.
|
||||||
if you are using Stackdriver Debugger.
|
This script will generate the source context for the project and populate
|
||||||
|
it to the root directory of all service modules.
|
||||||
gcloud debug source gen-repo-info-file --output-directory=./src/
|
|
||||||
|
|
||||||
5. Set your project ID on image names:
|
5. Set your project ID on image names:
|
||||||
|
|
||||||
|
@ -126,14 +125,13 @@ Find **Protocol Buffers Descriptions** at the [`./pb` directory](./pb).
|
||||||
`image:` fields with `gcr.io/[...]` and change them to your own GCP project
|
`image:` fields with `gcr.io/[...]` and change them to your own GCP project
|
||||||
ID.
|
ID.
|
||||||
|
|
||||||
6. Run `./deploy.sh` from the root of this repository. This script:
|
6. Run `skaffold run` from the root of this repository. This script:
|
||||||
- generates source context for cloud debugger
|
|
||||||
- builds the container images
|
- builds the container images
|
||||||
- pushes them to GCR
|
- pushes them to GCR
|
||||||
- applies the `./kubernetes-manifests` deploying the application to
|
- applies the `./kubernetes-manifests` deploying the application to
|
||||||
Kubernetes.
|
Kubernetes.
|
||||||
|
|
||||||
7. Find the IP address of your application, then visit the application on your
|
7. Find the IP address of your application, then visit the application on your
|
||||||
browser to confirm installation.
|
browser to confirm installation.
|
||||||
|
|
||||||
kubectl get service frontend-external
|
kubectl get service frontend-external
|
||||||
|
|
10
depoly.sh
10
depoly.sh
|
@ -1,10 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Fist generate code context for the cloud debugger
|
|
||||||
gcloud debug source gen-repo-info-file
|
|
||||||
for module in src/*; do
|
|
||||||
cp source-context.json "$module"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Now deploy on GKE
|
|
||||||
skaffold run
|
|
26
gen-debug-source-code.sh
Executable file
26
gen-debug-source-code.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Copyright 2018 Google LLC
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
# This script generates code context for the cloud debugger agents
|
||||||
|
# and populate it to the root directory of each service module.
|
||||||
|
# This step is necessary if you want to try Cloud Debugger. Otherwise,
|
||||||
|
# you can simply ignore it.
|
||||||
|
|
||||||
|
gcloud debug source gen-repo-info-file
|
||||||
|
for MODULE in $(find ./src -maxdepth 1 -mindepth 1 -type d); do
|
||||||
|
cp source-context.json "$MODULE"
|
||||||
|
done
|
|
@ -26,7 +26,8 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /cartservice .
|
COPY --from=builder /cartservice .
|
||||||
COPY ./source-context.json /usr/share/dotnet-debugger/agent
|
|
||||||
|
COPY Dockerfile ./source-context.json* /usr/share/dotnet-debugger/agent/
|
||||||
|
|
||||||
ENV STACKDRIVER_DEBUGGER_MODULE=cartservice
|
ENV STACKDRIVER_DEBUGGER_MODULE=cartservice
|
||||||
ENV STACKDRIVER_DEBUGGER_VERSION=1.0.0
|
ENV STACKDRIVER_DEBUGGER_VERSION=1.0.0
|
||||||
|
|
|
@ -27,8 +27,7 @@ RUN wget -O go-cloud-debug https://storage.googleapis.com/cloud-debugger/compute
|
||||||
&& chmod 0755 go-cloud-debug
|
&& chmod 0755 go-cloud-debug
|
||||||
|
|
||||||
COPY --from=builder /productcatalogservice ./server
|
COPY --from=builder /productcatalogservice ./server
|
||||||
COPY products.json .
|
COPY products.json source-context.json* ./
|
||||||
COPY source-context.json .
|
|
||||||
|
|
||||||
EXPOSE 3550
|
EXPOSE 3550
|
||||||
ENTRYPOINT ["./go-cloud-debug", "-sourcecontext=source-context.json", \
|
ENTRYPOINT ["./go-cloud-debug", "-sourcecontext=source-context.json", \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue