Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfaas-faas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team Jaz CS 598 CCC Final Project
openfaas-faas
Commits
8fe7cb69
Commit
8fe7cb69
authored
8 years ago
by
Alex Ellis
Browse files
Options
Downloads
Patches
Plain Diff
Initial
parent
d94cfeb6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
watchdog/Dockerfile
+7
-0
7 additions, 0 deletions
watchdog/Dockerfile
watchdog/Dockerfile.build
+6
-0
6 additions, 0 deletions
watchdog/Dockerfile.build
watchdog/build.sh
+7
-0
7 additions, 0 deletions
watchdog/build.sh
watchdog/main.go
+42
-0
42 additions, 0 deletions
watchdog/main.go
with
62 additions
and
0 deletions
watchdog/Dockerfile
0 → 100644
+
7
−
0
View file @
8fe7cb69
FROM
alpine:edge
COPY
./fwatchdog /usr/bin/fwatchdog
ENV
fprocess "cat -b"
EXPOSE
8080
CMD
["fwatchdog"]
This diff is collapsed.
Click to expand it.
watchdog/Dockerfile.build
0 → 100644
+
6
−
0
View file @
8fe7cb69
FROM golang:1.7.3
RUN mkdir -p /go/src/fwatchdog
COPY main.go /go/src/fwatchdog
WORKDIR /go/src/fwatchdog
RUN go get -d -v
RUN go build
This diff is collapsed.
Click to expand it.
watchdog/build.sh
0 → 100755
+
7
−
0
View file @
8fe7cb69
#!/bin/bash
docker build
-t
watchdog:latest
.
-f
Dockerfile.build
docker create
--name
buildoutput watchdog:latest
docker
cp
buildoutput:/go/src/fwatchdog/fwatchdog ./
docker
rm
buildoutput
This diff is collapsed.
Click to expand it.
watchdog/main.go
0 → 100644
+
42
−
0
View file @
8fe7cb69
package
main
import
(
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"strings"
"time"
)
func
main
()
{
s
:=
&
http
.
Server
{
Addr
:
":8080"
,
ReadTimeout
:
2
*
time
.
Second
,
WriteTimeout
:
2
*
time
.
Second
,
MaxHeaderBytes
:
1
<<
20
,
}
http
.
HandleFunc
(
"/"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
if
r
.
Method
==
"POST"
{
process
:=
os
.
Getenv
(
"fprocess"
)
parts
:=
strings
.
Split
(
process
,
" "
)
targetCmd
:=
exec
.
Command
(
parts
[
0
],
parts
[
1
:
]
...
)
writer
,
_
:=
targetCmd
.
StdinPipe
()
res
,
_
:=
ioutil
.
ReadAll
(
r
.
Body
)
writer
.
Write
(
res
)
writer
.
Close
()
out
,
err
:=
targetCmd
.
Output
()
if
err
!=
nil
{
panic
(
err
)
}
os
.
Stdout
.
Write
(
out
)
w
.
Write
(
out
)
}
})
log
.
Fatal
(
s
.
ListenAndServe
())
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment