Recently, I was investigating a bug with Azure OpenAI and conversations timing out, so I took it upon myself to find the issue, fix it, and test it. The biggest struggle I had around this was figuring out how to build TypeSense. The shell scripts that you think build the project don't work as they are outdated. Rather you need to use bazel (bazelisk) to build it. So I did find the basics of it in the GitHub workflow test script/yml file. So the following is what I found to help others trying to build it:
- The following are the requirements that you must install:
- You should use Ubuntu 22.04 for everything to work, but I built on Ubuntu 24.04 and it was fine except I had to update the deployment.Dockerfile to use Ubuntu 24.04 to get the Docker image to work
- The following installs the dependencies:
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y g++-10 make git zlib1g-dev m4
# Define the compiler
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 30
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 30
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
sudo apt-get install -y lld
- Next you need to install bazelisk. Go to the following URL, and download the appropriate .deb file, and install using
dpkg -i <filename>.deb):
https://github.com/bazelbuild/bazelisk/releases
eg.
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.29.0/bazelisk-amd64.deb
dpkg -i ./bazelisk-amd64.deb
- Now you are ready to build TypeSense, so first build the external dependencies (from the cloned TypeSense repo root):
bazel build @com_google_protobuf//:protobuf_headers
bazel build @com_google_protobuf//:protobuf_lite
bazel build @com_google_protobuf//:protobuf
bazel build @com_google_protobuf//:protoc
- Next, build TypeSense server:
bazel build //:typesense-server
- Finally, to create the Docker image, do the following (if building on Ubuntu 24.04 vs 22.04 then update the docker/deployment.Dockerfile accordingly to the same Ubuntu version):
eg.
cd bazel-bin
docker build --tag typesense:31.0.1 . -f ~/typesense/docker/deployment.Dockerfile
Recently, I was investigating a bug with Azure OpenAI and conversations timing out, so I took it upon myself to find the issue, fix it, and test it. The biggest struggle I had around this was figuring out how to build TypeSense. The shell scripts that you think build the project don't work as they are outdated. Rather you need to use bazel (bazelisk) to build it. So I did find the basics of it in the GitHub workflow test script/yml file. So the following is what I found to help others trying to build it:
dpkg -i <filename>.deb):https://github.com/bazelbuild/bazelisk/releases
eg.
eg.