Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fails on step 5 (looks like problem with gocenter.io AND problem with mockery) #62

Open
Bondrake opened this issue Sep 22, 2021 · 2 comments

Comments

@Bondrake
Copy link

Just pulled master. On Arch: amd64 Linux. Tried make...

Step 5/15 : RUN go get -u github.com/vektra/mockery/.../
 ---> Running in dcd1965c7357
package github.com/vektra/mockery
        imports github.com/hashicorp/hcl/hcl/printer: cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
        /go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)
The command '/bin/sh -c go get -u github.com/vektra/mockery/.../' returned a non-zero code: 1
make: *** [Makefile:60: build] Error 1

Ok...

Found this vektra/mockery#364

Modify ./docker/dev/Dockerfile line to ...

# Mock creator
RUN GO111MODULE="on" go get -u github.com/vektra/mockery

Try again ...

Step 5/15 : RUN GO111MODULE="on" go get -u github.com/vektra/mockery
 ---> Running in f240d67d7a70
go get github.com/vektra/mockery: unexpected status (https://gocenter.io/github.com/vektra/mockery/@v/list): 405 Not Allowed

Ok, back to Dockerfile... Change goproxy line to...

ENV GOPROXY=https://proxy.golang.org

Try again...

Step 8/15 : RUN bash -c 'if [ ${ostype} == Linux ]; then addgroup -g $gid app; else addgroup app; fi &&     adduser -D -u $uid -G app app &&     chown app:app -R /go'
 ---> Running in d2ce703cf649
addgroup: gid '0' in use
The command '/bin/sh -c bash -c 'if [ ${ostype} == Linux ]; then addgroup -g $gid app; else addgroup app; fi &&     adduser -D -u $uid -G app app &&     chown app:app -R /go'' returned a non-zero code: 1
make: *** [Makefile:60: build] Error 1

Ok, back to Dockerfile... changed uid and gid variable names...

ARG auid=2000
ARG agid=2000

RUN bash -c 'if [ ${ostype} == Linux ]; then addgroup -g $agid app; else addgroup app; fi && \
    adduser -D -u $auid -G app app && \
    chown app:app -R /go'

Try again...

Step 16/16 : WORKDIR /src
 ---> Running in 4bd2a103b450
Removing intermediate container 4bd2a103b450
 ---> 2aa32cec6d7e
[Warning] One or more build-args [gid uid] were not consumed
Successfully built 2aa32cec6d7e
Successfully tagged grafterm:latest

Success!

Actually building a binary was another slog through the Makefile..

I manually ran VERSION=amd64 ostype=Linux ./hack/scripts/build.sh

❯ ls -l ~/github/grafterm/bin/grafterm-linux-amd64
-rwxr-xr-x 1 ... /home/user/github/grafterm/bin/grafterm-linux-amd64

Cool.

~/github/grafterm/bin/grafterm-linux-amd64 --help
usage: grafterm [<flags>]

graph metrics on the terminal

Flags:
      --help                     Show context-sensitive help (also try --help-long and --help-man).
      --version                  Show application version.
  -c, --cfg="dashboard.json"     the path to the configuration file
  -r, --refresh-interval=10s     the interval to refresh the dashboard
      --log-path="grafterm.log"  the path where the log output will be written
  -d, --relative-duration=RELATIVE-DURATION
                                 the relative duration from now to load the graph.
  -s, --start=START              the time the dashboard will start in time. Accepts 2 formats, relative time from now based on duration(e.g.: 24h, 15m), or fixed duration in ISO 8601 (e.g.:
                                 2019-05-12T09:35:11+00:00). If set it disables relative duration flag.
  -e, --end=END                  the time the dashboard will end in time. Accepts 2 formats, relative time from now based on duration(e.g.: 24h, 15m), or fixed duration in ISO 8601 (e.g.:
                                 2019-05-12T09:35:11+00:00).
  -v, --var=VAR ...              repeatable flag that will override the variable defined on the dashboard (in 'key=value' form)
  -a, --ds-alias=DS-ALIAS ...    repeatable flag that maps dashboard ID datasources to user defined datasources in the form of 'dashboard=user' (in 'key=value' form)
  -u, --user-datasources="/home/user/grafterm/datasources.json"
                                 path to a configuration file with user defined datasources, these datasources can override the dashboard datasources with the same ID and also can be used to alias
                                 them using datasource alias flags. It fallbacks to GRAFTERM_USER_DATASOURCES env var
      --debug                    enable debug mode, on debug mode it will print logs to the desired output

Hey, it is alive.

~/github/grafterm/bin/grafterm-linux-amd64 --cfg="/home/$USER/github/grafterm/dashboard-examples/test-grid-adaptive.json"

Yep, that loads the test grid.

@Bondrake
Copy link
Author

@Bondrake
Copy link
Author

The ./.circleci/config.yml includes GO111MODULE: "on", so it was probably working through Circle before.
gocenter.io shut down in May: https://twitter.com/gocenterio/status/1388209462926659591

AdamStawarz added a commit to AdamStawarz/grafterm that referenced this issue Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant