Skip to content

Commit

Permalink
Update and baclkports
Browse files Browse the repository at this point in the history
* add fortio and grpcurl from upstream
* update to alpine 3.18
* version bumps
  • Loading branch information
mindw committed May 29, 2023
1 parent 9b8af44 commit e28ff38
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 8 deletions.
32 changes: 24 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG ALPINE_VERSION=3.17
FROM python:3.10.10-alpine${ALPINE_VERSION} as builder
ARG ALPINE_VERSION=3.18
FROM python:3.11.3-alpine${ALPINE_VERSION} as builder

ARG AWS_CLI_VERSION=2.9.23
ARG AWS_CLI_VERSION=2.11.23
RUN apk add --no-cache git unzip groff build-base libffi-dev cmake
RUN git clone --single-branch --depth 1 -b ${AWS_CLI_VERSION} https://github.com/aws/aws-cli.git

Expand All @@ -25,7 +25,7 @@ RUN set -ex; \
echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories; \
echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories; \
apk -U upgrade; \
apk add -u --no-cache \
apk add -u --no-cache !pyc\
7zip \
apache2-utils \
atop \
Expand Down Expand Up @@ -127,7 +127,7 @@ SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
COPY --from=builder /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=builder /aws-cli-bin/ /usr/local/bin/

# let's isntall httpie, yq and awscli v1, v2 can't be easily installed in Alpine
# let's install httpie, httpx, ipython and jc
RUN pip3 install --upgrade --no-cache-dir httpie httpx[cli,brotli,http2,socks] ipython jc

# Installing ctop - top-like container monitor
Expand All @@ -137,13 +137,13 @@ RUN \
chmod +x /usr/local/bin/ctop

# Installing calicoctl
ARG CALICOCTL_VERSION=v3.25.0
ARG CALICOCTL_VERSION=v3.26.0
RUN \
wget -q https://github.com/projectcalico/calico/releases/download/${CALICOCTL_VERSION}/calicoctl-linux-amd64 -O /usr/local/bin/calicoctl; \
chmod +x /usr/local/bin/calicoctl

# Installing kubectl
ARG KUBECTL_VERSION=v1.26.1
ARG KUBECTL_VERSION=v1.27.2
RUN \
wget -q https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl; \
chmod +x /usr/local/bin/kubectl
Expand All @@ -156,13 +156,29 @@ RUN \
kubectl krew install cert-manager ctx explore get-all oidc-login node-shell ns relay resource-capacity sniff topology

# Installing K9s
ARG K9S_VERSION=v0.27.3
ARG K9S_VERSION=v0.27.4
RUN \
curl --fail --silent -L https://github.com/derailed/k9s/releases/download/${K9S_VERSION}/k9s_Linux_amd64.tar.gz | \
tar zx k9s; \
chmod +x k9s; \
mv k9s /usr/local/bin

# Installing grpcurl
ARG GRPCURL_VERSION=1.8.7
RUN \
curl --fail --silent -L https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_linux_x86_64.tar.gz | \
tar zx grpcurl; \
chmod +x grpcurl; \
mv grpcurl /usr/local/bin

# Installing Fortio
ARG FORTIO_VERSION=1.54.3
RUN \
curl --fail --silent -L "https://github.com/fortio/fortio/releases/download/v${FORTIO_VERSION}/fortio-linux_amd64-${FORTIO_VERSION}.tgz" | \
tar zx --strip-components=2 usr/bin/fortio; \
chmod +x fortio; \
mv fortio /usr/local/bin

# kubectl aliases
RUN \
curl --fail --silent --location https://rawgit.com/ahmetb/kubectl-alias/master/.kubectl_aliases -o "$HOME/.kubectl_aliases"
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ some with some sample use-cases.
- ethtool: Utility for controlling network drivers and hardware
- fatrace: Report system wide file access events
- fio: Flexible I/O Tester
- fortio: A load testing library, command line tool, advanced echo server and web UI.
- fping: A utility to ping multiple hosts at once
- hping3: A ping-like TCP/IP packet assembler/analyzer
- htop: Interactive process viewer
Expand Down Expand Up @@ -162,6 +163,7 @@ some with some sample use-cases.
- aws-cli2: Universal Command Line Interface for Amazon Web Services
- curl: URL retrieval utility and library
- ca-certificates: Common CA certificates PEM files from Mozilla
- grpcurl: Like cURL, but for gRPC - Command-line tool for interacting with gRPC servers.
- httpie: human-friendly CLI HTTP client for the API era
- httpx: a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2.
- openssh: Port of OpenBSD's free SSH release
Expand Down Expand Up @@ -454,6 +456,7 @@ srvc.2.vu47gf0sdmje@moby | Listener started on port 5000
🐳 → sudo tcpdump -vvvn -i eth0 port 5000
...
```

## iproute2
purpose: a collection of utilities for controlling TCP / IP networking and traffic
control in Linux.
Expand Down Expand Up @@ -724,6 +727,49 @@ swaks --to [email protected] \

More info, examples and lots of documentation on `Swaks` [here](http://www.jetmore.org/john/code/swaks/)

## Grpcurl
grpcurl is a command-line tool that lets you interact with gRPC servers. It's basically curl for gRPC servers.
Invoking an RPC on a trusted server (e.g. TLS without self-signed key or custom CA) that requires no client certs and supports server reflection is the simplest thing to do with grpcurl. This minimal invocation sends an empty request body:
```bash
grpcurl grpc.server.com:443 my.custom.server.Service/Method
# no TLS
grpcurl -plaintext grpc.server.com:80 my.custom.server.Service/Method
```

More info, examples and lots of documentation on `Grpcurl` [here](https://github.com/fullstorydev/grpcurl)

## Fortio
Fortio is a fast, small (4Mb docker image, minimal dependencies), reusable, embeddable go library as well as a command line tool and server process, the server includes a simple web UI and REST API to trigger run and see graphical representation of the results (both a single latency graph and a multiple results comparative min, max, avg, qps and percentiles graphs).

```bash
$ fortio load http://www.google.com
Fortio X.Y.Z running at 8 queries per second, 8->8 procs, for 5s: http://www.google.com
19:10:33 I httprunner.go:84> Starting http test for http://www.google.com with 4 threads at 8.0 qps
Starting at 8 qps with 4 thread(s) [gomax 8] for 5s : 10 calls each (total 40)
19:10:39 I periodic.go:314> T002 ended after 5.056753279s : 10 calls. qps=1.9775534712220633
19:10:39 I periodic.go:314> T001 ended after 5.058085991s : 10 calls. qps=1.9770324224999916
19:10:39 I periodic.go:314> T000 ended after 5.058796046s : 10 calls. qps=1.9767549252963101
19:10:39 I periodic.go:314> T003 ended after 5.059557593s : 10 calls. qps=1.9764573910247019
Ended after 5.059691387s : 40 calls. qps=7.9056
Sleep times : count 36 avg 0.49175757 +/- 0.007217 min 0.463508712 max 0.502087879 sum 17.7032725
Aggregated Function Time : count 40 avg 0.060587641 +/- 0.006564 min 0.052549016 max 0.089893269 sum 2.42350566
# range, mid point, percentile, count
>= 0.052549 < 0.06 , 0.0562745 , 47.50, 19
>= 0.06 < 0.07 , 0.065 , 92.50, 18
>= 0.07 < 0.08 , 0.075 , 97.50, 2
>= 0.08 <= 0.0898933 , 0.0849466 , 100.00, 1
# target 50% 0.0605556
# target 75% 0.0661111
# target 99% 0.085936
# target 99.9% 0.0894975
Code 200 : 40
Response Header Sizes : count 40 avg 690.475 +/- 15.77 min 592 max 693 sum 27619
Response Body/Total Sizes : count 40 avg 12565.2 +/- 301.9 min 12319 max 13665 sum 502608
All done 40 calls (plus 4 warmup) 60.588 ms avg, 7.9 qps
```

More info, examples and lots of documentation on `Fortio` [here](https://github.com/fortio/fortio)

# Feedback & Contribution
Feel free to provide feedback and contribute networking troubleshooting tools and
use-cases by opening PRs. If you would like to add any package, open a PR with the rationale and ensure that you update both the Dockerfile and the README with some examples on how to use it!

0 comments on commit e28ff38

Please sign in to comment.