Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ type server struct {
encryptionKeyFile string
configFile string

useFakeResponse bool
enableGRPCReflection bool
}

Expand Down Expand Up @@ -118,7 +117,6 @@ func NewCommand() *cobra.Command {
cmd.MarkFlagRequired("config-file")

// For debugging early in development
cmd.Flags().BoolVar(&s.useFakeResponse, "use-fake-response", s.useFakeResponse, "Whether the server responds fake response or not.")
cmd.Flags().BoolVar(&s.enableGRPCReflection, "enable-grpc-reflection", s.enableGRPCReflection, "Whether to enable the reflection service or not.")

return cmd
Expand Down Expand Up @@ -226,12 +224,7 @@ func (s *server) run(ctx context.Context, t cli.Telemetry) error {
return err
}

var service rpc.Service
if s.useFakeResponse {
service = grpcapi.NewFakeWebAPI()
} else {
service = grpcapi.NewWebAPI(ctx, ds, sls, alss, cmds, cfg.ProjectMap(), encryptDecrypter, t.Logger)
}
service := grpcapi.NewWebAPI(ctx, ds, sls, alss, cmds, cfg.ProjectMap(), encryptDecrypter, t.Logger)
opts := []rpc.Option{
rpc.WithPort(s.webAPIPort),
rpc.WithGracePeriod(s.gracePeriod),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,14 @@ description: >

## How to run it locally

In order to run `piped` at the local environment for debugging while development without connecting to a real control plane,
we prepared a fake control-plane to be used.

1. Prepare a `.dev` directory at the root of repository that contains:
- A `piped.key` file with a fake key as the following
```
hello-pipecd
```

- A piped configuration file `piped-config.yaml`
1. Prepare the piped configuration file `piped-config.yaml`

2. Ensure that your `kube-context` is connecting to the right kubernetes cluster

2. Run the following command to start running `piped`

``` console
bazelisk run --run_under="cd $PWD && " //cmd/piped:piped -- piped \
--use-fake-api-client=true \
--tools-dir=/tmp/piped-bin \
--config-file=.dev/piped-config.yaml
--config-file=piped-config.yaml
```
1 change: 0 additions & 1 deletion manifests/pipecd/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ spec:
{{- end }}
- --cache-address={{ .Values.server.args.cacheAddress | default (printf "%s-cache:6379" (include "pipecd.fullname" .)) }}
- --config-file=/etc/pipecd-config/{{ .Values.config.fileName }}
- --use-fake-response={{ .Values.server.args.useFakeResponse }}
- --enable-grpc-reflection={{ .Values.server.args.enableGRPCReflection }}
- --encryption-key-file={{ .Values.secret.mountPath }}/{{ .Values.secret.encryptionKey.fileName }}
- --log-encoding={{ .Values.server.args.logEncoding }}
Expand Down
3 changes: 1 addition & 2 deletions manifests/pipecd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ server:
replicasCount: 1
args:
cacheAddress: ""
useFakeResponse: false
enableGRPCReflection: true
enableGRPCReflection: false
secureCookie: false
logEncoding: humanize
resources: {}
Expand Down
1 change: 0 additions & 1 deletion pkg/app/api/grpcapi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go_library(
name = "go_default_library",
srcs = [
"deployment_config_templates.go",
"fake_web_api.go",
"piped_api.go",
"web_api.go",
":deployment_config_templates.embed", #keep
Expand Down
Loading