Skip to content

Commit 4a9b9c1

Browse files
committed
Added macOS install script for quick installation of dependencies
1 parent afe4c4b commit 4a9b9c1

File tree

4 files changed

+133
-0
lines changed

4 files changed

+133
-0
lines changed

README.md

100644100755
+6
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ $ git checkout dev
3333
```
3434
Finally, run the installation script for a quick installation of dependencies.
3535

36+
For linux use:
3637
```
3738
$ sh install.sh
3839
```
3940

41+
For macOS use:
42+
```
43+
$ sh macos_install.sh
44+
```
45+
4046
This script is written for Centos. If you are using another operating system, please go through the script and make necessary changes as the script is easy to follow.
4147

4248
Please refer to each module's individual README for additional instructions on configuring, deploying, and using Niffler for each of its modules.

macos_install.sh

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Label</key>
6+
<string>com.niffler.frontend</string>
7+
<key>ProgramArguments</key>
8+
<array>
9+
<string>/opt/Niffler/modules/frontend/service/frontend_service.sh</string>
10+
</array>
11+
<key>RunAtLoad</key>
12+
<true/>
13+
<key>KeepAlive</key>
14+
<dict>
15+
<key>NetworkState</key>
16+
<true/>
17+
</dict>
18+
</dict>
19+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Label</key>
6+
<string>com.example.mdextractor</string>
7+
<key>ProgramArguments</key>
8+
<array>
9+
<string>/opt/localdrive/Niffler/modules/meta-extraction/service/mdextractor.sh</string>
10+
</array>
11+
<key>RunAtLoad</key>
12+
<true/>
13+
<key>KeepAlive</key>
14+
<true/>
15+
<key>EnvironmentVariables</key>
16+
<dict>
17+
<key>MONGO_URI</key>
18+
<string>USERNAME:PASSWORD@localhost:27017/</string>
19+
</dict>
20+
<key>WorkingDirectory</key>
21+
<string>/opt/localdrive/Niffler/modules/meta-extraction/service/</string>
22+
<key>StandardOutPath</key>
23+
<string>/var/log/mdextractor.log</string>
24+
<key>StandardErrorPath</key>
25+
<string>/var/log/mdextractor.log</string>
26+
</dict>
27+
</plist>

0 commit comments

Comments
 (0)