Skip to content

Commit

Permalink
Remove armhf templates and move to multi-arch / buildx
Browse files Browse the repository at this point in the history
Migrate as per the python3 template in the classic Go
templates, where a separate -armhf/-arm64 template is not
required and TARGETPLATFORM is introduced for use with
buildkit / buildx and faas-cli publish.

Tested with an RPi with a 32-bit OS and with a 64-bit ARM
OS (Ubuntu 20.04).

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Oct 3, 2022
1 parent e4f4f42 commit bf64898
Show file tree
Hide file tree
Showing 22 changed files with 14 additions and 379 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ The Python Flask templates that make use of the incubator project [of-watchdog](

Templates available in this repository:

- python27-flask
- python3-http
- python3-http-debian (ideal for compiled dependencies like numpy, pandas, pillow)

- python3-flask
- python3-flask-debian
- python3-flask-armhf
- python3-flask-debian (ideal for compiled dependencies like numpy, pandas, pillow)

- python3-http
- python3-http-debian
- python3-http-armhf
- python27-flask (Python 2.7 is deprecated)

Notes:
- To build and deploy a function for Raspberry Pi or ARMv7 in general, use the language templates ending in *-armhf*
- To build and deploy a function for an ARM computer, you'll need to use `faas-cli publish --platforms`

## Picking your template

Expand Down
54 changes: 0 additions & 54 deletions template/python3-flask-armhf/Dockerfile

This file was deleted.

Empty file.
7 changes: 0 additions & 7 deletions template/python3-flask-armhf/function/handler.py

This file was deleted.

10 changes: 0 additions & 10 deletions template/python3-flask-armhf/function/handler_test.py

This file was deleted.

Empty file.
41 changes: 0 additions & 41 deletions template/python3-flask-armhf/function/tox.ini

This file was deleted.

41 changes: 0 additions & 41 deletions template/python3-flask-armhf/index.py

This file was deleted.

3 changes: 0 additions & 3 deletions template/python3-flask-armhf/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions template/python3-flask-armhf/template.yml

This file was deleted.

4 changes: 2 additions & 2 deletions template/python3-flask-debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ghcr.io/openfaas/of-watchdog:0.9.6 as watchdog
FROM python:3.7-slim-buster
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.6 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3.7-slim-buster

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
Expand Down
4 changes: 2 additions & 2 deletions template/python3-flask/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ghcr.io/openfaas/of-watchdog:0.9.6 as watchdog
FROM python:3.7-alpine
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.6 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3.7-alpine

COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
Expand Down
51 changes: 0 additions & 51 deletions template/python3-http-armhf/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions template/python3-http-armhf/function/handler.py

This file was deleted.

10 changes: 0 additions & 10 deletions template/python3-http-armhf/function/handler_test.py

This file was deleted.

Empty file.
41 changes: 0 additions & 41 deletions template/python3-http-armhf/function/tox.ini

This file was deleted.

81 changes: 0 additions & 81 deletions template/python3-http-armhf/index.py

This file was deleted.

0 comments on commit bf64898

Please sign in to comment.