diff --git a/train-rank/.gitignore b/train-rank/.gitignore index a007fea..2dc7318 100755 --- a/train-rank/.gitignore +++ b/train-rank/.gitignore @@ -1 +1,2 @@ build/* +train-rank/src/gitinfo.h \ No newline at end of file diff --git a/train-rank/infra/rss_wise_environment/deploy_knowledge_only.sh b/train-rank/infra/rss_wise_environment/deploy_knowledge_only.sh index 5610c8c..936e3a0 100755 --- a/train-rank/infra/rss_wise_environment/deploy_knowledge_only.sh +++ b/train-rank/infra/rss_wise_environment/deploy_knowledge_only.sh @@ -8,6 +8,12 @@ export MONGODB_FEED_COLL="feeds" export MONGODB_ENTRY_COLL="entries" export LISTEN_ADDR="127.0.0.1:8080" export REDIS_HOST_DATA_DIRECTORY="/home/ubuntu/terminus_redis" -export REDIS_ADDR="127.0.0.1:6381" +export REDIS_ADDR="127.0.0.1:6379" export REDIS_PASSWORD="terminusrecommendredis123" +export PG_PORT="5432" +export PG_HOST="127.0.0.1" +export PG_USERNAME="myuser" +export PG_PASSWORD="mysecretpassword" + +export PG_DATABASE="mydatabase" docker-compose -f docker-compose-only-knowledge-base-api.yaml up -d \ No newline at end of file diff --git a/train-rank/infra/rss_wise_environment/docker-compose-only-knowledge-base-api.yaml b/train-rank/infra/rss_wise_environment/docker-compose-only-knowledge-base-api.yaml index a2fd466..1de10d9 100755 --- a/train-rank/infra/rss_wise_environment/docker-compose-only-knowledge-base-api.yaml +++ b/train-rank/infra/rss_wise_environment/docker-compose-only-knowledge-base-api.yaml @@ -3,7 +3,7 @@ version: '4' services: knowledge_base_api: - image: aboveos/knowledge-base-api:v0.1.18 + image: beclab/knowledge-base-api:v0.1.51 container_name: knowledge_base_api_server network_mode: host environment: @@ -11,6 +11,11 @@ services: BACKEND_URL: ${BACKEND_URL} REDIS_ADDR: ${REDIS_ADDR} REDIS_PASSWORD: ${REDIS_PASSWORD} + PG_PORT: ${PG_PORT} + PG_USERNAME: ${PG_USERNAME} + PG_PASSWORD: ${PG_PASSWORD} + PG_DATABASE: ${PG_DATABASE} + PG_HOST: ${PG_HOST} ports: - '3010:3010' @@ -22,7 +27,21 @@ services: - REDIS_PASSWORD=terminusrecommendredis123 - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL ports: - - '6381:6379' + - '6379:6379' volumes: - ${REDIS_HOST_DATA_DIRECTORY}:/bitnami/redis/data - command: /opt/bitnami/scripts/redis/run.sh --maxmemory 512MB \ No newline at end of file + command: /opt/bitnami/scripts/redis/run.sh --maxmemory 512MB + network_mode: host + + knowledge_postgres: + image: postgres + container_name: knowledge_postgres + network_mode: host + environment: + POSTGRES_USER: myuser + POSTGRES_PASSWORD: mysecretpassword + POSTGRES_DB: mydatabase + ports: + - '5432:5432' + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql diff --git a/train-rank/infra/rss_wise_environment/docker-compose.yml b/train-rank/infra/rss_wise_environment/docker-compose.yml index ac40373..8c64ede 100755 --- a/train-rank/infra/rss_wise_environment/docker-compose.yml +++ b/train-rank/infra/rss_wise_environment/docker-compose.yml @@ -30,7 +30,7 @@ services: command: /opt/bitnami/scripts/redis/run.sh --maxmemory 512MB knowledge_base_api: - image: aboveos/knowledge-base-api:v0.1.18 + image: aboveos/knowledge-base-api:v0.1.51 container_name: knowledge_base_api_server network_mode: host environment: diff --git a/train-rank/infra/rss_wise_environment/init.sql b/train-rank/infra/rss_wise_environment/init.sql new file mode 100644 index 0000000..43608ad --- /dev/null +++ b/train-rank/infra/rss_wise_environment/init.sql @@ -0,0 +1,2 @@ +CREATE EXTENSION IF NOT EXISTS pg_trgm; +CREATE EXTENSION IF NOT EXISTS btree_gin; \ No newline at end of file diff --git a/train-rank/infra/rss_wise_environment/rm_container.sh b/train-rank/infra/rss_wise_environment/rm_container.sh new file mode 100644 index 0000000..41a4680 --- /dev/null +++ b/train-rank/infra/rss_wise_environment/rm_container.sh @@ -0,0 +1,3 @@ +docker rm -f knowledge_base_api_server +docker rm -f knowledge_postgres +docker rm -f terminus_recommend_redis \ No newline at end of file diff --git a/train-rank/infra/rss_wise_environment/start_db.sh b/train-rank/infra/rss_wise_environment/start_db.sh new file mode 100644 index 0000000..cd8d74e --- /dev/null +++ b/train-rank/infra/rss_wise_environment/start_db.sh @@ -0,0 +1 @@ +docker run --name search3-postgres -e POSTGRES_USER=myuser -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=mydatabase -p 5434:5432 -d postgres \ No newline at end of file diff --git a/train-rank/infra/ubuntu_develop/Dockerfile b/train-rank/infra/ubuntu_develop/Dockerfile index bfd86b1..ad8ed4b 100755 --- a/train-rank/infra/ubuntu_develop/Dockerfile +++ b/train-rank/infra/ubuntu_develop/Dockerfile @@ -5,6 +5,7 @@ RUN mkdir -p /opt/rss-termius-v2-rank && \ RUN apt-get update && \ apt-get install build-essential -y && \ apt-get install cmake -y && \ + apt-get install libgflags-dev -y && \ apt install git -y && \ apt install curl -y && \ apt install pkg-config -y && \ @@ -86,9 +87,9 @@ RUN cd /opt && \ rm -r cppitertools-2.1 RUN apt update && \ - apt install python3 -y && \ - apt install python3-pip -y && \ - pip install cpplint + apt install python3 -y && \ + apt install python3-pip -y && \ + pip install cpplint ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file diff --git a/train-rank/infra/ubuntu_develop/build.sh b/train-rank/infra/ubuntu_develop/build.sh index ce96537..64af945 100755 --- a/train-rank/infra/ubuntu_develop/build.sh +++ b/train-rank/infra/ubuntu_develop/build.sh @@ -10,6 +10,6 @@ DOCKER_FILE_PATH=$bertv2rank_dir/Dockerfile PREFIX=beclab -docker build --progress auto \ +docker build \ -f ${DOCKER_FILE_PATH} \ -t ${PREFIX}/rank_develop $root_dir \ No newline at end of file diff --git a/train-rank/src/.gitignore b/train-rank/src/.gitignore new file mode 100644 index 0000000..896f1bd --- /dev/null +++ b/train-rank/src/.gitignore @@ -0,0 +1 @@ +gitinfo.h \ No newline at end of file