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

missing files or documentation? #7

Open
jkitchin opened this issue Nov 6, 2022 · 4 comments
Open

missing files or documentation? #7

jkitchin opened this issue Nov 6, 2022 · 4 comments

Comments

@jkitchin
Copy link

jkitchin commented Nov 6, 2022

I installed srvc using brew in a Docker image, and then cloned this repo.

In it, the sr review simple command works, but sr review annotate does not, and gives this error:

/usr/bin/env: 'bb': No such file or directory

I guess that the brew recipe does not include: brew install borkdude/brew/babashka. After I do that, and install the default-jre, it seems to work, although when I click on the localhost link that is generated, it shows raw html in the browser (in Codespaces. maybe some mime type is not being sent correctly and it looks like text). When running locally, I can't connect to the port via docker because it seems to make a random port each time, so I don't know in advance what to open. It might be nice if this was configurable.

Are there missing setup instructions? I see a requirements.txt file that suggests a Python venv, and also files that look like a nix virtual env perhaps. I am not familiar with nix, is there something these should be used for?

It seems like you need a python env to run the spacy step. It might be a good idea to describe some step for this, even if it is just pip install -r requirements.txt. I am unable to install the requirements with a typical miniconda installation. There are two issues:

ERROR: Ignored the following versions that require a different python version: 0.7 Requires-Python >=3.6, <3.7; 0.8 Requires-Python >=3.6, <3.7
ERROR: Could not find a version that satisfies the requirement dataclasses==0.8 (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
ERROR: No matching distribution found for dataclasses==0.8

also it seems you can't pip install pkg_resources. Finally, after lowering the dataclasses version to 0.6, and removing pkg_resources, it worked, but with this warning:

/home/vscode/miniconda/lib/python3.9/site-packages/spacy/util.py:865: UserWarning: ÄW095Å Model 'en_tox' (0.1.0) was trained with spaCy v3.0 and may not be 100% compatible with the current version (3.4.1). If you see errors or degraded performance, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate

and it has the same port issue.

It also looks like you need R installed for the srrecogito step. This seems to require pacman, and a user-writable package directory. This also has a port issue in docker, where you have to know in advance what the port is to expose it.

you can see my solutions in https://github.com/Steel-Bank-codespaces/sb-systematic-review/blob/main/.devcontainer/Dockerfile. This is not quite the right solution though, this devcontainer should go in a place like srvc-hello so that it sets up the environment for people working on that project I think.

@tomlue
Copy link
Collaborator

tomlue commented Nov 7, 2022

I'm not sure we want to include things like babashka in the brew recipe. I see a few options:

  1. We host default docker images for all srvc-hello flows with non-srvc dependencies.
  2. We remove all the srvc-hello flows with external dependencies
  3. We provide extensive documentation for what tools are need to make each flow work.

Solution (1) has the advantage that users would only need srvc and docker. But the drawback of being much heavier weight than necessary. It will also give people the impression that docker is necessary for srvc.

Solution (2) is attractive in it's simplicity, but we do need to demonstrate how SRVC can work with python, clojure, R, and rust. We could have separate repos for each of those flows though.

I don't think solution (3) will work. There will be too much documentation, and most people will ignore it. Good error messaging explaining why a flow didn't work might go a long way to solving this issue.

Nix is also a really good solution, but unfortunately requiring a nix-shell will reduce the audience (@jkitchin nix is really awesome and you might want to take a look though).

@john-shaffer do you have an opinion on a good solution? When I come back to this I will probably work on solution (1).

@john-shaffer
Copy link
Collaborator

john-shaffer commented Nov 7, 2022

I've updated srvc-hello to use the CLI html steps for basic labels and recogito, so there is no longer any need for babashka or java at all.

The port is configurable by adding, e.g., port: 5000 to the step in sr.yaml. I've added default ports to sr.yaml to make that more easily discoverable.

I have no idea how to tame python deps without nix. I added a devcontainer config based on the nix derivations, so having either nix or devcontainers installed should result in a working python environment. We can probably provide a pre-built image in the future to speed up the initial setup.

If someone is able to get a requirements.txt working, we can easily import that in nix

@john-shaffer
Copy link
Collaborator

@john-shaffer do you have an opinion on a good solution? When I come back to this I will probably work on solution (1).

(1) seems best. I would like to make as many steps dependency-free as possible, but we will need to support at least python and R-based steps and provide working examples

@john-shaffer
Copy link
Collaborator

john-shaffer commented Nov 7, 2022

All steps should work now using either nix, devcontainers, or Codespaces

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

3 participants