Skip to content

Commit

Permalink
licenses.jsonの生成スクリプトを追加 (#125)
Browse files Browse the repository at this point in the history
* add generate_licenses.py

* add cuda, open_jtalk license in repo

* remove ignore line of each_cpp_forwarder package

* add license json endpoint

* add public/index.html

* fix format

* remove index/license endpoint

* add license generation test ci

* generate licenses.json in docker

* use redirect

* fix filename in binary dist

* fix step name

* use venv for license check in ci

* use bash shell in ci

* switch venv command for os

* unquote

* drop generate_licenses output on ci

* Apply suggestions from code review

Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
aoirint and Hiroshiba authored Sep 28, 2021
1 parent 39b5777 commit a3014c5
Show file tree
Hide file tree
Showing 9 changed files with 2,112 additions and 4 deletions.
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

0 comments on commit a3014c5

Please sign in to comment.