Closed atlas-wheatear closed 1 year ago
I found a previous version of the Dockerfile in the python3-http template, stored (locally, it's gitignored) in one of my function repos.
Using this local previous version, my functions are still building on my local MacBook.
Here is the diff (from previous to current).
1,2c1,2
< 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.8 as watchdog
> FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3.7-alpine
22,23c22,23
< COPY index.py .
< COPY requirements.txt .
---
> COPY --chown=app:app index.py .
> COPY --chown=app:app requirements.txt .
25c25
< RUN pip install -r requirements.txt
---
> RUN pip install --no-cache-dir -r requirements.txt
33,34c33,34
< COPY function/requirements.txt .
< RUN pip install --user -r requirements.txt
---
> COPY --chown=app:app function/requirements.txt .
> RUN pip install --no-cache-dir --user -r requirements.txt
36c36
< #install function code
---
> # install function code
38,39c38
< COPY function/ .
< RUN chown -R app:app ../
---
> COPY --chown=app:app function/ .
40a40
> FROM builder as tester
44a45
> FROM builder as final
47c48
< #configure WSGI server and healthcheck
---
> # configure WSGI server and healthcheck
Sorry for the inconvenience. We are not sure who you are and how you use OpenFaaS as we don't have your company as a sponsor or the ADOPTERS file
We'll look into supporting you here, perhaps consider doing one of the above to reciprocate the goodwill.
Alex
I can reproduce the problem with:
faas-cli new --lang python3-http testbuild
faas-cli build -f testbuild.yml
@LucasRoesler I think it may be related to recent changes we've made to the Python template.
I've pushed https://github.com/openfaas/python-flask-template/commit/bf6afb78613a1ff94de0fa5fe5167d644fa45b36 as a fix.
Perhaps we should get the e2e test from the openfaas/templates repo over here and run it as GitHub Action?
https://github.com/openfaas/templates/blob/master/verify.sh https://github.com/openfaas/templates/blob/master/.github/workflows/only-ci.yaml
My actions before raising this issue
Expected Behaviour
The faas-cli build, having pulled the most recent templates for python3-http as of the last 30 minutes, should continue to build as it did earlier today. (There could be a problem my end, but it's failing on my local M1 Macbook Pro and my GitLab instance.) Functions I haven't modified at all in days are also failing redeployment.
Current Behaviour
It fails, seemingly because it is trying to pull from a remote "builder" image on Docker Hub, as opposed to using the builder "stage" of the multi-stage build. Error below:
Possible Solution
Explicitly label the previous stage as builder? I'm actually stumped as to why this has broken just now, perhaps due to a breaking of compatibility introduced by using the --platform flag?
https://github.com/openfaas/python-flask-template/blob/79b444bca68df126b7d9e31aca35857dbd4d80f9/template/python3-http/Dockerfile#L2
Steps to Reproduce (for bugs)
faas-cli template store pull python3-http
faas-cli build
Context
My test functions are no longer building with the newest templates at all. Sorry to be a pain :) . I can revert back to the previous version for now though! Will have to check it in to my code manually, and alter the CI scripts.
Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
): 0.14.2Docker version
docker version
(e.g. Docker 17.0.05 ): Docker version 20.10.13, build a224086Are you using Docker Swarm or Kubernetes (FaaS-netes)? Kubernetes
Operating System and version (e.g. Linux, Windows, MacOS): MacOS with M1 Pro
Code example or link to GitHub repo or gist to reproduce problem:
Other diagnostic information / logs from troubleshooting guide
https://github.com/emoulsdale/openfaas-test
Next steps
You may join Slack for community support.
Just wanted to add that this still only the first problem I've had, so far, after months of trying silly things. I am really enjoying sponsoring this project!