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 using Podman to develop Earthly #1675

Merged
merged 17 commits into from
Feb 22, 2022
Merged

Allow using Podman to develop Earthly #1675

merged 17 commits into from
Feb 22, 2022

Conversation

dchw
Copy link
Collaborator

@dchw dchw commented Feb 16, 2022

These changes fix a couple sore points when using Podman to develop Earthly itself:

  • Fix the prerelease script to use podman or docker; whichever is present.
  • Fix the Buildkit image tag to be fully qualified, so development builds can find the image.
  • Allow using the LocalRegistryHost without TLS; without requiring changes to your registries.conf.
    • Includes refactor of URL generation; as fallout from the refactor.
  • Allow WITH DOCKER --load in a LOCALLY target.

@dchw dchw self-assigned this Feb 16, 2022
buildkitd/Earthfile Outdated Show resolved Hide resolved
@dchw dchw requested a review from alexcb February 16, 2022 16:35
Copy link
Collaborator

@alexcb alexcb left a comment

Choose a reason for hiding this comment

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

nice job! just left some ultra minor nits.

@dchw
Copy link
Collaborator Author

dchw commented Feb 16, 2022

nice job! just left some ultra minor nits.

Handled.

@dchw dchw enabled auto-merge (squash) February 16, 2022 16:50
buildkitd/Earthfile Outdated Show resolved Hide resolved
@dchw dchw requested a review from alexcb February 18, 2022 00:56
@dchw
Copy link
Collaborator Author

dchw commented Feb 18, 2022

@alexcb I think I cleaned up the test failure reasons. The refactor hid a very sneaky bug; would love your re-review to make sure its still ok to merge.

@dchw dchw disabled auto-merge February 18, 2022 00:58
fe.urls, err = fe.setupAndValidateAddresses(FrontendStub, cfg)
if err != nil {
return nil, errors.Wrap(err, "failed to calculate buildkit URLs")
}
Copy link
Collaborator Author

@dchw dchw Feb 18, 2022

Choose a reason for hiding this comment

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

This was the source of the bug. We used to calculate URLs after choosing a frontend; but by choosing the stub, we would end up skipping the calculations instead during our unit tests. The solution was to also let the stub calculate URLs; so the remote buildkit would end up being chosen.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ohhhh buddy did this take a while to figure out.

all := []string{binary}
all = append(all, args...)

return fmt.Sprintf("cat %s | %s", filename, strings.Join(all, " "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return fmt.Sprintf("cat %s | %s", filename, strings.Join(all, " "))
return fmt.Sprintf("cat %s | %s", shellescape.QuoteCommand(filename), strings.Join(all, " "))

Copy link
Collaborator

@alexcb alexcb left a comment

Choose a reason for hiding this comment

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

looks good, just a minor edge-case

Copy link
Contributor

@brandonSc brandonSc left a comment

Choose a reason for hiding this comment

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

Nice job 🥇

@dchw dchw enabled auto-merge (squash) February 22, 2022 19:02
@dchw dchw merged commit de6d08f into main Feb 22, 2022
@dchw dchw deleted the corey/podman-earthly-develop branch February 22, 2022 19:25
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

3 participants