From d5a6c8e590ee7a2de1ab472a655c485afc615c5c Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Fri, 20 Sep 2024 15:25:49 +0800 Subject: [PATCH 1/4] add_deploy_by_docker_and_opt_structures --- manual/config/README.md | 37 +++++++++++-- manual/deploy/Deploy_by_docker.md | 54 +++++++++++++++++++ .../README.md => deploy/Deploy_by_manual.md} | 53 ++++++++++++++---- manual/deploy/README.md | 28 ---------- mkdocs.yml | 5 +- 5 files changed, 132 insertions(+), 45 deletions(-) create mode 100644 manual/deploy/Deploy_by_docker.md rename manual/{setup/README.md => deploy/Deploy_by_manual.md} (79%) delete mode 100644 manual/deploy/README.md diff --git a/manual/config/README.md b/manual/config/README.md index 6eb15f5..a9e2ae3 100644 --- a/manual/config/README.md +++ b/manual/config/README.md @@ -1,10 +1,12 @@ # SeaSearch Configuration +## Environment Variables + The official configuration can be referenced:[https://zincsearch-docs.zinc.dev/environment-variables/](https://zincsearch-docs.zinc.dev/environment-variables/) The following configuration instructions are for our extended configuration items. All configurations are set in the form of environment variables. -## Extended configuration +### Extended Environment Variables ``` GIN_MODE, log mode of gin framework,default release @@ -45,7 +47,7 @@ ZINC_LOG_LEVEL, log level,default debug ``` -## proxy configuration +#### Proxy Configuration ``` ZINC_CLUSTER_PROXY_LOG_DIR=./log @@ -58,7 +60,7 @@ ZINC_MAX_DOCUMENT_SIZE=1m # Bulk and multisearch limit on the maximum single doc ZINC_CLUSTER_MANAGER_ADDR=127.0.0.1:4081 # manager address ``` -## cluster-manger configuration +#### Cluster-manger Configuration ``` ZINC_CLUSTER_MANAGER_LOG_DIR=./log @@ -67,3 +69,32 @@ ZINC_CLUSTER_MANAGER_PORT=4081 ZINC_CLUSTER_MANAGER_ETCD_ENDPOINTS=127.0.0.1:2379 ZINC_CLUSTER_MANAGER_ETCD_PREFIX=/zinc ``` + +## Integration into SeaTable Service by Nginx + +Add a `location` block in `nginx.conf`: + +```conf +#... +server { + #... + location /sea-search/ { + proxy_pass http://127.0.0.1:4080; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + #... + } + #... +} +#... +``` + +You can browse the SeaSearch and use relative APIs by the url `http(s)://{your_SeaTable_server_url}/sea-search/` after restarting the nginx service. diff --git a/manual/deploy/Deploy_by_docker.md b/manual/deploy/Deploy_by_docker.md new file mode 100644 index 0000000..cbaf6fb --- /dev/null +++ b/manual/deploy/Deploy_by_docker.md @@ -0,0 +1,54 @@ +# Deploy by Docker + +If your SeaTable service is deployed using [docker](https://admin.seatable.io/installation/basic-setup/), we also recommend that you use docker to deploy SeaSearch. + +## Modify .env file + +First, you need to specify the environment variables used by the SeaSearch image in the relevant `.env` file. Some environment variables can be found in [here](../config/README.md). Please add and modify the values (i.e., `<...>`) ​​of the following fields in the `.env` file + + +```shell +# If seasearch uses a separate configuration file such as seasearch.yml, you need to write it into COMPOSE_FILE +COMPOSE_FILE='docker-compose.yml,seasearch.yml' + +# other environment variables in .env file + +SEASEARCH_DATA_PATH= +ZINC_FIRST_ADMIN_USER= +ZINC_FIRST_ADMIN_PASSWORD= +``` + +## SeaSearch.yml + +```yml +services: + seasearch: + image: ${SEASEARCH_IMAGE:-seafileltd/seasearch:latest} + container_name: seasearch + volumes: + - ${SEASEARCH_DATA_PATH}:/opt/seasearch/data + ports: + - "4080:4080" + environment: + # Note: if new environment variables are added in .env, they also need to be set synchronously here + - ZINC_FIRST_ADMIN_USER=${ZINC_FIRST_ADMIN_USER} + - ZINC_FIRST_ADMIN_PASSWORD=${ZINC_FIRST_ADMIN_PASSWORD} + networks: + - frontend-net + - backend-scheduler-net + + +networks: + frontend-net: + name: frontend-net + backend-scheduler-net: + name: backend-scheduler-net + +``` + +Restart the services, and browse seasearch services in [http://127.0.0.1:4080/](http://127.0.0.1:4080/). + +```shell +docker-compose down +docker-compose up +``` diff --git a/manual/setup/README.md b/manual/deploy/Deploy_by_manual.md similarity index 79% rename from manual/setup/README.md rename to manual/deploy/Deploy_by_manual.md index 643d28d..524a527 100644 --- a/manual/setup/README.md +++ b/manual/deploy/Deploy_by_manual.md @@ -1,12 +1,14 @@ -# Installation of SeaSearch +# Deploy SeaSearch by Manual + +## Installation of SeaSearch The original version of SeaSearch is written in pure Go language and can be compiled directly through the Go compilation tool. When we introduced the vector search function, we used the faiss library, which needs to be called in CGO mode, so it will affect the compilation of SeaSearch. -## Installation of faiss +### Installation of faiss To compile or run SeaSearch on a machine, you need to install the faiss library on that machine. The following are the specific installation steps, which are applicable to x86 linux machines. The operating system used in the process is debian 12, using apt as the package manager. -### Prerequisites +#### Prerequisites Install through the package manager. If the connection speed is slow, you can try changing the source @@ -50,7 +52,7 @@ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.co sudo apt update && sudo apt install nodejs -y ``` -### Install Intel MKL library (optional, only supports x86 CPU) +#### Install Intel MKL library (optional, only supports x86 CPU) faiss relies on BLAS, and Intel MKL is recommended for best performance. @@ -79,7 +81,7 @@ MKL cannot be installed on non-x86 CPUs, but can be instead by installing OpenBL sudo apt install -y libatlas-base-dev libatlas3-base ``` -### compile faiss +#### compile faiss Download faiss source code by ssh: @@ -136,7 +138,7 @@ sudo cp /tmp/faiss/build/c_api/libfaiss_c.so /usr/lib For the complete installation script, please refer to /ci/install\_faiss.sh in the SeaSearch project directory. -## Compile SeaSearch +### Compile SeaSearch Faiss has been installed, you can start compiling SeaSearch @@ -198,7 +200,7 @@ If the runtime prompts that the dynamic link library cannot be found, you can us LD_LIBRARY_PATH=/usr/lib # Specify the dynamic link library directory ``` -## Compile seasearch proxy and cluster manger +### Compile seasearch proxy and cluster manger In a cluster, you need to compile and deploy seasearch proxy and cluster manager @@ -215,7 +217,7 @@ go build -o cluster-manager ./cmd/cluster-manager/main.go ``` -## Publish +### Publish There is a Dokcerfile file in the project root directory, and you can build a docker image based on this file @@ -225,13 +227,13 @@ Note: To build this docker image, you need to ensure that you can access github docker build -f ./Dockerfile . ``` -## Installation issues on Mac +### Installation issues on Mac -### faiss installation +#### faiss installation faiss can be installed via brew install faiss. -### fatal error: 'faiss/c\_api/AutoTune\_c.h' file not found +#### fatal error: 'faiss/c\_api/AutoTune\_c.h' file not found Execute the following command to solve: @@ -245,3 +247,32 @@ make -C build sudo make -C build install sudo cp build/c_api/libfaiss_c.dylib /usr/local/lib/libfaiss_c.dylib ``` + +## Launch SeaSearch + +### Start a single machine + +For the development environment, you only need to follow the official instructions to configure the two environment variables of the startup account and startup password. + +Compile SeaSearch reference: [Setup](../setup/README.md) + +For the development environment, simply configure the environment variables and start the binary file + +The following command will first create a data folder as the default storage path, then start a SeaSearch program with admin and xxx as the initial users, and listen to port 4080 by default: + +``` +mkdir data +ZINC_FIRST_ADMIN_USER=admin ZINC_FIRST_ADMIN_PASSWORD=xxx GIN_MODE=release ./SeaSearch +``` + +If you need to reset the data, just delete the entire data directory and restart, which will clean up all metadata and index data. + +### Start the cluster + +1. Start etcd + +2. Start the SeaSearch node, which will automatically register its heartbeat with etcd. + +3. Start cluster-manager, then set the address of the SeaSearch node through the API or directly set cluster-info to etcd. At the same time, cluster-manager starts to allocate shards based on the node heartbeat. + +4. Start SeaSearch-proxy, and you can now provide services to the outside world. diff --git a/manual/deploy/README.md b/manual/deploy/README.md deleted file mode 100644 index 4f435f8..0000000 --- a/manual/deploy/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Launch SeaSearch - -## Start a single machine - -For the development environment, you only need to follow the official instructions to configure the two environment variables of the startup account and startup password. - -Compile SeaSearch reference: [Setup](../setup/README.md) - -For the development environment, simply configure the environment variables and start the binary file - -The following command will first create a data folder as the default storage path, then start a SeaSearch program with admin and xxx as the initial users, and listen to port 4080 by default: - -``` -mkdir data -ZINC_FIRST_ADMIN_USER=admin ZINC_FIRST_ADMIN_PASSWORD=xxx GIN_MODE=release ./SeaSearch -``` - -If you need to reset the data, just delete the entire data directory and restart, which will clean up all metadata and index data. - -## Start the cluster - -1. Start etcd - -2. Start the SeaSearch node, which will automatically register its heartbeat with etcd. - -3. Start cluster-manager, then set the address of the SeaSearch node through the API or directly set cluster-info to etcd. At the same time, cluster-manager starts to allocate shards based on the node heartbeat. - -4. Start SeaSearch-proxy, and you can now provide services to the outside world. diff --git a/mkdocs.yml b/mkdocs.yml index 80f8bf0..fe7907b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -45,9 +45,8 @@ markdown_extensions: # Page tree nav: - - SeaSearch Setup: - - Installation: setup/README.md - Deploy: - - Deploy SeaSearch: deploy/README.md + - Deploy SeaSearch by Manual: deploy/Deploy_by_manual.md + - Deploy SeaSearch by Docker: deploy/Deploy_by_docker.md - Configuration: config/README.md - SeaSearch API: api/seasearch_api.md From 1af340eb8dd37475237a62a7a43279b8cddf651d Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Sat, 21 Sep 2024 11:20:07 +0800 Subject: [PATCH 2/4] opt: structures --- manual/config/README.md | 41 +-- manual/deploy/Deploy_by_manual.md | 278 ------------------ .../deploy/{Deploy_by_docker.md => README.md} | 8 +- mkdocs.yml | 4 +- 4 files changed, 13 insertions(+), 318 deletions(-) delete mode 100644 manual/deploy/Deploy_by_manual.md rename manual/deploy/{Deploy_by_docker.md => README.md} (82%) diff --git a/manual/config/README.md b/manual/config/README.md index a9e2ae3..f824b22 100644 --- a/manual/config/README.md +++ b/manual/config/README.md @@ -1,12 +1,14 @@ # SeaSearch Configuration -## Environment Variables +## Original Configurations -The official configuration can be referenced:[https://zincsearch-docs.zinc.dev/environment-variables/](https://zincsearch-docs.zinc.dev/environment-variables/) +The original configurations of environment variables can be referenced:[https://zincsearch-docs.zinc.dev/environment-variables/](https://zincsearch-docs.zinc.dev/environment-variables/) The following configuration instructions are for our extended configuration items. All configurations are set in the form of environment variables. -### Extended Environment Variables +## Extended Configurations in SeaSearch + +### Single-Node Configurations ``` GIN_MODE, log mode of gin framework,default release @@ -47,7 +49,7 @@ ZINC_LOG_LEVEL, log level,default debug ``` -#### Proxy Configuration +### Proxy Configurations ``` ZINC_CLUSTER_PROXY_LOG_DIR=./log @@ -60,7 +62,7 @@ ZINC_MAX_DOCUMENT_SIZE=1m # Bulk and multisearch limit on the maximum single doc ZINC_CLUSTER_MANAGER_ADDR=127.0.0.1:4081 # manager address ``` -#### Cluster-manger Configuration +### Cluster-manger Configurations ``` ZINC_CLUSTER_MANAGER_LOG_DIR=./log @@ -69,32 +71,3 @@ ZINC_CLUSTER_MANAGER_PORT=4081 ZINC_CLUSTER_MANAGER_ETCD_ENDPOINTS=127.0.0.1:2379 ZINC_CLUSTER_MANAGER_ETCD_PREFIX=/zinc ``` - -## Integration into SeaTable Service by Nginx - -Add a `location` block in `nginx.conf`: - -```conf -#... -server { - #... - location /sea-search/ { - proxy_pass http://127.0.0.1:4080; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - #... - } - #... -} -#... -``` - -You can browse the SeaSearch and use relative APIs by the url `http(s)://{your_SeaTable_server_url}/sea-search/` after restarting the nginx service. diff --git a/manual/deploy/Deploy_by_manual.md b/manual/deploy/Deploy_by_manual.md deleted file mode 100644 index 524a527..0000000 --- a/manual/deploy/Deploy_by_manual.md +++ /dev/null @@ -1,278 +0,0 @@ -# Deploy SeaSearch by Manual - -## Installation of SeaSearch - -The original version of SeaSearch is written in pure Go language and can be compiled directly through the Go compilation tool. When we introduced the vector search function, we used the faiss library, which needs to be called in CGO mode, so it will affect the compilation of SeaSearch. - -### Installation of faiss - -To compile or run SeaSearch on a machine, you need to install the faiss library on that machine. The following are the specific installation steps, which are applicable to x86 linux machines. The operating system used in the process is debian 12, using apt as the package manager. - -#### Prerequisites - -Install through the package manager. If the connection speed is slow, you can try changing the source - -ubuntu reference:[https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/](https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/) - -debian reference:[https://mirrors.tuna.tsinghua.edu.cn/help/debian/](https://mirrors.tuna.tsinghua.edu.cn/help/debian/) - -After changing the source, run - -``` -sudo apt update -``` - -C++ compiler, supports C++17 and above - -Can be installed via apt - -``` -sudo apt install -y gcc -``` - -Cmake, 3.23.1 or above, if the source is not the latest, you can install it from ppa or source code - -``` -sudo apt install -y cmake -``` - -wget swig gnupg libomp - -``` -sudo apt install -y wget swig gnupg libomp-dev -``` - -nodeJs; - -``` -sudo apt-get update && sudo apt-get install -y ca-certificates curl gnupg -curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -NODE_MAJOR=20 -echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list -sudo apt update && sudo apt install nodejs -y -``` - -#### Install Intel MKL library (optional, only supports x86 CPU) - -faiss relies on BLAS, and Intel MKL is recommended for best performance. - -``` -wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ -| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null - -echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" |sudo tee /etc/apt/sources.list.d/oneAPI.list - -sudo apt update - -sudo apt install -y intel-oneapi-mkl-devel -``` - -After the execution is completed, the MKL library is installed. Then configure an environment variable: - -``` -export MKL_PATH=/opt/intel/oneapi/mkl/latest/lib/intel64 -``` - -### Install BLAS on non-x86 CPUs - -MKL cannot be installed on non-x86 CPUs, but can be instead by installing OpenBLAS - -``` -sudo apt install -y libatlas-base-dev libatlas3-base -``` - -#### compile faiss - -Download faiss source code by ssh: - -``` -git clone git@github.com:facebookresearch/faiss.git -``` - -or by https: - -``` -git clone https://github.com/facebookresearch/faiss.git -``` - -If MKL is installed, go to the faiss directory and run: - -``` -cmake -B build -DFAISS_ENABLE_GPU=OFF \ - -DFAISS_ENABLE_C_API=ON \ - -DFAISS_ENABLE_PYTHON=OFF \ - -DBLA_VENDOR=Intel10_64_dyn \ - -DBUILD_SHARED_LIBS=ON \ - "-DMKL_LIBRARIES=-Wl,--start-group;${MKL_PATH}/libmkl_intel_lp64.a;${MKL_PATH}/libmkl_gnu_thread.a;${MKL_PATH}/libmkl_core.a;-Wl,--end-group" \ - . -``` - -If MKL is not installed, run: - -``` -cmake -B build -DFAISS_ENABLE_GPU=OFF \ - -DFAISS_ENABLE_C_API=ON \ - -DFAISS_ENABLE_PYTHON=OFF \ - -DBUILD_SHARED_LIBS=ON=ON \ - -DBUILD_TESTING=OFF \ - . -``` - -Installing the C++ library - -``` -make -C build -``` - -Installing the headers - -``` -sudo make -C build install -``` - -Copy the compiled dynamic link library to the system path. Here /tmp/faiss is the faiss source code path. Replace it with the real path: - -``` -sudo cp /tmp/faiss/build/c_api/libfaiss_c.so /usr/lib -``` - -For the complete installation script, please refer to /ci/install\_faiss.sh in the SeaSearch project directory. - -### Compile SeaSearch - -Faiss has been installed, you can start compiling SeaSearch - -Download the SeaSearch source code using ssh: - -``` -git clone git@github.com:seafileltd/seasearch.git -``` - -or by https: - -``` -git clone https://github.com/seafileltd/seasearch.git -``` - -Compile frontend static files - -``` -cd web -npm config set registry https://registry.npmmirror.com -npm install -npm run build -``` - -Install the go language environment Go 1.20 or above - -reference [https://go.dev/doc/install](https://go.dev/doc/install) - -You need to make sure CGO is enabled - -``` -export CGO_ENABLED=1 -``` - -Optional, replace the go source: - -``` -go env -w GOPROXY=https://goproxy.cn,direct -``` - -Run in the project root directory: - -``` -go build -o seasearch ./cmd/zincsearch/ -``` - -After completing the above steps, you can get the final seasearch binary file in the root directory of the project. - -Generally, there is no need to manually specify the location of header files and dynamic link libraries. If the compilation prompt says that the header file cannot be found, or the dynamic runtime library cannot be found, you can specify the location through environment variables during compilation: - -``` -CGO_CFLAGS=-I /usr/local/include # Your default installation path for C header files -CGO_LDFLAGS=-I /usr/lib -``` - -If the runtime prompts that the dynamic link library cannot be found, you can use: - -``` -LD_LIBRARY_PATH=/usr/lib # Specify the dynamic link library directory -``` - -### Compile seasearch proxy and cluster manger - -In a cluster, you need to compile and deploy seasearch proxy and cluster manager - -Compile proxy: - -``` -go build -o seasearch-proxy ./cmd/zinc-proxy/main.go -``` - -Compile cluster manager: - -``` -go build -o cluster-manager ./cmd/cluster-manager/main.go -``` - - -### Publish - -There is a Dokcerfile file in the project root directory, and you can build a docker image based on this file - -Note: To build this docker image, you need to ensure that you can access github normally, otherwise you will not be able to download the faiss source code, which will cause the build to fail. It only supports x86 cpu, and arm needs to set the platform parameter to simulate x86. - -``` -docker build -f ./Dockerfile . -``` - -### Installation issues on Mac - -#### faiss installation - -faiss can be installed via brew install faiss. - -#### fatal error: 'faiss/c\_api/AutoTune\_c.h' file not found - -Execute the following command to solve: - -source: [https://github.com/DataIntelligenceCrew/go-faiss/issues/7](https://github.com/DataIntelligenceCrew/go-faiss/issues/7) - -``` -cd faiss -export CMAKE_PREFIX_PATH=/opt/homebrew/opt/openblas:/opt/homebrew/opt/libomp:/opt/homebrew -cmake -B build -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DFAISS_ENABLE_PYTHON=OFF . -make -C build -sudo make -C build install -sudo cp build/c_api/libfaiss_c.dylib /usr/local/lib/libfaiss_c.dylib -``` - -## Launch SeaSearch - -### Start a single machine - -For the development environment, you only need to follow the official instructions to configure the two environment variables of the startup account and startup password. - -Compile SeaSearch reference: [Setup](../setup/README.md) - -For the development environment, simply configure the environment variables and start the binary file - -The following command will first create a data folder as the default storage path, then start a SeaSearch program with admin and xxx as the initial users, and listen to port 4080 by default: - -``` -mkdir data -ZINC_FIRST_ADMIN_USER=admin ZINC_FIRST_ADMIN_PASSWORD=xxx GIN_MODE=release ./SeaSearch -``` - -If you need to reset the data, just delete the entire data directory and restart, which will clean up all metadata and index data. - -### Start the cluster - -1. Start etcd - -2. Start the SeaSearch node, which will automatically register its heartbeat with etcd. - -3. Start cluster-manager, then set the address of the SeaSearch node through the API or directly set cluster-info to etcd. At the same time, cluster-manager starts to allocate shards based on the node heartbeat. - -4. Start SeaSearch-proxy, and you can now provide services to the outside world. diff --git a/manual/deploy/Deploy_by_docker.md b/manual/deploy/README.md similarity index 82% rename from manual/deploy/Deploy_by_docker.md rename to manual/deploy/README.md index cbaf6fb..dbc7700 100644 --- a/manual/deploy/Deploy_by_docker.md +++ b/manual/deploy/README.md @@ -1,6 +1,6 @@ -# Deploy by Docker +# Deploy -If your SeaTable service is deployed using [docker](https://admin.seatable.io/installation/basic-setup/), we also recommend that you use docker to deploy SeaSearch. +Note: SeaSearch only supports deployment via docker now. ## Modify .env file @@ -46,9 +46,11 @@ networks: ``` -Restart the services, and browse seasearch services in [http://127.0.0.1:4080/](http://127.0.0.1:4080/). +Restart the services ```shell docker-compose down docker-compose up ``` + +Browse seasearch services in [http://127.0.0.1:4080/](http://127.0.0.1:4080/). diff --git a/mkdocs.yml b/mkdocs.yml index fe7907b..74c3934 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -45,8 +45,6 @@ markdown_extensions: # Page tree nav: - - Deploy: - - Deploy SeaSearch by Manual: deploy/Deploy_by_manual.md - - Deploy SeaSearch by Docker: deploy/Deploy_by_docker.md + - Deploy: deploy/README.md - Configuration: config/README.md - SeaSearch API: api/seasearch_api.md From 9239441ae60d467c66bee743611c6121be004e71 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 25 Sep 2024 12:39:03 +0800 Subject: [PATCH 3/4] update --- manual/deploy/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manual/deploy/README.md b/manual/deploy/README.md index dbc7700..5f4f846 100644 --- a/manual/deploy/README.md +++ b/manual/deploy/README.md @@ -12,6 +12,8 @@ First, you need to specify the environment variables used by the SeaSearch image COMPOSE_FILE='docker-compose.yml,seasearch.yml' # other environment variables in .env file +# For Apple's chip (M2, e.g.), you should use the images with -nomkl tags (i.e., seafileltd/seasearch-nomkl:latest) +SEASEARCH_IMAGE=seafileltd/seasearch:latest SEASEARCH_DATA_PATH= ZINC_FIRST_ADMIN_USER= From a9c2738acfab06389193eae87741ddb6716de040 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Sun, 29 Sep 2024 00:51:28 +0900 Subject: [PATCH 4/4] update --- manual/deploy/README.md | 38 +++++++++----------------------------- manual/repo/seasearch.yml | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 manual/repo/seasearch.yml diff --git a/manual/deploy/README.md b/manual/deploy/README.md index 5f4f846..5e99cac 100644 --- a/manual/deploy/README.md +++ b/manual/deploy/README.md @@ -2,9 +2,15 @@ Note: SeaSearch only supports deployment via docker now. +## Download the seasearch.yml + +```bash +wget https://haiwen.github.io/seasearch-docs/repo/seasearch.yml +``` + ## Modify .env file -First, you need to specify the environment variables used by the SeaSearch image in the relevant `.env` file. Some environment variables can be found in [here](../config/README.md). Please add and modify the values (i.e., `<...>`) ​​of the following fields in the `.env` file +First, you need to specify the environment variables used by the SeaSearch image in the relevant `.env` file. Some environment variables can be found in [here](../config/README.md). Please add and modify the values (i.e., `<...>`) ​​of the following fields in the `.env` file. ```shell @@ -20,35 +26,9 @@ ZINC_FIRST_ADMIN_USER= ZINC_FIRST_ADMIN_PASSWORD= ``` -## SeaSearch.yml - -```yml -services: - seasearch: - image: ${SEASEARCH_IMAGE:-seafileltd/seasearch:latest} - container_name: seasearch - volumes: - - ${SEASEARCH_DATA_PATH}:/opt/seasearch/data - ports: - - "4080:4080" - environment: - # Note: if new environment variables are added in .env, they also need to be set synchronously here - - ZINC_FIRST_ADMIN_USER=${ZINC_FIRST_ADMIN_USER} - - ZINC_FIRST_ADMIN_PASSWORD=${ZINC_FIRST_ADMIN_PASSWORD} - networks: - - frontend-net - - backend-scheduler-net - - -networks: - frontend-net: - name: frontend-net - backend-scheduler-net: - name: backend-scheduler-net - -``` +Note: if new environment variables are added in .env, they also need to **be set synchronously** in the `seasearch.yml` -Restart the services +## Restart the Service ```shell docker-compose down diff --git a/manual/repo/seasearch.yml b/manual/repo/seasearch.yml new file mode 100644 index 0000000..c8cc75a --- /dev/null +++ b/manual/repo/seasearch.yml @@ -0,0 +1,21 @@ +services: + seasearch: + image: ${SEASEARCH_IMAGE:-seafileltd/seasearch:latest} + container_name: seasearch + volumes: + - ${SEASEARCH_DATA_PATH}:/opt/seasearch/data + ports: + - "4080:4080" + environment: + - ZINC_FIRST_ADMIN_USER=${ZINC_FIRST_ADMIN_USER} + - ZINC_FIRST_ADMIN_PASSWORD=${ZINC_FIRST_ADMIN_PASSWORD} + networks: + - frontend-net + - backend-scheduler-net + + +networks: + frontend-net: + name: frontend-net + backend-scheduler-net: + name: backend-scheduler-net