From 143cd054318ef8037d051d953be0e0a073f6410d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B8=E9=B9=8F?= Date: Wed, 11 May 2022 09:34:00 +0800 Subject: [PATCH] fix the istio-diff links (#199) --- .../quick-start/istio/{index.md => _index.md} | 2 +- .../{istio-diff.md => istio-diff/index.md} | 5 ++ .../start/istio/{index.md => _index.md} | 5 +- .../start/istio/istio-diff/index.md | 85 +++++++++++++++++++ 4 files changed, 93 insertions(+), 4 deletions(-) rename content/en/docs/quick-start/istio/{index.md => _index.md} (99%) rename content/en/docs/quick-start/istio/{istio-diff.md => istio-diff/index.md} (99%) rename content/zh/docs/user-guide/start/istio/{index.md => _index.md} (99%) create mode 100644 content/zh/docs/user-guide/start/istio/istio-diff/index.md diff --git a/content/en/docs/quick-start/istio/index.md b/content/en/docs/quick-start/istio/_index.md similarity index 99% rename from content/en/docs/quick-start/istio/index.md rename to content/en/docs/quick-start/istio/_index.md index b2d00a51..a798076f 100644 --- a/content/en/docs/quick-start/istio/index.md +++ b/content/en/docs/quick-start/istio/_index.md @@ -42,7 +42,7 @@ cd istio git checkout 1.10.6 ``` -2. Istio will load wasm by default. To simplify, we need to comment out this part of the code. see details in [istio-diff](./istio-diff.md) +2. Istio will load wasm by default. To simplify, we need to comment out this part of the code. see details in [istio-diff](./istio-diff) 3. Build a MOSN binary. You can use the make command provided by MOSN project to build a binary on linux. As the same time, since we are using MacOS, we also need to compile a MacOS binary. diff --git a/content/en/docs/quick-start/istio/istio-diff.md b/content/en/docs/quick-start/istio/istio-diff/index.md similarity index 99% rename from content/en/docs/quick-start/istio/istio-diff.md rename to content/en/docs/quick-start/istio/istio-diff/index.md index ec7e673a..3548938b 100644 --- a/content/en/docs/quick-start/istio/istio-diff.md +++ b/content/en/docs/quick-start/istio/istio-diff/index.md @@ -1,3 +1,8 @@ +--- +date: 2022-03-25 +weight: 2 +--- + bin/init.sh ```diff diff --git a/content/zh/docs/user-guide/start/istio/index.md b/content/zh/docs/user-guide/start/istio/_index.md similarity index 99% rename from content/zh/docs/user-guide/start/istio/index.md rename to content/zh/docs/user-guide/start/istio/_index.md index 9b5e84d5..9805b0c3 100644 --- a/content/zh/docs/user-guide/start/istio/index.md +++ b/content/zh/docs/user-guide/start/istio/_index.md @@ -2,11 +2,10 @@ title: "MOSN 作为 Istio 的数据平面" linkTitle: "集成 Istio" date: 2022-03-25 -aliases: "/zh/docs/quick-startistio" +aliases: "/zh/docs/istio" weight: 2 description: > 本文将介绍如何使用 MOSN 在 Istio 框架下搭建 Service Mesh 的开发环境,并验证 MOSN 的一些基础路由能力、负载均衡能力等。 - --- {{% pageinfo color="primary" %}} @@ -44,7 +43,7 @@ cd istio git checkout 1.10.6 ``` -2、由于目前 Istio 默认会加载 wasm,我们需要将相关逻辑注释掉,再重新编译镜像,避免一些不必要的错误。详细的改动可见 [istio-diff](./istio-diff.md) +2、由于目前 Istio 默认会加载 wasm,我们需要将相关逻辑注释掉,再重新编译镜像,避免一些不必要的错误。详细的改动可见 [istio-diff](./istio-diff) 3、编译 MOSN 二进制,MOSN 提供了镜像编译的方式可直接编译 linux 的二进制;同时由于在 MacOS 上构建的过程中,Istio 还会下载一个 MacOS 版本,因此还需要编译一个 MacOS 的二进制 diff --git a/content/zh/docs/user-guide/start/istio/istio-diff/index.md b/content/zh/docs/user-guide/start/istio/istio-diff/index.md new file mode 100644 index 00000000..3548938b --- /dev/null +++ b/content/zh/docs/user-guide/start/istio/istio-diff/index.md @@ -0,0 +1,85 @@ +--- +date: 2022-03-25 +weight: 2 +--- + +bin/init.sh + +```diff +-WASM_RELEASE_DIR=${ISTIO_ENVOY_LINUX_RELEASE_DIR} +-for plugin in stats metadata_exchange +-do +- FILTER_WASM_URL="${ISTIO_ENVOY_BASE_URL}/${plugin}-${ISTIO_ENVOY_VERSION}.wasm" +- download_wasm_if_necessary "${FILTER_WASM_URL}" "${WASM_RELEASE_DIR}"/"${plugin//_/-}"-filter.wasm +- FILTER_WASM_URL="${ISTIO_ENVOY_BASE_URL}/${plugin}-${ISTIO_ENVOY_VERSION}.compiled.wasm" +- download_wasm_if_necessary "${FILTER_WASM_URL}" "${WASM_RELEASE_DIR}"/"${plugin//_/-}"-filter.compiled.wasm +-done ++#WASM_RELEASE_DIR=${ISTIO_ENVOY_LINUX_RELEASE_DIR} ++#for plugin in stats metadata_exchange ++#do ++# FILTER_WASM_URL="${ISTIO_ENVOY_BASE_URL}/${plugin}-${ISTIO_ENVOY_VERSION}.wasm" ++# download_wasm_if_necessary "${FILTER_WASM_URL}" "${WASM_RELEASE_DIR}"/"${plugin//_/-}"-filter.wasm ++# FILTER_WASM_URL="${ISTIO_ENVOY_BASE_URL}/${plugin}-${ISTIO_ENVOY_VERSION}.compiled.wasm" ++# download_wasm_if_necessary "${FILTER_WASM_URL}" "${WASM_RELEASE_DIR}"/"${plugin//_/-}"-filter.compiled.wasm ++#done +``` + +bin/update_proxy.sh + +```diff +-WASM_URL=${ISTIO_ENVOY_BASE_URL}/${plugin}-${ISTIO_ENVOY_VERSION}.wasm +-printf "Verifying %s is available\n" "$WASM_URL" +-until curl --output /dev/null --silent --head --fail "$WASM_URL"; do +- printf '.' +- sleep $SLEEP_TIME +-done ++#WASM_URL=${ISTIO_ENVOY_BASE_URL}/${plugin}-${ISTIO_ENVOY_VERSION}.wasm ++#printf "Verifying %s is available\n" "$WASM_URL" ++#until curl --output /dev/null --silent --head --fail "$WASM_URL"; do ++# printf '.' ++# sleep $SLEEP_TIME ++#done +``` + +pilot/docker/Dockerfile.proxyv2 + +```diff +-COPY stats-filter.wasm /etc/istio/extensions/stats-filter.wasm +-COPY stats-filter.compiled.wasm /etc/istio/extensions/stats-filter.compiled.wasm +-COPY metadata-exchange-filter.wasm /etc/istio/extensions/metadata-exchange-filter.wasm +-COPY metadata-exchange-filter.compiled.wasm /etc/istio/extensions/metadata-exchange-filter.compiled.wasm ++#COPY stats-filter.wasm /etc/istio/extensions/stats-filter.wasm ++#COPY stats-filter.compiled.wasm /etc/istio/extensions/stats-filter.compiled.wasm ++#COPY metadata-exchange-filter.wasm /etc/istio/extensions/metadata-exchange-filter.wasm ++#COPY metadata-exchange-filter.compiled.wasm /etc/istio/extensions/metadata-exchange-filter.compiled.wasm +``` + +tools/istio-docker.mk + +```diff + # rule for wasm extensions. +-$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.wasm: init +-$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.compiled.wasm: init +-$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.wasm: init +-$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.compiled.wasm: init ++#$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.wasm: init ++#$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.compiled.wasm: init ++#$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.wasm: init ++#$(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.compiled.wasm: init + +-docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.wasm +-docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.compiled.wasm +-docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.wasm +-docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.compiled.wasm ++#docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.wasm ++#docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/stats-filter.compiled.wasm ++#docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.wasm ++#docker.proxyv2: $(ISTIO_ENVOY_LINUX_RELEASE_DIR)/metadata-exchange-filter.compiled.wasm +``` + +pkg/config/constants/constants.go + +```diff +- BinaryPathFilename = "/usr/local/bin/envoy" ++ BinaryPathFilename = "/usr/local/bin/mosn" +```