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

Bootstrap if simple heuristics say we haven't run it yet. #989

Merged
merged 11 commits into from
May 19, 2021

Conversation

dchw
Copy link
Collaborator

@dchw dchw commented May 19, 2021

Pulled the logic out of the TCP pull request.

Note that this does not separate the shell completions from bootstrap itself yet. It seemed like we could skate by and see if we wanted to do that later?

I was on board with logging to stderr; but given the number of places I had to redirect I am concerned; but not enough to change course. Just want to think more deeply one more time before we merge something like this.

@dchw dchw requested review from vladaionescu and alexcb May 19, 2021 05:08
@@ -61,7 +61,7 @@ type ConsoleLogger struct {
// Current returns the current console.
func Current(colorMode ColorMode, prefixPadding int) ConsoleLogger {
return ConsoleLogger{
outW: os.Stdout,
outW: os.Stderr, // So logs dont sully any intended outputs of commands.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed in standup this morning

@@ -431,7 +431,7 @@ save-artifact-after-push:
--post_command="2>&1 | perl -pe 'BEGIN {\\\$status=1} END {exit \\\$status} \\\$status=0 if /not found/;'"

push-build:
DO +RUN_EARTHLY --earthfile=push-build.earth --target=+test --extra_args="--push" --post_command="2>&1 > output"
DO +RUN_EARTHLY --earthfile=push-build.earth --target=+test --extra_args="--push" --post_command="> output 2>&1"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Flipping this order means we capture stderr properly

@dchw dchw enabled auto-merge (squash) May 19, 2021 07:02
Copy link
Member

@vladaionescu vladaionescu left a comment

Choose a reason for hiding this comment

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

util/cliutil/earthlydir.go Show resolved Hide resolved
@dchw dchw merged commit 1098a49 into main May 19, 2021
@dchw dchw deleted the corey/bootstrap-unknown branch May 19, 2021 13:23
@vladaionescu
Copy link
Member

Oh.. did we want to move auto-complete installation under a new flag too? earthly bootstrap --with-autocomplete?

Otherwise the bootstrapping might not work due to missing sudo.

@dchw
Copy link
Collaborator Author

dchw commented May 19, 2021

Oh.. did we want to move auto-complete installation under a new flag too? earthly bootstrap --with-autocomplete?

Otherwise the bootstrapping might not work due to missing sudo.

I was trying to see if we could get away without it, and although CI does work, it does fail in bootstrap a lot and really increases noise. Ill add that flag.

@dchw
Copy link
Collaborator Author

dchw commented May 19, 2021

* https://github.com/earthly/earthly/blob/main/builder/docker.go#L72

* https://github.com/earthly/earthly/blob/main/builder/docker.go#L85

I can dig some; what are these hooked up to?

@vladaionescu
Copy link
Member

I can dig some; what are these hooked up to?

Not sure what you mean. They're hooked up to stdout - they show up during the output phase, when Earthly exports images to the local Docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants