-
Notifications
You must be signed in to change notification settings - Fork 455
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
Simplify builders config #905
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
djmb
force-pushed
the
simplify-builders-config
branch
2 times, most recently
from
August 28, 2024 10:45
df04cd4
to
e1de023
Compare
Much nicer, much simpler. Need to update the Rails default config/deploy.yml when this is released. |
Combine the two builders, as they are almost identical. The only difference was whether the platforms were set. The native cached builder wasn't using the context it created, so now we do. We'll set the driver to `docker-container` - it seems to be the default but the Docker docs claim it is `docker`.
It's just a remote builder, that will build whichever platform is asked for, so let's remove the "native" part. We'll also remove the service name from the builder name, so multiple services can share the same builder.
We already ensure that buildx is installed, so let's always use it.
This ensures we use the docker-container driver and not whatever the local default is.
Include the host name in the builder name, so we can have one builder per host/arch across all kamal projects. Inherit from the remote builder. The difference in the hybrid builder is that we create a local buildx instance and append the remote context to it.
The remote host is now encoded in the builder name so we don't need to check it. We'll just do an inspect to confirm the builder exists.
Remote and local are only allowed when multiarch is enabled. Remote requires a host and arch, local only requires an arch.
1. Add driver as an option, defaulting to `docker-container`. For a "native" build you can set it to `docker` 2. Set arch as a array of architectures to build for, defaulting to `[ "amd64", "arm64" ]` unless you are using the docker driver in which case we default to not setting a platform 3. Remote is now just a connection string for the remote builder 4. If remote is set, we only use it for non-local arches, if we are only building for the local arch, we'll ignore it. Examples: On arm64, build for arm64 locally, amd64 remotely or On amd64, build for amd64 locally, arm64 remotely: ```yaml builder: remote: ssh://docker@docker-builder ``` On arm64, build amd64 on remote, On amd64 build locally: ```yaml builder: arch: - amd64 remote: host: ssh://docker@docker-builder ``` Build amd64 on local: ```yaml builder: arch: - amd64 ``` Use docker driver, building for local arch: ```yaml builder: driver: docker ```
djmb
force-pushed
the
simplify-builders-config
branch
from
August 29, 2024 07:46
ce5b6cc
to
5f2384f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
amd64
in the templatesExamples:
On arm64, build for arm64 locally, amd64 remotely and
on amd64, build for amd64 locally, arm64 remotely:
On arm64, build amd64 on remote and on amd64 build locally:
Build amd64 on local:
Use docker driver, building for local arch: