Skip to content
Merged
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
77 changes: 75 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,90 @@ instructions for local setup and deployment.

In the case of Windows, all the commands outlined in this file should be run inside the Linux VM terminal, which hosts Docker, rather than in native Windows terminals (e.g., CMD or PowerShell). For instance, if Docker is used with WSL, the commands should be executed inside the WSL terminal.

To launch WSL: Press `Win + R`, type `wsl`, and hit `Enter`.

### Git Repository Checkout

WSL commands run in the linux context.
Therefore, you must check out / git clone this repository via the WSL terminal
to prevent Git from automatically converting newlines in bash scripts (`\n`) to Windows-style newlines (`\r\n`),
which could cause unexpected errors while parsing and running the scripts.

### External Docker images

If you are running the below commands on Windows, replace `image: bitnami/etcd` in `gateway/local/docker-compose.yml`
to `image: bitnamilegacy/etcd`.

### Install Homebrew and java inside WSL

#### Install curl:
```bash
sudo apt update
sudo apt install -y build-essential curl file git
```

#### Install Homebrew:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

Add brew to your shell
```bash
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
```

Restart your WSL shell or run:
```bash
source ~/.bashrc
```

Verify:
```bash
brew --version
```

#### Install java:
```bash
brew update
brew install openjdk@17
brew link --force --overwrite openjdk@17
```

### Docker Resource Management

If heavy automation scripts (such as `publish-all.sh`) become unresponsive or "hang",
it typically indicates that Docker has reached the default resource ceiling allocated by Windows.

You can adjust these settings by creating or editing a global configuration file on your Windows host.

To do so, navigate to your Windows user profile folder by entering `%USERPROFILE%` in the File Explorer address bar.

Open or create a file named `.wslconfig`.
Add or update the following section:

```
[wsl2]
memory=80%
swap=4GB
```

For the changes to take effect - stop WSL using the `wsl --shutdown` command, and start `wsl` again.

---

## Local Setup

As a prerequisite, ensure that you have StreamX CLI installed in latest preview version:
```shell
brew upgrade streamx-dev/preview-tap/streamx
brew install streamx-dev/preview-tap/streamx
```
Publishing requires also `yq` and `envsubst` commands. To install these run:
Running apisix gateway requires also `yq`, `jq` and `envsubst` commands. To install these run:
```shell
brew install yq
brew install gettext
brew install jq
brew install envsubst
```

1. **Start StreamX**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
image: apache/apisix:${APISIX_IMAGE_TAG:-3.11.0-debian}
restart: always
volumes:
- ./apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml:rw
- ./config.yaml:/usr/local/apisix/conf/config.yaml:rw
Comment thread
stan-r-ds marked this conversation as resolved.
depends_on:
- etcd
##network_mode: host
Expand Down