Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ registry (available at `localhost:5000`).
task e2e:setup-env
```

> [!INFO]
> Use the `REGISTRY_HOST_PORT` variable to customize the local registry port.
> If changed, you must pass this variable to all subsequent tasks that interact
> with the registry to ensure connectivity.

### Get access to the cluster

To interact with the cluster via `kubectl` from your local terminal:
Expand All @@ -177,9 +182,10 @@ export KUBECONFIG=$PWD/kubeconfig
```

> [!IMPORTANT]
> The local registry running alongside the Kind cluster is reachable within
> Kubernetes at `registry.extensions:5000`. When testing your local builds, you
> must point the extension's `reference` to this internal address.
> By default, the local registry running alongside the Kind cluster is
> reachable within Kubernetes at `registry.extensions:5000`. When testing your
> local builds, you must point the extension's `reference` to this internal
> address.
> For example, if you are testing a locally built `pgvector` image, use:
> `reference: registry.extensions:5000/pgvector-testing:<tag>`

Expand Down
12 changes: 8 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ vars:
E2E_NETWORK: pg-extensions-e2e
DAGGER_ENGINE_NAME: dagger-engine-pg-extensions
REGISTRY_NAME: registry.pg-extensions
REGISTRY_HOST_IP: localhost
REGISTRY_HOST_PORT: 5000
REGISTRY_INTERNAL_PORT: 5000
# renovate: datasource=git-refs depName=kind lookupName=https://github.com/aweris/daggerverse currentValue=main
DAGGER_KIND_SHA: dadbc09a1e0790ccbf1d88f796308b26a12f0488
# renovate: datasource=docker depName=kindest/node versioning=docker
Expand Down Expand Up @@ -72,6 +74,8 @@ tasks:
- prereqs
prefix: 'bake-{{.TARGET}}'
silent: true
env:
registry: '{{ .REGISTRY_HOST_IP }}:{{ .REGISTRY_HOST_PORT }}'
vars:
PUSH: '{{.PUSH | default "false"}}'
DRY_RUN: '{{.DRY_RUN | default "false"}}'
Expand Down Expand Up @@ -181,7 +185,7 @@ tasks:
REGISTRY_VERSION: 3.0.0@sha256:6c5666b861f3505b116bb9aa9b25175e71210414bd010d92035ff64018f9457e
cmds:
- >
docker run -d --name {{ .REGISTRY_NAME }} --rm -p {{ .REGISTRY_HOST_PORT }}:5000
docker run -d --name {{ .REGISTRY_NAME }} --rm -p {{ .REGISTRY_HOST_PORT }}:{{ .REGISTRY_INTERNAL_PORT }}
--network {{ .E2E_NETWORK }} registry:{{ .REGISTRY_VERSION }}
status:
- test "$(docker inspect -f {{`'{{json .State.Running}}'`}} {{ .REGISTRY_NAME }})" == "true"
Expand Down Expand Up @@ -210,7 +214,7 @@ tasks:
internal: true
run: once
vars:
REGISTRY_DIR: /etc/containerd/certs.d/{{ .REGISTRY_NAME }}:{{ .REGISTRY_HOST_PORT }}
REGISTRY_DIR: /etc/containerd/certs.d/{{ .REGISTRY_NAME }}:{{ .REGISTRY_INTERNAL_PORT }}
DOCKER_SOCKET:
sh: docker context inspect -f {{`'{{json .Endpoints.docker.Host}}'`}} $(docker context show)
env:
Expand All @@ -224,7 +228,7 @@ tasks:
- docker exec "{{ .KIND_CLUSTER_NAME }}-control-plane" mkdir -p "{{ .REGISTRY_DIR }}"
- |
cat <<EOF | docker exec -i "{{ .KIND_CLUSTER_NAME }}-control-plane" cp /dev/stdin "{{ .REGISTRY_DIR }}/hosts.toml"
[host."http://{{ .REGISTRY_NAME }}:5000"]
[host."http://{{ .REGISTRY_NAME }}:{{ .REGISTRY_INTERNAL_PORT }}"]
EOF
status:
- >
Expand Down Expand Up @@ -327,7 +331,7 @@ tasks:
EXTENSION_IMAGE:
# We need to replace localhost with the registry container name as it is how
# the registry is reachable from within the Docker network.
sh: sed -E 's/^localhost/{{ .REGISTRY_NAME }}/;t' <<< "{{ .EXTENSION_IMAGE }}"
sh: sed -E 's/^{{ .REGISTRY_HOST_IP }}:{{ .REGISTRY_HOST_PORT }}/{{ .REGISTRY_NAME }}:{{ .REGISTRY_INTERNAL_PORT }}/;t' <<< "{{ .EXTENSION_IMAGE }}"
requires:
vars:
- name: TARGET
Expand Down
Loading