-
Notifications
You must be signed in to change notification settings - Fork 662
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
45
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
45 commits
Select commit
Hold shift + click to select a range
0b326cb
Golang bosh-monitor via Cursor
aramprice 957b668
Fix hm_stateless_spec logger format: add number_of_processes to Event…
aramprice ff47215
Add Go tests for NATS client TLS config and connection retry
colins d37698b
Add Go tests for DirectorMonitor message handling
colins 386f45f
Add Go tests for AuthProvider UAA token flow and CA cert selection
colins f0d9955
Fix hm_stateless_spec.rb:96 loop: filter heartbeats inline and use in…
aramprice 9de93e6
Add Go tests for AlertTracker meltdown logic
colins c5668ce
Add Go tests for Agent timeout/rogue thresholds
colins fd41642
Add Go tests for heartbeat team-change tracking and manager event pro…
colins c7b8eab
Add Go unit tests for all 11 bosh-monitor plugins
colins b9c31a7
Add Go tests for Runner startup / signal handling
colins 5f205c7
fix linter issues
aramprice 3caa1ea
Fix resurrector meltdown: pass total agent count in deployment_health…
aramprice 322bb9b
Add fly:bats rake task to run BATs from local branch via Concourse
colins 26f5b52
fly-bats: inline compile step with Go 1.26.3 workaround
colins 13a0e68
Fix critical concurrency, liveness, and packaging issues in Go bosh-m…
aramprice 071f560
Fidelity fixes (email STARTTLS, severity) and typed director config
aramprice 891a5bd
Type the director response boundary (deployments/instances/configs)
aramprice 5102fae
Type the event-processing seam and the plugin alert contract
aramprice 828877d
Remove the dead Attributes()/Attrs map and type NumberOfProcesses
aramprice 37a246a
N1/N3/N4: document *int field, name channel constants, stop signal no…
aramprice 05f7aed
N2: make HTTP server listen address configurable via http.host config…
aramprice 80f0048
B1: fix double file-read in tlsConfigForCAFile (TOCTOU)
aramprice 29e2e09
B2: cache UAA http.Client in AuthProvider to prevent connection pool …
aramprice 9b5ec9a
B4: guard email goroutine cmds sends with context to prevent block/pa…
aramprice 2582252
B5: reset restartAttempts after a long-lived successful run
aramprice ed7a368
B3/D3: remove unused SyncInstancesPublic/SyncAgentsPublic; test Fetch…
aramprice 4d5de3c
B6: make semaphore acquire in handleHTTPRequest interruptible on shut…
aramprice 2496e08
D4: remove validPayload from DirectorMonitor; delegate to Alert.Validate
aramprice 8317779
D6: eliminate 30 s mutex hold in AuthProvider.uaaTokenHeader
aramprice 23bcdba
D7: use ordered slice for NATS subjects; unsubscribe on partial failure
aramprice 4eb9d2c
D1: add thorough config validation with multi-error reporting
aramprice 89df5d6
D2: narrow Event interface to {ID, Kind, Validate}
aramprice e292cfd
D5: type the emit_alert payload in plugin protocol
aramprice 8b90902
BF-1: scope resurrector AlertTracker unhealthy count to current deplo…
aramprice 3a9af1f
IGo-2: remove unnecessary mutex from alertTracker
aramprice d79707f
BF-2: emit resurrection-disabled alert for config-suppressed instances
aramprice 8dd3df7
BF-4: change Agent.NumberOfProcesses to *int to match Ruby nil semantics
aramprice f272424
IGo-1: replace sync.Map with map+Mutex for HTTP response correlation
aramprice c3cc20f
IGo-3: decode NATS payload at the boundary; ProcessEvent accepts []byte
aramprice d806ed6
IGo-4: add optional ca_cert option to PagerDuty plugin
aramprice 7a93437
IGo-5: use errors.Join in config validation for unwrap-able multi-error
aramprice 62338a7
Fixed a race condition caused by the go resurrector. The director
colins 3fc9a2d
Indentation alignment to keep linter happy.
colins e2dbeb1
Add golang-1.26-linux BOSH package and declare it as health_monitor d…
aramprice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
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,149 @@ | ||
| --- | ||
| # Standalone pipeline for running the BOSH Acceptance Test suite (BATs) | ||
| # against a specific branch. | ||
| # | ||
| # Intended to be driven by `bundle exec rake fly:bats` from src/, which | ||
| # pushes the current branch and sets this pipeline automatically. | ||
| # | ||
| # Manual usage: | ||
| # fly -t bosh set-pipeline -p bats-local \ | ||
| # -c ci/fly-bats.yml \ | ||
| # --var bosh_repo=https://github.com/cloudfoundry/bosh.git \ | ||
| # --var bosh_branch=my-feature-branch \ | ||
| # --var env_name=bats-local \ | ||
| # --var stemcell_name=bosh-google-kvm-ubuntu-noble \ | ||
| # --var deploy_args="-o bosh-deployment/external-ip-not-recommended.yml" \ | ||
| # --var bat_rspec_flags="" | ||
| # fly -t bosh unpause-pipeline -p bats-local | ||
| # fly -t bosh trigger-job -j bats-local/bats -w | ||
|
|
||
| resources: | ||
| - name: bosh | ||
| type: git | ||
| source: | ||
| uri: ((bosh_repo)) | ||
| branch: ((bosh_branch)) | ||
|
|
||
| # bosh-ci is the same repo as bosh but filtered to ci/ paths so that | ||
| # scripts under ci/bats/ are available at bosh-ci/ in the task workspace. | ||
| - name: bosh-ci | ||
| type: git | ||
| source: | ||
| uri: ((bosh_repo)) | ||
| branch: ((bosh_branch)) | ||
| paths: [ci] | ||
|
|
||
| - name: bosh-cli | ||
| type: github-release | ||
| source: | ||
| owner: cloudfoundry | ||
| repository: bosh-cli | ||
| access_token: ((github_public_repo_token)) | ||
|
|
||
| - name: stemcell | ||
| type: bosh-io-stemcell | ||
| source: | ||
| name: bosh-google-kvm-ubuntu-noble | ||
|
|
||
| - name: bats | ||
| type: git | ||
| source: | ||
| uri: https://github.com/cloudfoundry/bosh-acceptance-tests.git | ||
| branch: master | ||
|
|
||
| - name: bosh-deployment | ||
| type: git | ||
| source: | ||
| uri: https://github.com/cloudfoundry/bosh-deployment | ||
| branch: master | ||
|
|
||
| - name: integration-image | ||
| type: registry-image | ||
| source: | ||
| repository: ghcr.io/cloudfoundry/bosh/integration | ||
| tag: main | ||
| username: ((github_read_write_packages.username)) | ||
| password: ((github_read_write_packages.password)) | ||
|
|
||
| jobs: | ||
| - name: bats | ||
| serial: true | ||
| plan: | ||
| - do: | ||
| - in_parallel: | ||
| - get: bosh | ||
| - get: bosh-ci | ||
| - get: bosh-cli | ||
| params: | ||
| globs: [bosh-cli-*-linux-amd64] | ||
| - get: stemcell | ||
| - get: bats | ||
| - get: bosh-deployment | ||
| - get: integration-image | ||
|
|
||
| - task: make-candidate | ||
| image: integration-image | ||
| file: bosh-ci/ci/tasks/make-candidate.yml | ||
|
|
||
| - task: compile-bosh-release | ||
| config: | ||
| platform: linux | ||
| # ubuntu-noble-stemcell ships the BOSH agent at /var/vcap/bosh/bin/bosh-agent. | ||
| image_resource: | ||
| type: registry-image | ||
| source: | ||
| repository: ghcr.io/cloudfoundry/ubuntu-noble-stemcell | ||
| inputs: | ||
| - name: release | ||
| outputs: | ||
| - name: compiled-release | ||
| run: | ||
| path: /bin/bash | ||
| args: | ||
| - -exc | ||
| - | | ||
| # golang-1.26-linux on this branch is a stub (env files only; no binary | ||
| # blob in GCS yet). Install Go 1.26.3 and drop a shim at | ||
| # /usr/local/bin/go so `go build` works even though $GOROOT/bin is empty. | ||
| GO_VERSION=1.26.3 | ||
| if ! /usr/local/go/bin/go version 2>/dev/null | grep -q "go${GO_VERSION}"; then | ||
| curl -sSfL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" \ | ||
| | tar -C /usr/local -xz | ||
| fi | ||
| cat > /usr/local/bin/go <<'GOSHIM' | ||
| #!/bin/bash | ||
| export GOROOT=/usr/local/go | ||
| exec /usr/local/go/bin/go "$@" | ||
| GOSHIM | ||
| chmod +x /usr/local/bin/go | ||
|
|
||
| /var/vcap/bosh/bin/bosh-agent compile \ | ||
| --output-directory compiled-release \ | ||
| release/*.tgz | ||
|
|
||
| - task: run-bats | ||
| image: integration-image | ||
| input_mapping: | ||
| bosh-release: compiled-release | ||
| config: | ||
| platform: linux | ||
| inputs: | ||
| - name: bosh | ||
| - name: bosh-ci | ||
| - name: bosh-cli | ||
| - name: bosh-deployment | ||
| - name: stemcell | ||
| - name: bats | ||
| - name: bosh-release | ||
| caches: | ||
| - path: cache-dot-bosh-dir | ||
| params: | ||
| BAT_INFRASTRUCTURE: gcp | ||
| GCP_JSON_KEY: ((gcp_json_key)) | ||
| GCP_PROJECT_ID: ((gcp_project_id)) | ||
| STEMCELL_NAME: ((stemcell_name)) | ||
| ENV_NAME: ((env_name)) | ||
| DEPLOY_ARGS: ((deploy_args)) | ||
| BAT_RSPEC_FLAGS: ((bat_rspec_flags)) | ||
| run: | ||
| path: bosh/ci/tasks/run-bats-pipeline.sh |
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
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.