Skip to content

Commit

Permalink
multi-arch builds
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Feb 28, 2025
1 parent 9382835 commit ffa3ed5
Show file tree
Hide file tree
Showing 23 changed files with 162 additions and 80 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Continuous Integration
on: push
on:
schedule:
- cron: '0 0 2 * *'
push:
branches-ignore:
- runtime
jobs:
build-docker-images:
runs-on: ubuntu-latest
Expand Down
34 changes: 28 additions & 6 deletions .github/workflows/runtime_alpine_3_10.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
name: 'build & push: runtime_alpine_3_10'
on:
schedule:
- cron: '0 0 1 * *'
push:
branches:
- runtime
jobs:
push_to_registry:
name: 'build & push: runtime_alpine_3_10'
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Check out the repo
uses: actions/checkout@v2
- name: runtime_alpine_3_10
uses: docker/build-push-action@v1
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: pelias/spatial
dockerfile: runtime/runtime.alpine.3.10.Dockerfile
tags: runtime_alpine_3_10
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build Docker Images
timeout-minutes: 360
env:
TAG: runtime_alpine_3_10
FILE: runtime/runtime.debian.buster.Dockerfile
run: |
docker buildx create --use --bootstrap --platform='linux/amd64,linux/arm64' --name 'multi-platform-builder'
docker buildx build --platform 'linux/amd64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64,linux/amd64' -f $FILE -t pelias/spatial:$TAG --push .
34 changes: 28 additions & 6 deletions .github/workflows/runtime_debian_buster.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
name: 'build & push: runtime_debian_buster'
on:
schedule:
- cron: '0 0 1 * *'
push:
branches:
- runtime
jobs:
push_to_registry:
name: 'build & push: runtime_debian_buster'
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Check out the repo
uses: actions/checkout@v2
- name: runtime_debian_buster
uses: docker/build-push-action@v1
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: pelias/spatial
dockerfile: runtime/runtime.debian.buster.Dockerfile
tags: runtime_debian_buster
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build Docker Images
timeout-minutes: 360
env:
TAG: runtime_debian_buster
FILE: runtime/runtime.debian.buster.Dockerfile
run: |
docker buildx create --use --bootstrap --platform='linux/amd64,linux/arm64' --name 'multi-platform-builder'
docker buildx build --platform 'linux/amd64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64,linux/amd64' -f $FILE -t pelias/spatial:$TAG --push .
34 changes: 28 additions & 6 deletions .github/workflows/runtime_ubuntu_bionic.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
name: 'build & push: runtime_ubuntu_bionic'
on:
schedule:
- cron: '0 0 1 * *'
push:
branches:
- runtime
jobs:
push_to_registry:
name: 'build & push: runtime_ubuntu_bionic'
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Check out the repo
uses: actions/checkout@v2
- name: runtime_ubuntu_bionic
uses: docker/build-push-action@v1
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: pelias/spatial
dockerfile: runtime/runtime.ubuntu.bionic.Dockerfile
tags: runtime_ubuntu_bionic
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build Docker Images
timeout-minutes: 360
env:
TAG: runtime_ubuntu_bionic
FILE: runtime/runtime.ubuntu.bionic.Dockerfile
run: |
docker buildx create --use --bootstrap --platform='linux/amd64,linux/arm64' --name 'multi-platform-builder'
docker buildx build --platform 'linux/amd64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64,linux/amd64' -f $FILE -t pelias/spatial:$TAG --push .
34 changes: 28 additions & 6 deletions .github/workflows/runtime_ubuntu_focal.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
name: 'build & push: runtime_ubuntu_focal'
on:
schedule:
- cron: '0 0 1 * *'
push:
branches:
- runtime
jobs:
push_to_registry:
name: 'build & push: runtime_ubuntu_focal'
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Check out the repo
uses: actions/checkout@v2
- name: runtime_ubuntu_focal
uses: docker/build-push-action@v1
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: pelias/spatial
dockerfile: runtime/runtime.ubuntu.focal.Dockerfile
tags: runtime_ubuntu_focal
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build Docker Images
timeout-minutes: 360
env:
TAG: runtime_ubuntu_focal
FILE: runtime/runtime.ubuntu.focal.Dockerfile
run: |
docker buildx create --use --bootstrap --platform='linux/amd64,linux/arm64' --name 'multi-platform-builder'
docker buildx build --platform 'linux/amd64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64' -f $FILE -t pelias/spatial:$TAG .
docker buildx build --platform 'linux/arm64,linux/amd64' -f $FILE -t pelias/spatial:$TAG --push .
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# 4. Produce a minimally sized image for distribution

# 1. ------------------------------------------------
FROM pelias/spatial:runtime_ubuntu_bionic as runtime
FROM pelias/spatial:runtime_ubuntu_bionic AS runtime

# 2. ------------------------------------------------
FROM pelias/baseimage as better_sqlite3
FROM pelias/baseimage AS better_sqlite3

# we require clang++ for compiling better-sqlite3
# this adds ~400MB to the image, so we build in a
# separate image and only copy the files we need.
RUN apt-get update -y
RUN apt-get install -y clang python3 make
RUN apt-get install -y clang python3 build-essential

# copy runtime
COPY --from=runtime /opt/spatial /opt/spatial
Expand All @@ -27,7 +27,7 @@ WORKDIR /code
RUN bin/compile_better_sqlite3

# 3. ------------------------------------------------
FROM pelias/baseimage as testing
FROM pelias/baseimage AS testing

# copy runtime
COPY --from=runtime /opt/spatial /opt/spatial
Expand Down
4 changes: 2 additions & 2 deletions runtime/install/_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ function gaia_download(){
function gaia_clone(){
REPO="$1"
rm -rf "${REPO}" "${REPO}.fossil"*
USER='me' fossil clone https://www.gaia-gis.it/fossil/$REPO $REPO.fossil
USER='me' fossil clone https://www.gaia-gis.it/fossil/$REPO $REPO.fossil | wc -l
mkdir -p "${REPO}"
cd "${REPO}"
fossil open "../${REPO}.fossil"
fossil open "../${REPO}.fossil" | wc -l
cd -
rm -rf "${REPO}.fossil"*
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/install/expat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd expat
--enable-static=no

# compile and install in runtime directory
make -j8
make -j4
make install-strip

# clean up
Expand Down
2 changes: 1 addition & 1 deletion runtime/install/geos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd geos
--enable-static=no

# compile and install in runtime directory
make -j8
make -j4
make install-strip

# clean up
Expand Down
4 changes: 3 additions & 1 deletion runtime/install/icu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ cd icu/source
--disable-debug \
--disable-samples \
--disable-tests \
--disable-tools \
--disable-extras \
--disable-static

# compile and install in runtime directory
make -j8
make -j4
make install

# clean up
Expand Down
2 changes: 1 addition & 1 deletion runtime/install/libtiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd libtiff
--enable-static=no

# compile and install in runtime directory
make -j8
make -j4
make install-strip

# clean up
Expand Down
4 changes: 2 additions & 2 deletions runtime/install/libxml2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cd /tmp
rm -rf libxml2 && mkdir -p libxml2

# download release and decompress it
curl -L 'ftp://xmlsoft.org/libxml2/libxml2-2.9.10.tar.gz' \
curl -L 'ftp://xmlsoft.org/libxml2/libxml2-2.9.12.tar.gz' \
| tar -xz --strip-components=1 -C libxml2

# working directory
Expand All @@ -25,7 +25,7 @@ cd libxml2
--without-python

# compile and install in runtime directory
make -j8
make -j4
make install-strip

# clean up
Expand Down
4 changes: 2 additions & 2 deletions runtime/install/proj7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cd /tmp
rm -rf proj7 && mkdir -p proj7

# download release and decompress it
curl -L 'https://download.osgeo.org/proj/proj-7.0.1.tar.gz' \
curl -L 'https://download.osgeo.org/proj/proj-7.2.1.tar.gz' \
| tar -xz --strip-components=1 -C proj7

# working directory
Expand All @@ -35,7 +35,7 @@ export TIFF_LIBS="-L${RUNTIME}/lib -ltiff"
--enable-static=no

# compile and install in runtime directory
make -j8
make -j4
make install-strip

# clean up
Expand Down
5 changes: 4 additions & 1 deletion runtime/install/readosm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ export CPPFLAGS="-I${RUNTIME}/include"
export LDFLAGS="-L${RUNTIME}/lib"
export LIBS="-ldl"

# generate config.guess
autoreconf -fi

# configure build
./configure \
--prefix="${RUNTIME}" \
--disable-dependency-tracking \
--enable-static=no

# compile and install in runtime directory
make -j8
make -j4
make install-strip

# clean up
Expand Down
2 changes: 1 addition & 1 deletion runtime/install/rttopo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export LDFLAGS="-L${RUNTIME}/lib"
--enable-static=no

# compile and install in runtime directory
make -j8
make -j4
make install-strip

# clean up
Expand Down
Loading

0 comments on commit ffa3ed5

Please sign in to comment.