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

Adds support for Docker Build Cloud #1354

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

matthewbjones
Copy link
Contributor

@matthewbjones matthewbjones commented Jan 14, 2025

This PR aims to add the minimal amount of code changes to support building using Docker Build Cloud

Although Kamal already currently supports remote builds using remote: ssh://user@ip-address, some individuals or organizations may prefer to use Docker Build Cloud for remote compiling (for example, you don't have a remote machine around to utilize remote builds)

Assuming you're using Docker Build Cloud, and you've already created a builder on your Docker Build Cloud, then, all you need to do with Kamal is specify the driver:

driver: cloud org-name/builder-name

When specifying driver: cloud ..., the buildx commands will now pass in a --builder cloud-org-name-builder-name to instruct buildx to use that builder. It will also automatically register and remove the cloud driver as well.

Related Discussion: #914

@nickhammond
Copy link
Contributor

@alexohre Can you try this PR out for your cloud build?

@matthewbjones matthewbjones force-pushed the feature/docker-build-cloud branch from 821ba25 to 4530a0a Compare January 14, 2025 18:32
@matthewbjones
Copy link
Contributor Author

I believe the build failure is an intermittent failure and should pass if the GitHub Actions were re-ran. I don't see a way to do that myself.

@nickhammond
Copy link
Contributor

nickhammond commented Jan 14, 2025

@matthewbjones Can we create the build setup automatically? That'll keep it closer in functionality to the remote builder. We'd just need create_buildx and remove_buildx.

https://github.com/basecamp/kamal/blob/main/lib/kamal/commands/builder/remote.rb#L56

@matthewbjones matthewbjones force-pushed the feature/docker-build-cloud branch from 4530a0a to 3c47f64 Compare January 14, 2025 19:40
@matthewbjones
Copy link
Contributor Author

@matthewbjones Can we create the build setup automatically? That'll keep it closer in functionality to the remote builder. We'd just need create_buildx and remove_buildx.

https://github.com/basecamp/kamal/blob/main/lib/kamal/commands/builder/remote.rb#L56

Thanks for the suggestion, I've updated the PR to add this functionality.

@alexohre
Copy link

alexohre commented Jan 15, 2025

@alexohre Can you try this PR out for your cloud build?

Thanks for the update @nickhammond, That's exactly what I've been waiting for all this while.

@nickhammond
Copy link
Contributor

@alexohre All credit goes to @matthewbjones! 🙌

@alexohre
Copy link

@nickhammond definitely, a big thanks to @matthewbjones for his exceptional contribution 👏

@djmb
Copy link
Collaborator

djmb commented Jan 17, 2025

Looks great @matthewbjones. Just one suggestion and we can get that merged.

@matthewbjones matthewbjones force-pushed the feature/docker-build-cloud branch from 3c47f64 to b420b26 Compare January 17, 2025 14:14
@matthewbjones
Copy link
Contributor Author

@djmb Thanks for the code review and suggestion, I've updated the PR as requested

@matthewbjones
Copy link
Contributor Author

@djmb all tests passed locally, and passed previously, the slight code update shouldn't have caused test failures. I don't see a way on my end to have GitHub Actions re-run, are you able to do that on your end?

@djmb
Copy link
Collaborator

djmb commented Jan 17, 2025

@matthewbjones - I think you just caught some broken tests on main. They are fixed now and I've merged in main, so hopefully that will fix them

@matthewbjones
Copy link
Contributor Author

matthewbjones commented Jan 17, 2025

@matthewbjones - I think you just caught some broken tests on main. They are fixed now and I've merged in main, so hopefully that will fix them

@djmb Makes sense, thanks! Looks like they all pass now :-)

@djmb djmb merged commit f8db5de into basecamp:main Jan 20, 2025
8 checks passed
@alexohre
Copy link

I thought this branch had been merged with the main.

I added driver: cloud org-name/builder-name under my builder, but it's not working. Am I missing something?

@nickhammond
Copy link
Contributor

@alexohre It has but a release hasn't been cut yet.

You can point your Gemfile at this repo and then prefix your kamal commands with bundle exec though.

@alexohre
Copy link

thanks @nickhammond, it's working now.

image

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.

4 participants