Skip to content

Commit 6caf135

Browse files
committed
build gdal
1 parent afc2247 commit 6caf135

File tree

3 files changed

+57
-60
lines changed

3 files changed

+57
-60
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
username: ${{ secrets.DOCKERHUB_USERNAME }}
1919
password: ${{ secrets.DOCKERHUB_TOKEN }}
2020

21-
- name: Common build cache
21+
- name: setup Common cache
2222
uses: actions/cache@v2
2323
id: common-cache
2424
with:
@@ -36,66 +36,63 @@ jobs:
3636
mkdir -p /tmp/docker
3737
docker image save -o /tmp/docker/${{ matrix.image-name }}.tar ${{ matrix.image-name }}:build
3838
39-
# - name: GDAL build cache
40-
# uses: actions/cache@v2
41-
# id: gdal-cache
42-
# with:
43-
# path: /tmp/docker
44-
# key: gdal${{ matrix.gdal-version }}-${{ hashFiles(format('gdal{0}/Dockerfile', matrix.gdal-version)) }}-${{ hashFiles(format('common/{0}/Dockerfile', matrix.image-name)) }}
45-
46-
# - name: Restore gdal image
47-
# if: steps.gdal-cache.outputs.cache-hit == 'true'
48-
# run: docker image load -i /tmp/docker/lambda-${{ matrix.image-name }}-gdal${{ matrix.gdal-version }}.tar
39+
- name: setup GDAL cache
40+
uses: actions/cache@v2
41+
id: gdal-cache
42+
with:
43+
path: /tmp/docker
44+
key: gdal${{ matrix.gdal-version }}-${{ hashFiles(format('gdal{0}/Dockerfile', matrix.gdal-version)) }}-${{ hashFiles(format('common/{0}/Dockerfile', matrix.image-name)) }}
4945

50-
# - name: Build gdal docker image
51-
# run: |
52-
# docker build \
53-
# --build-arg IMAGE_VERSION=${{ matrix.image-name }} \
54-
# -f gdal${{ matrix.gdal-version }}/Dockerfile \
55-
# -t lambgeo/lambda-${{ matrix.image-name }}:gdal${{ matrix.gdal-version }} .
46+
- name: Restore gdal image
47+
if: steps.gdal-cache.outputs.cache-hit == 'true'
48+
run: docker image load -i /tmp/docker/${{ matrix.image-name }}-gdal${{ matrix.gdal-version }}.tar
5649

57-
# - name: Save gdal image in Cache
58-
# if: steps.gdal-cache.outputs.cache-hit != 'true'
59-
# run: |
60-
# mkdir -p /tmp/docker
61-
# docker image save \
62-
# -o /tmp/docker/lambda-${{ matrix.image-name }}-gdal${{ matrix.gdal-version }}.tar \
63-
# lambgeo/lambda-${{ matrix.image-name }}:gdal${{ matrix.gdal-version }}
50+
- name: Build and Cache GDAL image
51+
if: steps.gdal-cache.outputs.cache-hit != 'true'
52+
run: |
53+
docker build \
54+
--build-arg IMAGE_VERSION=${{ matrix.image-name }} \
55+
-f gdal${{ matrix.gdal-version }}/Dockerfile \
56+
-t lambgeo/${{ matrix.image-name }}-gdal:${{ matrix.gdal-version }} .
57+
mkdir -p /tmp/docker
58+
docker image save \
59+
-o /tmp/docker/${{ matrix.image-name }}-gdal${{ matrix.gdal-version }}.tar \
60+
lambgeo/${{ matrix.image-name }}-gdal:${{ matrix.gdal-version }}
6461
65-
# - name: Run Tests
66-
# run: |
67-
# docker run \
68-
# -v ${{ github.workspace }}:/local --rm \
69-
# lambgeo/lambda-${{ matrix.image-name }}:gdal${{ matrix.gdal-version }} \
70-
# sh -c "cd /local/tests && sh tests.sh"
62+
- name: Run Tests
63+
run: |
64+
docker run \
65+
-v ${{ github.workspace }}:/local --rm \
66+
lambgeo/${{ matrix.image-name }}-gdal:${{ matrix.gdal-version }} \
67+
sh -c "cd /local/tests && sh tests.sh"
7168
72-
# - name: Push to DockerHub
73-
# if: contains(github.ref, 'tags')
74-
# run: docker push lambgeo/lambda-${{ matrix.image-name }}:gdal${{ matrix.gdal-version }}
69+
- name: Push to DockerHub
70+
if: contains(github.ref, 'tags')
71+
run: docker push lambgeo/${{ matrix.image-name }}-gdal:${{ matrix.gdal-version }}
7572

76-
runtimes:
77-
needs: [build]
78-
runs-on: ubuntu-latest
79-
if: contains(github.ref, 'tags')
80-
strategy:
81-
matrix:
82-
runtimes: [py3.7, py3.8]
83-
steps:
84-
- uses: actions/checkout@v2
85-
- name: Login to DockerHub
86-
uses: docker/login-action@v1
87-
with:
88-
username: ${{ secrets.DOCKERHUB_USERNAME }}
89-
password: ${{ secrets.DOCKERHUB_TOKEN }}
73+
# runtimes:
74+
# needs: [build]
75+
# runs-on: ubuntu-latest
76+
# if: contains(github.ref, 'tags')
77+
# strategy:
78+
# matrix:
79+
# runtimes: [py3.7, py3.8]
80+
# steps:
81+
# - uses: actions/checkout@v2
82+
# - name: Login to DockerHub
83+
# uses: docker/login-action@v1
84+
# with:
85+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
86+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
9087

91-
- name: Push to DockerHub
92-
env:
93-
GDAL_VERSIONS: "2.4 3.1 3.2"
94-
run: |
95-
for GDAL_VERSION in ${GDAL_VERSIONS}; do
96-
docker build \
97-
--build-arg GDAL_VERSION=${GDAL_VERSION} \
98-
-f runtimes/${{ matrix.runtimes }} \
99-
-t lambgeo/lambda-gdal:${GDAL_VERSION}-${{ matrix.runtimes }} .
100-
docker push lambgeo/lambda-gdal:${GDAL_VERSION}-${{ matrix.runtimes }}
101-
done
88+
# - name: Push to DockerHub
89+
# env:
90+
# GDAL_VERSIONS: "2.4 3.1 3.2"
91+
# run: |
92+
# for GDAL_VERSION in ${GDAL_VERSIONS}; do
93+
# docker build \
94+
# --build-arg GDAL_VERSION=${GDAL_VERSION} \
95+
# -f runtimes/${{ matrix.runtimes }} \
96+
# -t lambgeo/lambda-gdal:${GDAL_VERSION}-${{ matrix.runtimes }} .
97+
# docker push lambgeo/lambda-gdal:${GDAL_VERSION}-${{ matrix.runtimes }}
98+
# done

gdal3.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ COPY --from=builder /opt/share/ $PREFIX/share/
109109
COPY --from=builder /opt/bin/ $PREFIX/bin/
110110

111111
ENV \
112-
GDAL_VERSION=3.1.0 \
112+
GDAL_VERSION=3.1.4 \
113113
GDAL_DATA=$PREFIX/share/gdal \
114114
PROJ_LIB=$PREFIX/share/proj \
115115
GDAL_CONFIG=$PREFIX/bin/gdal-config \

gdal3.2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ COPY --from=builder /opt/share/ $PREFIX/share/
109109
COPY --from=builder /opt/bin/ $PREFIX/bin/
110110

111111
ENV \
112-
GDAL_VERSION=3.1.0 \
112+
GDAL_VERSION=3.2.0 \
113113
GDAL_DATA=$PREFIX/share/gdal \
114114
PROJ_LIB=$PREFIX/share/proj \
115115
GDAL_CONFIG=$PREFIX/bin/gdal-config \

0 commit comments

Comments
 (0)