From 59c851a55b10299b0e7b811362ad69ecb7b51bf2 Mon Sep 17 00:00:00 2001 From: ARQtty Date: Tue, 29 Dec 2020 19:08:16 +0300 Subject: [PATCH] fix port error, add service starting scripts, add deploy docs --- .../docs => docs}/config_description.md | 0 {recommendations_server/docs => docs}/deploy.md | 7 +++++++ {recommendations_server/docs => docs}/recsys_api.yaml | 0 recommendations_server/models/server.py | 6 +++++- run_services/run_book.sh | 5 +++++ run_services/run_dorama.sh | 5 +++++ run_services/run_mint.sh | 5 +++++ run_services/run_read.sh | 5 +++++ run_services/run_selfmanga.sh | 5 +++++ run_docker.sh => run_single_docker.sh | 2 +- 10 files changed, 38 insertions(+), 2 deletions(-) rename {recommendations_server/docs => docs}/config_description.md (100%) rename {recommendations_server/docs => docs}/deploy.md (76%) rename {recommendations_server/docs => docs}/recsys_api.yaml (100%) create mode 100755 run_services/run_book.sh create mode 100755 run_services/run_dorama.sh create mode 100755 run_services/run_mint.sh create mode 100755 run_services/run_read.sh create mode 100755 run_services/run_selfmanga.sh rename run_docker.sh => run_single_docker.sh (90%) diff --git a/recommendations_server/docs/config_description.md b/docs/config_description.md similarity index 100% rename from recommendations_server/docs/config_description.md rename to docs/config_description.md diff --git a/recommendations_server/docs/deploy.md b/docs/deploy.md similarity index 76% rename from recommendations_server/docs/deploy.md rename to docs/deploy.md index 350a962..0ebc424 100644 --- a/recommendations_server/docs/deploy.md +++ b/docs/deploy.md @@ -9,7 +9,14 @@ ## Run +For custom service container ``` ./build_docker.sh ./run_docker.sh {port} {config_file_name} ``` + +For default services +``` +cd run_services +./run_{service}.sh +``` diff --git a/recommendations_server/docs/recsys_api.yaml b/docs/recsys_api.yaml similarity index 100% rename from recommendations_server/docs/recsys_api.yaml rename to docs/recsys_api.yaml diff --git a/recommendations_server/models/server.py b/recommendations_server/models/server.py index f66fd72..c11de26 100644 --- a/recommendations_server/models/server.py +++ b/recommendations_server/models/server.py @@ -301,4 +301,8 @@ def recalc(): explorations_categies = load_explorations_model(config.explorations_path) top_popular = calc_top_popular(df) - app.run(host='0.0.0.0', port=5000) + try: + app.run(host='0.0.0.0', port=5000) + except Exception as e: + print('main exception occurs:', e) + raise e \ No newline at end of file diff --git a/run_services/run_book.sh b/run_services/run_book.sh new file mode 100755 index 0000000..687ddb3 --- /dev/null +++ b/run_services/run_book.sh @@ -0,0 +1,5 @@ +docker run --volume /home/iria/grouple/production/recommendations_server:/recommendations_server \ + --volume /data/groupLe_recsys/processed:/data/groupLe_recsys/processed \ + -p 5001:5000 \ + -e CONFIG_FILE=book_setting.yml \ + sagiri \ No newline at end of file diff --git a/run_services/run_dorama.sh b/run_services/run_dorama.sh new file mode 100755 index 0000000..96ec8d7 --- /dev/null +++ b/run_services/run_dorama.sh @@ -0,0 +1,5 @@ +docker run --volume /home/iria/grouple/production/recommendations_server:/recommendations_server \ + --volume /data/groupLe_recsys/processed:/data/groupLe_recsys/processed \ + -p 5000:5000 \ + -e CONFIG_FILE=dorama_setting.yml \ + sagiri \ No newline at end of file diff --git a/run_services/run_mint.sh b/run_services/run_mint.sh new file mode 100755 index 0000000..157db7f --- /dev/null +++ b/run_services/run_mint.sh @@ -0,0 +1,5 @@ +docker run --volume /home/iria/grouple/production/recommendations_server:/recommendations_server \ + --volume /data/groupLe_recsys/processed:/data/groupLe_recsys/processed \ + -p 5003:5000 \ + -e CONFIG_FILE=mint_setting.yml \ + sagiri \ No newline at end of file diff --git a/run_services/run_read.sh b/run_services/run_read.sh new file mode 100755 index 0000000..f55c638 --- /dev/null +++ b/run_services/run_read.sh @@ -0,0 +1,5 @@ +docker run --volume /home/iria/grouple/production/recommendations_server:/recommendations_server \ + --volume /data/groupLe_recsys/processed:/data/groupLe_recsys/processed \ + -p 5002:5000 \ + -e CONFIG_FILE=manga_setting.yml \ + sagiri \ No newline at end of file diff --git a/run_services/run_selfmanga.sh b/run_services/run_selfmanga.sh new file mode 100755 index 0000000..71ce6e1 --- /dev/null +++ b/run_services/run_selfmanga.sh @@ -0,0 +1,5 @@ +docker run --volume /home/iria/grouple/production/recommendations_server:/recommendations_server \ + --volume /data/groupLe_recsys/processed:/data/groupLe_recsys/processed \ + -p 5013:5000 \ + -e CONFIG_FILE=selfmanga_setting.yml \ + sagiri \ No newline at end of file diff --git a/run_docker.sh b/run_single_docker.sh similarity index 90% rename from run_docker.sh rename to run_single_docker.sh index dff52bb..661ee9d 100755 --- a/run_docker.sh +++ b/run_single_docker.sh @@ -1,5 +1,5 @@ docker run --volume /home/iria/grouple/production/recommendations_server:/recommendations_server \ --volume /data/groupLe_recsys/processed:/data/groupLe_recsys/processed \ - -p 5000:$1 \ + -p $1:5000 \ -e CONFIG_FILE=$2 \ sagiri \ No newline at end of file