Skip to content

Commit

Permalink
working arm v7 build
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate committed Oct 31, 2023
1 parent 12c9664 commit bc555cc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 93 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-o", "errtrace", "-o", "
COPY --chown=root:root --chmod=755 package.json "$CODE_DIR/"
RUN grep '"version": ' "${CODE_DIR}/package.json" | awk -F'"' '{print $4}' > /VERSION.txt


# Print debug info about build and save it to disk
RUN (echo "[i] Docker build for ArchiveBox $(cat /VERSION.txt) starting..." \
&& echo "PLATFORM=${TARGETPLATFORM} ARCH=$(uname -m) ($(uname -s) ${TARGETARCH} ${TARGETVARIANT})" \
Expand Down Expand Up @@ -106,7 +107,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
&& apt-get update -qq \
&& apt-get install -qq -y -t bookworm-backports --no-install-recommends \
# 1. packaging dependencies
apt-transport-https ca-certificates gnupg2 curl wget \
apt-transport-https ca-certificates apt-utils gnupg2 curl wget \
# 2. docker and init system dependencies
zlib1g-dev dumb-init gosu cron unzip grep \
# 3. frivolous CLI helpers to make debugging failed archiving easier
Expand All @@ -122,7 +123,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/root/.np
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& apt-get update -qq \
&& apt-get install -qq -y -t bookworm-backports --no-install-recommends \
nodejs libatomic1 \
nodejs libatomic1 python3-minimal \
&& rm -rf /var/lib/apt/lists/* \
# Update NPM to latest version
&& npm i -g npm --cache /root/.npm \
Expand Down Expand Up @@ -178,7 +179,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/root/.ca
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/root/.cache/pip --mount=type=cache,target=/root/.cache/ms-playwright \
echo "[+] Installing Browser binary dependencies to $PLAYWRIGHT_BROWSERS_PATH..." \
&& apt-get update -qq \
&& if [[ "$TARGETPLATFORM" == "linux/amd64"* || "$TARGETPLATFORM" == "linux/arm64"* ]]; then \
&& if [[ "$TARGETPLATFORM" == *amd64* || "$TARGETPLATFORM" == *arm64* ]]; then \
# install Chromium using playwright
pip install playwright \
&& cp -r /root/.cache/ms-playwright "$PLAYWRIGHT_BROWSERS_PATH" \
Expand Down
4 changes: 1 addition & 3 deletions bin/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ which docker > /dev/null || exit 1
which jq > /dev/null || exit 1
# which pdm > /dev/null || exit 1

SUPPORTED_PLATFORMS="linux/arm64,linux/amd64,linux/arm/v7"


SUPPORTED_PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7"

TAG_NAME="${1:-$(git rev-parse --abbrev-ref HEAD)}"
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
Expand Down
83 changes: 1 addition & 82 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
"w3lib>=1.22.0",
# "youtube-dl>=2021.04.17",
"yt-dlp>=2021.4.11",
"playwright>=1.39.0; platform_machine != 'armv7l'",
# "playwright>=1.39.0; platform_machine != 'armv7l'",
]
requires-python = ">=3.9"
readme = "README.md"
Expand Down Expand Up @@ -94,6 +94,10 @@ ldap = [
"python-ldap>=3.4.3",
"django-auth-ldap>=4.1.0",
]
# playwright = [
# platform_machine isnt respected by pdm export -o requirements.txt, this breaks arm/v7
# "playwright>=1.39.0; platform_machine != 'armv7l'",
# ]

[project.scripts]
archivebox = "archivebox.cli:main"
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ django==3.1.14
django-auth-ldap==4.1.0
django-extensions==3.1.5
executing==2.0.1
greenlet==3.0.0
idna==3.4
ipython==8.17.2
jedi==0.19.1
Expand All @@ -23,14 +22,12 @@ mutagen==1.47.0
mypy-extensions==1.0.0
parso==0.8.3
pexpect==4.8.0
playwright==1.39.0
prompt-toolkit==3.0.39
ptyprocess==0.7.0
pure-eval==0.2.2
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycryptodomex==3.19.0
pyee==11.0.1
pygments==2.16.1
python-crontab==3.0.0
python-dateutil==2.8.2
Expand All @@ -43,7 +40,6 @@ sonic-client==1.0.0
sqlparse==0.4.4
stack-data==0.6.3
traitlets==5.13.0
typing-extensions==4.8.0
tzlocal==5.2
urllib3==2.0.7
w3lib==2.1.2
Expand Down

0 comments on commit bc555cc

Please sign in to comment.