diff --git a/.gitignore b/.gitignore index a9cc7a6..0e0736a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ k8s/calculator k8s/web-app k8s/service-center k8s/frontend +vendor/ diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..288d4c8 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,536 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/ServiceComb/auth" + packages = [ + ".", + "third_party/forked/datastream/aws" + ] + revision = "31bcd34cbac5841ae214b7a8fb322168d191325e" + +[[projects]] + branch = "master" + name = "github.com/ServiceComb/go-archaius" + packages = [ + ".", + "core", + "core/cast", + "core/config-manager", + "core/event-system", + "lager", + "sources/commandline-source", + "sources/configcenter-source", + "sources/enviromentvariable-source", + "sources/file-source", + "sources/memory-source" + ] + revision = "561c7547733a283358a2a52f593764361f6ffbb3" + +[[projects]] + branch = "master" + name = "github.com/ServiceComb/go-cc-client" + packages = [ + ".", + "apollo-client", + "configcenter-client", + "serializers", + "serializers/json" + ] + revision = "b92c97d78e6e13e17f8b148309dce8756cb1b929" + +[[projects]] + name = "github.com/ServiceComb/go-chassis" + packages = [ + ".", + "auth", + "bootstrap", + "client/highway", + "client/highway/pb", + "client/rest", + "config-center", + "core", + "core/archaius", + "core/client", + "core/common", + "core/config", + "core/config/model", + "core/config/schema", + "core/endpoint-discovery", + "core/fault", + "core/goplugin", + "core/handler", + "core/invocation", + "core/lager", + "core/loadbalancer", + "core/metadata", + "core/provider", + "core/qpslimiter", + "core/registry", + "core/registry/file", + "core/registry/pilot", + "core/registry/servicecenter", + "core/router", + "core/router/cse", + "core/router/pilot", + "core/router/weightpool", + "core/server", + "core/tls", + "core/tracing", + "core/util/string", + "eventlistener", + "healthz/client", + "metrics", + "metrics/prom", + "pkg/istio/client", + "pkg/istio/util", + "pkg/runtime", + "pkg/util/fileutil", + "pkg/util/iputil", + "security", + "security/common", + "security/plugins/aes", + "security/plugins/plain", + "server/highway", + "server/restful", + "session", + "third_party/forked/afex/hystrix-go/hystrix", + "third_party/forked/afex/hystrix-go/hystrix/metric_collector", + "third_party/forked/afex/hystrix-go/hystrix/rolling" + ] + revision = "fde7303777781a0e38a9ff62a4e4212a13fa009b" + version = "v0.6" + +[[projects]] + branch = "master" + name = "github.com/ServiceComb/go-sc-client" + packages = [ + ".", + "model" + ] + revision = "369f58c0db9f0a9d1bf632aa1d262135828adf76" + +[[projects]] + branch = "master" + name = "github.com/ServiceComb/http-client" + packages = ["."] + revision = "1c8b6172a2877d77b85fb7a308a49301ca7f7855" + +[[projects]] + branch = "master" + name = "github.com/ServiceComb/paas-lager" + packages = [ + ".", + "third_party/forked/cloudfoundry/lager", + "third_party/forked/cloudfoundry/lager/color" + ] + revision = "70c0ec58b92bfcc895af93e779bd3f3e107c6dd9" + +[[projects]] + name = "github.com/Shopify/sarama" + packages = ["."] + revision = "35324cf48e33d8260e1c7c18854465a904ade249" + version = "v1.17.0" + +[[projects]] + name = "github.com/apache/thrift" + packages = ["lib/go/thrift"] + revision = "3d556248a8b97310da49939195330691dfe9d9ad" + +[[projects]] + branch = "master" + name = "github.com/beorn7/perks" + packages = ["quantile"] + revision = "3a771d992973f24aa725d07868b467d1ddfceafb" + +[[projects]] + name = "github.com/cenkalti/backoff" + packages = ["."] + revision = "2ea60e5f094469f9e65adb9cd103795b73ae743e" + version = "v2.0.0" + +[[projects]] + name = "github.com/davecgh/go-spew" + packages = ["spew"] + revision = "346938d642f2ec3594ed81d874461961cd0faa76" + version = "v1.1.0" + +[[projects]] + name = "github.com/eapache/go-resiliency" + packages = ["breaker"] + revision = "ea41b0fad31007accc7f806884dcdf3da98b79ce" + version = "v1.1.0" + +[[projects]] + branch = "master" + name = "github.com/eapache/go-xerial-snappy" + packages = ["."] + revision = "040cc1a32f578808623071247fdbd5cc43f37f5f" + +[[projects]] + name = "github.com/eapache/queue" + packages = ["."] + revision = "44cc805cf13205b55f69e14bcb69867d1ae92f98" + version = "v1.1.0" + +[[projects]] + name = "github.com/emicklei/go-restful" + packages = [ + ".", + "log" + ] + revision = "3eb9738c1697594ea6e71a7156a9bb32ed216cf0" + version = "v2.8.0" + +[[projects]] + name = "github.com/emicklei/go-restful-swagger12" + packages = ["."] + revision = "dcef7f55730566d41eae5db10e7d6981829720f6" + version = "1.0.1" + +[[projects]] + name = "github.com/envoyproxy/go-control-plane" + packages = [ + "envoy/api/v2", + "envoy/api/v2/auth", + "envoy/api/v2/cluster", + "envoy/api/v2/core", + "envoy/api/v2/endpoint", + "envoy/api/v2/listener", + "envoy/api/v2/route", + "envoy/service/discovery/v2", + "envoy/type" + ] + revision = "c14704578b82128fab17743d91f870c406ef8d09" + version = "v0.4" + +[[projects]] + name = "github.com/fsnotify/fsnotify" + packages = ["."] + revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" + version = "v1.4.7" + +[[projects]] + name = "github.com/go-logfmt/logfmt" + packages = ["."] + revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5" + version = "v0.3.0" + +[[projects]] + name = "github.com/gogo/googleapis" + packages = [ + "google/api", + "google/rpc" + ] + revision = "08a7655d27152912db7aaf4f983275eaf8d128ef" + version = "v1.0.0" + +[[projects]] + name = "github.com/gogo/protobuf" + packages = [ + "gogoproto", + "proto", + "protoc-gen-gogo/descriptor", + "sortkeys", + "types" + ] + revision = "636bf0302bc95575d69441b25a2603156ffdddf1" + version = "v1.1.1" + +[[projects]] + name = "github.com/golang/protobuf" + packages = [ + "proto", + "protoc-gen-go/descriptor", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/timestamp" + ] + revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" + version = "v1.1.0" + +[[projects]] + branch = "master" + name = "github.com/golang/snappy" + packages = ["."] + revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" + +[[projects]] + name = "github.com/gorilla/websocket" + packages = ["."] + revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" + version = "v1.2.0" + +[[projects]] + branch = "master" + name = "github.com/hashicorp/go-version" + packages = ["."] + revision = "270f2f71b1ee587f3b609f00f422b76a6b28f348" + +[[projects]] + name = "github.com/json-iterator/go" + packages = ["."] + revision = "ab8a2e0c74be9d3be70b3184d9acc634935ded82" + version = "1.1.4" + +[[projects]] + name = "github.com/klauspost/compress" + packages = [ + "flate", + "gzip", + "zlib" + ] + revision = "b939724e787a27c0005cabe3f78e7ed7987ac74f" + version = "v1.4.0" + +[[projects]] + name = "github.com/klauspost/cpuid" + packages = ["."] + revision = "ae7887de9fa5d2db4eaa8174a7eff2c1ac00f2da" + version = "v1.1" + +[[projects]] + branch = "master" + name = "github.com/kr/logfmt" + packages = ["."] + revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" + +[[projects]] + name = "github.com/lyft/protoc-gen-validate" + packages = ["validate"] + revision = "930a67cf7ba41b9d9436ad7a1be70a5d5ff6e1fc" + version = "v0.0.6" + +[[projects]] + name = "github.com/matttproud/golang_protobuf_extensions" + packages = ["pbutil"] + revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" + version = "v1.0.1" + +[[projects]] + name = "github.com/modern-go/concurrent" + packages = ["."] + revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" + version = "1.0.3" + +[[projects]] + name = "github.com/modern-go/reflect2" + packages = ["."] + revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" + version = "1.0.1" + +[[projects]] + branch = "master" + name = "github.com/opentracing-contrib/go-observer" + packages = ["."] + revision = "a52f2342449246d5bcc273e65cbdcfa5f7d6c63c" + +[[projects]] + name = "github.com/opentracing/opentracing-go" + packages = [ + ".", + "ext", + "log" + ] + revision = "1949ddbfd147afd4d964a9f00b24eb291e0e7c38" + version = "v1.0.2" + +[[projects]] + name = "github.com/openzipkin/zipkin-go-opentracing" + packages = [ + ".", + "flag", + "thrift/gen-go/scribe", + "thrift/gen-go/zipkincore", + "types", + "wire" + ] + revision = "6bb822a7f15fdc5800b9822a6ac1bfa0b7d9195d" + +[[projects]] + name = "github.com/patrickmn/go-cache" + packages = ["."] + revision = "a3647f8e31d79543b2d0f0ae2fe5c379d72cedc0" + version = "v2.1.0" + +[[projects]] + name = "github.com/pierrec/lz4" + packages = [ + ".", + "internal/xxh32" + ] + revision = "1958fd8fff7f115e79725b1288e0b878b3e06b00" + version = "v2.0.3" + +[[projects]] + name = "github.com/prometheus/client_golang" + packages = [ + "prometheus", + "prometheus/promhttp" + ] + revision = "c5b7fccd204277076155f10851dad72b76a49317" + version = "v0.8.0" + +[[projects]] + branch = "master" + name = "github.com/prometheus/client_model" + packages = ["go"] + revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" + +[[projects]] + branch = "master" + name = "github.com/prometheus/common" + packages = [ + "expfmt", + "internal/bitbucket.org/ww/goautoneg", + "model" + ] + revision = "7600349dcfe1abd18d72d3a1770870d9800a7801" + +[[projects]] + branch = "master" + name = "github.com/prometheus/procfs" + packages = [ + ".", + "internal/util", + "nfs", + "xfs" + ] + revision = "ae68e2d4c00fed4943b5f6698d504a5fe083da8a" + +[[projects]] + branch = "master" + name = "github.com/rcrowley/go-metrics" + packages = ["."] + revision = "e2704e165165ec55d062f5919b4b29494e9fa790" + +[[projects]] + name = "github.com/spf13/cast" + packages = ["."] + revision = "8965335b8c7107321228e3e3702cab9832751bac" + version = "v1.2.0" + +[[projects]] + branch = "master" + name = "github.com/valyala/bytebufferpool" + packages = ["."] + revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7" + +[[projects]] + name = "github.com/valyala/fasthttp" + packages = [ + ".", + "fasthttputil", + "stackless" + ] + revision = "e5f51c11919d4f66400334047b897ef0a94c6f3c" + version = "v20180529" + +[[projects]] + branch = "master" + name = "go.uber.org/ratelimit" + packages = [ + ".", + "internal/clock" + ] + revision = "c15da02342779cb6dc027fc95ee2277787698f36" + +[[projects]] + branch = "master" + name = "golang.org/x/net" + packages = [ + "context", + "http/httpguts", + "http2", + "http2/hpack", + "idna", + "internal/timeseries", + "trace" + ] + revision = "81d44fd177a98d09fe3bc40a5a78d495d3f042ea" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = ["unix"] + revision = "ac767d655b305d4e9612f5f6e33120b9176c4ad4" + +[[projects]] + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable" + ] + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" + +[[projects]] + branch = "master" + name = "google.golang.org/genproto" + packages = ["googleapis/rpc/status"] + revision = "fedd2861243fd1a8152376292b921b394c7bef7e" + +[[projects]] + name = "google.golang.org/grpc" + packages = [ + ".", + "balancer", + "balancer/base", + "balancer/roundrobin", + "codes", + "connectivity", + "credentials", + "encoding", + "encoding/proto", + "grpclog", + "internal", + "internal/backoff", + "internal/channelz", + "internal/grpcrand", + "keepalive", + "metadata", + "naming", + "peer", + "resolver", + "resolver/dns", + "resolver/passthrough", + "stats", + "status", + "tap", + "transport" + ] + revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" + version = "v1.13.0" + +[[projects]] + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" + version = "v2.2.1" + +[[projects]] + branch = "master" + name = "k8s.io/apimachinery" + packages = ["pkg/util/sets"] + revision = "001f0307e2ebcfc31265ae32d8d3130c1b81b44e" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "bfb458d1eae31f94dc8d07d332d24a79ad61d07b740fe620a699a4dd0c1badb9" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..7cb28d5 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,42 @@ +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/ServiceComb/go-chassis" + version = "0.6.0" + +[prune] + go-tests = true + unused-packages = true + +[[override]] + name = "github.com/apache/thrift" + revision = "3d556248a8b97310da49939195330691dfe9d9ad" + +[[override]] + name = "github.com/openzipkin/zipkin-go-opentracing" + revision = "6bb822a7f15fdc5800b9822a6ac1bfa0b7d9195d" diff --git a/Makefile b/Makefile index c30192d..b9ab811 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,11 @@ endif .PHONY: calculator webapp -k8s: k8s.calculator k8s.webapp k8s.servicecenter +namespace: echo '{"apiVersion":"v1","kind":"Namespace","metadata":{"name":"bmi"}}' | kubectl apply -f - +k8s: namespace k8s.calculator k8s.webapp k8s.servicecenter + docker: docker.webapp docker.calculator bin: webapp calculator @@ -35,10 +37,10 @@ webapp: docker.webapp: webapp mv ./web-app/web-app ./k8s/ - cd ./k8s; $(DOCKERBIN) build -t bmi/webapp:v1 -f ./Dockerfile.webapp . + cd ./k8s; $(DOCKERBIN) build -t bmi/webapp:0.0.1 -f ./Dockerfile.webapp . k8s.webapp: docker.webapp - ./scripts/distribute-image.sh bmi/webapp:v1 + ./scripts/distribute-image.sh bmi/webapp:0.0.1 -kubectl delete -f ./k8s/webapp.yaml kubectl apply -f ./k8s/webapp.yaml @@ -47,10 +49,10 @@ calculator: docker.calculator: calculator mv ./calculator/calculator ./k8s/ - cd ./k8s; $(DOCKERBIN) build -t bmi/calculator:v1 -f ./Dockerfile.calculator . + cd ./k8s; $(DOCKERBIN) build -t bmi/calculator:0.0.2 -f ./Dockerfile.calculator . k8s.calculator: docker.calculator - ./scripts/distribute-image.sh bmi/calculator:v1 + ./scripts/distribute-image.sh bmi/calculator:0.0.2 -kubectl delete -f ./k8s/calculator.yaml kubectl apply -f ./k8s/calculator.yaml diff --git a/k8s/calculator.conf/microservice.yaml b/k8s/calculator.conf/microservice.yaml index 4884d64..f2eb0c1 100755 --- a/k8s/calculator.conf/microservice.yaml +++ b/k8s/calculator.conf/microservice.yaml @@ -1,3 +1,3 @@ service_description: name: calculator - version: 0.0.1 \ No newline at end of file + version: 0.0.2 diff --git a/k8s/calculator.yaml b/k8s/calculator.yaml index 1142097..e99b175 100644 --- a/k8s/calculator.yaml +++ b/k8s/calculator.yaml @@ -25,7 +25,7 @@ spec: metadata: labels: app: calculator - version: v1 + version: 0.0.2 spec: containers: - name: calculator diff --git a/k8s/webapp.yaml b/k8s/webapp.yaml index 3a31858..2055cd0 100644 --- a/k8s/webapp.yaml +++ b/k8s/webapp.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: webapp + name: web-app namespace: bmi labels: app: webapp @@ -24,15 +24,15 @@ spec: metadata: labels: app: webapp - version: v1 + version: 0.0.1 spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: debug - operator: Exists + # affinity: + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: debug + # operator: Exists containers: - name: webapp image: bmi/webapp:v1 diff --git a/scripts/distribute-image.sh b/scripts/distribute-image.sh index cf25e2b..750d9b2 100755 --- a/scripts/distribute-image.sh +++ b/scripts/distribute-image.sh @@ -22,7 +22,7 @@ if [ "$nodeIPs" == "" ]; then fi -localip=$(ip addr | grep 'inet.*wlp3s0' | awk '{print $2}' | awk '{split($0,a,"/")}; {print a[1]}') +localip=$(ip addr | grep 'inet.*wlp' | awk '{print $2}' | awk '{split($0,a,"/")}; {print a[1]}') if [ "$localip" == "" ]; then echo "Failed to get local ip" exit 1