-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from srikrishnabh1/srbh
initial code base
- Loading branch information
Showing
46 changed files
with
3,913 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
all: | ||
cd proto && protoc --go_out=../agent/pkg/agentpb/ --go_opt=paths=source_relative \ | ||
--go-grpc_out=../agent/pkg/agentpb/ --go-grpc_opt=paths=source_relative \ | ||
./agent.proto | ||
|
||
cd proto && protoc --go_out=../server/pkg/pb/agentpb --go_opt=paths=source_relative \ | ||
--go-grpc_out=../server/pkg/pb/agentpb --go-grpc_opt=paths=source_relative \ | ||
./agent.proto | ||
|
||
cd proto && protoc --go_out=../server/pkg/pb/climonpb --go_opt=paths=source_relative \ | ||
--go-grpc_out=../server/pkg/pb/climonpb --go-grpc_opt=paths=source_relative \ | ||
./climon.proto | ||
|
||
cd proto && protoc --go_out=../cilmon/pkg/pb/climonpb --go_opt=paths=source_relative \ | ||
--go-grpc_out=../cilmon/pkg/pb/climonpb --go-grpc_opt=paths=source_relative \ | ||
./climon.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:1.19 AS builder | ||
# All these steps will be cached | ||
RUN mkdir /agent | ||
WORKDIR /agent | ||
|
||
# COPY the source code as the last step | ||
COPY . . | ||
RUN go mod vendor | ||
RUN go build -o intelopsagent cmd/agent/main.go | ||
|
||
FROM alpine:3.16 | ||
RUN apk add --no-cache libc6-compat | ||
RUN mkdir /agent | ||
WORKDIR /agent | ||
COPY --from=builder /agent/intelopsagent . | ||
ENTRYPOINT ["./intelopsagent"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net" | ||
|
||
"google.golang.org/grpc" | ||
|
||
"intelops.io/agent/pkg/agentpb" | ||
"intelops.io/agent/pkg/config" | ||
"intelops.io/agent/pkg/server" | ||
) | ||
|
||
func main() { | ||
listener, err := net.Listen("tcp", config.DefaultAgentPort) | ||
if err != nil { | ||
log.Fatalf("failed to listen: %v", err) | ||
} | ||
|
||
grpcServer := grpc.NewServer() | ||
agentpb.RegisterAgentServer(grpcServer, &server.Agent{}) | ||
log.Println("server listening at ", listener.Addr()) | ||
//Todo: handle the interrupts | ||
|
||
if err := grpcServer.Serve(listener); err != nil { | ||
log.Fatalf("failed to start agent : %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module intelops.io/agent | ||
|
||
go 1.19 | ||
|
||
require ( | ||
go.temporal.io/sdk v1.17.0 | ||
google.golang.org/grpc v1.50.1 | ||
google.golang.org/protobuf v1.28.1 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect | ||
github.com/gogo/googleapis v1.4.1 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/gogo/status v1.1.1 // indirect | ||
github.com/golang/mock v1.6.0 // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect | ||
github.com/pborman/uuid v1.2.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/robfig/cron v1.2.0 // indirect | ||
github.com/stretchr/objx v0.4.0 // indirect | ||
github.com/stretchr/testify v1.8.0 // indirect | ||
go.temporal.io/api v1.11.1-0.20220907050538-6de5285cf463 // indirect | ||
go.uber.org/atomic v1.9.0 // indirect | ||
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect | ||
golang.org/x/sys v0.0.0-20220906165534-d0df966e6959 // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect | ||
google.golang.org/genproto v0.0.0-20220902135211-223410557253 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.