Skip to content

Commit

Permalink
Merge branch 'main' into add-worker-conn-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean-Coakley committed Sep 12, 2023
2 parents 9c9106b + a9728fe commit dabeaff
Show file tree
Hide file tree
Showing 2,721 changed files with 306,848 additions and 56,195 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ jobs:
version: "9"
- image: "ubuntu"
version: "22.04"
- image: "alpine"
version: "3.14"
- image: "alpine"
version: "3.15"
- image: "alpine"
version: "3.16"
- image: "alpine"
version: "3.17"
- image: "alpine"
version: "3.18"
- image: "debian"
version: "bookworm-slim"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
# Change made to fix an issue cause by security fix in Go 1.20.6 & 1.19.11 which was causing TestContainers to fail
# https://github.com/testcontainers/testcontainers-go/issues/1359
with:
go-version: '1.19.10'
go-version: '1.21.0'
- name: Run Integration Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
Expand Down
37 changes: 19 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ VERSION = $(shell git describe --match "v[0-9]*" --abbrev=0 --tags)
COMMIT = $(shell git rev-parse --short HEAD)
DATE = $(shell date +%F_%H-%M-%S)

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# https://docs.nginx.com/nginx/releases/ #
# These images are based on https://github.com/nginxinc/docker-nginx and are NOT recommended for production #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# | OS_RELEASE | OS_VERSION | NOTES |
# | ---------------- | ----------------------------- | -------------------------------------------------------------- |
# | amazonlinux | 2, 2023 | |
# | ubuntu | 18.04, 20.04, 22.04 | |
# | debian | bullseye-slim, buster-slim | |
# | centos | 7 | |
# | redhatenterprise | 7, 8, 9 | |
# | rockylinux | 8, 9 | |
# | almalinux | 8, 9 | |
# | alpine | 3.13, 3.14, 3.15, 3.16, 3.17 | |
# | oraclelinux | 7, 8 , 9 | |
# | suse | sles12sp5, sle15 | |
# | freebsd | | Not supported |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# https://docs.nginx.com/nginx/releases/ #
# These images are based on https://github.com/nginxinc/docker-nginx and are NOT recommended for production #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# | OS_RELEASE | OS_VERSION | NOTES |
# | ---------------- | ----------------------------------------- | -------------------------------------------------------------- |
# | amazonlinux | 2, 2023 | |
# | ubuntu | 20.04, 22.04 | |
# | debian | bookworm-slim, bullseye-slim, buster-slim | |
# | centos | 7 | |
# | redhatenterprise | 7, 8, 9 | |
# | rockylinux | 8, 9 | |
# | almalinux | 8, 9 | |
# | alpine | 3.15, 3.16, 3.17, 3.18 | |
# | oraclelinux | 7, 8, 9 | |
# | suse | sles12sp5, sle15 | |
# | freebsd | | Not supported |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
OS_RELEASE ?= ubuntu
OS_VERSION ?= 22.04
BASE_IMAGE = "${CONTAINER_REGISTRY}/${OS_RELEASE}:${OS_VERSION}"
Expand Down Expand Up @@ -214,6 +214,7 @@ test-bench: ## Run benchmark tests
cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 5 -timeout 2m -bench=. -benchmem metrics_test.go
cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 1 -bench=. -benchmem user_workflow_test.go
cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 5 -timeout 2m -bench=. -benchmem plugins_test.go
cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 5 -timeout 2m -bench=. -benchmem environment_test.go

benchmark-image: ## Build benchmark test container image for NGINX Plus, need nginx-repo.crt and nginx-repo.key in build directory
$(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build --no-cache -t nginx-agent-benchmark:1.0.0 \
Expand Down
4 changes: 2 additions & 2 deletions Makefile.packaging
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GITHUB_PACKAGES_DIR := ./build/github/packages
AZURE_PACKAGES_DIR := ./build/azure/packages
GPG_PUBLIC_KEY := .key

DEB_DISTROS?=ubuntu-jammy-22.04 ubuntu-focal-20.04 ubuntu-bionic-18.04 debian-bullseye-11 debian-buster-10
DEB_DISTROS?=ubuntu-jammy-22.04 ubuntu-focal-20.04 debian-bookworm-12 debian-bullseye-11 debian-buster-10
DEB_ARCHS?=arm64 amd64
RPM_DISTROS?=centos-7-x86_64 oraclelinux-7-x86_64 oraclelinux-8-x86_64 oraclelinux-9-x86_64 suse-12-x86_64 suse-15-x86_64
RPM_ARCH=x86_64
Expand All @@ -17,7 +17,7 @@ REDHAT_ARCHS?=aarch64 x86_64
ROCKY_VERSIONS?=rocky-8 rocky-9
ROCKY_ARCHS?=aarch64 x86_64
FREEBSD_DISTROS?="FreeBSD:12:amd64" "FreeBSD:13:amd64"
APK_VERSIONS?=3.13 3.14 3.15 3.16 3.17
APK_VERSIONS?=3.15 3.16 3.17, 3.18
APK_ARCHS?=aarch64 x86_64
ALMA_VERSIONS?=almalinux-8 almalinux-9
ALMA_ARCHS?=aarch64 x86_64
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Follow steps in the [Installation](#installation) section to download, install,
Using your preferred method, clone the NGINX Agent repository into your development directory. See [Cloning a GitHub Repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) for additional help.

## Installing Go
NGINX Agent and the Mock Control Plane are written in Go. Go 1.19.9 or higher is required to build and run either application from the source code directory. You can [download Go from the official website](https://go.dev/dl/).
NGINX Agent and the Mock Control Plane are written in Go. Go 1.21.0 or higher is required to build and run either application from the source code directory. You can [download Go from the official website](https://go.dev/dl/).

## Starting the gRPC Mock Control Plane
Start the mock control plane by running the following command from the `agent` source code root directory:
Expand Down
120 changes: 120 additions & 0 deletions docs/proto/proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@
- [NginxHealth.NginxStatus](#f5-nginx-agent-sdk-NginxHealth-NginxStatus)
- [NginxSslMetaData.NginxSslType](#f5-nginx-agent-sdk-NginxSslMetaData-NginxSslType)

- [phpfpm.proto](#phpfpm-proto)
- [PhpFpmDetails](#f5-nginx-agent-sdk-PhpFpmDetails)
- [PhpFpmHealth](#f5-nginx-agent-sdk-PhpFpmHealth)
- [PhpFpmPool](#f5-nginx-agent-sdk-PhpFpmPool)

- [PhpFpmHealth.PhpFpmHealthStatus](#f5-nginx-agent-sdk-PhpFpmHealth-PhpFpmHealthStatus)
- [PhpFpmProcessType](#f5-nginx-agent-sdk-PhpFpmProcessType)

- [Scalar Value Types](#scalar-value-types)


Expand Down Expand Up @@ -939,6 +947,7 @@ Represents dataplane software details which contains details for additional soft
| ----- | ---- | ----- | ----------- |
| app_protect_waf_details | [AppProtectWAFDetails](#f5-nginx-agent-sdk-AppProtectWAFDetails) | | App Protect WAF software details |
| nginx_details | [NginxDetails](#f5-nginx-agent-sdk-NginxDetails) | | NGINX software details |
| php_fpm_details | [PhpFpmDetails](#f5-nginx-agent-sdk-PhpFpmDetails) | | PhpFpmDetails software details |



Expand Down Expand Up @@ -1533,6 +1542,117 @@ SSL type enum



<a name="phpfpm-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## phpfpm.proto



<a name="f5-nginx-agent-sdk-PhpFpmDetails"></a>

### PhpFpmDetails
PhpFpmDetails registers a phpfpm master process &#43; child pools


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [PhpFpmProcessType](#f5-nginx-agent-sdk-PhpFpmProcessType) | | PhpFpm process type |
| uuid | [string](#string) | | System ID |
| php_id | [string](#string) | | PhpFpm ID |
| name | [string](#string) | | PhpFpm process name |
| cmd | [string](#string) | | PhpFpm process descpription Example: php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf) |
| conf_path | [string](#string) | | Location of PhpFpm config path Example: /etc/php/7.4/fpm/php-fpm.conf |
| process_path | [string](#string) | | Location of PhpFpm binary path Example: /usr/sbin/php-fpm7.4 |
| version | [string](#string) | | PhpFpm version |
| version_line | [string](#string) | | PhpFpm version line Example: PHP 7.4.33 (fpm-fcgi) (built: Feb 14 2023 18:31:23) |
| pid | [int32](#int32) | | PhpFpm process id |
| agent | [string](#string) | | NGINX agent version |
| children | [PhpFpmPool](#f5-nginx-agent-sdk-PhpFpmPool) | repeated | PhpFpm children process |
| workers | [int32](#int32) | | PhpFpm master process total workers/children |
| health | [PhpFpmHealth](#f5-nginx-agent-sdk-PhpFpmHealth) | | PhpFpm master process health |






<a name="f5-nginx-agent-sdk-PhpFpmHealth"></a>

### PhpFpmHealth
PhpFpmHealth reports the health details of PHPFPM process


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| system_id | [string](#string) | | System ID |
| phpfpm_health_status | [PhpFpmHealth.PhpFpmHealthStatus](#f5-nginx-agent-sdk-PhpFpmHealth-PhpFpmHealthStatus) | | PhpFpm health status |
| degraded_reason | [string](#string) | | Provides an error message of why PhpFpm is degraded |






<a name="f5-nginx-agent-sdk-PhpFpmPool"></a>

### PhpFpmPool
PhpFpmPool registers one of the worker pools of a Php-Fpm master process


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [PhpFpmProcessType](#f5-nginx-agent-sdk-PhpFpmProcessType) | | PhpFpm process type (e.g. phpfpm-pool) |
| uuid | [string](#string) | | System ID |
| php_id | [string](#string) | | PhpFpm ID |
| name | [string](#string) | | PhpFpm process name |
| display_name | [string](#string) | | PhpFpm display name Example: phpfpm master @ Ubuntu |
| parent_php_id | [string](#string) | | Phpfpm master process ID |
| listen | [string](#string) | | Location for PhpFpm process to listen to connections |
| flisten | [string](#string) | | PhpFpm formatted listen |
| status_path | [string](#string) | | PhpFpm status path |
| can_have_children | [bool](#bool) | | Provides info on if PhpFpm process can have child |
| agent | [string](#string) | | NGINX agent version |








<a name="f5-nginx-agent-sdk-PhpFpmHealth-PhpFpmHealthStatus"></a>

### PhpFpmHealth.PhpFpmHealthStatus
Status enum

| Name | Number | Description |
| ---- | ------ | ----------- |
| UNKNOWN | 0 | Unknown status |
| ACTIVE | 1 | Active status |
| DEGRADED | 2 | Degraded status |



<a name="f5-nginx-agent-sdk-PhpFpmProcessType"></a>

### PhpFpmProcessType
Represents PhpFpm process type

| Name | Number | Description |
| ---- | ------ | ----------- |
| PHPFPM | 0 | Master |
| PHPFPM_POOL | 1 | Child |










## Scalar Value Types

| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
Expand Down
46 changes: 23 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/nginx/agent/v2

go 1.19
go 1.21

require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
Expand All @@ -9,7 +9,7 @@ require (
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.0
github.com/google/uuid v1.3.1
github.com/klauspost/cpuid/v2 v2.1.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.6.2
github.com/mitchellh/mapstructure v1.5.0
Expand All @@ -29,7 +29,7 @@ require (
github.com/vardius/message-bus v1.1.5
go.uber.org/atomic v1.11.0
golang.org/x/sync v0.3.0
google.golang.org/grpc v1.56.2
google.golang.org/grpc v1.57.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/mcuadros/go-syslog.v2 v2.3.0
Expand All @@ -47,8 +47,8 @@ require (
github.com/prometheus/client_golang v1.16.0
github.com/pseudomuto/protoc-gen-doc v1.5.1
github.com/rs/cors v1.9.0
golang.org/x/sys v0.10.0
golang.org/x/text v0.11.0
golang.org/x/sys v0.11.0
golang.org/x/text v0.12.0
gopkg.in/yaml.v2 v2.4.0
mvdan.cc/gofumpt v0.5.0
)
Expand Down Expand Up @@ -106,10 +106,10 @@ require (
github.com/daixiang0/gci v0.10.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denis-tingaikin/go-header v0.4.3 // indirect
github.com/docker/cli v24.0.4+incompatible // indirect
github.com/docker/cli v24.0.5+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v24.0.4+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/docker v24.0.5+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/elazarl/goproxy v0.0.0-20230731152917-f99041a5c027 // indirect
Expand All @@ -135,7 +135,7 @@ require (
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.26.0 // indirect
Expand Down Expand Up @@ -257,7 +257,7 @@ require (
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/pseudomuto/protokit v0.2.0 // indirect
github.com/quasilyte/go-ruleguard v0.3.19 // indirect
github.com/quasilyte/gogrep v0.5.0 // indirect
Expand Down Expand Up @@ -313,29 +313,29 @@ require (
gitlab.com/bosi/decorder v0.2.3 // indirect
gitlab.com/digitalxero/go-conventional-commit v1.0.7 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
go.opentelemetry.io/otel v1.17.0 // indirect
go.opentelemetry.io/otel/metric v1.17.0 // indirect
go.opentelemetry.io/otel/sdk v1.17.0 // indirect
go.opentelemetry.io/otel/trace v1.17.0 // indirect
go.uber.org/goleak v1.2.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.11.0 // indirect
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230710151506-e685fd7b542b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230710151506-e685fd7b542b // indirect
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
gopkg.in/alessio/shellescape.v1 v1.0.0-20170105083845-52074bc9df61 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gotest.tools/v3 v3.4.0 // indirect
gotest.tools/v3 v3.5.0 // indirect
honnef.co/go/tools v0.4.3 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
Expand Down
Loading

0 comments on commit dabeaff

Please sign in to comment.