Skip to content

Commit

Permalink
#314 pre PR version + 327 clean comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelToman committed May 24, 2024
1 parent c71f831 commit 1198488
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 92 deletions.
14 changes: 0 additions & 14 deletions 314_napari_microsam/affogato.eb
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,15 @@ dependencies = [
('Boost', '1.82.0'),
('SciPy-bundle', '2023.07'),
('vigra', '1.11.2'),
# ('bzip2', '1.0.8'),
# ('lz4', '1.9.4'),
# ('XZ', '5.4.2'),
# ('zlib', '1.2.13'),
('xtensor', '0.24.7'),
# ('python-blosc', '1.11.0'),
# ('imageio', '2.33.1'),
('h5py', '3.9.0'),
# ('nlohmann_json', '3.11.2'),
# ('zarr', '2.17.1'),
# ('pybind11', '2.11.1'),
]

# Add flags
configopts = '-DBUILD_PYTHON=ON '
# Fix path to python executable - it finds v3.6.8 from /usr/bin/ without this fix
configopts += '-DPYTHON_EXECUTABLE="$EBROOTPYTHON/bin/python" '

# # export PYTHON_MODULE_INSTALL_DIR to fix make install
# preinstallopts = 'export PYTHON_MODULE_INSTALL_DIR="%(builddir)s/easybuild_obj/python/" '

files_to_copy = [(['python/affogato'], 'lib/python%(pyshortver)s/site-packages')]
# files_to_copy = ['*']

sanity_check_paths = {
'files': [],
Expand Down
19 changes: 1 addition & 18 deletions 314_napari_microsam/elf.eb
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,12 @@ use_pip = True
sanity_pip_check = True

exts_list = [
('structsvm', '0.1.1', {
'checksums': ['3f0c83f33656ebe13516b6dde2911469b6d8f805e024fa7069972a8bcf081f79'],
}),
('ilpy', '0.4.0', {
'checksums': ['5cee3c0e5fe6e48cbb4686a8d8362b5e5fa407ab242c480b3981beb7b3429f0c'],
}),
('nose2', '0.14.1', {
'checksums': ['7f8f03a21c9de2c33015933afcef72bf8e4a2d5dfec3b40092287de6e41b093a'],
}),
('intern', '1.4.1', {
'checksums': ['7cdc6caa66716760f93dbbadaa67cc8a03866d6c5f33a6a3285cb9e5f4994315'],
}),
('motile', '0.2.1', {
'checksums': ['c2cd61e8566198b5a3fdbcb11355837fdcfe82f415bd6d3358ff7acec877ff12'],
}),
('skan', '0.11.1', {
'checksums': ['d5439c17fbf5f86386a7548acb6ab11482961164a6284047b9bdc6652a0d1faf'],
}),
Expand All @@ -67,14 +58,6 @@ exts_list = [
}),
]

# postinstallcmds = [
# 'sed -i "s/np.float/float/g" %(installdir)s/lib/python%(pyshortver)s/site-packages/checkm2/predictQuality.py',
# '%(installdir)s/bin/checkm2 database --download --path %(installdir)s',
# # 'export CHECKM2DB="$EBROOTCHECKM2/CheckM2_database/uniref100.KO.1.dmnd"',
# ]

# modextrapaths = {'CHECKM2DB': 'CheckM2_database/uniref100.KO.1.dmnd', 'PYTHONPATH': ''}

sanity_check_commands = [
"python -c 'import elf.segmentation.multicut'",
"python -c 'import elf.segmentation.features'",
Expand All @@ -86,7 +69,7 @@ sanity_check_commands = [
"python -c 'from elf.evaluation import rand_index'",
"python -c 'from elf.io import open_file'",
"python -c 'from elf.visualisation import visualise_edges'",
"python -c 'import elf.tracking.motile_tracking'",
"python -c 'import elf.tracking.tracking_utils'",
"python -c 'import elf.transformation'",
"python -c 'import elf.util'",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
easyblock = 'PythonBundle'

name = 'micro-sam'
version = '1.0.0'
version = '1.0.1'

homepage = 'https://github.com/computational-cell-analytics/micro-sam/'
description = "Tools for segmentation and tracking in microscopy build on top of SegmentAnything."
Expand All @@ -11,7 +11,6 @@ toolchain = {'name': 'foss', 'version': '2023a'}
# DEPS:
# napari OK
# pyqt OK (in napari)
# $ micro_sam.annotator -> GUI needs more deps:
# zarr OK
# torch OK - torchvision
# vigra NO (not in EB) -> created OK
Expand All @@ -20,7 +19,7 @@ toolchain = {'name': 'foss', 'version': '2023a'}
# z5py -> created OK
# python-xxhash OK
# segment_anything -> created OK
# torch_em >=0.7.0
# torch_em >=0.7.0 -> created OK

dependencies = [
('Python', '3.11.3'),
Expand All @@ -33,6 +32,7 @@ dependencies = [
('z5py', '2.0.17'),
('python-xxhash', '3.4.1'),
('segment-anything', '1.0'),
('torch_em', '0.7.1'),
]

use_pip = True
Expand All @@ -42,18 +42,15 @@ exts_list = [
(name, version, {
'source_urls': ['https://github.com/computational-cell-analytics/micro-sam/archive/'],
'sources': ['v%(version)s.tar.gz'],
'checksums': ['c9bdf7d141911a56062e4df4e0d23a094848a70381b8e09ba9013eea53bbdadd'],
'checksums': ['5b7cc562a639d68de4f9462f3696f17b479ea0d669eaedb34687b65ceac715e9'],
}),
]

# postinstallcmds = [
# 'sed -i "s/np.float/float/g" %(installdir)s/lib/python%(pyshortver)s/site-packages/checkm2/predictQuality.py',
# '%(installdir)s/bin/checkm2 database --download --path %(installdir)s',
# # 'export CHECKM2DB="$EBROOTCHECKM2/CheckM2_database/uniref100.KO.1.dmnd"',
# ]

# modextrapaths = {'CHECKM2DB': 'CheckM2_database/uniref100.KO.1.dmnd', 'PYTHONPATH': ''}

# sanity_check_commands = ["pyscenic --help"]
sanity_check_commands = [
"python -c 'import affogato'",
"python -c 'import napari.viewer'",
"micro_sam.annotator_2d -h",
"micro_sam.annotator_3d -h",
]

moduleclass = 'vis'
28 changes: 6 additions & 22 deletions 314_napari_microsam/nifty.eb
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,31 @@ dependencies = [
('nlohmann_json', '3.11.2'),
('scikit-image', '0.22.0'),
('vigra', '1.11.2'),
# ('zarr', '2.17.1'),
('xtensor', '0.24.7'),
('zlib', '1.2.13'),
('HDF5', '1.14.0'),
]

# # Print out _NUMPY_VALUES - not working
# preconfigopts = "pwd && cd %(builddir)s && pwd && "
# preconfigopts += "sed -i '62 a\message(\"${_NUMPY_VALUES}\")' nifty-1.2.1/cmake/modules/FindNUMPY.cmake && "
# preconfigopts += "cd /tmp/vsc47063/easybuild/build/nifty/1.2.1/foss-2023a/easybuild_obj &&"

# Try find_package (Python3 COMPONENTS Interpreter) - ok, do not help - still python 3.6.8
# preconfigopts = "pwd && cd %(builddir)s && pwd && "
# preconfigopts += "sed -i 's/PythonInterp/Python3 COMPONENTS Interpreter/g' nifty-1.2.1/cmake/modules/FindNUMPY.cmake && "
# preconfigopts += "cd /tmp/vsc47063/easybuild/build/nifty/1.2.1/foss-2023a/easybuild_obj &&"

# Add flags (nifty/.github/workflows/build_unix.sh)
configopts = '-DWITH_QPBO=OFF -DWITH_HDF5=ON -DWITH_Z5=OFF -DWITH_ZLIB=ON -DWITH_CPLEX=OFF -DWITH_GUROBI=OFF '
# Fix path to python executable - it finds v3.6.8 from /usr/bin/ without this fix
configopts += '-DPYTHON_EXECUTABLE="$EBROOTPYTHON/bin/python" -DBUILD_NIFTY_PYTHON=ON '

# # Fix python files path in make install step -> maybe better to export PYTHON_MODULE_INSTALL_DIR
# path = "%(builddir)s/nifty-1.2.1/src/python/CMakeList.txt"
# preinstallopts = "sed -i '44 s/${PYTHON_MODULE_INSTALL_DIR}/\"%(installdir)s/lib/python%(pyshortver)s/site-packages\/"' %s && " % path

# # export PYTHON_MODULE_INSTALL_DIR to fix make install
# preinstallopts = 'export PYTHON_MODULE_INSTALL_DIR="%(installdir)s/lib/python%(pyshortver)s/site-packages" '
# easybuild_obj/python/
# export PYTHON_MODULE_INSTALL_DIR to fix make install
preinstallopts = 'export PYTHON_MODULE_INSTALL_DIR="%(builddir)s/easybuild_obj/python/" '

# separate_build_dir = False

files_to_copy = [(['python/nifty'], 'lib/python%(pyshortver)s/site-packages'),]

sanity_check_paths = {
'files': [],
'dirs': ['lib/python%(pyshortver)s/site-packages/nifty'],
}

sanity_check_commands = ["python -c 'import nifty'"]
# from nifty.graph import UndirectedGraph
sanity_check_commands = [
"python -c 'import nifty'",
"python -c 'from nifty.graph import UndirectedGraph'",
"python -c 'import nifty.tools'",
]

modextrapaths = {'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages'}

Expand Down
45 changes: 27 additions & 18 deletions 314_napari_microsam/torch_em.eb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ toolchain = {'name': 'foss', 'version': '2023a'}
# DEPS:
# "torch", OK
# "h5py" OK
# - affogato NO - should be version from constantinpape
# - affogato ok created
# - bioimageio.spec >=0.5.0 OK exts
# - bioimageio.core >=0.6.0 OK exts
# - cpuonly ??? no
Expand Down Expand Up @@ -46,6 +46,12 @@ toolchain = {'name': 'foss', 'version': '2023a'}
# email-validator 2.1.1 requires dnspython, ok exts
# fire 0.6.0 requires termcolor, ok exts
# bioimageio-spec 0.5.2.post5 has requirement pydantic<3,>=2.6.3, but you have pydantic 2.5.3. -> unpin by preinstallopts
# imports to torch_em from bioimageio.spec:
# bioimageio.spec.model.v0_5
# from bioimageio.spec import save_bioimageio_package
# skimage -> scikit-image (in elf, nifty)
# import skimage.measure
# import skimage.segmentation

builddependencies = [
('maturin', '1.1.0'),
Expand All @@ -54,27 +60,25 @@ builddependencies = [
]
dependencies = [
('Python', '3.11.3'),
# ('Python-bundle-PyPI', '2023.06'),
('torchvision', '0.16.0'),
('h5py', '3.9.0'),
('imagecodecs', '2023.1.23'), # from empanada-dl
('imagecodecs', '2023.1.23'),
('tensorboard', '2.15.1'),
('tqdm', '4.66.1'),
# ('napari', '0.4.18'),
# ('zarr', '2.17.1'),
# ('vigra', '1.11.2'),
('napari', '0.4.18'),
('vigra', '1.11.2'),
('python-elf', '0.5.1'),
# ('z5py', '2.0.17'),
# ('python-xxhash', '3.4.1'),
# ('segment-anything', '1.0'),
('z5py', '2.0.17'),
('pydantic', '2.5.3'),
('xarray', '2023.9.0'),
('affogato', '0.3.3'),
]

use_pip = True
sanity_pip_check = True

# avoid using hatchling as build backend (since installing it for this old Python version is a nightmare)
# copied from MONAI-1.0.1-foss-2022a.eb
local_preinstallopts_termcolor = ' '.join([
r"""sed -i -e 's/^build-backend = .*/build-backend = "setuptools.build_meta"/g' """,
r"""-e 's/^requires = \[/requires = \["setuptools"/g' """,
Expand Down Expand Up @@ -129,6 +133,7 @@ exts_list = [
'checksums': ['3b2851e44a2b074536c36fe3bb05b28dc1413ed358d3edd0eb272b75e6c9ca2b'],
}),
('bioimageio.spec', '0.5.2.post5', {
# delete pin of pydantic version
'preinstallopts': "sed -i 's/pydantic>=2.6.3,<3/pydantic/' setup.py && ",
'checksums': ['3007aedc4da9f77f4fb46f72c134c8367bd469f05f6dd275db1a93f0fff48e97'],
}),
Expand All @@ -139,14 +144,18 @@ exts_list = [
}),
]

# # postinstallcmds = [
# # 'sed -i "s/np.float/float/g" %(installdir)s/lib/python%(pyshortver)s/site-packages/checkm2/predictQuality.py',
# # '%(installdir)s/bin/checkm2 database --download --path %(installdir)s',
# # # 'export CHECKM2DB="$EBROOTCHECKM2/CheckM2_database/uniref100.KO.1.dmnd"',
# # ]

# # modextrapaths = {'CHECKM2DB': 'CheckM2_database/uniref100.KO.1.dmnd', 'PYTHONPATH': ''}

# # sanity_check_commands = ["pyscenic --help"]
sanity_check_commands = [
"python -c 'import torch_em.data.datasets.util'",
"python -c 'import torch_em.transform.label'",
"python -c 'import torch_em.data.sampler'",
"python -c 'import torch_em.segmentation'",
"python -c 'import torch_em.data.datasets.neurips_cell_seg'",
"python -c 'import torch_em.model'",
"python -c 'import torch_em.loss'",
"python -c 'import torch_em.trainer'",
# check if unpined pydantic version is woking
"python -c 'import bioimageio.spec.model.v0_5'",
"python -c 'from bioimageio.spec import save_bioimageio_package'",
]

moduleclass = 'vis'
10 changes: 5 additions & 5 deletions 314_napari_microsam/vigra_v2.eb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ dependencies = [
]

# Fix python files path in make install step
path = "%(builddir)s/%(name)s-Version-1-11-2/config/FindVIGRANUMPY_DEPENDENCIES.cmake"
add = "SET(VIGRANUMPY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/python%(pyshortver)s/site-packages)"
preinstallopts = "sed -i '90,91d' %s && " % path
preinstallopts += "sed -i '94d' %s && " % path
preinstallopts += "sed -i '89 a\%s' %s && " % (add, path)
_py_path = "%(builddir)s/%(name)s-Version-1-11-2/config/FindVIGRANUMPY_DEPENDENCIES.cmake"
_py_add = "SET(VIGRANUMPY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/python%(pyshortver)s/site-packages)"
preinstallopts = "sed -i '90,91d' %s && " % _py_path
preinstallopts += "sed -i '94d' %s && " % _py_path
preinstallopts += "sed -i '89 a\%s' %s && " % (_py_add, _py_path)

sanity_check_paths = {
'files': ['bin/vigra-config'],
Expand Down
1 change: 0 additions & 1 deletion 314_napari_microsam/z5py.eb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ dependencies = [
('pybind11', '2.11.1'),
]

# Add flags
configopts = '-DWITH_ZLIB=ON -DWITH_BZIP2=ON '
# Fix path to python executable - it finds v3.6.8 from /usr/bin/ without this fix
configopts += '-DPYTHON_EXECUTABLE="$EBROOTPYTHON/bin/python" '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ checksums = ['8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa']

builddependencies = [('binutils', '2.40')]

dependencies = [('libgpg-error', '1.48')] # not for 12.3.0 -> ctreated
dependencies = [('libgpg-error', '1.48')]

sanity_check_paths = {
'files': ['bin/libgcrypt-config', 'include/gcrypt.h', 'lib/libgcrypt.%s' % SHLIB_EXT],
Expand Down

0 comments on commit 1198488

Please sign in to comment.