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

Allow users to specify stdin into containers #2847

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Dec 11, 2020

Some commands within a Containerfile, might need input from users.
For example confirmation commands from Apt.

Adding a --stdin flag will allows users to interact with containers
while running inside of buildah bud.

Signed-off-by: Daniel J Walsh [email protected]

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?


@rhatdan
Copy link
Member Author

rhatdan commented Dec 11, 2020

I know someone asked me for this, but I can not find the reference to it.

@edsantiago
Copy link
Member

someone asked me for this

#2708 (comment) ?

@rhatdan
Copy link
Member Author

rhatdan commented Dec 15, 2020

Yes.

@rhatdan rhatdan force-pushed the stdin branch 4 times, most recently from 6a91c1a to 97ecce1 Compare December 17, 2020 14:28
@rhatdan
Copy link
Member Author

rhatdan commented Dec 17, 2020

@containers/podman-maintainers PTAL
@nalind PTAL

Copy link
Member

@ashley-cui ashley-cui left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan
Copy link
Member Author

rhatdan commented Dec 21, 2020

Fixes: #2863

@rhatdan
Copy link
Member Author

rhatdan commented Dec 21, 2020

@nalind @TomSweeneyRedHat @vrothberg @giuseppe @QiWang19 @umohnani8 PTAL
@containers/podman-maintainers PTAL

RUN read -t 1 x
_EOF

run_buildah 1 bud -t testbud --signature-policy ${TESTSDIR}/policy.json ${mytmpdir} <<< input
Copy link
Member

Choose a reason for hiding this comment

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

There's a common pattern in buildah tests that I find odd: just test one little thing at a time. Given the substantial setup costs for each test, doesn't it make sense to occasionally bundle tests together? Like, you could combine with with --stdin: it's the same Containerfile, same setup, just a one-word difference in the command. You could first run the error one (perhaps adding expect_output --substring 'error building at STEP "RUN read -t 1 x":'), then run the one with --stdin.

I realize there are pedantic voices who will say "write microtests so that every molecular component can be individually checked!!1!". Those voices are often silent when we need to deal with CI timeout errors or simply the development hassle of waiting hours and hours for CI runs. I am rabidly in favor of multipurpose tests: they are, most of the time, Good Enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem. I am just happy that I added some tests for it. I will consolidate.

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, rhatdan

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

Some commands within a Containerfile, might need input from users.
For example confirmation commands from Apt.

Adding a --stdin flag will allows users to interact with containers
while running inside of buildah bud.

Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan rhatdan added the lgtm label Dec 22, 2020
@openshift-merge-robot openshift-merge-robot merged commit 59cd527 into containers:master Dec 22, 2020
@nalind nalind added todo-backport-to-1.16 We should do or consider a backport to 1.16. Remove when we either decide not to, or open a PR. todo-backport-to-1.17 We should do or consider a backport to 1.17. Remove when we either decide not to, or open a PR. todo-backport-to-1.18 We should do or consider a backport to 1.18. Remove when we either decide not to, or open a PR. labels Jan 6, 2021
@nalind nalind removed the todo-backport-to-1.18 We should do or consider a backport to 1.18. Remove when we either decide not to, or open a PR. label Jan 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved lgtm locked - please file new issue/PR todo-backport-to-1.16 We should do or consider a backport to 1.16. Remove when we either decide not to, or open a PR. todo-backport-to-1.17 We should do or consider a backport to 1.17. Remove when we either decide not to, or open a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants