grafana / xk6-sql

k6 extension to load test RDBMSs (PostgreSQL, MySQL, MS SQL and SQLite3)
Apache License 2.0
108 stars 57 forks source link

grafana/k6-for-sql doesn't seem to exist #19

Closed APWHY closed 2 years ago

APWHY commented 2 years ago

I was trying to run this plugin via docker, but it seems as though the image doesn't exist in dockerhub anymore. Is there a new name or has the image been taken down?

APWHY commented 2 years ago

I've also tried to run the dockerfile myself and have run into this error, if this is of any use:

go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7  
go: downloading github.com/fsnotify/fsnotify v1.4.9  
2022/05/12 03:35:48 [INFO] Pinning versions  
2022/05/12 03:35:48 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod edit -require go.k6.io/k6@latest   
2022/05/12 03:35:48 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17   
2022/05/12 03:35:48 [INFO] Build environment ready  
2022/05/12 03:35:48 [INFO] Building k6  
2022/05/12 03:35:48 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17   
go: finding module for package github.com/grafana/xk6-sql  
k6 imports  
        github.com/grafana/xk6-sql: module github.com/grafana/xk6-sql@latest found (v0.0.0-20220505143442-9c6ae906d6ea,  
 replaced by /go/src/go.k6.io/k6), but does not contain package github.com/grafana/xk6-sql  
2022/05/12 03:35:49 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-05-12-0335.3016591874  
2022/05/12 03:35:49 [FATAL] exit status 1
The command '/bin/sh -c CGO_ENABLED=1 xk6 build     --with github.com/grafana/xk6-sql=.     --output /tmp/k6' returned a non-zero code: 1

EDIT: Changing the run command to not use the c compiler (and use master) seemed to work, since I'm using postgresql anyway.

RUN xk6 build master\ --with github.com/grafana/xk6-sql \ --output /tmp/k6

imiric commented 2 years ago

Hi there!

There is no Docker image for this project on Docker Hub or elsewhere yet. The instructions in the README are to simplify building the extension in order to avoid having to setup Go on your host system, but the recommended approach is still to use xk6 directly.

What command did you run to get that error? I'm not able to reproduce it with the commands from the README and the image builds fine for me.

CGO_ENABLED=1 is only needed for SQLite support, but it won't cause issues with other RDBMSs. Only the build time will be slightly longer.

Building with k6 master is also not necessary. The extension builds fine with the latest k6 as well (v0.38.2). Actually v0.38.2 and master currently point to the same commit (https://github.com/grafana/k6/commit/5c357289fcc7a717a9b39990bd975ea2784b42bc), so there's no difference which is used.

APWHY commented 2 years ago

If I recall correctly the command was just docker build -t testk6 -f <filelocation> .. I'm not sure what was causing the issue since if changing my RUN command didn't actually change anything I have no idea what caused this issue to go away.

APWHY commented 2 years ago

Also, reading your comment made me notice that you did mention in the README that the docker image is supposed to be built from local files, so I'm happy to mark this as closed since that was the initial point of my question. Thanks for the help!