Skip to content

Commit 2326e20

Browse files
tdrztudor
andauthored
force buildkite to build the sdk using the new repo (#13)
* buildkite uses the new repo to build the sdk * update pglite-builder image used for wasm * remove unused Dockerfile --------- Co-authored-by: tudor <[email protected]>
1 parent cc93dc8 commit 2326e20

File tree

4 files changed

+23
-71
lines changed

4 files changed

+23
-71
lines changed

.buildkite/builder-docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ steps:
2727
--build-arg SDK_VERSION=$${SDK_VERSION}
2828
-t $${IMGNAME}:$${IMGTAG}
2929
-t $${IMGNAME}:latest
30-
.
30+
./pglite

pglite/Dockerfile

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ubuntu:22.04 AS build_sdk
22

3-
ARG PG_VERSION
4-
ARG SDK_VERSION
3+
ARG PG_VERSION=16.4
4+
ARG SDK_VERSION=3.1.74.3bi
55
ARG DEBUG=false
66
ARG OBJDUMP=true
77

@@ -12,7 +12,7 @@ ENV \
1212
SYS_PYTHON=/usr/bin/python3 \
1313
DEBUG=$DEBUG \
1414
BUILDS=3.12 \
15-
EMFLAVOUR=latest
15+
EMFLAVOUR=3.1.74
1616

1717
WORKDIR /workspace
1818

@@ -26,53 +26,43 @@ RUN \
2626
make build-essential wget lz4 bzip2 pv curl
2727

2828
# Download the python-wasm-sdk source for the given version
29-
RUN git clone --depth 1 --branch ${SDK_VERSION} https://github.com/pygame-web/python-wasm-sdk.git
29+
# RUN git clone --depth 1 --branch ${SDK_VERSION} https://github.com/pygame-web/python-wasm-sdk.git
30+
RUN git clone --depth 1 https://github.com/electric-sql/portable-sdk.git
3031

31-
# Remove third party libraries that are not necessary for PGLite
32-
RUN cd ./python-wasm-sdk/sources.wasm && rm assimp.sh bullet3.sh ode.sh
32+
WORKDIR /workspace/portable-sdk/python-wasm-sdk
3333

3434
# Make python-wasm-sdk
35-
RUN cd ./python-wasm-sdk && chmod +x ./python-wasm-sdk.sh && bash -c "./python-wasm-sdk.sh"
35+
RUN chmod +x python-wasm-sdk.sh
3636

37+
RUN bash -c "./python-wasm-sdk.sh"
3738

3839
FROM ubuntu:22.04
3940

40-
ARG PG_VERSION
41-
ARG SDK_VERSION
41+
# Install dependencies to build postgres wasm
42+
RUN \
43+
apt-get update &&\
44+
apt-get install -y lz4 wget pv bash bzip2 python3 build-essential libreadline-dev zlib1g-dev bison flex &&\
45+
apt-get clean
46+
47+
ARG PG_VERSION=16.4
48+
ARG SDK_VERSION=3.1.74.3bi
4249
ARG DEBUG=false
4350
ARG OBJDUMP=true
4451

4552
ENV \
4653
PG_VERSION=$PG_VERSION \
4754
SDK_VERSION=$SDK_VERSION \
48-
SDK_ARCHIVE=python3.12-wasm-sdk-Ubuntu-22.04.tar \
55+
SDK_ARCHIVE=python3.12-wasm-sdk-Ubuntu-22.04.tar.lz4 \
4956
SDKROOT=/opt/python-wasm-sdk \
5057
SYS_PYTHON=/usr/bin/python3 \
5158
PGROOT=/tmp/pglite \
5259
DEBUG=$DEBUG \
5360
OBJDUMP=$OBJDUMP
5461

55-
WORKDIR /workspace
56-
57-
COPY --from=0 /tmp/sdk /tmp/sdk
58-
59-
ENV SDK_VERSION=3.1.74.2bi
60-
ENV WASI_SDK_VERSION=24.0.5
61-
ENV SDK_ARCHIVE=python3.13-wasm-sdk-Ubuntu-22.04.tar.lz4
62-
ENV WASI_SDK_ARCHIVE=python3.13-wasi-sdk-Ubuntu-22.04.tar.lz4
63-
64-
# Install dependencies to build postgres wasm
65-
RUN \
66-
apt-get update &&\
67-
apt-get install -y lz4 wget pv bash curl bzip2 python3 build-essential libreadline-dev zlib1g-dev bison flex git curl &&\
68-
apt-get clean
69-
70-
RUN curl -sL --retry 5 https://github.com/pygame-web/python-wasm-sdk/releases/download/$SDK_VERSION/$SDK_ARCHIVE | tar xvP --use-compress-program=lz4 | pv -p -l -s 46000 >/dev/null
71-
RUN curl -sL --retry 5 https://github.com/pygame-web/python-wasi-sdk/releases/download/$WASI_SDK_VERSION/$WASI_SDK_ARCHIVE | tar xvP --use-compress-program=lz4 | pv -p -l -s 23000 >/dev/null
62+
COPY --from=build_sdk /tmp/sdk /tmp/sdk
7263

73-
# Extract SDK
74-
RUN cd / && tar xvf /tmp/sdk/${SDK_ARCHIVE} | pv -p -l -s 24400 >/dev/null
64+
RUN tar --use-compress-program=lz4 -xvf /tmp/sdk/${SDK_ARCHIVE} -C /
7565

76-
# Clean up packaged SDK
77-
RUN rm -rf /tmp/sdk
66+
RUN rm -r /tmp/sdk
7867

68+
WORKDIR /workspace

pglite/cibuild/build-with-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [[ -z "$SDK_VERSION" || -z "$PG_VERSION" ]]; then
1212
exit 1
1313
fi
1414

15-
IMG_NAME="electricsql/emsdk"
15+
IMG_NAME="electricsql/pglite-builder"
1616
IMG_TAG="${PG_VERSION}_${SDK_VERSION}"
1717

1818
SDK_ARCHIVE="${SDK_ARCHIVE:-python3.13-wasm-sdk-Ubuntu-22.04.tar.lz4}"

pglite/postgres-pglite-builder/Dockerfile

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)