Skip to content

Commit

Permalink
The NGINX Agent is a lightweight piece of software that can be instal…
Browse files Browse the repository at this point in the history
…led next to NGINX Open Source (OSS) and/or NGINX Plus

The Agent provides the following information on a NGINX instance
* Management of NGINX instance configurations
* Metrics from Logs (OSS) or API (Plus)
* Gathering of a key set of dataplane events

Key features of the Agent
- Registration: Registration of NGINX and Host / Dataplane Software Information
- NGINX Config Management: Manage NGINX configurations upstream and downstream
- NGINX+ Counting: R27+ NGINX Counting
- Metrics Reporting: Reporting of metrics information from NGINX OSS / Plus, Host (real and virtual)
- Dataplane Health Status: Report on the health of NGINX instances and dataplane information
- Process Watching: Watch for NGINX process changes (including workers)
- File Watching: Watch for file changes on the dataplane, uploading NGINX configuration changes via an allowed list of directories
- Activity Events: Report on key events on the dataplane
- TLS Certificate Reporting: Report on TLS Certificate Information
  • Loading branch information
oliveromahony authored and dhurley committed Aug 18, 2022
0 parents commit 2074d37
Show file tree
Hide file tree
Showing 5,721 changed files with 2,003,011 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 7 additions & 0 deletions .chglog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
conventional-commits: false
deb:
distribution: []
urgency: ""
debug: false
owner: "nginx"
package-name: "nginx-agent"
38 changes: 38 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file; https://editorconfig.org/
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true

[{Makefile,go.mod,go.sum,*.go,.gitmodules}]
indent_style = tab
indent_size = 4

[*.md]
indent_size = 4
trim_trailing_whitespace = false

eclint_indent_style = unset

[Dockerfile]
indent_size = 4

[*.conf]
indent_size = 4
indent_style = space
trim_trailing_whitespace = false

# Ignore paths
[/vendor/**]
charset = unset
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_style = unset
indent_size = unset
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/vendor/* -diff
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Proposed changes

Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue using one of the [supported keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) here in this description (not in the title of the PR).

### Checklist

Before creating a PR, run through this checklist and mark each as complete.

- [ ] I have read the [`CONTRIBUTING`](https://github.com/nginx/agent/blob/main/docs/CONTRIBUTING.md) document
- [ ] If applicable, I have added tests that prove my fix is effective or that my feature works
- [ ] If applicable, I have checked that any relevant tests pass after adding my changes
- [ ] I have updated any relevant documentation ([`README.md`](https://github.com/nginx/agent/blob/main/README.md))
30 changes: 30 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
autolabeler:
- label: 'documentation'
files:
- '*.md'
branch:
- '/docs{0,1}\/.+/'
- label: 'chore'
branch:
- '/chore\/.+/'
- label: 'bug'
branch:
- '/fix\/.+/'
title:
- '/fix/i'
- label: 'enhancement'
branch:
- '/enh\/.+/'
- '/enhancement\/.+/'
- '/feat\/.+/'
- '/feature\/.+/'
title:
- '/feat/i'
- label: 'dependencies'
files:
- 'go.mod'
- 'go.sum'
- 'vendor*'
branch:
- '/deps\/.+/'
template: "not used, but required"
23 changes: 23 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
changelog:
exclude:
labels:
- skip-changelog
categories:
- title: 🚀 Features
labels:
- enhancement
- title: 💣 Breaking Changes
labels:
- change
- title: 🐛 Bug Fixes
labels:
- bug
- title: 📝 Documentation
labels:
- documentation
- title: 🔨 Maintenance
labels:
- chore
- title: ⬆️ Dependencies
labels:
- dependencies
113 changes: 113 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CI

on:
push:
branches-ignore:
- 'release-*'

env:
GOLANGCI_LINT_VERSION: 'v1.46.2'
NFPM_VERSION: 'v2.18.0'

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Lint Agent Code
uses: golangci/golangci-lint-action@v3
with:
version: "${{ env.GOLANGCI_LINT_VERSION }}"
args: -c ./scripts/.golangci.yml
- name: Lint SDK Code
uses: golangci/golangci-lint-action@v3
with:
version: "${{ env.GOLANGCI_LINT_VERSION }}"
working-directory: sdk
args: -c ../scripts/.golangci.yml

unit-test:
name: Unit Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Run Unit Tests
run: make unit-test
- name: Upload Test Coverage
uses: codecov/codecov-action@v3
with:
files: ./build/test/coverage.out

component-test:
name: Component Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Run Component Tests
run: make component-test

performance-test:
name: Performance Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Docker Build
uses: docker/setup-buildx-action@v2
- name: Build Docker Image
uses: docker/build-push-action@v3
with:
file: test/docker/Dockerfile
tags: nginx-agent-benchmark:1.0.0
context: '.'
push: false
load: true
no-cache: true
secrets: |
"nginx-crt=${{ secrets.NGINX_CRT }}"
"nginx-key=${{ secrets.NGINX_KEY }}"
- name: Run Performance Tests
run: docker run -v ${GITHUB_WORKSPACE}:/home/nginx/ --rm nginx-agent-benchmark:1.0.0

build-snapshot:
name: Build Snapshot
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker Image
uses: docker/build-push-action@v3
with:
file: scripts/packages/packager/Dockerfile
tags: build-packager:1.0.0
context: '.'
push: false
load: true
no-cache: true
- name: Build Packages
# TODO: Remove git config step later once the repo https://github.com/nginxinc/crossplane-go is made public
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
git config --global url."https://dhurley:${TOKEN}@github.com".insteadOf "https://github.com"
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
make clean local-apk-package local-deb-package local-rpm-package local-pkg-package
tar -cf ./build/snapshots.tar.gz ./build/*.deb ./build/*.rpm ./build/*.pkg ./build/*.apk
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: snapshots
path: build/**/*.tar.gz
retention-days: 3
18 changes: 18 additions & 0 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Label Pull Requests

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-20.04
steps:
- uses: release-drafter/release-drafter@v5
with:
disable-releaser: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
build/
bin/
whitesource/
.vscode/
.idea/
*.log
*.test
*.orig
certs/*
sdk/certs/**

__debug_bin
.key
.key.*
.next-version
.devops-utils/

*tar.gz
49 changes: 49 additions & 0 deletions .nfpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# this is the base "template" for the package
name: nginx-agent
description: NGINX Agent
arch: ${ARCH}
version: ${VERSION}
priority: optional
vendor: NGINX Software, Inc.
maintainer: NGINX Inc. <[email protected]>
homepage: https://github.com/nginx/agent
license: Apache 2.0
changelog: "./scripts/changelog.yml"
contents:
- src: ./build/nginx-agent
dst: /usr/bin/nginx-agent
- src: nginx-agent.conf
dst: /etc/nginx-agent/nginx-agent.conf
file_info:
mode: 0660
- src: ./scripts/packages/nginx-agent.service
dst: /etc/systemd/system/nginx-agent.service
- src: ./scripts/selinux/nginx_agent_selinux.8.gz
dst: /usr/share/man/man8/nginx_agent_selinux.8.gz
packager: rpm
- src: ./scripts/selinux/nginx_agent.if
dst: /usr/share/selinux/devel/include/contrib/nginx_agent.if
packager: rpm
- src: ./scripts/selinux/nginx_agent.pp
dst: /usr/share/selinux/packages/nginx_agent.pp
packager: rpm
- dst: /var/log/nginx-agent
type: dir
overrides:
deb:
depends:
- apt-transport-https
deb:
signature:
key_file: ".key.asc"
rpm:
signature:
key_file: ".key.asc"
apk:
signature:
key_file: ".key.rsa"
scripts:
preinstall: "./scripts/packages/preinstall.sh"
postinstall: "./scripts/packages/postinstall.sh"
preremove: "./scripts/packages/preremove.sh"
postremove: "./scripts/packages/postremove.sh"
Loading

0 comments on commit 2074d37

Please sign in to comment.