-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libopcut musl libc allocation bugfix
- Loading branch information
Showing
15 changed files
with
155 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
FROM python:3.10-slim-bookworm as opcut-base | ||
WORKDIR /opcut | ||
RUN apt update -y && \ | ||
apt install -y pkg-config gcc libcairo2-dev | ||
apt install -y pkg-config gcc libcairo2-dev && \ | ||
python3 -m venv /opt/opcut | ||
|
||
FROM opcut-base as opcut-build | ||
WORKDIR /opcut | ||
RUN apt install -y nodejs yarnpkg git && \ | ||
ln -sT /usr/bin/yarnpkg /usr/bin/yarn | ||
RUN apt install -y nodejs npm git | ||
COPY . . | ||
RUN pip install -r requirements.pip.txt && \ | ||
doit clean_all && \ | ||
doit | ||
RUN /opt/opcut/bin/pip install -r requirements.pip.txt && \ | ||
/opt/opcut/bin/doit clean_all && \ | ||
/opt/opcut/bin/doit | ||
|
||
FROM opcut-base as opcut-run | ||
WORKDIR /opcut | ||
COPY --from=opcut-build /opcut/build/py/*.whl . | ||
RUN pip install *.whl && \ | ||
rm *.whl | ||
RUN /opt/opcut/bin/pip install *.whl && \ | ||
rm -r /opcut | ||
EXPOSE 8080 | ||
CMD ["/usr/local/bin/opcut", "server"] | ||
CMD ["/opt/opcut/bin/opcut", "server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM python:3.12-alpine3.20 as opcut-base | ||
WORKDIR /opcut | ||
RUN apk update && \ | ||
apk add cairo && \ | ||
python3 -m venv /opt/opcut | ||
|
||
FROM opcut-base as opcut-build | ||
WORKDIR /opcut | ||
RUN apk add build-base pkgconf cargo cairo-dev nodejs npm | ||
COPY . . | ||
RUN /opt/opcut/bin/pip install -r requirements.pip.txt && \ | ||
/opt/opcut/bin/doit clean_all && \ | ||
/opt/opcut/bin/doit | ||
|
||
FROM opcut-base as opcut-run | ||
WORKDIR /opcut | ||
COPY --from=opcut-build /root/.cache/pip /root/.cache/pip | ||
COPY --from=opcut-build /opcut/build/py/*.whl . | ||
RUN /opt/opcut/bin/pip install *.whl && \ | ||
rm -r /opcut | ||
EXPOSE 8080 | ||
CMD ["/opt/opcut/bin/opcut", "server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,7 @@ Development requirements | |
|
||
* C99 compiler (gcc, clang, ...) | ||
* nodejs >=7 | ||
* npm | ||
|
||
|
||
Build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/result.json | ||
/output.pdf | ||
/output.svg | ||
/build | ||
/dist |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
PLAYGROUND_PATH=$(dirname "$(realpath "$0")") | ||
. $PLAYGROUND_PATH/env.sh | ||
|
||
for i in $(find $ROOT_PATH/src_py -name '*.so'); do | ||
objdump -T $i | grep GLIBC | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
PLAYGROUND_PATH=$(dirname "$(realpath "$0")") | ||
. $PLAYGROUND_PATH/env.sh | ||
|
||
cd $ROOT_PATH | ||
rm -rf $DIST_PATH | ||
mkdir -p $DIST_PATH | ||
|
||
|
||
if command -v x86_64-w64-mingw32-gcc >/dev/null; then | ||
export TARGET_PLATFORM=windows_amd64 | ||
|
||
$PYTHON -m doit clean_all | ||
$PYTHON -m doit dist | ||
|
||
cp $ROOT_PATH/build/py/*.whl $DIST_PATH | ||
cp $ROOT_PATH/build/dist/*.zip $DIST_PATH | ||
fi | ||
|
||
|
||
PLATFORMS="linux/amd64 | ||
linux/arm/v7 | ||
linux/arm64/v8" | ||
|
||
for PLATFORM in $PLATFORMS; do | ||
for DOCKERFILE in $PLAYGROUND_PATH/dockerfiles/*; do | ||
IMAGE=$PLATFORM/$(basename $DOCKERFILE) | ||
IMAGE_ID=$(podman images -q $IMAGE) | ||
|
||
$PYTHON -m doit clean_all | ||
|
||
podman build --platform $PLATFORM \ | ||
-f $DOCKERFILE \ | ||
-t $IMAGE \ | ||
. | ||
if [ -n "$IMAGE_ID" -a "$IMAGE_ID" != "$(podman images -q $IMAGE)" ]; then | ||
podman rmi $IMAGE_ID | ||
fi | ||
podman run --rm \ | ||
--platform $PLATFORM \ | ||
-v $DIST_PATH:/opcut/dist \ | ||
-v ~/.cache/pip:/root/.cache/pip \ | ||
-i $IMAGE /bin/sh - << EOF | ||
set -e | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip install --upgrade pip hat-json | ||
./playground/requirements.sh > requirements.pip.txt | ||
pip install --upgrade -r requirements.pip.txt | ||
doit clean_all | ||
doit | ||
cp build/py/*.whl dist | ||
EOF | ||
|
||
done | ||
done | ||
|
||
$PYTHON -m doit clean_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.12-alpine3.20 as base | ||
RUN apk update && \ | ||
apk add build-base pkgconf cargo cairo-dev nodejs npm git jq | ||
|
||
FROM base | ||
WORKDIR /opcut | ||
VOLUME /opcut/dist | ||
VOLUME /root/.cache/pip | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.12-bullseye as base | ||
RUN apt update -qy && \ | ||
apt install -qy pkg-config gcc libcairo2-dev nodejs npm git jq | ||
|
||
FROM base | ||
WORKDIR /opcut | ||
VOLUME /opcut/dist | ||
VOLUME /root/.cache/pip | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
PLAYGROUND_PATH=$(dirname "$(realpath "$0")") | ||
. $PLAYGROUND_PATH/env.sh | ||
|
||
hat-json-convert $ROOT_PATH/pyproject.toml | \ | ||
jq -r '.project | .dependencies[], .["optional-dependencies"][][]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
aiohttp ~=3.9.3 | ||
hat-aio ~=0.7.9 | ||
hat-doit ~=0.15.13 | ||
aiohttp ~=3.9.5 | ||
hat-aio ~=0.7.10 | ||
hat-doit ~=0.15.15 | ||
hat-json ~=0.5.27 | ||
pycairo ~=1.26.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters