Skip to content

Commit

Permalink
Update Mixer binary directory names. (istio#2043)
Browse files Browse the repository at this point in the history
  • Loading branch information
geeknoid authored Dec 8, 2017
1 parent 10a06bd commit 9f920e2
Show file tree
Hide file tree
Showing 29 changed files with 28 additions and 33 deletions.
2 changes: 1 addition & 1 deletion mixer/cmd/client/BUILD → mixer/cmd/mixc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_library(
name = "go_default_library",
srcs = ["main.go"],
deps = [
"//mixer/cmd/client/cmd:go_default_library",
"//mixer/cmd/mixc/cmd:go_default_library",
"//mixer/cmd/shared:go_default_library",
],
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mixer/cmd/client/main.go → mixer/cmd/mixc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package main
import (
"os"

"istio.io/istio/mixer/cmd/client/cmd"
"istio.io/istio/mixer/cmd/mixc/cmd"
"istio.io/istio/mixer/cmd/shared"
)

Expand Down
2 changes: 1 addition & 1 deletion mixer/cmd/collateral/BUILD → mixer/cmd/mixcol/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_library(
name = "go_default_library",
srcs = ["main.go"],
deps = [
"//mixer/cmd/collateral/cmd:go_default_library",
"//mixer/cmd/mixcol/cmd:go_default_library",
"//mixer/cmd/shared:go_default_library",
],
)
Expand Down
4 changes: 2 additions & 2 deletions mixer/cmd/collateral/cmd/BUILD → mixer/cmd/mixcol/cmd/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ go_library(
srcs = ["root.go"],
visibility = ["//mixer/cmd:__subpackages__"],
deps = [
"//mixer/cmd/client/cmd:go_default_library",
"//mixer/cmd/server/cmd:go_default_library",
"//mixer/cmd/mixc/cmd:go_default_library",
"//mixer/cmd/mixs/cmd:go_default_library",
"//mixer/cmd/shared:go_default_library",
"@com_github_spf13_cobra//:go_default_library",
"@com_github_spf13_cobra//doc:go_default_library",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"

mixc "istio.io/istio/mixer/cmd/client/cmd"
mixs "istio.io/istio/mixer/cmd/server/cmd"
mixc "istio.io/istio/mixer/cmd/mixc/cmd"
mixs "istio.io/istio/mixer/cmd/mixs/cmd"
"istio.io/istio/mixer/cmd/shared"
)

Expand Down
2 changes: 1 addition & 1 deletion mixer/cmd/collateral/main.go → mixer/cmd/mixcol/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package main
import (
"os"

"istio.io/istio/mixer/cmd/collateral/cmd"
"istio.io/istio/mixer/cmd/mixcol/cmd"
"istio.io/istio/mixer/cmd/shared"
)

Expand Down
2 changes: 1 addition & 1 deletion mixer/cmd/server/BUILD → mixer/cmd/mixs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_library(
srcs = ["main.go"],
deps = [
"//mixer/adapter:go_default_library",
"//mixer/cmd/server/cmd:go_default_library",
"//mixer/cmd/mixs/cmd:go_default_library",
"//mixer/cmd/shared:go_default_library",
"//mixer/pkg/adapter:go_default_library",
"//mixer/pkg/template:go_default_library",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mixer/cmd/server/main.go → mixer/cmd/mixs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"os"

adapter "istio.io/istio/mixer/adapter"
"istio.io/istio/mixer/cmd/server/cmd"
"istio.io/istio/mixer/cmd/mixs/cmd"
"istio.io/istio/mixer/cmd/shared"
adptr "istio.io/istio/mixer/pkg/adapter"
"istio.io/istio/mixer/pkg/template"
Expand Down
6 changes: 3 additions & 3 deletions mixer/doc/adapter-development-walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ spec:
Start the mixer pointing it to the sample operator configuration
```bash
cd $MIXER_REPO && bazel build ... && ../bazel-bin/mixer/cmd/server/mixs server --configStore2URL=fs://$MIXER_REPO/adapter/mysampleadapter/sampleoperatorconfig --configStoreURL=fs://$MIXER_REPO
cd $MIXER_REPO && bazel build ... && ../bazel-bin/mixer/cmd/mixs/mixs server --configStore2URL=fs://$MIXER_REPO/adapter/mysampleadapter/sampleoperatorconfig --configStoreURL=fs://$MIXER_REPO
```

The terminal will have the following output and will be blocked waiting to serve requests
Expand Down Expand Up @@ -622,7 +622,7 @@ cd $MIXER_REPO && bazel build ...
Invoke report

```bash
../bazel-bin/mixer/cmd/client/mixc report -s="destination.service=svc.cluster.local"
../bazel-bin/mixer/cmd/mixc/mixc report -s="destination.service=svc.cluster.local"
```


Expand All @@ -646,7 +646,7 @@ You can even try passing other attributes to mixer server and inspect your out.t
the adapter changes. For example

```bash
../bazel-bin/mixer/cmd/client/mixc report -s="destination.service=svc.cluster.local,target.service=mySrvc" -i="response.code=400" --stringmap_attributes="target.labels=app:dummyapp"
../bazel-bin/mixer/cmd/mixc/mixc report -s="destination.service=svc.cluster.local,target.service=mySrvc" -i="response.code=400" --stringmap_attributes="target.labels=app:dummyapp"
```

**If you have reached this far, congratulate yourself !!**. You have successfully created a Mixer adapter. You can
Expand Down
2 changes: 1 addition & 1 deletion mixer/doc/deploy-mixer-with-custom-adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ These instructions assume that:
The Mixer binary has a utility for generating the Custom Resource Definitions for adapters. Invoke this utility as follows:

```bash
bazel run mixer/cmd/server:mixs -- crd adapter
bazel run mixer/cmd/mixs:mixs -- crd adapter
```

Find the stanza for your custom adapter and save it to a file, named something like `custom-crd.yaml`.
Expand Down
6 changes: 3 additions & 3 deletions mixer/doc/running-local-mixer.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The `KUBECONFIG` environment variable specifies the location of the Kubernetes c
If you do not want to use the Kubernetes adapter, remove `mixer/testdata/configroot/scopes/global/subjects/global/rules.yml`.

```shell
KUBECONFIG=${HOME}/.kube/config bazel-bin/mixer/cmd/server/mixs server --logtostderr --configStore2URL=fs://$(pwd)/mixer/testdata/config --configStoreURL=fs://$(pwd)/mixer/testdata/configroot -v=4
KUBECONFIG=${HOME}/.kube/config bazel-bin/mixer/cmd/mixs/mixs server --logtostderr --configStore2URL=fs://$(pwd)/mixer/testdata/config --configStoreURL=fs://$(pwd)/mixer/testdata/configroot -v=4
```

You can also run a simple client to interact with the server:
Expand All @@ -20,15 +20,15 @@ Note that `source.ip` is an ip address specified as 4 `:` separated bytes.
`192.0.0.2` is encoded as `c0:0:0:2` in the example.

```shell
bazel-bin/mixer/cmd/client/mixc check -v 2 --string_attributes destination.service=abc.ns.svc.cluster.local,source.name=myservice,target.port=8080 --stringmap_attributes "request.headers=clnt:abcd;source:abcd,destination.labels=app:ratings,source.labels=version:v2" --timestamp_attributes request.time="2017-07-04T00:01:10Z" --bytes_attributes source.ip=c0:0:0:2
bazel-bin/mixer/cmd/mixc/mixc check -v 2 --string_attributes destination.service=abc.ns.svc.cluster.local,source.name=myservice,target.port=8080 --stringmap_attributes "request.headers=clnt:abcd;source:abcd,destination.labels=app:ratings,source.labels=version:v2" --timestamp_attributes request.time="2017-07-04T00:01:10Z" --bytes_attributes source.ip=c0:0:0:2

Check RPC completed successfully. Check status was OK
Valid use count: 10000, valid duration: 5m0s
```

The following command sends a `report` request to Mixer.
```shell
bazel-bin/mixer/cmd/client/mixc report -v 2 --string_attributes destination.service=abc.ns.svc.cluster.local,source.name=myservice,target.port=8080 --stringmap_attributes "request.headers=clnt:abc;source:abcd,destination.labels=app:ratings,source.labels=version:v2" --int64_attributes response.duration=2003,response.size=1024 --timestamp_attributes request.time="2017-07-04T00:01:10Z" --bytes_attributes source.ip=c0:0:0:2
bazel-bin/mixer/cmd/mixc/mixc report -v 2 --string_attributes destination.service=abc.ns.svc.cluster.local,source.name=myservice,target.port=8080 --stringmap_attributes "request.headers=clnt:abc;source:abcd,destination.labels=app:ratings,source.labels=version:v2" --int64_attributes response.duration=2003,response.size=1024 --timestamp_attributes request.time="2017-07-04T00:01:10Z" --bytes_attributes source.ip=c0:0:0:2

Report RPC returned OK
```
2 changes: 1 addition & 1 deletion mixer/docker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ load("//mixer/docker:cacerts.bzl", "cacerts")
pkg_tar(
name = "mixer_tar",
srcs = [
"//mixer/cmd/server:mixs",
"//mixer/cmd/mixs:mixs",
],
extension = "tar.gz",
mode = "0755",
Expand Down
17 changes: 6 additions & 11 deletions mixer/pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ func new(a *Args, p *patchTable) (*Server, error) {
return nil, fmt.Errorf("failed to create IL expression evaluator with cache size %d: %v", a.ExpressionEvalCacheSize, err)
}

ilEvalForLegacy, err = p.newILEvaluator(a.ExpressionEvalCacheSize)
if err != nil {
if ilEvalForLegacy, err = p.newILEvaluator(a.ExpressionEvalCacheSize); err != nil {
return nil, fmt.Errorf("failed to create IL expression evaluator with cache size %d: %v", a.ExpressionEvalCacheSize, err)
}

Expand Down Expand Up @@ -126,8 +125,7 @@ func new(a *Args, p *patchTable) (*Server, error) {

var interceptor grpc.UnaryServerInterceptor

s.tracer, interceptor, err = p.startTracer(a.ZipkinURL, a.JaegerURL, a.LogTraceSpans)
if err != nil {
if s.tracer, interceptor, err = p.startTracer(a.ZipkinURL, a.JaegerURL, a.LogTraceSpans); err != nil {
_ = s.Close()
return nil, fmt.Errorf("unable to setup ZipKin: %v", err)
}
Expand All @@ -140,8 +138,7 @@ func new(a *Args, p *patchTable) (*Server, error) {
grpc_prometheus.EnableHandlingTimeHistogram()
grpcOptions = append(grpcOptions, grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(interceptors...)))

s.monitor, err = p.startMonitor(a.MonitoringPort)
if err != nil {
if s.monitor, err = p.startMonitor(a.MonitoringPort); err != nil {
_ = s.Close()
return nil, fmt.Errorf("unable to setup monitoring: %v", err)
}
Expand All @@ -159,8 +156,7 @@ func new(a *Args, p *patchTable) (*Server, error) {
}

if a.ServiceConfig != "" || a.GlobalConfig != "" {
s.configDir, err = serializeConfigs(a.GlobalConfig, a.ServiceConfig)
if err != nil {
if s.configDir, err = serializeConfigs(a.GlobalConfig, a.ServiceConfig); err != nil {
_ = s.Close()
return nil, fmt.Errorf("unable to serialize supplied configuration state: %v", err)
}
Expand All @@ -176,9 +172,8 @@ func new(a *Args, p *patchTable) (*Server, error) {
}

var dispatcher mixerRuntime.Dispatcher
dispatcher, err = p.newRuntime(eval, evaluator.NewTypeChecker(), eval, s.gp, s.adapterGP,
a.ConfigIdentityAttribute, a.ConfigDefaultNamespace, store2, adapterMap, a.Templates)
if err != nil {
if dispatcher, err = p.newRuntime(eval, evaluator.NewTypeChecker(), eval, s.gp, s.adapterGP,
a.ConfigIdentityAttribute, a.ConfigDefaultNamespace, store2, adapterMap, a.Templates); err != nil {
_ = s.Close()
return nil, fmt.Errorf("unable to create runtime dispatcher: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/example/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function process_result() {
}

# Build mixer binary
bazel build //mixer/cmd/server:mixs
MIXER_BINARY=$(pwd)/bazel-bin/mixer/cmd/server/mixs
bazel build //mixer/cmd/mixs:mixs
MIXER_BINARY=$(pwd)/bazel-bin/mixer/cmd/mixs/mixs

# Get fortio
go get -u istio.io/fortio
Expand Down
2 changes: 1 addition & 1 deletion tools/setup_run
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd istio; set +x; source bin/use_bazel_go.sh ; set -x; cd ..
fortio server &
( cd proxy/src/envoy/mixer; ./start_envoy > /tmp/envoy.log ) &
# add -v=5 for verbose/debug
./istio/bazel-bin/mixer/cmd/server/mixs server --configStore2URL=fs://$(pwd)/mixerconfig --configStoreURL=fs://$(pwd)/emptydir --logtostderr 2> /tmp/mixs.2.log > /tmp/mixs.1.log &
./istio/bazel-bin/mixer/cmd/mixs/mixs server --configStore2URL=fs://$(pwd)/mixerconfig --configStoreURL=fs://$(pwd)/emptydir --logtostderr 2> /tmp/mixs.2.log > /tmp/mixs.1.log &
echo "starting everything..."
sleep 3
curl -v http://localhost:9090/debug
Expand Down
2 changes: 1 addition & 1 deletion tools/update_all
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -x
cd istio
git pull
bazel build -c opt mixer/cmd/server:mixs
bazel build -c opt mixer/cmd/mixs:mixs
cd ../proxy
git pull
bazel build -c opt src/envoy/mixer:envoy
Expand Down

0 comments on commit 9f920e2

Please sign in to comment.