Skip to content

Commit

Permalink
dev: fix broken 'make prebuild'
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
  • Loading branch information
spacewander committed Oct 23, 2024
1 parent f1f3d87 commit c6af264
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-and-push-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
# https://github.com/mosn/htnn/pkgs/container/htnn-proxy
- name: Build and push Docker image
run: |
make prebuild
cd ./manifests
# push image with the dev tag
export PROXY_IMAGE=${{ env.PROXY_IMAGE_NAME }}:dev
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ verify-example:
cd ./examples/dev_your_plugin && ./verify.sh

# use a path outside repo so the linters won't lint the istio files
TARGET_ISTIO_DIR ?= $(shell pwd)/../istio
TARGET_ISTIO_DIR = $(shell pwd)/../istio

.PHONY: prebuild
prebuild:
Expand Down
6 changes: 3 additions & 3 deletions manifests/images/cp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ WORKDIR /workspace
# Copy the source

COPY go.* ./
RUN sed -i 's/.\/site/.\/external\/istio/' go.work && sed -i '/.\/e2e/d' go.work && sed -i '/.\/tools/d' go.work
RUN sed -i '/.\/site/d' go.work && sed -i '/.\/e2e/d' go.work && sed -i '/.\/tools/d' go.work
# use single layer to copy only works on files, so we have to list all the directories
COPY api/ api/
COPY types/ types/
Expand All @@ -49,8 +49,8 @@ _EOF

# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y patch --no-install-recommends
RUN TARGET_ISTIO_DIR=$(pwd)/external/istio make prebuild
WORKDIR /workspace/external/istio
RUN make prebuild
WORKDIR /istio
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -C pilot/cmd/pilot-discovery -a -o /workspace/pilot-discovery

# hadolint ignore=DL3006
Expand Down
6 changes: 3 additions & 3 deletions manifests/images/dp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ WORKDIR /workspace
# Copy the source

COPY go.* ./
RUN sed -i 's/.\/site/.\/external\/istio/' go.work && sed -i '/.\/e2e/d' go.work && sed -i '/.\/tools/d' go.work
RUN sed -i '/.\/site/d' go.work && sed -i '/.\/e2e/d' go.work && sed -i '/.\/tools/d' go.work
COPY api/ api/
COPY types/ types/
COPY plugins/ plugins/
Expand All @@ -48,7 +48,7 @@ _EOF

# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y patch --no-install-recommends
RUN TARGET_ISTIO_DIR=$(pwd)/external/istio make prebuild
RUN make prebuild

COPY patch/switch-envoy-go-version.sh patch/switch-envoy-go-version.sh
COPY common.mk common.mk
Expand All @@ -57,7 +57,7 @@ RUN ./patch/switch-envoy-go-version.sh 1.29.5 && \
cd plugins/ && \
ENVOY_API_VERSION=1.29 make build-so-local

WORKDIR /workspace/external/istio
WORKDIR /istio
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -C pilot/cmd/pilot-agent -a -o /workspace/pilot-agent

# hadolint ignore=DL3006
Expand Down
6 changes: 3 additions & 3 deletions patch/istio/1.21/20240410-htnn-go-mod.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ index e7f308e890..def9507093 100644
+)
+
+replace (
+ mosn.io/htnn/api => ../../api
+ mosn.io/htnn/controller => ../../controller
+ mosn.io/htnn/types => ../../types
+ mosn.io/htnn/api => ../htnn/api
+ mosn.io/htnn/controller => ../htnn/controller
+ mosn.io/htnn/types => ../htnn/types
+)
+
+// Downgrade some deps to match the one used in istio
Expand Down

0 comments on commit c6af264

Please sign in to comment.