Skip to content

Commit

Permalink
adding capten plugin proto with dummty methods
Browse files Browse the repository at this point in the history
cleanup climon as deployment worker used for app deployments
  • Loading branch information
vramk23 committed Oct 18, 2023
1 parent e482144 commit 12e3776
Show file tree
Hide file tree
Showing 89 changed files with 8,063 additions and 9,881 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/climon-docker-image-pr.yml

This file was deleted.

59 changes: 0 additions & 59 deletions .github/workflows/climon-docker-image-release.yml

This file was deleted.

86 changes: 0 additions & 86 deletions .github/workflows/climon-docker-image.yml

This file was deleted.

26 changes: 11 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,33 @@ SERVER_APP_NAME := server
AGENT_APP_NAME := agent
DEPLOYMENT_WORKER_APP_NAME := deployment-worker
CONFIG_WORKER_APP_NAME := config-worker
CLIMON_APP_NAME := climon
BUILD := 0.1.1

gen-protoc:
mkdir -p server/pkg/pb/serverpb
mkdir -p capten/agent/pkg/agentpb
mkdir -p capten/agent/pkg/pb/agentpb
mkdir -p server/pkg/pb/agentpb
mkdir -p server/pkg/pb/climonpb
mkdir -p server/pkg/pb/captenpluginspb

cd proto && protoc --go_out=../server/pkg/pb/serverpb/ --go_opt=paths=source_relative \
--go-grpc_out=../server/pkg/pb/serverpb --go-grpc_opt=paths=source_relative \
./server.proto

cd proto && protoc --go_out=../capten/agent/pkg/agentpb/ --go_opt=paths=source_relative \
--go-grpc_out=../capten/agent/pkg/agentpb/ --go-grpc_opt=paths=source_relative \
cd proto && protoc --go_out=../capten/agent/pkg/pb/agentpb/ --go_opt=paths=source_relative \
--go-grpc_out=../capten/agent/pkg/pb/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=../capten/capten-sdk/agentpb/ --go_opt=paths=source_relative \
--go-grpc_out=../capten/capten-sdk/agentpb/ --go-grpc_opt=paths=source_relative \
./agent.proto
cd proto && protoc --go_out=../server/pkg/pb/captenpluginspb --go_opt=paths=source_relative \
--go-grpc_out=../server/pkg/pb/captenpluginspb --go-grpc_opt=paths=source_relative \
./capten_plugins.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=../capten/agent/pkg/pb/captenpluginspb --go_opt=paths=source_relative \
--go-grpc_out=../capten/agent/pkg/pb/captenpluginspb --go-grpc_opt=paths=source_relative \
./capten_plugins.proto

docker-build-server:
# The prefix for server to changed either as server or intelops-kad-server
Expand All @@ -47,7 +46,4 @@ docker-build-deployment:
docker-build-config:
docker build -f dockerfiles/config-worker/Dockerfile -t ${PREFIX}-${CONFIG_WORKER_APP_NAME}:${BUILD} .

docker-build-climon:
docker build -f dockerfiles/climon/Dockerfile -t ${PREFIX}-${CLIMON_APP_NAME}:${BUILD} .

docker-build: docker-build-kad docker-build-server docker-build-climon
docker-build: docker-build-kad docker-build-server
1 change: 0 additions & 1 deletion capten/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ build:
go mod download
CGO_ENABLED=0 go build -o build/deployment_worker deployment-worker/main.go
CGO_ENABLED=0 go build -o build/config_worker config-worker/main.go
CGO_ENABLED=0 go build -o build/climon climon/main.go
CGO_ENABLED=0 go build -o build/agent agent/cmd/agent/main.go

clean:
Expand Down
21 changes: 1 addition & 20 deletions capten/Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $ make start-kind
# Reference: https://github.com/temporalio/helm-charts
$ cd ~/go/src/github.com/temporalio/helm-charts
$ helm install --set server.replicaCount=1 --set cassandra.config.cluster_size=1 --set prometheus.enabled=false --set grafana.enabled=false --set elasticsearch.enabled=false temporal . --timeout 8m
$ helm install --set server.replicaCount=1 --set cassandra.config.cluster_size=1 --set prometheus.enabled=false --set grafana.enabled=false --set elasticsearch.enabled=false temporal . --timeout 8m
```

## Expose temporal
Expand Down Expand Up @@ -57,8 +57,6 @@ deployment_worker:
repository: kad-deployment-worker
config_worker:
repository: kad-config-worker
climon:
repository: kad-climon
ingressroute:
enabled: false
Expand All @@ -73,9 +71,6 @@ $ helm install kad . -f /tmp/kad-values.yaml
# Install argo-cd using integrator framework helm plugin

```
$ cd integrator
$ curl -X POST http://127.0.0.1:9092/climon -H "content-type: application/json" -d @tests/argocd-helm-plugin.json
# Open temporal web UI (http://127.0.0.1:9082) and check the workflow activity of this action
```

Expand All @@ -97,28 +92,14 @@ $ export PASSWORD=$(kubectl -n default get secret argocd-initial-admin-secret -o
```
# make kind-integration-argocd-test
$ curl -X POST http://127.0.0.1:9092/deployer -H "content-type: application/json" -d @tests/hello-world-argocd-plugin.json
# Open temporal web UI (http://127.0.0.1:9082) and check the workflow activity of this action
```

# Delete hello-world using climon

```
# make kind-integration-argocd-delete-test
$ curl -X DELETE http://127.0.0.1:9092/deployer -H "content-type: application/json" -d @tests/hello-world-argocd-plugin-delete.json
# Open temporal web UI and check the workflow activity of this action
```

# Delete argocd using deployer

```
# make kind-integration-helm-delete-test
$ curl -X POST http://127.0.0.1:9092/climon -H "content-type: application/json" -d @tests/argocd-helm-plugin-delete.json
# Open temporal web UI and check the workflow activity of this action
```

Expand Down
5 changes: 4 additions & 1 deletion capten/agent/cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (

"github.com/intelops/go-common/logging"
"github.com/kube-tarian/kad/capten/agent/pkg/agent"
"github.com/kube-tarian/kad/capten/agent/pkg/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/config"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/captenpluginspb"
"github.com/kube-tarian/kad/capten/agent/pkg/util"
dbinit "github.com/kube-tarian/kad/capten/common-pkg/cassandra/db-init"
dbmigrate "github.com/kube-tarian/kad/capten/common-pkg/cassandra/db-migrate"
Expand Down Expand Up @@ -53,6 +54,8 @@ func main() {
grpcServer = grpc.NewServer()
}
agentpb.RegisterAgentServer(grpcServer, s)
captenpluginspb.RegisterCaptenPluginsServer(grpcServer, s)

log.Infof("Agent listening at %v", listener.Addr())
reflection.Register(grpcServer)

Expand Down
4 changes: 3 additions & 1 deletion capten/agent/pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"fmt"

"github.com/intelops/go-common/logging"
"github.com/kube-tarian/kad/capten/agent/pkg/agentpb"
captenstore "github.com/kube-tarian/kad/capten/agent/pkg/capten-store"
"github.com/kube-tarian/kad/capten/agent/pkg/config"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/captenpluginspb"
"github.com/kube-tarian/kad/capten/agent/pkg/temporalclient"
"github.com/kube-tarian/kad/capten/agent/pkg/workers"

Expand All @@ -18,6 +19,7 @@ var _ agentpb.AgentServer = &Agent{}

type Agent struct {
agentpb.UnimplementedAgentServer
captenpluginspb.UnimplementedCaptenPluginsServer
tc *temporalclient.Client
as *captenstore.Store
log logging.Logger
Expand Down
2 changes: 1 addition & 1 deletion capten/agent/pkg/agent/agent_app_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package agent
import (
"context"

"github.com/kube-tarian/kad/capten/agent/pkg/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/model"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/workers"
"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion capten/agent/pkg/agent/agent_app_values_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/intelops/go-common/logging"
"github.com/kube-tarian/kad/capten/agent/pkg/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/agentpb"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
)
Expand Down
2 changes: 1 addition & 1 deletion capten/agent/pkg/agent/agent_app_values_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"strings"

"github.com/intelops/go-common/logging"
"github.com/kube-tarian/kad/capten/agent/pkg/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/credential"
"github.com/kube-tarian/kad/capten/agent/pkg/model"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/agentpb"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
)
Expand Down
2 changes: 1 addition & 1 deletion capten/agent/pkg/agent/agent_cluster_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package agent
import (
"context"

"github.com/kube-tarian/kad/capten/agent/pkg/agentpb"
"github.com/kube-tarian/kad/capten/agent/pkg/pb/agentpb"
)

func (a *Agent) SyncApp(ctx context.Context, request *agentpb.SyncAppRequest) (
Expand Down
Loading

0 comments on commit 12e3776

Please sign in to comment.