Open jcohenadad opened 2 years ago
Why would it be better with a pip command?
It means other projects can build on us in a conventional way and makes it a lot easier to get integrated into people's environments whether conda-based, apt-based, or brew-based. It also imposes or at least strongly encourages many best practices like separating your input data from your source code and using semantic versioning.
I've got the scripts for this ready in other repos. I'll make you a PR and you can see if it makes sense for you.
You were asking for more than I realized, because we need some way to wrap a different team's large collection of C programs inside of python somehow. So it took me all day, but I had a good time anyway working through it. The relationship is almost identical to SCT par rapport de ANTs, and I should be able to repurpose these lessons into there.
I have ANIMA packages over at
You can try them out with
pip install --find-links https://github.com/ivadomed/anima-bin/releases/ ivadomed-anima-bin
Two major problems to resolve:
I don't have a PyPI token for ivadomed
; the PyPI token in ivadomed's secrets is evidently locked down to that specific project.
Who has the rights to the ivadomed PyPI project? I could use my personal PyPI tokens but I'd rather not leave that in place long term.
There's a 100MB limit on PyPI, and ANIMA is ~600MB so even if I do use my personal PyPI token it fails.
I can solve this by splitting it up into sub-packages, but that's going to take more than one day of work.
And two minor problems:
It doesn't work on macOS 10.13
But I think this is more an issue of we need to upgrade our own systems; Github doesn't even provide 10.13 images, 10.15 is the minimum. And actually, despite asking for macos-latest
which is supposed to be macOS 11, the script built for "macos_10_15". So I think 10.13 is probably just too old or something.
I can try building on runs-on: macos-10.15
but I'm skeptical that will make a difference.
I need someone to test Windows for me.
Once this is working, ms-challenge-2021
will have to be reworked to use the new location of the ANIMA apps. It should even simplify the code, since using pip
automatically adds the apps to $PATH
. And of course by using pip
it means we can pin the version down, if we need to. But there's still some hours left before we're there.
And that gives me a fifth thing to solve:
install_requires
and what to put at runtime (import anima.bin; subprocess.check_output([Path(anima.bin.__file__).parent / "animaKMeansClustering", ....])
?).@dyt811 reports that the Windows packages install and at least run --version
without crashing. So that's one issue checked off.
I've split up the package and that successful got it published to (test)PyPI. (there's another copy of everything on GitHub).
There was a bunch of python packaging weeds I had to learn about -- like that the manylinux tags are not generated by wheel
-- you need to either do them manually or have auditwheel
help you figure them out, but even then it's only half helpful in this case because it was written with the strong assumption that it would be running on the same system the compilation happened on -- which is not true here, I'm just repacking someone else's work. But once I got through all that I got it working.
There's still a couple of kinks -- I keep breaking the macOS or Windows builds in subtle ways -- so this version only comes with 6 apps. But the version with all 102 is really close to being ready.
You can try it out with
pip install -i https://test.pypi.org/simple/ ivadomed-anima-bin
And that will get you animaGeneralizedFA
, animaGraphCut
, and some others on your $PATH (only 6 at the moment; but maybe by the time you see this it will get all 102). It should work on all Linux, mac and Windows machines anyone might care to try it on. Not like, a really old Mac system, but I tried it on some of our macOS 10.13 systems (which aren't getting updates anymore and should really be upgraded!) and it even worked there, so I'm feeling pretty confident.
:tada: :+1:
https://github.com/ivadomed/anima-bin/runs/6952221852?check_suite_focus=true:
Now just to tidy the README to make it more presentable and actually do the real builds that publish to real PyPI, and then modify ms-challenge-2021 to actually make use of it.
Hey @kousu, just a quick clarification, does it install the latest anima version when we use pip install ivadomed-anima-bin
? The version that we used for the ms-challenge-2021 was Anima v4.1
but now I see that Anima v4.2
is released.
currently, ANIMA is installed with git clone syntax (see here).
It would be much better if instead we could get ANIMA installed with a pip command that would run the git clone downlaod. Is that something that is doable? @kousu @lifetheater57 @RignonNoel