Skip to content

step-registry: setup the commands to allow running on bastion #9640

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

Closed

Conversation

abhinavdahiya
Copy link
Contributor

To enable internal clusters current plan is to run the steps from the bastian instances. Since there can be multiple of these running to isolate the binaries and files
this change makes 2 changes,

  • WORSPACE, this defaults to /tmp
    All the files created as part of the steps, that are not in shared or artifact dir must be created in the WORKSPACE dir. This ensures that on bastians we can provide each test separate dir for the files.
  • PATH
    WORKSPACE is added to the PATH, this allows the wrapper to copy all the required binaries for that test to the WORKSPACE and the step can continue to use these transparently.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2020
@@ -4,6 +4,10 @@ set -o nounset
set -o errexit
set -o pipefail

export HOME=/tmp
export WORKSPACE=${WORKSPACE:-/tmp}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want this to be something generically available to all steps?

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 think that would be useful imo. making sure we have the workspace and path setup like this.

Copy link
Member

Choose a reason for hiding this comment

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

Can we use TMPDIR, which is in POSIX?

Copy link
Member

Choose a reason for hiding this comment

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

We can also lean on openshift/ci-tools#854 and define variables for these (example in #9676) to keep them out of the script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we use TMPDIR, which is in POSIX?

i like WORKSPACE name more beacuse it is more clearer for it's responsibility. and works better when using it in jumped formed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can also lean on openshift/ci-tools#854 and define variables for these (example in #9676) to keep them out of the script.

The step env variables are user configurable inputs to the steps, so using it for something that is more about core function, i.e. where do i create my files seems like a mis use. I would never want someone to change the location of the workspace in a workflow because it is proabably going to break the step as we don't create or check permissions for that dir it is given to us.

Copy link
Member

Choose a reason for hiding this comment

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

i like WORKSPACE name more beacuse it is more clearer for it's responsibility. and works better when using it in jumped formed.

Is #9553 actually setting WORKSPACE anywhere?

The step env variables are user configurable inputs to the steps...

And they're also a way to set convenient defaults, for things where the script has no opinion.

I would never want someone to change the location of the workspace in a workflow because it is proabably going to break the step as we don't create or check permissions for that dir it is given to us.

Then just hard-code the value, and skip the variable? If this is something where you have some consumers that want a knob (e.g. some #9553 logic I'm missing about running these jobs with a different WORKSPACE on a bastion), then add an environment knob. And if callers point it at a non-existent directory or whatever, and the job breaks as a result, that's the caller's problem. I don't think we need defensive guards for things like that, and I don't think the lack of defensive guards is a reason to avoid a declared env variable in these internal tools.

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 think exposing the env from steps that are not actually user-configurable or changing them just breaks is bad API. So I do not think workspace is a good idea.

Also #9553 only uses the bash script itself and not the step, it copies the bash script to the bastion and then runs it using a unique workspace. I do not need these to available as an API on the steps level just to these scripts for reusing.

@abhinavdahiya
Copy link
Contributor Author

/retest

@wking
Copy link
Member

wking commented Jun 17, 2020

/retitle step-registry: setup the commands to allow running on bastion

Fixing "bastian" -> "bastion".

@openshift-ci-robot openshift-ci-robot changed the title step-registry: setup the commands to allow running on bastian step-registry: setup the commands to allow running on bastion Jun 17, 2020
export PATH=$PATH:/tmp/shared
export HOME=/tmp
export WORKSPACE=${WORKSPACE:-/tmp}
export PATH=${PATH}:${WORKSPACE}
Copy link
Member

Choose a reason for hiding this comment

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

While we're touching this and adding new lines, we should quote (e.g. export PATH="${PATH}:${WORKSPACE}"). And maybe also grow ShellCheck coverage for ci-operator/step-registry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And maybe also grow ShellCheck coverage for ci-operator/step-registry?

not sure what you mean by that... can provide a little more detail more than happy to extend coverage.

While we're touching this and adding new lines, we should quote (e.g. export PATH="${PATH}:${WORKSPACE}").

Sure will do.

Copy link
Member

Choose a reason for hiding this comment

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

And maybe also grow ShellCheck coverage for ci-operator/step-registry?

not sure what you mean by that...

The installer has ShellCheck CI to keep us from making quoting mistakes in openshift/installer. We should have similar CI for this repo (but I can file a PR for that separately; it's orthogonal to this PR).

Copy link
Member

Choose a reason for hiding this comment

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

Huh, seems like we already do. This job ran with d5d4e66776's unquoted PATH value and did not fail. Hmm... are we running a ShellCheck image without mounting in our openshift/release checkout?

Copy link
Member

Choose a reason for hiding this comment

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

Spinning off into #9772.

To enable internal clusters current plan is to run the steps from the bastian instances. Since there can be multiple of these running to isolate the binaries and files
this change makes 2 changes,

- WORSPACE, this defaults to /tmp
All the files created as part of the steps, that are not in shared or artifact dir must be created in the WORKSPACE dir. This ensures that on bastians we can provide each test separate dir for the files.
- PATH
WORKSPACE is added to the PATH, this allows the wrapper to copy all the required binaries for that test to the WORKSPACE and the step can continue to use these transparently.
@jhixson74
Copy link
Member

Given the redundant setting of environment variables across scripts in this, and in #9553 , I think it would make more sense to set them globally in another file and source it. Any overrides can be done in individual scripts.

@abhinavdahiya
Copy link
Contributor Author

Given the redundant setting of environment variables across scripts in this, and in #9553 , I think it would make more sense to set them globally in another file and source it. Any overrides can be done in individual scripts.

We can't yet do that, reuse files across steps.

@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: PR needs rebase.

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2020
@openshift-ci-robot
Copy link
Contributor

@abhinavdahiya: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/rehearse/openshift/installer/master/e2e-gcp d5d4e66776e856892aff66e6ba3746d1927e1514 link /test pj-rehearse
ci/rehearse/openshift/installer/master/e2e-azure d5d4e66776e856892aff66e6ba3746d1927e1514 link /test pj-rehearse
ci/rehearse/openshift/cluster-network-operator/master/e2e-ovn-hybrid-step-registry 4ea92d9 link /test pj-rehearse
ci/rehearse/openshift/cluster-network-operator/master/e2e-ovn-step-registry 4ea92d9 link /test pj-rehearse
ci/rehearse/open-cluster-management/registration-operator/master/e2e 4ea92d9 link /test pj-rehearse
ci/rehearse/openshift/cluster-network-operator/master/e2e-windows-hybrid-network 4ea92d9 link /test pj-rehearse
ci/rehearse/opendatahub-io/odh-manifests/master/odh-manifests-e2e 4ea92d9 link /test pj-rehearse
ci/rehearse/openshift/cloud-credential-operator/master/e2e-azure 4ea92d9 link /test pj-rehearse
ci/rehearse/openshift/installer/master/e2e-gcp-shared-vpc 4ea92d9 link /test pj-rehearse
ci/rehearse/openshift/cluster-network-operator/master/e2e-vsphere 4ea92d9 link /test pj-rehearse
ci/rehearse/openshift/installer/master/e2e-vsphere 4ea92d9 link /test pj-rehearse
ci/prow/pj-rehearse 4ea92d9 link /test pj-rehearse
ci/rehearse/openshift/cluster-network-operator/master/e2e-aws-sdn-multi 4ea92d9 link /test pj-rehearse
ci/prow/release-controller-config 4ea92d9 link /test release-controller-config
ci/prow/step-registry-metadata 4ea92d9 link /test step-registry-metadata
ci/prow/ci-testgrid-allow-list 4ea92d9 link /test ci-testgrid-allow-list
ci/prow/yamllint 4ea92d9 link /test yamllint
ci/prow/boskos-config 4ea92d9 link /test boskos-config

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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot
Copy link
Contributor

@abhinavdahiya: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/release-config 4ea92d9 link /test release-config
ci/prow/boskos-config-generation 4ea92d9 link /test boskos-config-generation
ci/prow/secret-generator-config-valid 4ea92d9 link /test secret-generator-config-valid
ci/prow/deprecate-templates 4ea92d9 link /test deprecate-templates

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/test-infra repository. I understand the commands that are listed here.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2021

@abhinavdahiya: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/ci-secret-generator-config 4ea92d9 link /test ci-secret-generator-config

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/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 14, 2021
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 14, 2021
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 13, 2021

@openshift-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

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/test-infra repository.

@openshift-ci openshift-ci bot closed this Jun 13, 2021
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. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants