ソースを参照

upload prediction container recipe

Lucas Backes 1 週間 前
コミット
88f021cab4
1 ファイル変更78 行追加0 行削除
  1. 78 0
      More/BA_predict.recipe

+ 78 - 0
More/BA_predict.recipe

@@ -0,0 +1,78 @@
+Bootstrap: docker
+From: continuumio/miniconda3:latest
+
+%files
+
+	
+
+%post
+
+	export PATH=/opt/conda/bin:$PATH
+
+	mkdir -p /opt/scripts
+	mkdir /opt/src/
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/entrypoint.sh -O /opt/scripts/entrypoint.sh
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/setup.py -O /opt/src/setup.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/pyproject.toml -O /opt/src/pyproject.toml
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/predict_age_sing.py -O /opt/scripts/predict_age_sing.py
+
+	mkdir -p /opt/masks
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/masks/brainmask_12.8.nii -O /opt/masks/brainmask_12.8.nii
+
+	mkdir -p /opt/trained_models 
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/trained_models/brainageR_S4_R4.gauss.models -O /opt/trained_models/brainageR.S4_R4.gauss.models
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/trained_models/brainageR_S4_R4_pca.gauss.models -O /opt/trained_models/brainageR.S4_R4_pca.gauss.models
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/trained_models/4sites.S0_R4.lasso.models -O /opt/trained_models/4sites.S0_R4.lasso.models
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/trained_models/4sites.S4_R4.gauss.models -O /opt/trained_models/4sites.S4_R4.gauss.models
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/trained_models/4sites.S4_R4_pca.gauss.models -O /opt/trained_models/4sites.S4_R4_pca.gauss.models
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/trained_models/9datasets.S4_R4.gauss.models -O /opt/trained_models/9datasets.S4_R4.gauss.models
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/trained_models/9datasets.S4_R4_pca.gauss.models -O /opt/trained_models/9datasets.S4_R4_pca.gauss.models
+
+
+	mkdir /opt/src/brainage/
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/__init__.py -O /opt/src/brainage/__init__.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/calculate_features.py -O /opt/src/brainage/calculate_features.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/create_splits.py -O /opt/src/brainage/create_splits.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/define_models.py -O /opt/src/brainage/define_models.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/performance_metric.py -O /opt/src/brainage/performance_metric.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/read_data.py -O /opt/src/brainage/read_data.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/xgboost_adapted.py -O /opt/src/brainage/xgboost_adapted.py
+	wget https://gin.g-node.org/juaml/brainage/raw/master/More/brainage/zscore.py -O /opt/src/brainage/zscore.py
+
+	
+	chmod 777 /tmp/
+    chmod 777 /opt/scripts/entrypoint.sh
+	chmod 777 /opt/scripts/predict_age_sing.py
+	chmod 777 /opt/masks/brainmask_12.8.nii
+	
+	apt-get update --allow-releaseinfo-change
+    apt-get install -y --fix-missing libgomp1 wget dpkg 
+
+    
+	NOW=`date`
+	
+    # Initialize conda
+    conda --version
+
+	conda create --name BA_env -c conda-forge python=3.9.1 numpy==1.22.3 matplotlib==3.5.1 nibabel==3.2.2 nilearn==0.9.1 pandas==1.4.2 scipy==1.8.0 seaborn==0.11.2 xgboost==1.6.1 scikit-learn==1.0.2 glmnet
+	. /opt/conda/etc/profile.d/conda.sh
+ 	conda activate BA_env
+	pip install "julearn==0.2.5"
+	pip install git+https://github.com/JamesRitchie/scikit-rvm.git@master
+	cd /opt/src && pip install -e .
+
+%environment
+    export PYTHONPATH=/opt/src
+
+%runscript
+    echo "Container was created $NOW"
+    echo "Arguments received: $*"
+
+    # Activate environment
+    conda init
+    . /opt/conda/etc/profile.d/conda.sh
+    conda activate BA_env
+
+    # Running entrypoint.sh
+    /opt/scripts/entrypoint.sh "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8"
+    echo "Computation finished!"