target/strelka

Error when building docker container for strelka-frontend

Closed this issue · 4 comments

n3x77 commented

Describe the bug
When using the docker-compose.yml file for a quickstart the build of the docker image for the strelka-frontend failes

Steps to reproduce
Steps to reproduce the behavior:

  1. Clone the current strelka repository and use master or version 0.19.08.28
  2. Run up strelka using the docker-compose file: docker-compose -f build/docker-compose.yaml up
  3. See error
Step 4/8 : RUN cd /go/src/github.com/target/strelka/src/go/cmd/strelka-frontend/ &&     go get . &&     CGO_ENABLED=0 go build -o /tmp/strelka-frontend .
 ---> Running in 43f32b29e411
cannot find package "go.opentelemetry.io/otel/api/global" in any of:
        /usr/local/go/src/go.opentelemetry.io/otel/api/global (from $GOROOT)
        /go/src/go.opentelemetry.io/otel/api/global (from $GOPATH)
cannot find package "go.opentelemetry.io/otel/api/metric" in any of:
        /usr/local/go/src/go.opentelemetry.io/otel/api/metric (from $GOROOT)
        /go/src/go.opentelemetry.io/otel/api/metric (from $GOPATH)
cannot find package "go.opentelemetry.io/otel/api/trace" in any of:
        /usr/local/go/src/go.opentelemetry.io/otel/api/trace (from $GOROOT)
        /go/src/go.opentelemetry.io/otel/api/trace (from $GOPATH)
ERROR: Service 'frontend' failed to build: The command '/bin/sh -c cd /go/src/github.com/target/strelka/src/go/cmd/strelka-frontend/ &&     go get . &&     CGO_ENABLED=0 go build -o /tmp/strelka-frontend .' returned a non-zero code: 1

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Release

  • Release: github master branch
  • Release: 0.19.08.28

Additional context
It seems that this is a problem when resolving the golang package opentelemetry packages go.opentelemetry.io/otel/api/global.

n3x77 commented

So it seems that the problem comes from the go-redis package.

opentelemetry changed the package name and import paths. (https://raw.githubusercontent.com/open-telemetry/opentelemetry-go/34aa6816c1e568dc910344fd5eb10e87b42c901d/CHANGELOG.md)

There are also issues within the go-redis repo redis/go-redis#1544

n3x77 commented

The problem seems that go-redis now needs go modules for successful installation. After trying to fix that manually there are issues within the build of the docker container
# github.com/target/strelka/src/go/cmd/strelka-frontend ./main.go:86:25: cannot use stream.Context() (type context.Context) as type string in argument to p.RPush ./main.go:87:13: too many arguments in call to p.ExpireAt have (context.Context, string, time.Time) want (string, time.Time) ./main.go:88:22: too many arguments in call to p.Exec have (context.Context) want () ./main.go:111:36: too many arguments in call to s.gatekeeper.cli.cmdable.LRange have (context.Context, string, number, number) want (string, int64, int64) ./main.go:134:50: cannot use stream.Context() (type context.Context) as type string in argument to s.coordinator.cli.cmdable.Del ./main.go:143:20: cannot use stream.Context() (type context.Context) as type string in argument to s.coordinator.cli.cmdable.ZAdd ./main.go:144:3: cannot use "tasks" (type string) as type redis.Z in argument to s.coordinator.cli.cmdable.ZAdd ./main.go:145:3: cannot use &redis.Z literal (type *redis.Z) as type redis.Z in argument to s.coordinator.cli.cmdable.ZAdd ./main.go:154:23: cannot use stream.Context() (type context.Context) as type string in argument to tx.Del ./main.go:157:38: too many arguments in call to s.coordinator.cli.cmdable.LPop have (context.Context, string) want (string) ./main.go:157:38: too many errors

@n3x77 - Should be fixed in https://github.com/target/strelka/releases/tag/0.20.11.20 per the above PR. Let me know if it's causing you trouble and I'll reopen.

n3x77 commented

@phutelmyer thanks for the fast fix! I think you must add the fix with the go mod init also to the source folders of the strelka-fileshot. When trying to build that with go, the same error regarding redis-v8 occurs.