Skip to content

Commit

Permalink
add amr v7
Browse files Browse the repository at this point in the history
  • Loading branch information
ARC-MX committed Jun 3, 2024
1 parent 608cdb4 commit 5c3652a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:

- name: Build and push Docker image
run: |
PLATFORMS=linux/arm64,linux/amd64
PLATFORMS=linux/arm/v7
DOCKER_IMAGE=arcw/sgcc_electricity
docker buildx build --platform $PLATFORMS -t $DOCKER_IMAGE:latest -t $DOCKER_IMAGE:1.3.3 --file Dockerfile-for-github-action --push .
docker buildx build --platform $PLATFORMS -t $DOCKER_IMAGE:armv7 -t $DOCKER_IMAGE:1.3.3 --file Dockerfile-for-github-action-armv7 --push .
48 changes: 48 additions & 0 deletions Dockerfile-for-github-action-armv7
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM python:3.9-bullseye as build

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

ARG TARGETOS
ARG TARGETARCH

WORKDIR /app

# COPY scripts/* /app/
COPY ./requirements.txt /tmp/requirements.txt

RUN apt-get --allow-releaseinfo-change update \
&& apt-get install -y --no-install-recommends jq chromium chromium-driver tzdata cmake \
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN cd /tmp \
&& python3 -m pip install --upgrade pip

RUN if [${TARGETARCH} == "arm"]; then \
cd /tmp \
&& curl -O -L https://github.com/nknytk/built-onnxruntime-for-raspberrypi-linux/raw/master/wheels/buster/onnxruntime-1.8.1-cp39-cp39-linux_armv7l.whl \
&& PIP_ROOT_USER_ACTION=ignore pip3 install onnxruntime-1.8.1-cp39-cp39-linux_armv7l.whl \
&& PIP_ROOT_USER_ACTION=ignore pip3 install cmake==3.14.3; \
fi

# RUN if [${TARGETARCH} == "arm64"]; then \
# cd /tmp \
# && PIP_ROOT_USER_ACTION=ignore pip3 install onnxruntime==1.8.1; \
# fi

RUN cd /tmp \
&& PIP_ROOT_USER_ACTION=ignore pip install \
--disable-pip-version-check \
--no-cache-dir \
-r requirements-armv7.txt \
&& rm -rf /tmp/* \
&& pip cache purge \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/log/*

ENV LANG C.UTF-8

CMD ["python"]
9 changes: 9 additions & 0 deletions requirements-armv7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
numpy~=1.25.1
opencv-python-headless~=4.5.3
requests==2.31.0
selenium~=4.5.0
schedule==1.1.0
Pillow~=9.3.0
undetected_chromedriver==3.4.7
pymongo~=3.12.0
python-dotenv

0 comments on commit 5c3652a

Please sign in to comment.