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

--recommended does not work for previous SDK versions #281

Open
vmarkovtsev opened this issue Apr 24, 2019 · 11 comments
Open

--recommended does not work for previous SDK versions #281

vmarkovtsev opened this issue Apr 24, 2019 · 11 comments
Assignees
Labels

Comments

@vmarkovtsev
Copy link
Contributor

vmarkovtsev commented Apr 24, 2019

Using the latest docker image, I run

docker exec -it bblfshd bblfshctl driver install --recommended

This command silently returns and nothing happens. The logs stay silent, no drivers are installed.

Build information
  commit: v2.12.1
  date: 2019-04-10T16:05:44+0000
@vmarkovtsev
Copy link
Contributor Author

vmarkovtsev commented Apr 24, 2019

--all works though.

@dennwc
Copy link
Member

dennwc commented Apr 24, 2019

Is this a -drivers image?

@dennwc dennwc self-assigned this Apr 24, 2019
@vmarkovtsev
Copy link
Contributor Author

@creachadair
Copy link
Contributor

Nope, I followed https://docs.sourced.tech/babelfish/using-babelfish/getting-started

Well, I guess at very least we should call out that distinction in our setup instructions.

@dennwc
Copy link
Member

dennwc commented Apr 24, 2019

Interesting. Sounds like a bug, indeed.

@dennwc dennwc added the bug label Apr 24, 2019
@creachadair
Copy link
Contributor

Repro (macOS):

$ docker volume create bblfshd-cache
$ docker run -d --name bblfshd --privileged -p 9432:9432 -v bblfshd-cache:/var/lib/bblfshd bblfsh/bblfshd
$ docker exec -it bblfshd bblfshctl driver install --recommended
$ docker exec -it bblfshd bblfshctl driver list
<empty>

My first attempt was to just switch to the drivers image:

$ docker run -d --name bblfshd --privileged -p 9432:9432 -v bblfshd-cache:/var/lib/bblfshd bblfsh/bblfshd:v2.12.0-drivers

But then even after docker exec -it bblfshd bblfshctl driver install --recommended the driver list was empty. As @vmarkovtsev pointed out, --all works in this latter case, though.

@creachadair
Copy link
Contributor

Oh, and actually even without switching which image tag I used, --all worked fine (which in retrospect is probably what you meant).

@dennwc
Copy link
Member

dennwc commented Apr 24, 2019

The workaround is to use -drivers images for now. It's the same as --recommended.

@dennwc
Copy link
Member

dennwc commented Apr 24, 2019

OK, I know the reason now.

bblfshd uses either Github or a static driver list for discovery. To know what drivers are recommended, it checks the latest version of each driver and checks if the driver supports the same SDK version as bblfshd.

And recently we did a version bump for SDK and updated all the drivers to Go modules. Now old bblfshd considers all new driver versions incompatible because they use SDKv3, while bblfshd uses SDKv2.

Our mistake was that we did no version bump for drivers during the update. In theory, v2 and v3 drivers are compatible and have no differences in API. However, in practice, the driver discovery now has no way to know which driver uses which SDK version. It will have to scan all git tags to know that.

We will release a new bblfshd with SDKv3 in few days, which will fix this issue. Still, --recommended will not work for old bblfshd versions.

Thus, there is no easy fix for this, sorry. Installing driver with specific versions or using -drivers image is the only way right now.

@dennwc dennwc changed the title --recommended does not work --recommended does not work for previous SDK versions Apr 24, 2019
@vmarkovtsev
Copy link
Contributor Author

I confirm that it works now.

@dennwc
Copy link
Member

dennwc commented Jul 19, 2019

@vmarkovtsev Awesome, thanks for checking it!

Although it works for the current version, we will face the same issue again when switching to v3 when the time will come.

So leaving the issue open to decide what a potential fix may be.

We keep exposing more information in the driver's manifest, so we should be able to correctly identify compatible ones after a few more changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants