Skip to content

Commit

Permalink
fix the istio-diff links (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
nejisama committed May 11, 2022
1 parent 45f32ab commit 143cd05
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
date: 2022-03-25
weight: 2
---

bin/init.sh

```diff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" %}}
Expand Down Expand Up @@ -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 的二进制

Expand Down
85 changes: 85 additions & 0 deletions content/zh/docs/user-guide/start/istio/istio-diff/index.md
Original file line number Diff line number Diff line change
@@ -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"
```

0 comments on commit 143cd05

Please sign in to comment.