From 0cfb3366c255c6d78612001820d9991f961bfdc0 Mon Sep 17 00:00:00 2001 From: tarepan Date: Mon, 20 May 2024 09:50:25 +0900 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86:=20`engine=5Fmanifest=5Fasse?= =?UTF-8?q?ts/`=20=E3=82=92=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9=E3=83=87?= =?UTF-8?q?=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA=E3=81=B8=E7=A7=BB?= =?UTF-8?q?=E5=8B=95=20(#1247)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: `engine_manifest_assets/` をリソースディレクトリへ移動 --- .github/workflows/build-engine-package.yml | 4 ++-- Dockerfile | 5 ++--- build_util/process_voicevox_resource.bash | 6 +++--- engine_manifest.json | 8 ++++---- .../dependency_licenses.json | 0 .../downloadable_libraries.json | 0 .../engine_manifest_assets}/icon.png | Bin .../engine_manifest_assets}/terms_of_service.md | 0 .../engine_manifest_assets}/update_infos.json | 0 run.spec | 1 - voicevox_engine/library_manager.py | 4 ++-- 11 files changed, 13 insertions(+), 15 deletions(-) rename {engine_manifest_assets => resources/engine_manifest_assets}/dependency_licenses.json (100%) rename {engine_manifest_assets => resources/engine_manifest_assets}/downloadable_libraries.json (100%) rename {engine_manifest_assets => resources/engine_manifest_assets}/icon.png (100%) rename {engine_manifest_assets => resources/engine_manifest_assets}/terms_of_service.md (100%) rename {engine_manifest_assets => resources/engine_manifest_assets}/update_infos.json (100%) diff --git a/.github/workflows/build-engine-package.yml b/.github/workflows/build-engine-package.yml index 145fff42b..84927551b 100644 --- a/.github/workflows/build-engine-package.yml +++ b/.github/workflows/build-engine-package.yml @@ -445,10 +445,10 @@ jobs: # Build - name: Generate licenses.json run: | - OUTPUT_LICENSE_JSON_PATH=engine_manifest_assets/dependency_licenses.json \ + OUTPUT_LICENSE_JSON_PATH=resources/engine_manifest_assets/dependency_licenses.json \ bash build_util/create_venv_and_generate_licenses.bash # FIXME: VOICEVOX (editor) cannot build without licenses.json - cp engine_manifest_assets/dependency_licenses.json licenses.json + cp resources/engine_manifest_assets/dependency_licenses.json licenses.json - name: Build VOICEVOX ENGINE run.py run: | diff --git a/Dockerfile b/Dockerfile index 05c9feb73..488d7a586 100644 --- a/Dockerfile +++ b/Dockerfile @@ -232,7 +232,6 @@ ADD ./resources /opt/voicevox_engine/resources ADD ./build_util/generate_licenses.py /opt/voicevox_engine/build_util/ ADD ./speaker_info /opt/voicevox_engine/speaker_info ADD ./ui_template /opt/voicevox_engine/ui_template -ADD ./engine_manifest_assets /opt/voicevox_engine/engine_manifest_assets # Replace version ARG VOICEVOX_ENGINE_VERSION=latest @@ -251,8 +250,8 @@ RUN < /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json - cp /opt/voicevox_engine/engine_manifest_assets/dependency_licenses.json /opt/voicevox_engine/licenses.json + gosu user /opt/python/bin/python3 build_util/generate_licenses.py > /opt/voicevox_engine/resources/engine_manifest_assets/dependency_licenses.json + cp /opt/voicevox_engine/resources/engine_manifest_assets/dependency_licenses.json /opt/voicevox_engine/licenses.json EOF # Keep this layer separated to use layer cache on download failed in local build diff --git a/build_util/process_voicevox_resource.bash b/build_util/process_voicevox_resource.bash index 8f15d9f63..053ea3489 100644 --- a/build_util/process_voicevox_resource.bash +++ b/build_util/process_voicevox_resource.bash @@ -20,13 +20,13 @@ mv engine_manifest.json.tmp engine_manifest.json # エンジンとリソースの更新情報を統合する python build_util/merge_update_infos.py \ - engine_manifest_assets/update_infos.json \ + resources/engine_manifest_assets/update_infos.json \ "${DOWNLOAD_RESOURCE_PATH}/engine/engine_manifest_assets/update_infos.json" \ - engine_manifest_assets/update_infos.json + resources/engine_manifest_assets/update_infos.json # リソースのマニフェストアセットをエンジンのディレクトリへ複製する for f in "${DOWNLOAD_RESOURCE_PATH}"/engine/engine_manifest_assets/*; do if [ "$(basename "${f}")" != "update_infos.json" ]; then - cp "${f}" ./engine_manifest_assets/ + cp "${f}" ./resources/engine_manifest_assets/ fi done diff --git a/engine_manifest.json b/engine_manifest.json index 82121f652..a422a78bc 100644 --- a/engine_manifest.json +++ b/engine_manifest.json @@ -7,12 +7,12 @@ "url": "https://github.com/VOICEVOX/voicevox_engine", "command": "run", "port": 50021, - "icon": "engine_manifest_assets/icon.png", + "icon": "resources/engine_manifest_assets/icon.png", "default_sampling_rate": 24000, "frame_rate": 93.75, - "terms_of_service": "engine_manifest_assets/terms_of_service.md", - "update_infos": "engine_manifest_assets/update_infos.json", - "dependency_licenses": "engine_manifest_assets/dependency_licenses.json", + "terms_of_service": "resources/engine_manifest_assets/terms_of_service.md", + "update_infos": "resources/engine_manifest_assets/update_infos.json", + "dependency_licenses": "resources/engine_manifest_assets/dependency_licenses.json", "supported_features": { "adjust_mora_pitch": { "type": "bool", diff --git a/engine_manifest_assets/dependency_licenses.json b/resources/engine_manifest_assets/dependency_licenses.json similarity index 100% rename from engine_manifest_assets/dependency_licenses.json rename to resources/engine_manifest_assets/dependency_licenses.json diff --git a/engine_manifest_assets/downloadable_libraries.json b/resources/engine_manifest_assets/downloadable_libraries.json similarity index 100% rename from engine_manifest_assets/downloadable_libraries.json rename to resources/engine_manifest_assets/downloadable_libraries.json diff --git a/engine_manifest_assets/icon.png b/resources/engine_manifest_assets/icon.png similarity index 100% rename from engine_manifest_assets/icon.png rename to resources/engine_manifest_assets/icon.png diff --git a/engine_manifest_assets/terms_of_service.md b/resources/engine_manifest_assets/terms_of_service.md similarity index 100% rename from engine_manifest_assets/terms_of_service.md rename to resources/engine_manifest_assets/terms_of_service.md diff --git a/engine_manifest_assets/update_infos.json b/resources/engine_manifest_assets/update_infos.json similarity index 100% rename from engine_manifest_assets/update_infos.json rename to resources/engine_manifest_assets/update_infos.json diff --git a/run.spec b/run.spec index 8b10cb703..88b160ef4 100644 --- a/run.spec +++ b/run.spec @@ -5,7 +5,6 @@ import os datas = [ ('resources', 'resources'), - ('engine_manifest_assets', 'engine_manifest_assets'), ('speaker_info', 'speaker_info'), ('engine_manifest.json', '.'), ('licenses.json', '.'), diff --git a/voicevox_engine/library_manager.py b/voicevox_engine/library_manager.py index f2232ebbb..45e9d6916 100644 --- a/voicevox_engine/library_manager.py +++ b/voicevox_engine/library_manager.py @@ -57,14 +57,14 @@ def downloadable_libraries(self) -> list[DownloadableLibraryInfo]: # == ダウンロード情報をjsonファイルから取得する場合 # with open( - # self.root_dir / "engine_manifest_assets" / "downloadable_libraries.json", + # self.root_dir / "resources" / "engine_manifest_assets" / "downloadable_libraries.json", # noqa: B950 # encoding="utf-8", # ) as f: # return list(map(DownloadableLibrary.parse_obj, json.load(f))) # ダミーとして、speaker_infoのアセットを読み込む with open( - "./engine_manifest_assets/downloadable_libraries.json", + "./resources/engine_manifest_assets/downloadable_libraries.json", encoding="utf-8", ) as f: libraries = json.load(f)