KAI-JAY TU created YUNIKORN-3407:
------------------------------------
Summary: [k8shim] Add DEBUG_BUILDS=1 make image target support
Key: YUNIKORN-3407
URL: https://issues.apache.org/jira/browse/YUNIKORN-3407
Project: Apache YuniKorn
Issue Type: Improvement
Components: build, shim - kubernetes
Reporter: KAI-JAY TU
Assignee: KAI-JAY TU
Follow-up from YUNIKORN-3266 (yunikorn-site PR #569, review comment
https://github.com/apache/yunikorn-site/pull/569#discussion_r3802886844).
Today, building a debug image of the scheduler requires a manual
`go build -gcflags="all=-N -l"` plus a hand-written multi-stage
Dockerfile (as newly documented in yunikorn-site
docs/developer_guide/env_setup.md). This duplicates logic already
handled by `make image` and is easy to get wrong.
Proposal (per wilfred-s on PR #569):
1. Add a `DEBUG_BUILDS` flag to the k8shim Makefile, mirroring the
existing `REPRODUCIBLE_BUILDS=1 make image` pattern.
2. When `DEBUG_BUILDS=1`:
- Set `GCFLAGS='-gcflags="all=-N -l"'` and inject it into the
`go build` command (e.g. right after the `-a` option).
- Leave `GCFLAGS` empty when the flag is not set, so production
builds are unaffected.
- Override `VERSION` from `latest` to `debug` so debug images do
not overwrite production tags.
3. Compose with the existing `REGISTRY` shell variable, so users can
run:
REGISTRY=reg.local.host DEBUG_BUILDS=1 make image
4. Optionally include Delve (`dlv`) in the resulting image, or leave
that to a separate Dockerfile stage -- to be decided in review.
Once this lands, update yunikorn-site
docs/developer_guide/env_setup.md ("Debug scheduler in a remote
cluster" section) to reference the new Make target instead of the
manual `go build` + custom Dockerfile flow currently documented.
Acceptance criteria:
- `DEBUG_BUILDS=1 make image` produces an image built with
`-gcflags="all=-N -l"` and tagged `:debug` (or equivalent).
- `make image` (without the flag) is byte-identical to today.
- `REPRODUCIBLE_BUILDS=1 make image` still works unchanged.
- README / Makefile help mentions the new flag.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]