|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +echo "Configuring Niffler" |
| 4 | +sudo chmod -R 777 . |
| 5 | + |
| 6 | +curl -s https://get.nextflow.io | bash |
| 7 | +sudo mv nextflow /usr/local/bin |
| 8 | + |
| 9 | +PIP=`head -n 1 init/pip.out` |
| 10 | +if [ "$PIP" = false ] ; then |
| 11 | + brew install python3 |
| 12 | + echo "Installing pip" |
| 13 | + python3 -m ensurepip |
| 14 | + pip3 install -r requirements.txt |
| 15 | + pip3 install -i https://test.pypi.org/simple/ HITI-anon-internal |
| 16 | + wget https://repo.anaconda.com/archive/Anaconda3-2022.10-MacOSX-arm64.sh |
| 17 | + sh Anaconda3-2022.10-MacOSX-arm64.sh -u |
| 18 | + source ~/.zshrc |
| 19 | + rm Anaconda3-2022.10-MacOSX-arm64.sh |
| 20 | + echo "true" > init/pip.out |
| 21 | +fi |
| 22 | + |
| 23 | +MISC=`head -n 1 init/misc.out` |
| 24 | +if [ "$MISC" = false ] ; then |
| 25 | + echo "Installing gdcm and mail" |
| 26 | + brew install gdcm |
| 27 | + # mailx not availlable for MacOs |
| 28 | + brew install mailutils |
| 29 | + # sendmail-cf not available for MacOS |
| 30 | + chmod +x modules/meta-extraction/service/mdextractor.sh |
| 31 | + # echo "Disable THP" |
| 32 | + # sudo cp init/disable-thp.service /etc/systemd/system/disable-thp.service |
| 33 | + # sudo systemctl daemon-reload |
| 34 | + # sudo systemctl start disable-thp |
| 35 | + # sudo systemctl enable disable-thp |
| 36 | + echo "true" > init/misc.out |
| 37 | +fi |
| 38 | + |
| 39 | + |
| 40 | +DCM4CHE=`head -n 1 init/dcm4che.out` |
| 41 | +if [ "$DCM4CHE" = false ] ; then |
| 42 | + echo "Installing JDK" |
| 43 | + brew tap adoptopenjdk/openjdk |
| 44 | + brew install --cask adoptopenjdk8 |
| 45 | + echo "Installing Maven" |
| 46 | + brew install maven |
| 47 | + echo "Installing DCM4CHE" |
| 48 | + cd .. |
| 49 | + wget https://sourceforge.net/projects/dcm4che/files/dcm4che3/5.22.5/dcm4che-5.22.5-bin.zip/download -O dcm4che-5.22.5-bin.zip |
| 50 | + unzip dcm4che-5.22.5-bin.zip |
| 51 | + rm dcm4che-5.22.5-bin.zip |
| 52 | + cd Niffler |
| 53 | + echo "true" > init/dcm4che.out |
| 54 | +fi |
| 55 | + |
| 56 | +MONGO=`head -n 1 init/mongo.out` |
| 57 | +if [ "$MONGO" = false ] ; then |
| 58 | + echo "Installing mongo" |
| 59 | + brew tap mongodb/brew |
| 60 | + brew install mongodb-community |
| 61 | + brew services start mongodb-community |
| 62 | + brew services enable mongodb-community |
| 63 | + mongosh init/mongoinit.js |
| 64 | + sudo cp modules/meta-extraction/service/mdextractor.plist /Library/LaunchDaemons/ |
| 65 | + sudo launchctl load /Library/LaunchDaemons/mdextractor.plist |
| 66 | + sudo launchctl enable system/mdextractor.plist |
| 67 | + echo "true" > init/mongo.out |
| 68 | +fi |
| 69 | + |
| 70 | +SERVICE=`head -n 1 init/service.out` |
| 71 | +if [ "$SERVICE" = false ] ; then |
| 72 | + echo "Installing Niffler Frontend" |
| 73 | + pip install -r modules/frontend/requirements.txt |
| 74 | + pip install -i https://test.pypi.org/simple/ HITI-anon-internal |
| 75 | + chmod +x modules/frontend/service/frontend_service.sh |
| 76 | + sudo cp modules/frontend/service/niffler.plist /Library/LaunchDaemons/ |
| 77 | + sudo launchctl load -w /Library/LaunchDaemons/niffler.plist |
| 78 | + sudo launchctl enable system/niffler.plist |
| 79 | + echo "true" > init/service.out |
| 80 | +fi |
| 81 | + |
0 commit comments