Skip to content

Commit d4741eb

Browse files
authored
Setting bitnami uvicorn 3.9 as default image for kubernetes and pushing (#520)
it alongside normal gunicorn image. Signed-off-by: Maik Fischer <[email protected]> Signed-off-by: Maik Fischer <[email protected]>
1 parent 29439cc commit d4741eb

File tree

6 files changed

+37
-10
lines changed

6 files changed

+37
-10
lines changed

.github/workflows/check_charts.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
# See https://github.com/developmentseed/titiler/discussions/387
6363
platforms: linux/amd64
6464
context: .
65-
file: dockerfiles/Dockerfile.gunicorn
65+
file: dockerfiles/Dockerfile.uvicorn
6666
push: false
6767
tags: "titiler:dev"
6868

@@ -75,4 +75,4 @@ jobs:
7575
if: steps.list-changed.outputs.changed == 'true'
7676

7777
- name: Run chart-testing (install)
78-
run: ct install --chart-dirs deployment/k8s
78+
run: ct install --chart-dirs deployment/k8s

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,34 @@ jobs:
132132
id: tag
133133
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
134134
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
135+
# Uvicorn
136+
# Push `latest` when commiting to master
137+
- name: Build and push uvicorn
138+
if: github.ref == 'refs/heads/master'
139+
uses: docker/build-push-action@v2
140+
with:
141+
# See https://github.com/developmentseed/titiler/discussions/387
142+
platforms: linux/amd64
143+
context: .
144+
file: dockerfiles/Dockerfile.uvicorn
145+
push: true
146+
tags: |
147+
ghcr.io/${{ github.repository }}-uvicorn:latest
148+
149+
# Push `{VERSION}` when pushing a new tag
150+
- name: Build and push uvicorn
151+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
152+
uses: docker/build-push-action@v2
153+
with:
154+
# See https://github.com/developmentseed/titiler/discussions/387
155+
platforms: linux/amd64
156+
context: .
157+
file: dockerfiles/Dockerfile.uvicorn
158+
push: true
159+
tags: |
160+
ghcr.io/${{ github.repository }}-uvicorn:${{ steps.tag.outputs.tag }}
135161
162+
# Gunicorn
136163
# Push `latest` when commiting to master
137164
- name: Build and push
138165
if: github.ref == 'refs/heads/master'

deployment/k8s/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
appVersion: 0.7.1
33
description: A dynamic Web Map tile server
44
name: titiler
5-
version: 1.0.0
5+
version: 1.1.0
66
icon: https://raw.githubusercontent.com/developmentseed/titiler/master/docs/logos/TiTiler_logo_small.png
77
maintainers:
88
- name: emmanuelmathot # Emmanuel Mathot

deployment/k8s/charts/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
replicaCount: 1
33

44
image:
5-
repository: ghcr.io/developmentseed/titiler
5+
repository: ghcr.io/developmentseed/titiler-uvicorn
66
tag: latest
77
pullPolicy: IfNotPresent
88

dockerfiles/Dockerfile.gunicorn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ RUN pip install /tmp/titiler/core /tmp/titiler/mosaic /tmp/titiler/application -
1717
RUN rm -rf /tmp/titiler
1818

1919
ENV MODULE_NAME titiler.application.main
20-
ENV VARIABLE_NAME app
20+
ENV VARIABLE_NAME app

dockerfiles/Dockerfile.uvicorn

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Dockerfile for running titiler application with uvicorn server
2-
# Size ~600MB
32
ARG PYTHON_VERSION=3.9
43

5-
FROM python:${PYTHON_VERSION}-slim
6-
7-
RUN apt-get update && apt-get install curl -y
4+
FROM bitnami/python:${PYTHON_VERSION}
5+
RUN apt update && apt upgrade -y \
6+
&& apt install curl -y \
7+
&& rm -rf /var/lib/apt/lists/*
88

99
# Ensure root certificates are always updated at evey container build
1010
# and curl is using the latest version of them
@@ -20,4 +20,4 @@ RUN rm -rf /tmp/titiler
2020

2121
ENV HOST 0.0.0.0
2222
ENV PORT 80
23-
CMD uvicorn titiler.application.main:app --host ${HOST} --port ${PORT}
23+
CMD uvicorn titiler.application.main:app --host ${HOST} --port ${PORT}

0 commit comments

Comments
 (0)