-
Notifications
You must be signed in to change notification settings - Fork 661
Replace Ruby bosh-monitor with Go implementation #2747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
aramprice
wants to merge
12
commits into
main
Choose a base branch
from
experiment-golang-bosh-monitor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1a7651a
Golang bosh-monitor via Cursor
aramprice 7a09333
Fix hm_stateless_spec logger format: add number_of_processes to Event…
aramprice 960ff68
Add Go tests for NATS client TLS config and connection retry
colins 7bc76cc
Add Go tests for DirectorMonitor message handling
colins 0dcdfbf
Add Go tests for AuthProvider UAA token flow and CA cert selection
colins 0d24acd
Fix hm_stateless_spec.rb:96 loop: filter heartbeats inline and use in…
aramprice bf15476
Add Go tests for AlertTracker meltdown logic
colins 93e1061
Add Go tests for Agent timeout/rogue thresholds
colins 42530d1
Add Go tests for heartbeat team-change tracking and manager event pro…
colins 4ff4b97
Add Go unit tests for all 11 bosh-monitor plugins
colins 1980030
Add Go tests for Runner startup / signal handling
colins e88928d
fix linter issues
aramprice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ jobs: | |
| matrix: | ||
| sub_project: | ||
| - common:parallel | ||
| - monitor:parallel | ||
| - nats_sync:parallel | ||
| - release | ||
| steps: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ templates: | |
|
|
||
| packages: | ||
| - health_monitor | ||
| - director-ruby-3.3 | ||
|
|
||
| properties: | ||
| # | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| source /var/vcap/packages/director-ruby-3.3/bosh/runtime.env | ||
| exec /var/vcap/packages/health_monitor/bin/bosh-monitor -c /var/vcap/jobs/health_monitor/config/health_monitor.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,30 @@ | ||
| set -e | ||
|
|
||
| mkdir -p ${BOSH_INSTALL_TARGET}/{bin,gem_home} | ||
| # Use the Go toolchain from a vendored golang BOSH package if available. | ||
| # When the golang-1.26-linux package is present, source its compile.env | ||
| # to set PATH/GOROOT/etc. the same way other BOSH releases do. | ||
| for pkg in "${BOSH_PACKAGES_DIR}"/golang-*; do | ||
| if [ -f "${pkg}/bosh/compile.env" ]; then | ||
| # shellcheck disable=SC1091 | ||
| source "${pkg}/bosh/compile.env" | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| source /var/vcap/packages/director-ruby-3.3/bosh/compile.env | ||
| if ! command -v go >/dev/null 2>&1; then | ||
| echo "ERROR: Go toolchain not found." >&2 | ||
| echo " Add a golang-* BOSH package as a dependency in packages/health_monitor/spec" >&2 | ||
| echo " or ensure 'go' is available on PATH." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| cat > Gemfile <<EOF | ||
| # Explicitly require vendored version to avoid requiring builtin json gem | ||
| gem 'json', '~>2' | ||
| gem 'bosh-monitor' | ||
| EOF | ||
| echo "Using $(go version)" | ||
| mkdir -p "${BOSH_INSTALL_TARGET}/bin" | ||
|
|
||
| for gemspec in $( find . -maxdepth 2 -name *.gemspec ); do | ||
| gem_name="$( basename "$( dirname "$gemspec" )" )" | ||
| gem_spec="$( basename "$gemspec" )" | ||
| cd bosh-monitor | ||
| go build -o "${BOSH_INSTALL_TARGET}/bin/bosh-monitor" . | ||
|
|
||
| pushd "$gem_name" | ||
| gem build "$gem_spec" | ||
| mv *.gem ../vendor/cache | ||
| popd > /dev/null | ||
| for plugin_dir in cmd/plugins/hm-*; do | ||
| plugin_name="$(basename "${plugin_dir}")" | ||
| go build -o "${BOSH_INSTALL_TARGET}/bin/${plugin_name}" "./${plugin_dir}" | ||
|
aramprice marked this conversation as resolved.
|
||
| done | ||
|
|
||
| bosh_bundle_local | ||
|
|
||
| cp Gemfile ${BOSH_INSTALL_TARGET} | ||
| cp Gemfile.lock ${BOSH_INSTALL_TARGET} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,5 @@ | ||
| --- | ||
| name: health_monitor | ||
| dependencies: | ||
| - director-ruby-3.3 | ||
|
|
||
| files: | ||
| - bosh-monitor/**/* | ||
| - bosh-common/**/* | ||
| - vendor/cache/*.gem | ||
| - vendor/cache/extensions/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| version: "2" | ||
|
|
||
| linters: | ||
| default: standard | ||
|
|
||
| settings: | ||
| errcheck: | ||
| exclude-functions: | ||
| - (io.Closer).Close | ||
| - (io.ReadCloser).Close | ||
| - (net.Conn).Close | ||
| - (net.Listener).Close | ||
| - (*os.File).Close | ||
| - (os/exec.Cmd).Wait | ||
|
|
||
| exclusions: | ||
| rules: | ||
| - path: _test\.go | ||
| linters: | ||
| - errcheck | ||
|
|
||
| formatters: | ||
| enable: | ||
| - goimports |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.