Skip to content

refactor(scalers): publish scaler as standalone asya-scalers image - #506

Open
atemate wants to merge 4 commits into
mainfrom
dqpob.asya-scalers-image
Open

atemate wants to merge 4 commits into
mainfrom
dqpob.asya-scalers-image

Conversation

@atemate

@atemate atemate commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Now that asya-scalers and asya-state-proxy-{go,py} are public on ghcr, this removes the publish-readiness shims.

Changes

  • Move scaler to its own image: src/asya-crew/cmd/scaler-pubsubsrc/asya-scalers (git renames, history preserved), built as the previously-placeholder ghcr.io/deliveryhero/asya-scalers image. Drops the scaler build stage from the asya-crew Dockerfile.
  • Wire scaler into build/test: added src/asya-scalers to the Makefile (setup/test-unit/build-go/clean/cov) and the ci.yml unit-tests matrix — the scaler tests previously ran nowhere.
  • Chart: crossplane pubsub.keda.scaler.image.repository now points at asya-scalers (was temporarily asya-crew); binary still selected via command: ["/scaler-pubsub"].
  • release.yml: added asya-state-proxy-go/py to the tag-latest loop and release summary (they were built+pushed but never tagged latest nor advertised).
  • dependabot gomod dir + scaler reference doc updated.

Verification

  • go test ./..., go vet, gofmt clean in src/asya-scalers
  • make -C src/asya-scalers test-unit / build work (multi-package coverage merge needs a complete Go toolchain — present in CI)
  • helm template renders image: ghcr.io/deliveryhero/asya-scalers:<appVersion> + command: ["/scaler-pubsub"]
  • Both asya-scalers (25.8MB distroless) and asya-crew images build; crew confirmed to ship /dlq-worker and no longer /scaler-pubsub

Aint: dqpob

Move the KEDA external scaler from src/asya-crew/cmd/scaler-pubsub into a
standalone src/asya-scalers component built as the (previously placeholder)
ghcr.io/deliveryhero/asya-scalers image. Drop the scaler build stage from
the asya-crew Dockerfile.

Also fixes publish-readiness gaps now that the images are public:
- wire src/asya-scalers into Makefile (setup/test-unit/build-go/clean/cov)
  and the ci.yml unit-tests matrix (the scaler was tested nowhere before)
- point the crossplane chart scaler image at asya-scalers (was asya-crew)
- add asya-state-proxy-go/py to release.yml tag-latest loop + summary
- update dependabot gomod dir and the scaler reference doc

Signed-off-by: Artem Yushkovskiy <7501517+atemate@users.noreply.github.com>
@github-actions github-actions Bot added ci Changes in CI docs Improvements or additions to documentation test asya-crew charts refactor labels Jun 11, 2026
@codacy-production

codacy-production Bot commented Jun 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 44 complexity

Metric Results
Complexity 44

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the KEDA external pubsub scaler from the asya-crew component into a standalone asya-scalers directory and Docker image. The changes include updating the root Makefile, Dependabot configuration, Helm chart values, and documentation, as well as removing the scaler build steps from the asya-crew Dockerfile and implementing a new multi-stage Dockerfile and Makefile for asya-scalers. No review comments were provided, so there is no feedback to address.

atemate added 3 commits June 11, 2026 12:11
…otobuf

Match the module path to the directory/image now that the scaler is a
top-level component (github.com/deliveryhero/asya/asya-scalers, consistent
with asya-sidecar and asya-state-proxy-go). Regenerated the externalscaler
protobuf with protoc v5.29.5 / protoc-gen-go v1.36.11 / protoc-gen-go-grpc
v1.6.1 so the embedded go_package matches; the binary stays scaler-pubsub.

Signed-off-by: Artem Yushkovskiy <7501517+atemate@users.noreply.github.com>
Drop to the distroless nonroot user (uid/gid 65532) in the final stage so
the container does not run as root. The scaler binds only an unprivileged
gRPC port and writes nothing to disk, so no root capabilities are needed.
Resolves the Codacy root-execution finding.

Signed-off-by: Artem Yushkovskiy <7501517+atemate@users.noreply.github.com>
The pubsub-gcs-pg e2e profile ran the KEDA scaler from the asya-crew image
with command [/scaler-pubsub], but that binary now lives in asya-scalers.
The scaler pod crash-looped (exec: /scaler-pubsub: no such file or
directory), KEDA could not reach the external scaler, and the deploy timed
out with context deadline exceeded.

Build and kind-load asya-scalers in deploy.sh and point the profile's
scaler image at ghcr.io/deliveryhero/asya-scalers.

Signed-off-by: Artem Yushkovskiy <7501517+atemate@users.noreply.github.com>
@atemate

atemate commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed the E2E tests: pubsub-gcs-pg failure (commit 3e164f5d2).

Root cause: the pubsub-gcs-pg profile ran the KEDA scaler from the asya-crew image (pullPolicy: Never) with command: [/scaler-pubsub], but this PR moved that binary into asya-scalers. The scaler pod crash-looped:

exec: "/scaler-pubsub": stat /scaler-pubsub: no such file or directory  → CrashLoopBackOff
→ KEDA external scaler unreachable → Deploy E2E cluster: context deadline exceeded

Fix:

  • testing/e2e/scripts/deploy.sh: build + kind load asya-scalers alongside the other framework images
  • testing/e2e/profiles/pubsub-gcs-pg.yaml: point the scaler image at ghcr.io/deliveryhero/asya-scalers

No other e2e profile references the scaler image; sqs-s3-pvc (no pubsub scaler) was already green.

No actionable inline review comments — gemini-code-assist left a summary only, and Codacy is now 0 issues after the non-root USER fix.

@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

Code Coverage Report

Coverage includes: unit, component, integration, and e2e tests

Metrics tracked:

  • Code Coverage (overall and per changed file)
  • Test Execution Time

Legend: + increase | - decrease | ~ no change

main (c5d09de) #506 (1a86cc0) +/-
Coverage 52.9% 52.9% -0.1%
Code to Test Ratio 1:0.4 1:0.4 0.0
Test Execution Time 5m43s 5m42s -1s
Details
  |                     | main (c5d09de) | #506 (1a86cc0) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          52.9% |          52.9% | -0.1% |
  |   Files             |             49 |             49 |     0 |
  |   Lines             |           6887 |           6887 |     0 |
- |   Covered           |           3646 |           3644 |    -2 |
  | Code to Test Ratio  |          1:0.4 |          1:0.4 |   0.0 |
  |   Code              |          34098 |          34098 |     0 |
  |   Test              |          15393 |          15393 |     0 |
+ | Test Execution Time |          5m43s |          5m42s |   -1s |

Code coverage of files in pull request scope (19.3% → 18.6%)

Files Coverage +/- Status
src/asya-sidecar/cmd/sidecar/main.go 18.6% -0.8% affected

Reported by octocov

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

asya-crew charts ci Changes in CI docs Improvements or additions to documentation refactor test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant