-
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.
+564,010
−9,605
Draft
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
f816c68
Golang bosh-monitor via Cursor
aramprice 74ef7fd
Fix hm_stateless_spec logger format: add number_of_processes to Event…
aramprice 24c57fa
Add Go tests for NATS client TLS config and connection retry
colins 130db5c
Add Go tests for DirectorMonitor message handling
colins 05a58e4
Add Go tests for AuthProvider UAA token flow and CA cert selection
colins 4d46b19
Fix hm_stateless_spec.rb:96 loop: filter heartbeats inline and use in…
aramprice 2ef6a2c
Add Go tests for AlertTracker meltdown logic
colins 1dae11f
Add Go tests for Agent timeout/rogue thresholds
colins fad21a5
Add Go tests for heartbeat team-change tracking and manager event pro…
colins 5b53221
Add Go unit tests for all 11 bosh-monitor plugins
colins 20e46a7
Add Go tests for Runner startup / signal handling
colins 51a8893
fix linter issues
aramprice 2ac7a38
Fix resurrector meltdown: pass total agent count in deployment_health…
aramprice af5077a
Add fly:bats rake task to run BATs from local branch via Concourse
colins 28368e1
fly-bats: inline compile step with Go 1.26.3 workaround
colins a736a20
Fix critical concurrency, liveness, and packaging issues in Go bosh-m…
aramprice 52122b5
Fidelity fixes (email STARTTLS, severity) and typed director config
aramprice 8b292e8
Type the director response boundary (deployments/instances/configs)
aramprice bd2c6f5
Type the event-processing seam and the plugin alert contract
aramprice c818997
Remove the dead Attributes()/Attrs map and type NumberOfProcesses
aramprice 9e2bf25
N1/N3/N4: document *int field, name channel constants, stop signal no…
aramprice ab5d3f2
N2: make HTTP server listen address configurable via http.host config…
aramprice c77423e
B1: fix double file-read in tlsConfigForCAFile (TOCTOU)
aramprice 2223e47
B2: cache UAA http.Client in AuthProvider to prevent connection pool …
aramprice 58fbf71
B4: guard email goroutine cmds sends with context to prevent block/pa…
aramprice 2f3641c
B5: reset restartAttempts after a long-lived successful run
aramprice 95da701
B3/D3: remove unused SyncInstancesPublic/SyncAgentsPublic; test Fetch…
aramprice b83f562
B6: make semaphore acquire in handleHTTPRequest interruptible on shut…
aramprice 9ed3bdd
D4: remove validPayload from DirectorMonitor; delegate to Alert.Validate
aramprice d95d160
D6: eliminate 30 s mutex hold in AuthProvider.uaaTokenHeader
aramprice 590de0c
D7: use ordered slice for NATS subjects; unsubscribe on partial failure
aramprice 7bd90aa
D1: add thorough config validation with multi-error reporting
aramprice d28aae8
D2: narrow Event interface to {ID, Kind, Validate}
aramprice 4c63958
D5: type the emit_alert payload in plugin protocol
aramprice 61a206e
BF-1: scope resurrector AlertTracker unhealthy count to current deplo…
aramprice 52b4cb4
IGo-2: remove unnecessary mutex from alertTracker
aramprice 7d12f81
BF-2: emit resurrection-disabled alert for config-suppressed instances
aramprice 8db0536
BF-4: change Agent.NumberOfProcesses to *int to match Ruby nil semantics
aramprice 9eedc2b
IGo-1: replace sync.Map with map+Mutex for HTTP response correlation
aramprice 312c193
IGo-3: decode NATS payload at the boundary; ProcessEvent accepts []byte
aramprice 39c0f02
IGo-4: add optional ca_cert option to PagerDuty plugin
aramprice 9caab42
IGo-5: use errors.Join in config validation for unwrap-able multi-error
aramprice 3232c9f
Fixed a race condition caused by the go resurrector. The director
colins b31194a
Indentation alignment to keep linter happy.
colins 9e76d88
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.