From 913f7acc120923c362f92360bd74c7106b91b59d Mon Sep 17 00:00:00 2001 From: Carmelo Calafiore Date: Sun, 14 Sep 2025 16:30:41 +0100 Subject: [PATCH 1/5] Singularity Container Creation Bug Fixes --- .gitignore | 12 ++++++++++++ requirements.txt | 4 ++-- singularity/Singularity | 5 ++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0d20b64..8f40441 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,13 @@ + +/.idea *.pyc + +/singularity/requirements.txt +/singularity/setup.py +/singularity/synister +/singularity/synister.img +/singularity/src + +/build +/synister.egg-info +/src diff --git a/requirements.txt b/requirements.txt index a471c05..c626229 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,9 +11,9 @@ tqdm tensorboardX notebook==6.1.4 zarr -git+git://github.com/nilsec/pymaid@master +git+https://github.com/nilsec/pymaid@master -e git+https://github.com/funkey/gunpowder@754607abcd3c84ec28c0d2ea257b969934ce986d#egg=gunpowder --e git+https://github.com/funkelab/daisy@0.3-dev#egg=daisy +-e git+https://github.com/funkelab/daisy@master#egg=daisy -e git+https://github.com/funkelab/funlib.learn.torch@636813e60d48379d078b5458e40bdf23269631b3#egg=funlib.learn.torch -e git+https://github.com/funkelab/funlib.show.neuroglancer@master#egg=funlib.show.neuroglancer -e git+https://github.com/funkelab/funlib.math@master#egg=funlib.math diff --git a/singularity/Singularity b/singularity/Singularity index 4537d38..14645ff 100644 --- a/singularity/Singularity +++ b/singularity/Singularity @@ -40,11 +40,10 @@ rm -rf /var/lib/apt/lists/* # install conda -wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh +wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh -b -p /miniconda PATH="/miniconda/bin:$PATH" conda config --set always_yes yes --set changeps1 no -conda update -q conda conda info -a conda install python=3.6 @@ -134,7 +133,7 @@ PYTHONPATH=/src/synister:$PYTHONPATH pip install mahotas pip install pymongo -pip install opencv-python +pip install opencv-python==4.2.0.34 pip install iteration_utilities %environment From 1e6759662f83400fcbd7212f33031b7bbaf39a11 Mon Sep 17 00:00:00 2001 From: Carmelo Calafiore Date: Wed, 17 Sep 2025 12:20:50 +0100 Subject: [PATCH 2/5] Mongo database connection string bug fixes in synister/synister_db.py --- .gitignore | 10 ++++++---- synister/synister_db.py | 37 +++++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 8f40441..8d09bbf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,12 +2,14 @@ /.idea *.pyc +/build +/synister.egg-info +/src + +/data/fafb_v3/mongodb.ini + /singularity/requirements.txt /singularity/setup.py /singularity/synister /singularity/synister.img /singularity/src - -/build -/synister.egg-info -/src diff --git a/synister/synister_db.py b/synister/synister_db.py index 12d4c12..6614fae 100644 --- a/synister/synister_db.py +++ b/synister/synister_db.py @@ -30,11 +30,40 @@ def __init__(self, credentials, db_name): self.credentials["host"] = config.get("Credentials", "host") self.credentials["port"] = config.get("Credentials", "port") - self.auth_string = 'mongodb://{}:{}@{}:{}'.format(self.credentials["user"], - self.credentials["password"], - self.credentials["host"], - self.credentials["port"]) + self.connection = {} + self.connection["is_srv"] = config.get("Connection", "is_srv").lower() + if self.connection["is_srv"] == "true": + self.connection["is_srv"] = True + elif self.connection["is_srv"] == "false": + self.connection["is_srv"] = False + else: + raise ValueError('"is_srv" must be "true" or "false".') + + self.connection["options"] = config.get("Connection", "options") + + auth_string_0 = 'mongodb' + + auth_string_template_1 = '://{user:s}:{password:s}@{host:s}' + + auth_string_1 = auth_string_template_1.format( + user=self.credentials["user"], + password=self.credentials["password"], + host=self.credentials["host"]) + + if self.connection["is_srv"]: + auth_string_0 += '+srv' + elif len(self.credentials["port"]) > 0: + try: + int(self.credentials["port"]) + auth_string_1 += ':' + self.credentials["port"] + except ValueError: + raise ValueError('"port" must only contains numeric characters.') + + self.auth_string = auth_string_0 + auth_string_1 + + if (len(self.connection["options"]) > 0) and self.connection["options"].__contains__('='): + self.auth_string += '/?' + self.connection["options"] self.collections = ["synapses", "skeletons", "hemi_lineages", "meta"] From 749f8330e7fd7b833dacba192760ea315f1c073f Mon Sep 17 00:00:00 2001 From: Carmelo Calafiore Date: Tue, 23 Sep 2025 17:20:47 +0100 Subject: [PATCH 3/5] Update Singularity --- singularity/Singularity | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/singularity/Singularity b/singularity/Singularity index 14645ff..789b132 100644 --- a/singularity/Singularity +++ b/singularity/Singularity @@ -123,7 +123,7 @@ python setup.py build_ext --inplace PYTHONPATH=${FUNLIB_LEARN_ROOT}:$PYTHONPATH # install pytorch -conda install pytorch torchvision cudatoolkit=10.2 -c pytorch +conda install pytorch=1.10.2 torchvision==0.11.3 cudatoolkit=11.3 -c pytorch # install synister cd /src/synister From 979172883281ac04b927e305d9380fce9017b40a Mon Sep 17 00:00:00 2001 From: Carmelo Calafiore Date: Wed, 24 Sep 2025 13:19:16 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1217748..2c0803c 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,16 @@ useful to train and predict in other datasets. ### Installation -1. Singularity +You need to build a Singularity container and conda environment. + +#### Singularity +Install [Singularity](https://github.com/sylabs/singularity/blob/main/INSTALL.md) and then run this: ```console cd singularity make ``` - -2. Conda +#### Conda +Create a conda envirnoment with: ``` conda create -n synister -c conda-forge -c funkey python numpy scipy cython pylp pytorch-gpu conda activate synister From 770249587f2c77211876d870bfb26468a6594a88 Mon Sep 17 00:00:00 2001 From: Carmelo Calafiore Date: Fri, 3 Oct 2025 16:21:56 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c0803c..6e8a47d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ useful to train and predict in other datasets. ### Installation -You need to build a Singularity container and conda environment. +You need to build a Singularity container and a conda environment. #### Singularity Install [Singularity](https://github.com/sylabs/singularity/blob/main/INSTALL.md) and then run this: @@ -39,7 +39,7 @@ cd singularity make ``` #### Conda -Create a conda envirnoment with: +Create a conda environment with: ``` conda create -n synister -c conda-forge -c funkey python numpy scipy cython pylp pytorch-gpu conda activate synister