mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
Add armhf support
This commit is contained in:
commit
726e9c6d36
4
build.armhf.sh
Executable file
4
build.armhf.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
(cd gateway && ./armhf.build.sh)
|
||||
(cd watchdog && ./armhf.build.sh)
|
@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Deploying stack"
|
||||
docker stack deploy func --compose-file docker-compose.yml
|
||||
docker stack deploy func --compose-file docker-compose.yml
|
||||
|
||||
|
4
deploy_stack_arm.sh
Executable file
4
deploy_stack_arm.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Deploying stack"
|
||||
docker stack deploy func --compose-file docker-compose.armhf.yml
|
103
docker-compose.armhf.yml
Normal file
103
docker-compose.armhf.yml
Normal file
@ -0,0 +1,103 @@
|
||||
version: "3"
|
||||
services:
|
||||
|
||||
# Core API services are pinned, HA is provided for functions.
|
||||
gateway:
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||
ports:
|
||||
- 8080:8080
|
||||
image: alexellis2/faas-gateway:latest-armhf
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
|
||||
prometheus:
|
||||
image: alexellis2/prometheus-armhf:latest
|
||||
volumes:
|
||||
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
- ./prometheus/alert.rules:/etc/prometheus/alert.rules
|
||||
|
||||
command: "-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 --alertmanager.url=http://alertmanager:9093"
|
||||
ports:
|
||||
- 9090:9090
|
||||
depends_on:
|
||||
- gateway
|
||||
- alertmanager
|
||||
environment:
|
||||
no_proxy: "gateway"
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
|
||||
|
||||
alertmanager:
|
||||
image: alexellis2/alertmanager-armhf
|
||||
environment:
|
||||
no_proxy: "gateway"
|
||||
volumes:
|
||||
- ./prometheus/alertmanager.yml:/alertmanager.yml
|
||||
command:
|
||||
- '-config.file=/alertmanager.yml'
|
||||
networks:
|
||||
- functions
|
||||
ports:
|
||||
- 9093:9093
|
||||
deploy:
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
|
||||
# Sample functions go here.
|
||||
wordcount:
|
||||
image: alexellis2/faas-alpinefunction:latest-armhf
|
||||
depends_on:
|
||||
- gateway
|
||||
networks:
|
||||
- functions
|
||||
environment:
|
||||
fprocess: "wc"
|
||||
no_proxy: "gateway"
|
||||
https_proxy: $https_proxy
|
||||
|
||||
|
||||
|
||||
echoit:
|
||||
image: alexellis2/faas-alpinefunction:latest-armhf
|
||||
depends_on:
|
||||
- gateway
|
||||
networks:
|
||||
- functions
|
||||
environment:
|
||||
fprocess: "cat"
|
||||
no_proxy: "gateway"
|
||||
https_proxy: $https_proxy
|
||||
|
||||
nodeinfo:
|
||||
image: alexellis2/faas-nodeinfo:latest-armhf
|
||||
depends_on:
|
||||
- gateway
|
||||
networks:
|
||||
- functions
|
||||
environment:
|
||||
no_proxy: "gateway"
|
||||
https_proxy: $https_proxy
|
||||
|
||||
hubstats:
|
||||
image: alexellis2/faas-hubstats:latest-armhf
|
||||
depends_on:
|
||||
- gateway
|
||||
networks:
|
||||
- functions
|
||||
environment:
|
||||
no_proxy: "gateway"
|
||||
https_proxy: $https_proxy
|
||||
|
||||
networks:
|
||||
functions:
|
||||
driver: overlay
|
||||
# Docker does not support this option yet - maybe create outside of the stack and reference as "external"?
|
||||
#attachable: true
|
@ -6,11 +6,15 @@ RUN go get -d github.com/docker/docker/api/types \
|
||||
&& go get -d github.com/docker/docker/client \
|
||||
&& go get github.com/gorilla/mux \
|
||||
&& go get github.com/prometheus/client_golang/prometheus
|
||||
RUN go get -d github.com/Sirupsen/logrus
|
||||
|
||||
WORKDIR /go/src/github.com/alexellis/faas/gateway
|
||||
|
||||
COPY metrics metrics
|
||||
COPY server.go .
|
||||
COPY metrics metrics
|
||||
COPY requests requests
|
||||
COPY tests tests
|
||||
COPY handlers handlers
|
||||
|
||||
COPY server.go .
|
||||
|
||||
RUN find /go/src/github.com/alexellis/faas/gateway/
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
|
8
sample-functions/AlpineFunction/Dockerfile.armhf
Normal file
8
sample-functions/AlpineFunction/Dockerfile.armhf
Normal file
@ -0,0 +1,8 @@
|
||||
FROM armhf/alpine:latest
|
||||
|
||||
COPY fwatchdog /usr/bin
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
# Populate example here
|
||||
# ENV fprocess="wc -l"
|
||||
CMD ["fwatchdog"]
|
3
sample-functions/AlpineFunction/build.armhf.sh
Executable file
3
sample-functions/AlpineFunction/build.armhf.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -f Dockerfile.armhf -t alexellis2/faas-alpinefunction:latest-armhf .
|
17
sample-functions/DockerHubStats/Dockerfile.armhf
Normal file
17
sample-functions/DockerHubStats/Dockerfile.armhf
Normal file
@ -0,0 +1,17 @@
|
||||
FROM alexellis2/go-armhf:1.7.4
|
||||
|
||||
MAINTAINER alexellis2@gmail.com
|
||||
ENTRYPOINT []
|
||||
|
||||
RUN apk --no-cache add make
|
||||
WORKDIR /go/src/github.com/alexellis/faas/sample-functions/DockerHubStats
|
||||
COPY . /go/src/github.com/alexellis/faas/sample-functions/DockerHubStats
|
||||
|
||||
RUN make
|
||||
|
||||
COPY ./fwatchdog /usr/bin
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
ENV fprocess "/go/bin/DockerHubStats"
|
||||
|
||||
CMD [ "/usr/bin/fwatchdog"]
|
3
sample-functions/DockerHubStats/build.armhf.sh
Executable file
3
sample-functions/DockerHubStats/build.armhf.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -t alexellis2/faas-hubstats:latest-armhf .
|
12
sample-functions/NodeInfo/Dockerfile.armhf
Normal file
12
sample-functions/NodeInfo/Dockerfile.armhf
Normal file
@ -0,0 +1,12 @@
|
||||
FROM armhf/alpine:latest
|
||||
RUN apk --update add nodejs
|
||||
|
||||
COPY fwatchdog /usr/bin
|
||||
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
COPY package.json .
|
||||
COPY main.js .
|
||||
RUN npm i
|
||||
ENV fprocess="node main.js"
|
||||
CMD ["fwatchdog"]
|
3
sample-functions/NodeInfo/build.armhf.sh
Executable file
3
sample-functions/NodeInfo/build.armhf.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -f Dockerfile.armhf -t alexellis2/faas-nodeinfo:latest-armhf .
|
@ -1,7 +1,12 @@
|
||||
FROM alexellis2/go-armhf:1.7.4
|
||||
|
||||
RUN mkdir -p /go/src/app
|
||||
COPY main.go /go/src/app
|
||||
WORKDIR /go/src/app
|
||||
COPY main.go .
|
||||
COPY readconfig.go .
|
||||
COPY config_test.go .
|
||||
|
||||
WORKDIR /go/src/app
|
||||
RUN go get -d -v
|
||||
|
||||
RUN go test
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
|
Loading…
x
Reference in New Issue
Block a user