Skip to content

Commit 1fb1faf

Browse files
authored
Merge pull request #170 from netboxlabs/develop
Release 🚀
2 parents 8db98de + b49d2fe commit 1fb1faf

File tree

15 files changed

+562
-13
lines changed

15 files changed

+562
-13
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @jajeffries @leoparente @mfiedorowicz @MicahParks

.github/workflows/develop.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
permissions:
1212
contents: write
13+
id-token: write
1314

1415
env:
1516
GO_VERSION: '1.24'
@@ -35,6 +36,22 @@ jobs:
3536
username: ${{ secrets.DOCKERHUB_USERNAME }}
3637
password: ${{ secrets.DOCKERHUB_TOKEN }}
3738

39+
- name: Setup JFrog CLI
40+
id: setup-jfrog-cli
41+
uses: jfrog/setup-jfrog-cli@ff5cb544114ffc152db9cea1cd3d5978d5074946 # v4.5.11
42+
env:
43+
JF_URL: https://netboxlabs.jfrog.io
44+
JF_PROJECT: obs
45+
with:
46+
oidc-provider-name: github-ci
47+
48+
- name: Login to JFrog Artifactory
49+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3
50+
with:
51+
registry: netboxlabs.jfrog.io
52+
username: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
53+
password: ${{ steps.setup-jfrog-cli.outputs.oidc-token }}
54+
3855
- name: Verify QEMU installation
3956
run: |
4057
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
@@ -55,6 +72,8 @@ jobs:
5572
push: true
5673
cache-from: type=gha
5774
cache-to: type=gha,mode=max
58-
tags: netboxlabs/orb-agent:develop
75+
tags: |
76+
netboxlabs/orb-agent:develop
77+
netboxlabs.jfrog.io/obs-builds/orb-agent:develop
5978
build-args: |
6079
GO_VERSION=${{ env.GO_VERSION }}

.github/workflows/pr-semantic-release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
"version": "1.0.0",
4444
"devDependencies": {
4545
"semantic-release-export-data": "^1.0.1",
46+
"semantic-release": "25.0.0-beta.6",
4647
"@semantic-release/changelog": "^6.0.3"
4748
}
4849
}
@@ -90,7 +91,7 @@ jobs:
9091
}
9192
9293
- name: Install dependencies
93-
run: npm i
94+
run: npm install --legacy-peer-deps
9495

9596
- name: Run semantic-release dry-run
9697
id: semantic-release

.github/workflows/release.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ permissions:
2222
contents: write
2323
issues: write
2424
pull-requests: write
25+
id-token: write
2526

2627
jobs:
2728
get-next-version:
@@ -44,6 +45,7 @@ jobs:
4445
"version": "1.0.0",
4546
"devDependencies": {
4647
"semantic-release-export-data": "^1.0.1",
48+
"semantic-release": "25.0.0-beta.6",
4749
"@semantic-release/changelog": "^6.0.3"
4850
}
4951
}
@@ -89,7 +91,7 @@ jobs:
8991
]
9092
}
9193
- name: setup semantic-release
92-
run: npm i
94+
run: npm install --legacy-peer-deps
9395
- name: release dry-run
9496
env:
9597
SLACK_WEBHOOK: ${{ secrets.SLACK_SEMANTIC_RELEASE_WEBHOOK }}
@@ -143,6 +145,22 @@ jobs:
143145
username: ${{ secrets.DOCKERHUB_USERNAME }}
144146
password: ${{ secrets.DOCKERHUB_TOKEN }}
145147

148+
- name: Setup JFrog CLI
149+
id: setup-jfrog-cli
150+
uses: jfrog/setup-jfrog-cli@ff5cb544114ffc152db9cea1cd3d5978d5074946 # v4.5.11
151+
env:
152+
JF_URL: https://netboxlabs.jfrog.io
153+
JF_PROJECT: obs
154+
with:
155+
oidc-provider-name: github-ci
156+
157+
- name: Login to JFrog Artifactory
158+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3
159+
with:
160+
registry: netboxlabs.jfrog.io
161+
username: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
162+
password: ${{ steps.setup-jfrog-cli.outputs.oidc-token }}
163+
146164
- name: Verify QEMU installation
147165
run: |
148166
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
@@ -165,6 +183,8 @@ jobs:
165183
tags: |
166184
netboxlabs/${{ env.APP_NAME }}:latest
167185
netboxlabs/${{ env.APP_NAME }}:${{ env.BUILD_VERSION }}
186+
netboxlabs.jfrog.io/obs-builds/${{ env.APP_NAME }}:latest
187+
netboxlabs.jfrog.io/obs-builds/${{ env.APP_NAME }}:${{ env.BUILD_VERSION }}
168188
build-args: |
169189
GO_VERSION=${{ env.GO_VERSION }}
170190
@@ -189,6 +209,7 @@ jobs:
189209
"version": "1.0.0",
190210
"devDependencies": {
191211
"semantic-release-export-data": "^1.0.1",
212+
"semantic-release": "25.0.0-beta.6",
192213
"@semantic-release/changelog": "^6.0.3"
193214
}
194215
}
@@ -234,7 +255,7 @@ jobs:
234255
]
235256
}
236257
- name: setup semantic-release
237-
run: npm i
258+
run: npm install --legacy-peer-deps
238259
- name: Release
239260
env:
240261
SLACK_WEBHOOK: ${{ secrets.SLACK_OBSERVABILITY_RELEASE_WEBHOOK }}

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ agent_bin:
4545
echo "ORB_VERSION: $(ORB_VERSION)-$(COMMIT_HASH)"
4646
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=$(GOARCH) GOARM=$(GOARM) go build -mod=mod -o ${BUILD_DIR}/orb-agent cmd/main.go
4747

48+
.PHONY: test
49+
test:
50+
@go test -race ./...
51+
4852
.PHONY: test-coverage
4953
test-coverage:
5054
@mkdir -p .coverage

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Only the `network_discovery`, `device_discovery`, `worker` and `snmp_discovery`
6767
- [SNMP Discovery](./docs/backends/snmp_discovery.md)
6868

6969
#### Common
70-
A special `common` subsection under `backends` defines configuration settings that are shared with all backends. Currently, it supports passing [diode](https://github.com/netboxlabs/diode) server settings to all backends.
70+
A special `common` subsection under `backends` defines configuration settings that are shared with all backends. Currently, it supports passing [diode](https://github.com/netboxlabs/diode) server settings and OpenTelemetry configuration to all backends.
7171

7272
```yaml
7373
backends:
@@ -80,6 +80,12 @@ A special `common` subsection under `backends` defines configuration settings th
8080
agent_name: agent01
8181
dry_run: false
8282
dry_run_output_dir: /opt/orb
83+
otel:
84+
grpc: "grpc://otel-collector:4317"
85+
agent_labels:
86+
environment: "production"
87+
datacenter: "us-east-1"
88+
service: "network-monitoring"
8389
```
8490
8591
### Policies
@@ -108,12 +114,12 @@ orb:
108114
To run `orb-agent`, use the following command from the directory where your created your `agent.yaml` file:
109115

110116
```sh
111-
docker run --net=host -v $(PWD):/opt/orb/ netboxlabs/orb-agent:latest run -c /opt/orb/agent.yaml
117+
docker run --net=host -v ${PWD}:/opt/orb/ netboxlabs/orb-agent:latest run -c /opt/orb/agent.yaml
112118
```
113119
The container needs sufficient permissions, to send `icmp` and `tcp` packets. This can either be achieved by setting the network-mode to `host` or by changing the container user to `root`:
114120

115121
```sh
116-
docker run -u root -v $(PWD):/opt/orb/ netboxlabs/orb-agent:latest run -c /opt/orb/agent.yaml
122+
docker run -u root -v ${PWD}:/opt/orb/ netboxlabs/orb-agent:latest run -c /opt/orb/agent.yaml
117123
```
118124

119125
### Configuration samples

agent/backend/networkdiscovery/network_discovery.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type networkDiscoveryBackend struct {
4646
diodeOtelEndpoint string
4747
diodeDryRun bool
4848
diodeDryRunOutputDir string
49+
diodeLogLevel string
4950

5051
startTime time.Time
5152
proc backend.Commander
@@ -107,6 +108,11 @@ func (d *networkDiscoveryBackend) Configure(logger *slog.Logger, repo policies.P
107108
if dryRunOutputDir, prs := config["dry_run_output_dir"].(string); prs {
108109
d.diodeDryRunOutputDir = dryRunOutputDir
109110
}
111+
if logLevel, prs := config["log_level"].(string); prs {
112+
d.diodeLogLevel = logLevel
113+
} else if debug, prs := config["debug"].(bool); prs && debug {
114+
d.diodeLogLevel = "debug"
115+
}
110116

111117
if common.Otel.Grpc != "" {
112118
d.diodeOtelEndpoint = common.Otel.Grpc
@@ -151,14 +157,28 @@ func (d *networkDiscoveryBackend) Start(ctx context.Context, cancelFunc context.
151157
}
152158
}
153159

160+
if d.diodeLogLevel != "" {
161+
pvOptions = append(pvOptions, "--log-level", d.diodeLogLevel)
162+
d.logger.Info("network-discovery using log level",
163+
slog.String("log_level", d.diodeLogLevel))
164+
}
165+
154166
if d.diodeOtelEndpoint != "" {
155167
pvOptions = append(pvOptions, "--otel-endpoint", d.diodeOtelEndpoint)
168+
d.logger.Info("network-discovery using OTLP metrics endpoint",
169+
slog.String("endpoint", d.diodeOtelEndpoint))
156170
}
157171

158172
d.logger.Info("network-discovery startup", slog.Any("arguments", pvOptions))
159173

160-
if !d.diodeDryRun && len(pvOptions) > 9 {
161-
pvOptions[9] = d.diodeClientSecret
174+
if !d.diodeDryRun {
175+
// Find and replace the masked client secret with the actual value
176+
for i, arg := range pvOptions {
177+
if arg == "********" {
178+
pvOptions[i] = d.diodeClientSecret
179+
break
180+
}
181+
}
162182
}
163183

164184
d.proc = backend.NewCmdOptions(backend.CmdOptions{

0 commit comments

Comments
 (0)