This message was deleted.
# ask-for-help
s
This message was deleted.
👀 1
🍱 1
🏁 2
a
oh so this is a recent change that we introduce a pytest plugin for bentoml
where it will setup modelstore and bentostore separately from the local store.
m
can I… turn it off? 😆
or more seriously, how do I do it properly now.
a
So you can setup the model via
pytest_collection_modifyitems
Copy code
def pytest_collection_modifyitems(
    session: Session, config: Config, items: list[Item]
) -> None:
    subprocess.check_call([sys.executable, f"{os.path.join(PROJECT_DIR, 'train.py')}"])
and inside
train.py
Copy code
if __name__ == "__main__":
    import python_model

    import bentoml

    bentoml.picklable_model.save_model(
        "py_model.case-1.grpc.e2e",
        python_model.PythonFunction(),
        signatures={
            "predict_file": {"batchable": True},
            "echo_json": {"batchable": True},
            "echo_object": {"batchable": False},
            "echo_ndarray": {"batchable": True},
            "double_ndarray": {"batchable": True},
            "multiply_float_ndarray": {"batchable": True},
            "double_dataframe_column": {"batchable": True},
        },
        external_modules=[python_model],
    )
under
bentoml/testing/server.py
you can find functions that can help you with creating bentos and setup the whole testing lifecycle https://github.com/bentoml/BentoML/blob/632141f197e7e3415781f7545039f318975238de/bentoml/testing/server.py#L428
I will take a look into how to turn this off
gratitude thank you 1
m
I’m sorry, I don’t quite follow. It sounds like you’re describing an entirely different way of doing testing with bentos now. Which is cool! But I’d still like to be able to do it my old-fashioned way, if possible.
a
My initial idea for this is to isolate the testing environment from local environment, but that creates a limitation where you can’t test your current bento
what you can do for now is to pass in
-p no:name
Copy code
pytest -p no:bentoml ...
m
but that creates a limitation where you can’t test your current bento
yeah, that’s a problem for the CI pipeline that I’m building. Basically I’m doing: • import models • bentoml build • run tests (
python -m pytest tests/
) • push to yatai And that’s been working great! Until 1.0.7…
what you can do for now is to pass in
-p no:name
Copy code
pytest -p no:bentoml ...
Thanks, lemme try that.
a
I will put a PR up right now. I will resolve this quickly
m
Thank you. But also, the
-p no:name
works for me, that unblocks me.
👍 1
a
Hi Mike, https://github.com/bentoml/BentoML/pull/3068 is up and we will merge this for 1.0.8