qiboteam / qibotn

The tensor-network translation module for Qibo.
https://qibo.science
Apache License 2.0
3 stars 1 forks source link

Poetry install might hang in some machines, but there's a workaround. #47

Open liweintu opened 4 months ago

liweintu commented 4 months ago

Some Ubuntu machines might encounter an hanging issue caused by poetry install.

After some investigation, I found it's stuck at keyring, which is a known issue here: https://github.com/python-poetry/poetry/issues/8623

The workaround is export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring, which works for me for now.

alecandido commented 4 months ago

Yes, it was known even in Qibo (@andrea-pasquale wrestled with it for a while, and most likely he was not alone).

However, with the latest Poetry release (i.e. 1.8.0) you don't need any workaround, they added a suitable configuration https://python-poetry.org/docs/configuration/#keyringenabled announced in: https://python-poetry.org/blog/announcing-poetry-1.8.0/#added introduced by: https://github.com/python-poetry/poetry/pull/8910

andrea-pasquale commented 4 months ago

However, with the latest Poetry release (i.e. 1.8.0) you don't need any workaround, they added a suitable configuration https://python-poetry.org/docs/configuration/#keyringenabled announced in: https://python-poetry.org/blog/announcing-poetry-1.8.0/#added introduced by: python-poetry/poetry#8910

Good to know that poetry finally addressed the issue! @alecandido at this point we can propagate this fix in the pyproejct.toml for all our repos, right?

alecandido commented 4 months ago

Yes, @andrea-pasquale, that was part of the reason I mentioned you :)

We are actually always using the latest version in the workflows (i.e. latest release, not the default branch), so the feature is available https://github.com/qiboteam/qibocal/actions/runs/8208980790/job/22453567462#step:4:52

andrea-pasquale commented 4 months ago

Great, I can propagate the change to qibocal.

I've seen that the qrccluster is using poetry 1.7.1. Most of the issues with keyring were happening in the cluster, although if I understand correctly poetry is used just to create the default env for non-developers. That being said it might be worth to keep an eye on this in case we see again something weird happening with poetry and keyring.

alecandido commented 4 months ago

although if I understand correctly poetry is used just to create the default env for non-developers.

Yes, exactly, it is the module load env. You can always install yourself your own Poetry with pipx and similar (or just curl ... | sh the official installer).

That being said it might be worth to keep an eye on this in case we see again something weird happening with poetry and keyring.

Not a bad idea :)

liweintu commented 4 months ago

Thanks @alecandido and @andrea-pasquale for the pointer. This new configuration, as a fix, is much clearer and better organised than the workaround of directly manipulating the environment variable.

As for the env, I believe, most of our folks here use miniforge, even for a cluster, so it's quite similar to a conda env, where poetry lives.

alecandido commented 4 months ago

Thanks @alecandido and @andrea-pasquale for the pointer. This new configuration, as a fix, is much clearer and better organised than the workaround of directly manipulating the environment variable.

No worries, it's a weeks-old fix, against a years-old bug (well, not truly a bug, but definitely an annoying behavior...).