Skip to content

Commit

Permalink
Setting bitnami uvicorn 3.9 as default image for kubernetes and pushi…
Browse files Browse the repository at this point in the history
…ng (#520)

it alongside normal gunicorn image.

Signed-off-by: Maik Fischer <maik.fischer@lgln.niedersachsen.de>

Signed-off-by: Maik Fischer <maik.fischer@lgln.niedersachsen.de>
  • Loading branch information
FischerLGLN committed Oct 10, 2022
1 parent 29439cc commit d4741eb
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check_charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
# See https://github.com/developmentseed/titiler/discussions/387
platforms: linux/amd64
context: .
file: dockerfiles/Dockerfile.gunicorn
file: dockerfiles/Dockerfile.uvicorn
push: false
tags: "titiler:dev"

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

- name: Run chart-testing (install)
run: ct install --chart-dirs deployment/k8s
run: ct install --chart-dirs deployment/k8s
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,34 @@ jobs:
id: tag
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
# Uvicorn
# Push `latest` when commiting to master
- name: Build and push uvicorn
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v2
with:
# See https://github.com/developmentseed/titiler/discussions/387
platforms: linux/amd64
context: .
file: dockerfiles/Dockerfile.uvicorn
push: true
tags: |
ghcr.io/${{ github.repository }}-uvicorn:latest
# Push `{VERSION}` when pushing a new tag
- name: Build and push uvicorn
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: docker/build-push-action@v2
with:
# See https://github.com/developmentseed/titiler/discussions/387
platforms: linux/amd64
context: .
file: dockerfiles/Dockerfile.uvicorn
push: true
tags: |
ghcr.io/${{ github.repository }}-uvicorn:${{ steps.tag.outputs.tag }}
# Gunicorn
# Push `latest` when commiting to master
- name: Build and push
if: github.ref == 'refs/heads/master'
Expand Down
2 changes: 1 addition & 1 deletion deployment/k8s/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 0.7.1
description: A dynamic Web Map tile server
name: titiler
version: 1.0.0
version: 1.1.0
icon: https://raw.githubusercontent.com/developmentseed/titiler/master/docs/logos/TiTiler_logo_small.png
maintainers:
- name: emmanuelmathot # Emmanuel Mathot
Expand Down
2 changes: 1 addition & 1 deletion deployment/k8s/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
replicaCount: 1

image:
repository: ghcr.io/developmentseed/titiler
repository: ghcr.io/developmentseed/titiler-uvicorn
tag: latest
pullPolicy: IfNotPresent

Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.gunicorn
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ RUN pip install /tmp/titiler/core /tmp/titiler/mosaic /tmp/titiler/application -
RUN rm -rf /tmp/titiler

ENV MODULE_NAME titiler.application.main
ENV VARIABLE_NAME app
ENV VARIABLE_NAME app
10 changes: 5 additions & 5 deletions dockerfiles/Dockerfile.uvicorn
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Dockerfile for running titiler application with uvicorn server
# Size ~600MB
ARG PYTHON_VERSION=3.9

FROM python:${PYTHON_VERSION}-slim

RUN apt-get update && apt-get install curl -y
FROM bitnami/python:${PYTHON_VERSION}
RUN apt update && apt upgrade -y \
&& apt install curl -y \
&& rm -rf /var/lib/apt/lists/*

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

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

0 comments on commit d4741eb

Please sign in to comment.