Skip to content

Commit

Permalink
feat: support v15 images
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdrivingduck committed Sep 5, 2024
1 parent 67bc6d4 commit 511dc77
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 511 deletions.
86 changes: 0 additions & 86 deletions .cirrus.yml

This file was deleted.

28 changes: 16 additions & 12 deletions .github/workflows/build-and-publish-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,42 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get submodule version

- name: get submodule version
id: version
run: |
sha=$(git submodule status -- ./PolarDB-for-PostgreSQL/ | awk '{print $1}')
pg_version=$(grep AC_INIT ./PolarDB-for-PostgreSQL/configure.in | awk -F'[][]' '{print $4}')
pg_majorversion=$(grep AC_INIT ./PolarDB-for-PostgreSQL/configure.in | awk -F '[][]' '{split($4, v, "."); print v[1]}')
polar_majorversion=2.0.${pg_version}
polar_minorversion=$(grep -A 1 '&polar_version' ./PolarDB-for-PostgreSQL/src/backend/utils/misc/guc.c | awk 'NR==2{print}' | awk -F'[."]' '{print $4}').0
pg_version=$(grep AC_INIT ./PolarDB-for-PostgreSQL/configure.ac | awk -F'[][]' '{print $4}')
pg_majorversion=$(grep AC_INIT ./PolarDB-for-PostgreSQL/configure.ac | awk -F '[][]' '{split($4, v, "."); print v[1]}')
polar_majorversion=${pg_version}
polar_minorversion=$(grep '^POLAR_MINORVERSION' ./PolarDB-for-PostgreSQL/configure.ac | cut -d '"' -f2)
echo "sha=${sha:0:8}" >> $GITHUB_OUTPUT
echo "version=${polar_majorversion}.${polar_minorversion}" >> $GITHUB_OUTPUT
echo "pg_majorversion=${pg_majorversion}" >> $GITHUB_OUTPUT
- name: Set up QEMU
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
- name: login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to the ghcr
- name: login to the ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Alibaba Cloud ACR
- name: login to Alibaba Cloud ACR
uses: docker/login-action@v3
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIBABA_CLOUD_ACR_USERNAME }}
password: ${{ secrets.ALIBABA_CLOUD_ACR_PASSWORD }}
- name: Build and push binary image

- name: build and push binary image
uses: docker/build-push-action@v5
with:
push: true
Expand All @@ -60,7 +63,8 @@ jobs:
registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_binary:${{ steps.version.outputs.version }}
registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_binary:${{ steps.version.outputs.version }}.${{ steps.version.outputs.sha }}
platforms: linux/amd64, linux/arm64
- name: Build and push instance image

- name: build and push instance image
uses: docker/build-push-action@v5
with:
push: true
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "PolarDB-for-PostgreSQL"]
path = PolarDB-for-PostgreSQL
url = https://github.com/ApsaraDB/PolarDB-for-PostgreSQL.git
branch = POLARDB_11_STABLE
branch = POLARDB_15_STABLE
30 changes: 6 additions & 24 deletions Dockerfile-binary
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,16 @@ WORKDIR /home/postgres/
COPY ./PolarDB-for-PostgreSQL ./PolarDB-for-PostgreSQL

# Compile and install PolarDB-PG
USER root
WORKDIR /home/postgres/PolarDB-for-PostgreSQL
RUN sudo chown -R postgres:postgres ./
RUN ./polardb_build.sh --with-pfsd --withpx --noinit

# Install PostGIS
WORKDIR /home/postgres
RUN wget --no-verbose https://download.osgeo.org/postgis/source/postgis-3.3.2.tar.gz && \
tar -zxf postgis-3.3.2.tar.gz && \
cd postgis-3.3.2 && \
./configure -q && \
make -s -j$(nproc) && \
make -s install

# Install TimescaleDB
WORKDIR /home/postgres
RUN wget --no-verbose https://github.com/timescale/timescaledb/archive/refs/tags/2.3.1.tar.gz && \
tar -zxf 2.3.1.tar.gz && \
cd timescaledb-2.3.1 && \
./bootstrap -DREGRESS_CHECKS=OFF && \
cd ./build && \
make -s -j$(nproc) && \
make -s install
RUN ./build.sh --ec="--prefix=/u01/polardb_pg/ --with-pfsd" --debug=off --ni

FROM polardb/polardb_pg_devel:ubuntu22.04
LABEL maintainer="mrdrivingduck@gmail.com"

# Copy binary
COPY --from=building /home/postgres/tmp_basedir_polardb_pg_1100_bld/ /home/postgres/tmp_basedir_polardb_pg_1100_bld/
COPY --from=building /u01/polardb_pg/ /u01/polardb_pg/
COPY --from=building /home/postgres/PolarDB-for-PostgreSQL/src/backend/utils/misc/polardb.conf.sample /u01/polardb_pg/share

RUN sudo chown -R postgres:postgres /home/postgres/tmp_*
RUN sudo chmod -R 700 /home/postgres/tmp_*
RUN sudo chown -R postgres:postgres /u01/polardb_pg/
RUN sudo chmod -R 700 /u01/polardb_pg/
Loading

0 comments on commit 511dc77

Please sign in to comment.