Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
lovegaoshi committed Nov 30, 2024
1 parent 4abc894 commit eeb6ab0
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.aarch64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: docker-aarch64

on:
schedule:
workflow_dispatch:

jobs:
docker-aarch64:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: false

- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: gaoshi/ipynb-inaseg:nightly-aarch64
file: ./Dockerfile-aarch64
5 changes: 5 additions & 0 deletions .github/workflows/keepAlive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ jobs:
steps:
- name: docker pull
run: docker pull gaoshi/ipynb-inaseg:nightly-gpu
docker-gpu:
runs-on: ubuntu-latest
steps:
- name: docker pull
run: docker pull gaoshi/ipynb-inaseg:nightly-aarch64
4 changes: 2 additions & 2 deletions Dockerfile-aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ RUN sudo groupmod -g 1001 ubuntu
RUN sudo usermod -u 1001 -g 1001 ubuntu
RUN sudo apt-get update --allow-insecure-repositories
RUN sudo apt-get -y --allow-unauthenticated install ffmpeg aria2 wget nano git
RUN sudo /home/ubuntu/python3-venv/python3 /inaseg/biliupinit.py --system aarch64-linux.tar.xz
WORKDIR /inaseg
RUN git clone https://github.com/lovegaoshi/inaSpeechSegmenter.git
RUN cd inaSpeechSegmenter; pip install .
COPY ./requirements.txt /inaseg/requirements.txt
RUN pip3 install -r /inaseg/requirements.txt
RUN pip3 install --force-reinstall git+https://github.com/grqz/yt-dlp.git@ie/bilibili/pi_fallbk
COPY . /inaseg
COPY . /inaseg
RUN python3 /inaseg/biliupinit.py --system aarch64-linux.tar.xz
8 changes: 7 additions & 1 deletion biliupinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
parser.add_argument(
'--system', type=str, default=r'x86_64-linux-musl.tar.xz',
)
parser.add_argument(
'--sudocp', type=bool, default=False, action='store_false'
)
args = parser.parse_args()

req = requests.get('https://api.github.com/repositories/437055168/releases/latest').json()
Expand All @@ -19,4 +22,7 @@
tarfile.open(biliup_tar_path).extractall()
os.remove(biliup_tar_path)
for file in glob.glob('biliupR*/*'):
os.rename(file, os.path.join('/bin', os.path.basename(file)))
if args.sudocp:
subprocess.call(['sudo', 'mv', file, '/bin'])
else:
os.rename(file, os.path.join('/bin', os.path.basename(file)))

0 comments on commit eeb6ab0

Please sign in to comment.