I'm trying to use buildkit on Mac M1
# 🤖|ask-kapa
m
Please stand by @most-window-13633 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- To use BuildKit on a Mac M1, you can follow these steps: 1. Ensure that the requirements () are installed on your machine. 2. Visit the Garden releases page () on GitHub and download the macOS archive (under Assets). 3. Create a
~/.garden/bin
directory, and extract the archive to that directory. Make sure to include the whole contents of the archive. 4. Add the
~/.garden/bin
directory to your PATH, or add a symlink from your
/usr/local/bin/garden
to the binary at
~/.garden/bin/garden
. For building images, you can choose between building your images locally with Docker using the
local-docker
build mode or remotely, in the cluster itself. If you want to use the
cluster-buildkit
build mode, add the following to your configuration:
Copy code
yaml
providers:
- name: kubernetes
  buildMode: "cluster-buildkit" # <--- Add this
Please note that there is an open feature request on Garden's GitHub page to support multi-platform builds with local-docker mode (enable BuildKit). This feature would allow you to build an image for a platform other than a platform of the machine where Garden is executed. You can follow the progress of this feature request here (). Sources: - Garden Installation Guide () - Garden GitHub Issue #3106 () - Garden Kubernetes Plugin Configuration () ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Let me check the knowledge base for you. One moment! :books:
m
@microscopic-river-74022 I have this
Copy code
---
apiVersion: garden.io/v1
kind: Project
name: cloudprem
defaultEnvironment: local
environments:
- name: local
providers:
- name: kubernetes
  context: ${variables.kubeContext}
  environments: ["local"]
  buildMode: cluster-buildkit
  deploymentRegistry:
    hostname: ${variables.registryInternalHostname}
    insecure: true
    namespace: formancehq
    port: ${variables.registryInternalPort}
  imagePullSecrets:
    - name: docker-registry-credentials
      namespace: formance-system
variables:
  env: local
  kubeContext: k3d-formance
  clusterName: formance
  formanceNamespace: formance-system
  namespace: membership
  registryInternalHostname: k3d-registry.host.k3d.internal
  registryInternalPort: 5000
  disableAgent: false           #build, test, deploy
  disableAuth: true             #build, test
  disableConsole: true          #none
  disableGateway: true          #build, test
  disableLedger: true           #build, test
  disableMembership: false      #build, test, deploy,
  disableOperator: false        #build, test
  disableOrchestration: true    #build, test
  disablePayments: true         #build, test
  disableSearch: true           #build, test
  disableStargate: true         #Client & Server: build, test
  disableWallets: true          #build, test
  disableWebhooks: true         #build, test
m
---------------------- It seems like you have a Garden configuration file for a project named
cloudprem
. This configuration is set to use the
local
environment by default and the Kubernetes provider for building, testing, and deploying your services. The build mode is set to
cluster-buildkit
, which means that your images will be built in the cluster itself. The
deploymentRegistry
field is configured to use an internal registry, with the hostname and port specified by the variables
registryInternalHostname
and
registryInternalPort
. The
insecure
field is set to
true
, which means that the connection to the registry is not secured by TLS. The
imagePullSecrets
field specifies a secret named
docker-registry-credentials
in the
formance-system
namespace. This secret is used to authenticate with the registry when pulling images. The
variables
field defines a set of variables that are used in the configuration. For example,
kubeContext
is set to
k3d-formance
, which is the context for your local Kubernetes cluster. The
disable*
variables seem to control whether certain components of your system should be built, tested, or deployed. For example,
disableAgent
is set to
false
, which means that the agent component will be built, tested, and deployed. If you have any specific questions about this configuration or if you're encountering any issues, feel free to ask! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Let me check the knowledge base for you. One moment! :books:
m
@microscopic-river-74022 I have this --- apiVersion: garden.io/v1 kind: Project name: cloudprem defaultEnvironment: local environments: - name: local providers: - name: kubernetes context: ${variables.kubeContext} environments: ["local"] buildMode: cluster-buildkit deploymentRegistry: hostname: ${variables.registryInternalHostname} insecure: true namespace: formancehq port: ${variables.registryInternalPort} imagePullSecrets: - name: docker-registry-credentials namespace: formance-system variables: env: local kubeContext: k3d-formance clusterName: formance formanceNamespace: formance-system namespace: membership registryInternalHostname: k3d-registry.host.k3d.internal registryInternalPort: 5000 disableAgent: false #build, test, deploy disableAuth: true #build, test disableConsole: true #none disableGateway: true #build, test disableLedger: true #build, test disableMembership: false #build, test, deploy, disableOperator: false #build, test disableOrchestration: true #build, test disablePayments: true #build, test disableSearch: true #build, test disableStargate: true #Client & Server: build, test disableWallets: true #build, test disableWebhooks: true #build, test
m
Let me check the knowledge base for you. One moment! :books:
m
@microscopic-river-74022 I have this --- apiVersion: garden.io/v1 kind: Project name: cloudprem defaultEnvironment: local environments: - name: local providers: - name: kubernetes context: ${variables.kubeContext} environments: ["local"] buildMode: cluster-buildkit deploymentRegistry: hostname: ${variables.registryInternalHostname} insecure: true namespace: formancehq port: ${variables.registryInternalPort} imagePullSecrets: - name: docker-registry-credentials namespace: formance-system variables: env: local kubeContext: k3d-formance clusterName: formance formanceNamespace: formance-system namespace: membership registryInternalHostname: k3d-registry.host.k3d.internal registryInternalPort: 5000 disableAgent: false #build, test, deploy disableAuth: true #build, test disableConsole: true #none disableGateway: true #build, test disableLedger: true #build, test disableMembership: false #build, test, deploy, disableOperator: false #build, test disableOrchestration: true #build, test disablePayments: true #build, test disableSearch: true #build, test disableStargate: true #Client & Server: build, test disableWallets: true #build, test disableWebhooks: true #build, test And i am on Mac M1, but builkit seems not working
m
---------------------- This is a Garden configuration file for a project named
cloudprem
. It's set to use the
local
environment by default and the Kubernetes provider for building, testing, and deploying your services. Here's a breakdown of the key parts of your configuration: -
apiVersion
,
kind
, `name`: These fields specify the version of the Garden API, the kind of the configuration file (in this case, a Project), and the name of the project. - `defaultEnvironment`: This field sets the default environment to
local
. - `environments`: This field lists all the environments for your project. In this case, there's only one environment named
local
. - `providers`: This field specifies the providers for your project. In this case, you're using the Kubernetes provider. The
context
field is set to the value of the
kubeContext
variable, which is
k3d-formance
. - `buildMode`: This field is set to
cluster-buildkit
, which means that your images will be built in the cluster itself. - `deploymentRegistry`: This field specifies the details of the registry where your images will be deployed. The
hostname
and
port
fields are set to the values of the
registryInternalHostname
and
registryInternalPort
variables, respectively. - `imagePullSecrets`: This field specifies the secrets to be used for pulling images from the registry. In this case, a secret named
docker-registry-credentials
in the
formance-system
namespace is used. - `variables`: This field defines a set of variables that are used in the configuration. For example,
kubeContext
is set to
k3d-formance
, which is the context for your local Kubernetes cluster.
The
disable*
variables seem to control whether certain components of your system should be built, tested, or deployed. For example,
disableAgent
is set to
false
, which means that the agent component will be built, tested, and deployed. If you have any specific questions about this configuration or if you're encountering any issues, feel free to ask! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
---------------------- From the configuration you've provided, it seems you're using the
cluster-buildkit
mode for building your images. This mode dynamically creates a BuildKit Deployment in each project namespace to perform in-cluster builds. However, if you're experiencing issues with BuildKit on your Mac M1, it could be due to a variety of reasons. Here are a few things you could check: 1. Ensure that Docker Desktop is installed and running on your machine. BuildKit is a part of Docker, so you need to have Docker installed to use it. 2. Check if your Kubernetes context is correctly set to
k3d-formance
as specified in your Garden configuration. 3. Make sure that your internal registry (
k3d-registry.host.k3d.internal
) is correctly set up and accessible. 4. Verify that the
docker-registry-credentials
secret exists in the
formance-system
namespace and contains the correct credentials for your registry. 5. Check the logs for the BuildKit pods in your Kubernetes cluster. They might contain useful information about what's going wrong. If you're still having trouble, it might be helpful to provide more specific details about the issues you're experiencing. For example, are there any error messages? At what stage does the process fail? Please note that there is an open feature request on Garden's GitHub page to support multi-platform builds with local-docker mode (enable BuildKit). This feature would allow you to build an image for a platform other than a platform of the machine where Garden is executed. You can follow the progress of this feature request here (). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------