Skip to content

Commit 2adfa40

Browse files
committed
Upgrade psycopg2-binary to a version with arm64 packages prebuilt. Revert a bunch of build hacks as a result
1 parent 2399afa commit 2adfa40

4 files changed

Lines changed: 4 additions & 21 deletions

File tree

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ typed-ast = "*"
1616

1717
[packages]
1818
sqlalchemy = "==1.3.13"
19-
psycopg2-binary = "==2.8.6"
2019
jmespath = "==0.9.4"
2120
jsonpatch = "==1.25"
2221
pyyaml = "==5.4"
@@ -30,6 +29,7 @@ colr = "*"
3029
python-dateutil = "*"
3130
boto3 = "==1.17.9"
3231
botocore = "==1.20.9"
32+
psycopg2-binary = "==2.9.1"
3333

3434
[requires]
3535
python_version = "3.9"

Pipfile.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/Dockerfile-arm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ FROM python:3.9-slim
22

33
ADD https://github.com/amacneil/dbmate/releases/download/v1.11.0/dbmate-linux-arm64 /app/dbmate
44
RUN chmod a+x /app/dbmate
5-
RUN apt-get update && apt-get install -y libpq-dev
65
COPY requirements.txt /app/
76
COPY migrations /app/migrations
87
WORKDIR /app/
98
RUN pip install -r requirements.txt
10-
COPY psycopg2_binary-2.8.6-cp39-cp39-linux_aarch64.whl /app/
11-
RUN pip install /app/psycopg2_binary-2.8.6-cp39-cp39-linux_aarch64.whl
129
EXPOSE 5000/tcp
1310
COPY introspector.py /app/
1411
COPY introspector /app/introspector

docker/build_arm.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,9 @@ set -e
55
PACKAGE=$1
66
VERSION=$2
77

8-
export DOCKER_BUILDKIT=1
9-
WHEEL_TAG=goldfig/tempbuildwheel:latest
10-
docker build --platform linux/arm64 -f docker/BuildWheelDockerFile -t $WHEEL_TAG .
11-
12-
CONTAINER_ID=$(docker run -t -d --rm $WHEEL_TAG)
13-
echo "Container ID $CONTAINER_ID"
14-
WHEEL_FILE=$(docker exec $CONTAINER_ID /usr/local/bin/pip cache list --format abspath)
15-
echo "Wheel file $WHEEL_FILE"
16-
LOCAL_WHEEL=psycopg2_binary-2.8.6-cp39-cp39-linux_aarch64.whl
17-
docker cp $CONTAINER_ID:$WHEEL_FILE $LOCAL_WHEEL
18-
docker stop $CONTAINER_ID
19-
208
echo "Building package ${PACKAGE}"
219

22-
pipenv lock -r > requirements.tmp
23-
sed '/psycopg2-binary.*/d' requirements.tmp > requirements.txt
24-
rm requirements.tmp
10+
pipenv lock -r > requirements.txt
2511

2612
INTROSPECTOR_DOCKER_REPO=${DOCKER_REPO:-goldfig}
2713
IMAGE="${INTROSPECTOR_DOCKER_REPO}/${PACKAGE}:arm64-${VERSION}"

0 commit comments

Comments
 (0)