From 63d43c7fdf9ff4a8a65b6fd86cf681f8b2059ca1 Mon Sep 17 00:00:00 2001 From: John Stairs Date: Wed, 7 Jan 2026 14:20:31 +0000 Subject: [PATCH 1/2] Refactor Docker build targets and scripts and exclude testconnectivity from official image list --- Makefile | 16 ++++---- Makefile.cloud | 4 +- Makefile.docker | 2 +- scripts/build-images.sh | 84 +++++++++++++++++------------------------ server/Dockerfile | 4 +- 5 files changed, 47 insertions(+), 63 deletions(-) diff --git a/Makefile b/Makefile index 0c6ea86d..68e178ff 100644 --- a/Makefile +++ b/Makefile @@ -85,30 +85,30 @@ _docker-build: docker-build-test: login-acr $(MAKE) _docker-build DOCKER_BUILD_TARGET=test-connectivity -docker-build-tyger-server: login-acr - $(MAKE) _docker-build DOCKER_BUILD_TARGET=tyger-server +docker-build-server: login-acr + $(MAKE) _docker-build DOCKER_BUILD_TARGET=server -docker-build-buffer-sidecar: login-acr - $(MAKE) _docker-build DOCKER_BUILD_TARGET=buffer-sidecar +docker-build-client: login-acr + $(MAKE) _docker-build DOCKER_BUILD_TARGET=client docker-build-helm: login-acr $(MAKE) _docker-build DOCKER_BUILD_TARGET=helm -docker-build: docker-build-test docker-build-tyger-server docker-build-buffer-sidecar +docker-build: docker-build-test docker-build-server docker-build-client publish-official-images: container_registry_spec=$$(echo '${DEVELOPER_CONFIG_JSON}' | jq -c '.officialPushContainerRegistry') export EXPLICIT_IMAGE_TAG="$$(git describe --tags)" - $(MAKE) DOCKER_BUILD_ARCH_FLAGS="--arch amd64 --arch arm64" CONTAINER_REGISTRY_SPEC="$${container_registry_spec}" docker-build docker-build-helm + $(MAKE) DOCKER_BUILD_ARCH_FLAGS="--arch amd64 --arch arm64" CONTAINER_REGISTRY_SPEC="$${container_registry_spec}" docker-build-server docker-build-client docker-build-helm publish-ghcr: container_registry_spec="{\"fqdn\": \"ghcr.io\", \"directory\": \"/$${GITHUB_REPOSITORY}\"}" - $(MAKE) DOCKER_BUILD_ARCH_FLAGS="--arch amd64 --arch arm64" CONTAINER_REGISTRY_SPEC="$${container_registry_spec}" docker-build docker-build-helm + $(MAKE) DOCKER_BUILD_ARCH_FLAGS="--arch amd64 --arch arm64" CONTAINER_REGISTRY_SPEC="$${container_registry_spec}" docker-build-server docker-build-client docker-build-helm prepare-wip-binaries: tag="$$(git describe --tags)-$$(date +'%Y%m%d%H%M%S')" export EXPLICIT_IMAGE_TAG=$${tag} - $(MAKE) DOCKER_BUILD_ARCH_FLAGS="--arch amd64 --arch arm64" docker-build docker-build-helm + $(MAKE) DOCKER_BUILD_ARCH_FLAGS="--arch amd64 --arch arm64" docker-build-server docker-build-client docker-build-helm $(MAKE) install-cli integration-test-no-up-prereqs: diff --git a/Makefile.cloud b/Makefile.cloud index b3d9006e..b1c8bcc5 100644 --- a/Makefile.cloud +++ b/Makefile.cloud @@ -137,14 +137,14 @@ set-localsettings: set-context } EOF -up: install-cli ensure-environment-conditionally docker-build-tyger-server docker-build-buffer-sidecar docker-build-test +up: install-cli ensure-environment-conditionally docker-build-server docker-build-client docker-build-test tyger api install -f <(scripts/get-config.sh) $(MAKE) cli-ready down: install-cli tyger api uninstall -f <(scripts/get-config.sh) -migrate: ensure-environment-conditionally docker-build-tyger-server +migrate: ensure-environment-conditionally docker-build-server tyger api migrations apply --latest --wait -f <(scripts/get-config.sh) download-test-client-cert: diff --git a/Makefile.docker b/Makefile.docker index ec99a7e5..f30a57b4 100644 --- a/Makefile.docker +++ b/Makefile.docker @@ -74,7 +74,7 @@ set-data-plane-localsettings: } EOF -up: ensure-data-plane-cert install-cli docker-build-tyger-server docker-build-buffer-sidecar docker-build-test +up: ensure-data-plane-cert install-cli docker-build-server docker-build-client docker-build-test tyger api install -f <(scripts/get-config.sh --docker) down: install-cli diff --git a/scripts/build-images.sh b/scripts/build-images.sh index 87ea9164..8fb250ec 100755 --- a/scripts/build-images.sh +++ b/scripts/build-images.sh @@ -14,9 +14,9 @@ Usage: $0 [options] Options: -r, --registry The FQDN of container registry to push to. - --test-connectivity Build (and optionally push) the testconnectivity image - --tyger-server Build (and optionally push) the tyger-server image - --buffer-sidecar Build (and optionally push) the buffer-sidecar image + --test Build (and optionally push) the test images + --server Build (and optionally push) the server images (i.e. the C# code) + --client Build (and optionally push) the client images (i.e. the Go code) --helm Package and push the Tyger Helm chart --registry-directory The parent directory of the repositories. e.g. // --arch amd64|arm64 The architecture to build for. Can be specified multiple times. @@ -39,15 +39,15 @@ while [[ $# -gt 0 ]]; do shift 2 ;; --test-connectivity) - test_connectivity=1 + test=1 shift ;; - --tyger-server) - tyger_server=1 + --server) + server=1 shift ;; - --buffer-sidecar) - buffer_sidecar=1 + --client) + client=1 shift ;; --helm) @@ -119,11 +119,17 @@ export DOCKER_BUILDKIT=1 repo_root_dir="$(dirname "$0")/.." function build_and_push_platform() { + local build_context="$1" + local dockerfile_path="$2" + local repo="$3" + local platform="$4" + local image_tag_with_platform="${image_tag}-${platform}" + full_image="${container_registry_fqdn}${registry_dir}${repo}:${image_tag_with_platform}" echo "Building image ${full_image}..." set +e - output=$(docker buildx build --platform "${platform}" -f "${dockerfile_path}" -t "${full_image}" --target "${target}" --build-arg TYGER_VERSION="${image_tag}" "${build_context}" --provenance false --progress plain 2>&1) + output=$(docker buildx build --platform "${platform}" -f "${dockerfile_path}" -t "${full_image}" --target "${repo}" --build-arg TYGER_VERSION="${image_tag}" "${build_context}" --provenance false --progress plain 2>&1) ret=$? set -e if [[ $ret -ne 0 ]]; then @@ -151,16 +157,16 @@ function build_and_push_platform() { } function build_and_push() { + local build_context="$1" + local dockerfile_path="$2" + local repo="$3" + if [[ -n "${amd64:-}" ]]; then - platform=amd64 - image_tag_with_platform=$"${image_tag}-${platform}" - build_and_push_platform + build_and_push_platform "${build_context}" "${dockerfile_path}" "${repo}" "amd64" fi if [[ -n "${arm64:-}" ]]; then - platform=arm64 - image_tag_with_platform=$"${image_tag}-${platform}" - build_and_push_platform + build_and_push_platform "${build_context}" "${dockerfile_path}" "${repo}" "arm64" fi # if not pushing or not building for both platforms, skip creating a manifest @@ -185,51 +191,29 @@ function build_and_push() { docker manifest push "${manifest_name}" --purge >/dev/null } -if [[ -n "${test_connectivity:-}" ]]; then +if [[ -n "${test:-}" ]]; then build_context="${repo_root_dir}/cli" - dockerfile_path="${repo_root_dir}/cli/integrationtest/testconnectivity/Dockerfile" - target="testconnectivity" - repo="testconnectivity" + dockerfile="${repo_root_dir}/cli/integrationtest/testconnectivity/Dockerfile" - build_and_push + build_and_push "${build_context}" "${dockerfile}" "testconnectivity" fi -if [[ -n "${tyger_server:-}" ]]; then +if [[ -n "${server:-}" ]]; then build_context="${repo_root_dir}/" - dockerfile_path="${repo_root_dir}/server/Dockerfile" - target="control-plane" - repo="tyger-server" - - build_and_push + dockerfile="${repo_root_dir}/server/Dockerfile" - target="data-plane" - repo="tyger-data-plane-server" - - build_and_push + build_and_push "${build_context}" "${dockerfile}" "tyger-server" + build_and_push "${build_context}" "${dockerfile}" "tyger-data-plane-server" fi -if [[ -n "${buffer_sidecar:-}" ]]; then +if [[ -n "${client:-}" ]]; then build_context="${repo_root_dir}/cli" - dockerfile_path="${repo_root_dir}/cli/Dockerfile" - target="buffer-sidecar" - repo="buffer-sidecar" - - build_and_push - - target="tyger-cli" - repo="tyger-cli" - - build_and_push - - target="buffer-copier" - repo="buffer-copier" - - build_and_push - - target="worker-waiter" - repo="worker-waiter" + dockerfile="${repo_root_dir}/cli/Dockerfile" - build_and_push + build_and_push "${build_context}" "${dockerfile}" "buffer-sidecar" + build_and_push "${build_context}" "${dockerfile}" "tyger-cli" + build_and_push "${build_context}" "${dockerfile}" "buffer-copier" + build_and_push "${build_context}" "${dockerfile}" "worker-waiter" fi if [[ -n "${helm:-}" ]]; then diff --git a/server/Dockerfile b/server/Dockerfile index 9f84ced8..89106783 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -44,7 +44,7 @@ RUN dotnet publish --no-restore --arch ${TARGETARCH} -c release -o /data-plane FROM mcr.microsoft.com/dotnet/aspnet:9.0.11-azurelinux3.0 AS runtime-prep -FROM mcr.microsoft.com/dotnet/aspnet:9.0.11-azurelinux3.0-distroless AS control-plane +FROM mcr.microsoft.com/dotnet/aspnet:9.0.11-azurelinux3.0-distroless AS tyger-server COPY --from=build /cp /app WORKDIR /app/bin COPY --from=runtime-prep /usr/bin/sleep . @@ -53,7 +53,7 @@ COPY --from=build /control-plane . USER app:app ENTRYPOINT ["/app/bin/tyger-server"] -FROM mcr.microsoft.com/dotnet/aspnet:9.0.11-azurelinux3.0-distroless AS data-plane +FROM mcr.microsoft.com/dotnet/aspnet:9.0.11-azurelinux3.0-distroless AS tyger-data-plane-server COPY --from=build /dp /app WORKDIR /app/bin COPY --from=build /static/curl . From e1043b8aa634f0f376bd3311169fd8d20fcf8b5a Mon Sep 17 00:00:00 2001 From: John Stairs Date: Thu, 15 Jan 2026 17:05:13 +0000 Subject: [PATCH 2/2] PR feedback --- Makefile | 2 +- scripts/build-images.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 68e178ff..4826559b 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ _docker-build: scripts/build-images.sh $$target_arg ${DOCKER_BUILD_ARCH_FLAGS} ${DOCKER_BUILD_PUSH_FLAGS} --tag "$$tag" --registry "$${registry}" --registry-directory "$${directory}" docker-build-test: login-acr - $(MAKE) _docker-build DOCKER_BUILD_TARGET=test-connectivity + $(MAKE) _docker-build DOCKER_BUILD_TARGET=test docker-build-server: login-acr $(MAKE) _docker-build DOCKER_BUILD_TARGET=server diff --git a/scripts/build-images.sh b/scripts/build-images.sh index 8fb250ec..c6fb16cc 100755 --- a/scripts/build-images.sh +++ b/scripts/build-images.sh @@ -38,7 +38,7 @@ while [[ $# -gt 0 ]]; do container_registry_fqdn="$2" shift 2 ;; - --test-connectivity) + --test) test=1 shift ;;