Skip to content

Commit

Permalink
Add finagle demo to pixie cli
Browse files Browse the repository at this point in the history
Summary:
Adds a finagle demo to the pixie cli. I thought this would be a good addition especially with the eBPF talk later this month.

As part of Twitter's hackathon week, we created sedarG/finagle-helloworld to demonstrate Pixie's mux protocol tracing. I've modified that repo to match the same setup as the pixie-labs/microservice-kafka repo (using kompose, kustomize, etc).

Test Plan:
docker-compose example works locally
Verify that the client and server work on minikube

Reviewers: vihang

Reviewed By: vihang

Signed-off-by: Dom Del Nano <ddelnano@twitter.com>

Differential Revision: https://phab.corp.pixielabs.ai/D12353

GitOrigin-RevId: ea4582bf4bf7b63f054967f9f3afbd041b35abf7
  • Loading branch information
Dom Del Nano authored and copybaranaut committed Oct 6, 2022
1 parent 39aa963 commit a11e107
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 1 deletion.
8 changes: 8 additions & 0 deletions demos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("@px//demos:demo_upload.bzl", "demo_upload")

pkg_tar(
name = "px-finagle",
srcs = glob(["finagle/*"]),
extension = "tar.gz",
strip_prefix = "finagle",
)

pkg_tar(
name = "px-kafka",
srcs = glob(["kafka/*"]),
Expand All @@ -39,6 +46,7 @@ pkg_tar(
)

ARCHIVES = [
":px-finagle",
":px-kafka",
":px-sock-shop",
":px-online-boutique",
Expand Down
17 changes: 16 additions & 1 deletion demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bazel run //demos:upload_prod_demo

1. Clone `https://github.com/pixie-io/microservice-kafka` and switch to the `pixie` branch.

2. (optional) Build the container images & update the individual yaml files.
2. (optional) Build the container image & update the individual yaml files.

3. Build a single yaml file for the demo:

Expand All @@ -41,6 +41,21 @@ kustomize build . > kafka.yaml

4. Copy the yaml file to `pixie/demos/kafka`.

## Updating the `px-finagle` demo

1. Clone `https://github.com/pixie-io/finagle-helloworld`

2. (optional) Build the container images & update the individual yaml files.

3. Build a single yaml file for the demo:

```
kustomize . > finagle.yaml
```

4. Copy the yaml file to `pixie/demos/finagle`.


## Updating the `px-online-boutique` demo

Our custom `adservice` image includes the `-XX:+PreserveFramePointer` Java option. To build our custom `adservice` image:
Expand Down
27 changes: 27 additions & 0 deletions demos/finagle/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This code is originally from: https://github.com/SedarG/finagle-helloworld.
Copyright is held by original copyright owners.

Original License Noted Below.
----------------------------------------------------------------------------------------

MIT License

Copyright (c) 2022 Sedar Gokbulut

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
95 changes: 95 additions & 0 deletions demos/finagle/finagle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
apiVersion: v1
kind: Namespace
metadata:
name: px-finagle
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -f ../docker/docker-compose.yml
kompose.version: 1.26.1 (a9d05d509)
creationTimestamp: null
labels:
io.kompose.service: finagle-server
name: finagle-server
namespace: px-finagle
spec:
ports:
- name: "9992"
port: 9992
targetPort: 9992
selector:
io.kompose.service: finagle-server
status:
loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -f ../docker/docker-compose.yml
kompose.version: 1.26.1 (a9d05d509)
creationTimestamp: null
labels:
io.kompose.service: finagle-client
name: finagle-client
namespace: px-finagle
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: finagle-client
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert -f ../docker/docker-compose.yml
kompose.version: 1.26.1 (a9d05d509)
creationTimestamp: null
labels:
io.kompose.service: finagle-client
spec:
containers:
- args:
- client/run
image: gcr.io/pixie-prod/demos/finagle/hello:1.0
name: finagle-client
resources: {}
restartPolicy: Always
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -f ../docker/docker-compose.yml
kompose.version: 1.26.1 (a9d05d509)
creationTimestamp: null
labels:
io.kompose.service: finagle-server
name: finagle-server
namespace: px-finagle
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: finagle-server
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert -f ../docker/docker-compose.yml
kompose.version: 1.26.1 (a9d05d509)
creationTimestamp: null
labels:
io.kompose.service: finagle-server
spec:
containers:
- image: gcr.io/pixie-prod/demos/finagle/hello:1.0
name: finagle-server
ports:
- containerPort: 9992
resources: {}
restartPolicy: Always
status: {}
8 changes: 8 additions & 0 deletions demos/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,13 @@
"To turn off the invoicing delay, run:",
" kubectl exec -n px-kafka $INVC_POD -c invoicing -- kill -USR2 $INVC_PID"
]
},
"px-finagle": {
"description": "Microservice demo that generates thriftmux traffic with finagle.",
"instructions": [
"Use the px/mux_data script to view the traffic that is continuously generated.",
"Mux tracing is only enabled on newer kernels (>= 5.2) by default.",
"Make sure your system meets these requirements before deploying."
]
}
}

0 comments on commit a11e107

Please sign in to comment.