Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

licenses.jsonの生成スクリプトを追加 #125

Merged
merged 18 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
id: pip-cache
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-test.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-test.txt', '**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-test.txt') }}
${{ runner.os }}-pip-

- name: Install libraries for ubuntu
if: matrix.os == 'ubuntu-latest'
Expand All @@ -49,3 +49,17 @@ jobs:
- run: pysen run lint

- run: pytest

- name: Check licenses
shell: bash
run: |
python -m venv venv

if [ -d "venv/Scripts" ]; then
source venv/Scripts/activate
else
source venv/bin/activate
fi

pip install -r requirements-dev.txt
python generate_licenses.py > /dev/null
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ venv/

/build
/cache

/licenses.json
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ EOF
# ARG PATH=/opt/python/bin:$PATH
ADD ./requirements.txt /tmp/
ADD ./voicevox_engine /opt/voicevox_engine/voicevox_engine
ADD ./run.py ./check_tts.py ./VERSION.txt ./LICENSE ./LGPL_LICENSE /opt/voicevox_engine/
ADD ./docs /opt/voicevox_engine/docs
ADD ./run.py ./generate_licenses.py ./check_tts.py ./VERSION.txt /opt/voicevox_engine/

ARG USE_GLIBC_231_WORKAROUND=0
RUN <<EOF
Expand All @@ -198,7 +199,7 @@ RUN <<EOF
ldconfig

# Const environment
export PATH="$PATH:/opt/python/bin/"
export PATH="/home/user/.local/bin:/opt/python/bin:$PATH"
export LIBRARY_PATH="/opt/voicevox_core:$LIBRARY_PATH"

# Install requirements
Expand All @@ -208,6 +209,11 @@ RUN <<EOF
# Install voicevox_core
cd /opt/voicevox_core_example/example/python
gosu user pip3 install .

# Generate licenses.json
cd /opt/voicevox_engine
gosu user pip3 install pip-licenses
gosu user python3 generate_licenses.py > /opt/voicevox_engine/licenses.json
EOF

# Keep layer cache above if dict download failed in local build
Expand Down Expand Up @@ -301,6 +307,7 @@ RUN <<EOF
--include-package-data=pyopenjtalk \
--include-package-data=resampy \
--include-data-file=/opt/voicevox_engine/VERSION.txt=./ \
--include-data-file=/opt/voicevox_engine/licenses.json=./ \
--include-data-file=/opt/libtorch/lib/*.so=./ \
--include-data-file=/opt/libtorch/lib/*.so.*=./ \
--include-data-file=/opt/voicevox_core/*.so=./ \
Expand Down
Loading