Skip to content
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

OTA-1403: Create minimal openshift tests extension #1168

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DavidHurta
Copy link
Contributor

@DavidHurta DavidHurta commented Mar 7, 2025

Create a minimal Cluster Version Operator OpenShift tests extension.

For more information regarding the extension, see openshift-eng/openshift-tests-extension repository or the respective enhancement.

This pull request references https://issues.redhat.com//browse/OTA-1403


Following PRs will:

  • Include new targets in the Makefile.
    • update to run _output/$OS/$ARCH/openshift-tests-extension update
    • verify to verify no changes are present after the update invocation
  • Create a new job to run the verify on presubmits
  • Create the first test in the extension
  • Update the Dockerfile to include the extension binary in a payload image
  • Register the extension in origin
  • Add remaining tests

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 7, 2025
Copy link
Contributor

openshift-ci bot commented Mar 7, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2025
Copy link
Contributor

openshift-ci bot commented Mar 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DavidHurta

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 7, 2025
So that we can have multiple CLI applications in the `cmd` folder.
Create a minimal openshift-tests-extension CLI application, which has no tests.

Verifying no tests are present:

```sh
$ ./_output/linux/amd64/openshift-tests-extension list
null
```
@DavidHurta DavidHurta force-pushed the create-openshift-tests-extension-binary branch from 419162c to 1ef5a94 Compare March 7, 2025 15:31
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The movement of the files could be considered an overkill. I am interested in opinions and suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

I'm a fan actually - but would do it in a separate PR that does nothing else

Build a statically compiled openshift-tests-extension binary.

Static compilation is done because [1]:

> Extension binaries are extracted from container images into a
> running Pod executing openshift-tests. Contributors do not
> necessarily know which version of RHEL the openshift-tests
> binary will be running on, so, for maximum portability,
> test extension binaries should be statically compiled.

The `GO_COMPLIANCE_POLICY="exempt_all"` is set because [1]:

> For compliance reasons, when a binary is compiled by a golang
> builder image supplied by ART, a wrapper around the go compiler
> will force FIPS compliant compilation (e.g. dynamic linking).
> For this reason, extension binaries should include
> GO_COMPLIANCE_POLICY="exempt_all" in the environment when
> compiling an extension binary. This will inhibit the wrapper from
> modifying CGO_ENABLED or other compiler arguments required for
> static compilation.

Set `CGO_ENABLED=0` to disable the use of cgo.

Verifying whether such a binary is built statically:

```sh
$ ldd _output/linux/amd64/openshift-tests-extension
        not a dynamic executable
```

[1]: https://github.com/openshift/enhancements/blob/c2c0d43e3cd70cf79bc2b101ceb6a03c5e0114a8/enhancements/testing/openshift-tests-extension.md
Compress the openshift-tests-extension binary. Use `--force` to overwrite
the output file if already present to speed up local development. Use `--keep`
to keep the original binary after compressing it so that a developer may use it.

Compressing because [1]:

> Statically linked binaries are prohibited in FIPS and will
> cause failures if detected by product pipeline scans. To
> avoid this, extension binaries should be gzipped before
> being committed to container images.

Such a compressed binary can be then extracted as per [1]:

> After discovering a test extension binary, the origin test framework will
> extract the binary from the container image which carries it and store it
> in /tmp storage of the pod in which it is running.
>
> If the binary-path ends in .gz, the binary will be decompressed.

[1]: https://github.com/openshift/enhancements/blob/c2c0d43e3cd70cf79bc2b101ceb6a03c5e0114a8/enhancements/testing/openshift-tests-extension.md
@DavidHurta DavidHurta force-pushed the create-openshift-tests-extension-binary branch from 1ef5a94 to 3fa9dbf Compare March 7, 2025 15:34
Comment on lines +32 to +38
echo "Building ${REPO} openshift-tests-extension binary (${VERSION_OVERRIDE})"
GO_COMPLIANCE_POLICY="exempt_all" CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} \
go build \
${GOFLAGS} \
-ldflags "${GLDFLAGS}" \
-o "${BIN_PATH}/openshift-tests-extension" \
"${REPO}/cmd/openshift-tests-extension/..."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not a skillful go builder. Suggestions and tips are welcomed.

@DavidHurta DavidHurta changed the title WIP: Create openshift-tests extension WIP: Create openshift tests extension Mar 7, 2025
@DavidHurta
Copy link
Contributor Author

/test images

@DavidHurta DavidHurta changed the title WIP: Create openshift tests extension OTA-1403: Create openshift tests extension Mar 7, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 7, 2025

@DavidHurta: This pull request references OTA-1403 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 7, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 7, 2025

@DavidHurta: This pull request references OTA-1403 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

Following PRs will:

  • Include new targets in a Makefile.
  • update to run _output/linux/amd64/openshift-tests-extension update
  • verify to verify no changes are present after the update invocation
  • Create a new job to run the verify on presubmits
  • Create a first test in the extension
  • Register the extension in origin
  • Add remaining tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 7, 2025

@DavidHurta: This pull request references OTA-1403 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

Following PRs will:

  • Include new targets in a Makefile.
  • update to run _output/linux/amd64/openshift-tests-extension update
  • verify to verify no changes are present after the update invocation
  • Create a new job to run the verify on presubmits
  • Create the first test in the extension
  • Register the extension in origin
  • Add remaining tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 7, 2025

@DavidHurta: This pull request references OTA-1403 which is a valid jira issue.

In response to this:

Create a minimal Cluster Version Operator OpenShift tests extension.

For more information regarding the extension, see openshift-eng/openshift-tests-extension repository or the respective enhancement.

This pull request references https://issues.redhat.com//browse/OTA-1403


Following PRs will:

  • Include new targets in a Makefile.
  • update to run _output/linux/amd64/openshift-tests-extension update
  • verify to verify no changes are present after the update invocation
  • Create a new job to run the verify on presubmits
  • Create the first test in the extension
  • Include the extension binary in a payload image
  • Register the extension in origin
  • Add remaining tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 7, 2025

@DavidHurta: This pull request references OTA-1403 which is a valid jira issue.

In response to this:

Create a minimal Cluster Version Operator OpenShift tests extension.

For more information regarding the extension, see openshift-eng/openshift-tests-extension repository or the respective enhancement.

This pull request references https://issues.redhat.com//browse/OTA-1403


Following PRs will:

  • Include new targets in the Makefile.
  • update to run _output/linux/amd64/openshift-tests-extension update
  • verify to verify no changes are present after the update invocation
  • Create a new job to run the verify on presubmits
  • Create the first test in the extension
  • Update the Dockerfile to include the extension binary in a payload image
  • Register the extension in origin
  • Add remaining tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 7, 2025

@DavidHurta: This pull request references OTA-1403 which is a valid jira issue.

In response to this:

Create a minimal Cluster Version Operator OpenShift tests extension.

For more information regarding the extension, see openshift-eng/openshift-tests-extension repository or the respective enhancement.

This pull request references https://issues.redhat.com//browse/OTA-1403


Following PRs will:

  • Include new targets in the Makefile.
  • update to run _output/$OS/$ARCH/openshift-tests-extension update
  • verify to verify no changes are present after the update invocation
  • Create a new job to run the verify on presubmits
  • Create the first test in the extension
  • Update the Dockerfile to include the extension binary in a payload image
  • Register the extension in origin
  • Add remaining tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@DavidHurta DavidHurta changed the title OTA-1403: Create openshift tests extension OTA-1403: Create minimal openshift tests extension Mar 7, 2025
@DavidHurta DavidHurta marked this pull request as ready for review March 7, 2025 16:06
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 7, 2025
@openshift-ci openshift-ci bot requested review from petr-muller and wking March 7, 2025 16:10
Copy link
Contributor

openshift-ci bot commented Mar 7, 2025

@DavidHurta: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 3fa9dbf link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-agnostic-ovn-upgrade-into-change 3fa9dbf link true /test e2e-agnostic-ovn-upgrade-into-change

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@DavidHurta
Copy link
Contributor Author

/uncc wking petr-muller
I will request a review internally.

@openshift-ci openshift-ci bot removed request for wking and petr-muller March 11, 2025 17:03
@DavidHurta
Copy link
Contributor Author

ci/prow/e2e-agnostic-ovn-upgrade-into-change failure not relevant to the PR:

...
level=error msg=RESPONSE 400: 400 Bad Request
level=error msg=ERROR CODE: PublicIPCountLimitReached
...

"github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
)

func main() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants