openshift-knative / hack

CI tooling to improve and automate CI and release management
Apache License 2.0
4 stars 14 forks source link

Provide template for target binary name in Dockerfile generator #243

Closed mgencur closed 2 weeks ago

mgencur commented 2 weeks ago

Some upstream tests from Serving depend on exact path that is compatible with binaries generated by ko. Examples: https://github.com/knative/serving/blob/main/test/conformance/runtime/cmd_args_test.go#L43 https://github.com/knative/serving/blob/main/test/conformance/runtime/readiness_probe_test.go#L98

This is required to onboard Serving otherwise some tests are failing: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift-knative_serving/832/pull-ci-openshift-knative-serving-release-v1.15-415-test-e2e-aws-415/1831386928168046592

mgencur commented 2 weeks ago

/hold Hmm. This can probably be achieved by https://github.com/openshift-knative/hack/commit/2f77409a4ee5217c3b9d8450f0f335e9f73d6e42

Update: The same could be achieved by calling bin/generate multple times, each time specifying a different symlink (for the "readiness" image from Serving that would be --sym-link-names "/ko-app/readiness". So this would mean calling bin/generate at least 3 times in Serving (one for all images, second time for "readiness", third time for "runtime" image)).

I think the stuff I implemented can work together with the symlinks. The command can be then called just once in Serving, like this:

$(go env GOPATH)/bin/generate \
  --root-dir "${repo_root_dir}" \
  --generators dockerfile \
  --app-file-fmt "/ko-app/%s" \
  --dockerfile-image-builder-fmt "registry.ci.openshift.org/openshift/release:rhel-8-release-golang-%s-openshift-4.17"
openshift-ci[bot] commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mgencur, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift-knative/hack/blob/main/OWNERS)~~ [mgencur,pierDipi] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
pierDipi commented 2 weeks ago

I think since this makes bash scripts easier, let's just do it even though it could be achieved differently

mgencur commented 2 weeks ago

/unhold