Code Monkey home page Code Monkey logo

catalogue's Introduction

Build Status Coverage Status Go Report Card Microbadger

DEPRECATED: Catalogue

A microservices-demo service that provides catalogue/product information. This service is built, tested and released by travis.

Bugs, Feature Requests and Contributing

We'd love to see community contributions. We like to keep it simple and use Github issues to track bugs and feature requests and pull requests to manage contributions.

API Spec

Checkout the API Spec here

To build this service

Dependencies

go get -u github.com/FiloSottile/gvt
gvt restore

Go tools

In order to build the project locally you need to make sure that the repository directory is located in the correct $GOPATH directory: $GOPATH/src/github.com/microservices-demo/catalogue/. Once that is in place you can build by running:

cd $GOPATH/src/github.com/microservices-demo/catalogue/cmd/cataloguesvc/
go build -o catalogue

The result is a binary named catalogue, in the current directory.

Docker

docker-compose build

To run the service on port 8080

Go native

If you followed to Go build instructions, you should have a "catalogue" binary in $GOPATH/src/github.com/microservices-demo/catalogue/cmd/cataloguesvc/. To run it use:

./catalogue

Docker

docker-compose up

Run tests before submitting PRs

make test

Check whether the service is alive

curl http://localhost:8080/health

Use the service endpoints

curl http://localhost:8080/catalogue

Push the service to Docker Container Registry

GROUP=weaveworksdemos COMMIT=test ./scripts/push.sh

Test Zipkin

To test with Zipkin

docker-compose -f docker-compose-zipkin.yml build
docker-compose -f docker-compose-zipkin.yml up

It takes about 10 seconds to seed data

you should see it at: http://localhost:9411/

be sure to hit the "Find Traces" button. You may need to reload the page.

when done you can run:

docker-compose -f docker-compose-zipkin.yml down

catalogue's People

Contributors

darren-reddick avatar dreddick-home avatar errordeveloper avatar frankscholten avatar idcrosby avatar jasonrichardsmith avatar jpellizzari avatar marccarre avatar morancj avatar nustiueudinastea avatar ottovsky avatar philwinder avatar pidster avatar vlal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

catalogue's Issues

Require image for ARM64 architecture

Hi Team,

I am trying to use the weaveworksdemos/catalogue image on the arm64 platform but it seems it is not available for arm64.

I have successfully built the image using the command docker build -t image_name . on the arm64 platform by making some changes in the files docker/catalogue/Dockerfile and .github/workflows/main.yml.

I have used GitHub action to build and push the image for both the platforms.

Commit Link - odidev@1db08c7

GitHub action link - https://github.com/odidev/catalogue/runs/3881209535?check_suite_focus=true

Docker Hub Link - https://hub.docker.com/repository/registry-1.docker.io/odidev/catalogue/tags?page=1&ordering=last_updated

Do you have any plans on releasing arm64 images?

It will be very helpful if an arm64 image is available. If interested, I will raise a PR.

Go Build issues with the latest go version go1.11.4 windows/amd64

Getting the below error while doing the go build. I really appreciate if someone can help me on this issue fix.

D:\GO\src\github.com\microservices-demo\catalogue\cmd\cataloguesvc>go build

github.com/DataDog/zstd

exec: "gcc": executable file not found in %PATH%

github.com/microservices-demo/catalogue

....\transport.go:38:69: too many arguments in call to "github.com/go-kit/kit/transport/http".NewServer
have ("context".Context, endpoint.Endpoint, func("context".Context, *"net/http".Request) (interface {}, error), func("context".Context, "net/http".ResponseWriter, interface {}) error, []"github.com/go-kit/kit/transport/http".ServerOption...)
want (endpoint.Endpoint, "github.com/go-kit/kit/transport/http".DecodeRequestFunc, "github.com/go-kit/kit/transport/http".EncodeResponseFunc, ..."github.com/go-kit/kit/transport/http".ServerOption)
....\transport.go:46:46: undefined: "github.com/go-kit/kit/tracing/opentracing".FromHTTPRequest
....\transport.go:48:74: too many arguments in call to "github.com/go-kit/kit/transport/http".NewServer
have ("context".Context, endpoint.Endpoint, func("context".Context, *"net/http".Request) (interface {}, error), func("context".Context, "net/http".ResponseWriter, interface {}) error, []"github.com/go-kit/kit/transport/http".ServerOption...)
want (endpoint.Endpoint, "github.com/go-kit/kit/transport/http".DecodeRequestFunc, "github.com/go-kit/kit/transport/http".EncodeResponseFunc, ..."github.com/go-kit/kit/transport/http".ServerOption)
....\transport.go:56:46: undefined: "github.com/go-kit/kit/tracing/opentracing".FromHTTPRequest
....\transport.go:58:74: too many arguments in call to "github.com/go-kit/kit/transport/http".NewServer
have ("context".Context, endpoint.Endpoint, func("context".Context, *"net/http".Request) (interface {}, error), func("context".Context, "net/http".ResponseWriter, interface {}) error, []"github.com/go-kit/kit/transport/http".ServerOption...)
want (endpoint.Endpoint, "github.com/go-kit/kit/transport/http".DecodeRequestFunc, "github.com/go-kit/kit/transport/http".EncodeResponseFunc, ..."github.com/go-kit/kit/transport/http".ServerOption)
....\transport.go:66:46: undefined: "github.com/go-kit/kit/tracing/opentracing".FromHTTPRequest
....\transport.go:68:64: too many arguments in call to "github.com/go-kit/kit/transport/http".NewServer
have ("context".Context, endpoint.Endpoint, func("context".Context, *"net/http".Request) (interface {}, error), func("context".Context, "net/http".ResponseWriter, interface {}) error, []"github.com/go-kit/kit/transport/http".ServerOption...)
want (endpoint.Endpoint, "github.com/go-kit/kit/transport/http".DecodeRequestFunc, "github.com/go-kit/kit/transport/http".EncodeResponseFunc, ..."github.com/go-kit/kit/transport/http".ServerOption)
....\transport.go:76:46: undefined: "github.com/go-kit/kit/tracing/opentracing".FromHTTPRequest
....\transport.go:82:72: too many arguments in call to "github.com/go-kit/kit/transport/http".NewServer
have ("context".Context, endpoint.Endpoint, func("context".Context, *"net/http".Request) (interface {}, error), func("context".Context, "net/http".ResponseWriter, interface {}) error, []"github.com/go-kit/kit/transport/http".ServerOption...)
want (endpoint.Endpoint, "github.com/go-kit/kit/transport/http".DecodeRequestFunc, "github.com/go-kit/kit/transport/http".EncodeResponseFunc, ..."github.com/go-kit/kit/transport/http".ServerOption)
....\transport.go:90:46: undefined: "github.com/go-kit/kit/tracing/opentracing".FromHTTPRequest
....\transport.go:82:72: too many errors

github.com/weaveworks/common/logging

........\weaveworks\common\logging\logging.go:25:16: cannot use hook (type promrus.PrometheusHook) as type "github.com/sirupsen/logrus".Hook in argument to "github.com/sirupsen/logrus".AddHook:
promrus.PrometheusHook does not implement "github.com/sirupsen/logrus".Hook (wrong type for Fire method)
have Fire(
"github.com/weaveworks/promrus/vendor/github.com/sirupsen/logrus".Entry) error
want Fire(
"github.com/sirupsen/logrus".Entry) error

Update catalog files

Hi,

I wanted to know if the Makefile and the Dockerfile are the up to date docker files which are being used same for the version 0.3.5.

Thank you!

Creating image from Docker file gives error

Hi,

I tried building the image by first cloning the repo of the catalogue here to my machine and then ran a docker build for the catalogue folder which container Dockerfile but I am experiencing the below error, is there any work around it?

can't load package: package github.com/microservices-demo/catalogue/cmd/cataloguesvc: cannot find package "github.com/microservices-demo/catalogue/cmd/cataloguesvc" in any of:
/usr/local/go/src/github.com/microservices-demo/catalogue/cmd/cataloguesvc (from $GOROOT)
/go/src/github.com/microservices-demo/catalogue/cmd/cataloguesvc (from $GOPATH)

Thank you.

Add code coverage

  • Add labels appropriate to the issue
  • Describe the expected behaviour and the actual behaviour
  • Describe steps to reproduce the problem

Unable to execute go build

I really appreciate if somebody help to resolve the following error

github.com/go-kit/kit/log/level

../../../../go-kit/kit/log/level/level.go:7:9: undefined: log.WithPrefix
../../../../go-kit/kit/log/level/level.go:12:9: undefined: log.WithPrefix
../../../../go-kit/kit/log/level/level.go:17:9: undefined: log.WithPrefix
../../../../go-kit/kit/log/level/level.go:22:9: undefined: log.WithPrefix

DockerFile is in .gitignore

In catalogue/.gitignore, there is line for "docker/catalogue/". Is there any reason why we ignore files in that folder? When I make changes in docker/catalogue/Dockerfile, it always get ignore by Git. Is it because of issue #16 ?

Container build out of date

The most recent container build does not reflect the latest merge into master. The latest code in master contains a commit which fixes the non-standard HTTP metrics name which would be useful in our deployment.
Could we get a new image pushed to resolve this?

Local built catalogue container failed to load pictures of socks

Step to reproduce the problem:

  1. Freshly clone catalogue and microservice-demo from github.
    git clone https://github.com/microservices-demo/microservices-demo.git
    git clone https://github.com/microservices-demo/catalogue.git
  2. Go to catalogue repo and run docker-compose build. If succeeded, the instruction will build image "weaveworksdemos/catalogue-dev:latest" and "weaveworksdemos/catalogue-dev-db:latest"
  3. Go to microservices-demo repo and change file deploy/docker-compose/docker-compose.yml. We want to use local images instead of images in the hub. Replace "weaveworksdemos/catalogue" to "weaveworksdemos/catalogue-dev:latest", weaveworksdemos/catalogue-db to "weaveworksdemos/catalogue-dev-db:latest"
  4. Run quickstart command docker-compose -f deploy/docker-compose/docker-compose.yml up -d in the microservices-demo repo
  5. (IMPORTANT) Access the sock shop by using chrome incognito mode to prevent caching the photo. Every time you want to access the sock shop again, it's recommend to always close incognito window and access the shop in a new incognito window to prevent further caching.

Actual behavior:
All of the photos for the sock items cannot be accessed with a 404 not found error. Originally I didn't find this bug because at first, I used the default microservice-demo configuration and the browser startes to caching those images from that point. If I don't clean the cache, the sock shop will function normally even after I replace them with the local images (because of the browser caching).

Fix arguments to NewServer in Transport.go

Error : cannot use ctx (type "context".Context) as type endpoint.Endpoint in argument to "github.com/go-kit/kit/transport/http".NewServer

Expected Behavior - it should compile and build
Actual Behavior - Build fails with the above error.

Steps to reproduce

  • build the code for this project

Migrate to go modules

  • allows escape $GOPATH directory
  • built into the go command: go build, go test, and other package-building commands add new dependencies to go.mod as needed. go mod tidy removes unused dependencies
  • minimal version selection algorithm

Simplify build scripts

Current problem:

  • Too complex
  • Too slow (runs gvt for every build)

I like the build in container philosophy, but maybe it's not required. Devs have to manage their deps to to development anyway. Consider removing build container?

Also see #34

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.