Skip to content

Commit

Permalink
Removed resource from rpm, deb and image (#1411)
Browse files Browse the repository at this point in the history
Removed resource from rpm, deb and image

- [x] Refactoring
  • Loading branch information
yuzhichang authored Jun 28, 2024
1 parent 19a0baa commit 53e0513
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ jobs:
TZ=$(readlink -f /etc/localtime | awk -F '/zoneinfo/' '{print $2}')
sudo docker rm -f infinity_build && sudo docker run -d --privileged --name infinity_build --network=host -e TZ=$TZ -v $PWD:/infinity infiniflow/infinity_builder:centos7
- name: Modify CMakeLists
run: sed -i '/install.*TARGETS embedded_infinity_ext.*/d' src/CMakeLists.txt

- name: Build release version
run: sudo docker exec infinity_build bash -c "git config --global safe.directory \"*\" && cd /infinity && rm -fr cmake-build-release && mkdir -p cmake-build-release && cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCPACK_PACKAGE_VERSION=${{ env.RELEASE_TAG }} -DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=amd64 -DCMAKE_JOB_POOL_LINK:STRING=link_pool -DCMAKE_JOB_POOLS:STRING=link_pool=1 -S /infinity -B /infinity/cmake-build-release && cmake --build /infinity/cmake-build-release"

Expand All @@ -83,7 +80,7 @@ jobs:
- name: Build RPM and DEB
run: sudo docker exec infinity_build bash -c "cd /infinity/cmake-build-release && cpack"

- name: Create or overwrite a releae
- name: Create or overwrite a release
# https://github.com/actions/upload-release-asset has been replaced by https://github.com/softprops/action-gh-release
uses: softprops/action-gh-release@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
run: |
sudo docker exec infinity_build bash -c "cd /infinity/ && source /usr/local/venv310/bin/activate && pip3 wheel . -v -w dist --config-settings=wheel.py-api=cp310 && auditwheel repair --plat manylinux_2_17_x86_64 dist/infinity*cp310*.whl && pip3 install wheelhouse/infinity*cp310*.whl"
- name: Test embeded infinity for Python 3.10
- name: Test embedded infinity for Python 3.10
if: ${{ !cancelled() && !failure() }}
run: |
sudo docker exec infinity_build bash -c "cd /infinity/ && source /usr/local/venv310/bin/activate && python3 tools/run_pysdk_local_infinity_test.py"
Expand Down
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ set(CMAKE_INSTALL_PREFIX /usr)
install(TARGETS infinity DESTINATION bin)
install(FILES conf/infinity.service DESTINATION lib/systemd/system)
install(FILES conf/infinity_conf.toml DESTINATION etc)
install(DIRECTORY resource/jieba DESTINATION ../var/infinity/resource)
install(DIRECTORY resource/mecab DESTINATION ../var/infinity/resource)

# https://cmake.org/cmake/help/latest/cpack_gen/rpm.html
# Specify the post-install script for RPM
Expand Down
5 changes: 1 addition & 4 deletions scripts/Dockerfile_infinity
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
FROM debian:stable-slim

COPY cmake-build-release/src/infinity /usr/bin

# https://docs.docker.com/reference/dockerfile/#copy
# If <src> is a directory, the entire contents of the directory are copied, including filesystem metadata.
# The directory itself isn't copied, only its contents.
COPY resource/jieba /resource/jieba
COPY resource/mecab /resource/mecab
COPY cmake-build-release/src/infinity /usr/bin

ENTRYPOINT ["bash", "-c", "cp -rf /resource /var/infinity/; exec /usr/bin/infinity"]

0 comments on commit 53e0513

Please sign in to comment.