##// END OF EJS Templates
Update configs
jespinoza -
r9:2e29893b10f5
parent child
Show More
@@ -1,25 +1,25
1 1 # general
2 2 .env
3 3 .DS_store
4 4 *.pyc
5 5 *.sqlite
6 6 # config
7 7 madrigal.cfg
8 8 # metadata
9 9 siteTab.txt
10 10 expTab.txt
11 11 expTabAll.txt
12 12 fileTab.txt
13 13 fileTabAll.txt
14 14 instData.txt
15 15 instDataPriv.txt
16 16 instParmLastUpdate.txt
17 17 instTab.txt
18 18 instType.txt
19 19 siteTab.txt
20 20 typeTab.txt
21 21 instKindatTab.txt
22 22 instParmTab.txt
23 23 parmCodes.txt
24 # experiments
25 24 experiments/
25 static_files/ No newline at end of file
@@ -1,17 +1,17
1 1 FROM python:3.7-slim
2 2
3 3 RUN mkdir /madrigal
4 4
5 5 WORKDIR /madrigal
6 6
7 7 ADD required_modules.txt ./required_modules.txt
8 8
9 9 RUN apt clean && apt update && apt install -y --no-install-recommends \
10 gcc gfortran build-essential automake autotools-dev autoconf m4 libtool hdf5-tools\
10 gcc gfortran build-essential automake autotools-dev autoconf m4 libtool hdf5-tools libhdf5-dev libnetcdf-dev pkg-config\
11 11 && rm -rf /var/lib/apt/lists/*\
12 12 && pip install -r required_modules.txt && pip install django-bootstrap3
13 13
14 14 COPY . ./
15 15
16 16 RUN ln -s /usr/local/bin/python3.7 /madrigal/bin/python && bash installMadrigal
17 17
@@ -1,31 +1,27
1 1 version: '3'
2 2
3 3 services:
4 4 web:
5 5 container_name: 'madrigal'
6 6 build: .
7 7 restart: always
8 8 image: madrigal
9 9 working_dir: /madrigal/source/madpy/djangoMad
10 10 command: gunicorn djangoMad.wsgi --bind 0.0.0.0:8000
11 # command: python manage.py runserver 0.0.0.0:8888
12 11 env_file: .env
13 # ports:
14 # - 8888:8888
15 12 volumes:
16 13 - '${EXP_DIR}:/madrigal/experiments'
17 # - '/usr/local/madrigal/metadata:/madrigal/metadata'
18 - '/home/jespinoza/workspace/madrigal/source/madpy/djangoMad:/madrigal/source/madpy/djangoMad'
14 - './source/madpy/djangoMad:/madrigal/source/madpy/djangoMad'
19 15
20 16 nginx:
21 17 container_name: 'madrigal-nginx'
22 18 image: nginx:1.15-alpine
23 19 volumes:
24 - ./source/madpy/djangoMad/madweb/static:/static
20 - ./source/madpy/djangoMad/static_files:/static
25 21 - ./nginx:/etc/nginx/conf.d
26 22 ports:
27 23 - "${MAD_PORT}:8080"
28 24 depends_on:
29 25 - web
30 26 command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
31 27
@@ -1,299 +1,299
1 1 #!/bin/sh
2 2 #
3 3 # This script installs the entire Madrigal database.
4 4 # Use -c to skip conversion from Madrigal 2->3 files
5 5 #
6 6 # See the latest documentation at http://madrigal.haystack.mit.edu/madrigal/admin.html
7 7 # for the latest installation instructions
8 8 #
9 9 # $Id: installMadrigal 7342 2021-03-29 13:53:30Z brideout $
10 10
11 11 function timer()
12 12 {
13 13 if [[ $# -eq 0 ]]; then
14 14 echo $(date '+%s')
15 15 else
16 16 local stime=$1
17 17 etime=$(date '+%s')
18 18
19 19 if [[ -z "$stime" ]]; then stime=$etime; fi
20 20
21 21 dt=$((etime - stime))
22 22 ds=$((dt % 60))
23 23 dm=$(((dt / 60) % 60))
24 24 dh=$((dt / 3600))
25 25 printf '%d:%02d:%02d' $dh $dm $ds
26 26 fi
27 27 }
28 28
29 29 tmr=$(timer)
30 30
31 31 # verify we are indeed in the right pwd
32 32 if [ ! -f installMadrigal ]
33 33 then
34 34 echo "You must run this script from the MADROOT directory"
35 35 exit -1
36 36 fi
37 37
38 38 # if MADROOT is set, be sure it matches PWD
39 39 if [ "$MADROOT" != "" ]
40 40 then
41 41 if [ $MADROOT != $PWD ]
42 42 then
43 43 echo "Environmental variable MADROOT = $MADROOT does not match PWD = $PWD"
44 44 exit -1
45 45 fi
46 46 else
47 47 export MADROOT=$PWD
48 48 fi
49 49
50 50 # test that h5repack installed
51 51 path_to_executable=$(which h5repack)
52 52 if [ -x "$path_to_executable" ] ; then
53 53 echo "h5repack installed"
54 54 else
55 55 echo "h5repack needs to be installed"
56 56 exit -1
57 57 fi
58 58
59 59
60 60 # check whether test experiments have been installed
61 61 if [[ (! -f experiments/1998/mlh/20jan98/mil980120g.002 ) && ( ! -f experiments/1998/mlh/20jan98/mil980120g.002.hdf5) && ( ! -f experiments/1998/mlh/20jan98/mlh980120g.002.hdf5) ]]
62 62 then
63 63 echo "The standard test data must be installed before installing Madrigal"
64 64 echo "See install instructions at http://madrigal.haystack.mit.edu/madrigal/ad_install.html"
65 65 echo "Standard test experiments can be found at http://madrigal.haystack.mit.edu/madrigal/madDownload.html"
66 66 exit -1
67 67 fi
68 68
69 69 # check if should convert to Madrigal3
70 70 convert=1
71 71 if [ $# -gt 0 ]
72 72 then
73 73 for arg in $@
74 74 do
75 75 if [ $arg = "-c" ]
76 76 then
77 77 convert=0
78 78 fi
79 79 done
80 80 fi
81 81
82 82 echo "Testing that all required python modules are already installed in the default python 3"
83 83 $MADROOT/bin/python testRequirements.py
84 84 if [ $? -ne 0 ]
85 85 then
86 86 exit -1
87 87 fi
88 88
89 89
90 90 echo "Installing Madrigal in $MADROOT"
91 91
92 92 # verify correctness of madrigal.cfg
93 93 if [ ! -f madrigal.cfg ]
94 94 then
95 95 echo
96 96 echo "madrigal.cfg must be created first by copying madrigal.cfg.template and editing as needed"
97 97 exit -1
98 98 else
99 99 $MADROOT/bin/python checkConfig.py
100 100 if [ $? -ne 0 ]
101 101 then
102 102 exit -1
103 103 fi
104 104 fi
105 105
106 106 # Set all file permissions to owner and group write
107 107 echo "********** setPermissions **********"
108 108 $MADROOT/bin/python setPermissions.py
109 109 if [ $? -ne 0 ]
110 110 then
111 111 exit -1
112 112 fi
113 113
114 114 echo "********** configureSource **********"
115 115 $MADROOT/bin/python configureSource.py
116 116 if [ $? -ne 0 ]
117 117 then
118 118 exit -1
119 119 fi
120 120
121 121 # Compile the Libraries and Programs
122 122 # ----------------------------------
123 123 cd source
124 124
125 125
126 126 echo "********** rebuilding dist with autotools **********"
127 127 aclocal
128 128 if [ $? -ne 0 ]
129 129 then
130 130 exit -1
131 131 fi
132 132 autoconf
133 133 if [ $? -ne 0 ]
134 134 then
135 135 exit -1
136 136 fi
137 137 libtoolize
138 138 if [ $? -ne 0 ]
139 139 then
140 140 exit -1
141 141 fi
142 142 autoheader
143 143 if [ $? -ne 0 ]
144 144 then
145 145 exit -1
146 146 fi
147 147 automake --add-missing
148 148 if [ $? -ne 0 ]
149 149 then
150 150 exit -1
151 151 fi
152 152
153 153 echo "********** ./configure **********"
154 ./configure --prefix=$MADROOT
154 ./configure --prefix=$MADROOT FFLAGS=-std=legacy
155 155 if [ $? -ne 0 ]
156 156 then
157 157 exit -1
158 158 fi
159 159
160 160 echo "********** make clean **********"
161 161 make clean
162 162 if [ $? -ne 0 ]
163 163 then
164 164 exit -1
165 165 fi
166 166
167 167 echo "********** make **********"
168 168 make
169 169 if [ $? -ne 0 ]
170 170 then
171 171 exit -1
172 172 fi
173 173
174 174 echo "********** make check **********"
175 175 make check
176 176 if [ $? -ne 0 ]
177 177 then
178 178 exit -1
179 179 fi
180 180
181 181 echo "********** make install **********"
182 182 make install
183 183 if [ $? -ne 0 ]
184 184 then
185 185 exit -1
186 186 fi
187 187
188 188 cd ..
189 189
190 190
191 191 echo "********** configureScripts **********"
192 192 $MADROOT/bin/python configureScripts.py
193 193 if [ $? -ne 0 ]
194 194 then
195 195 exit -1
196 196 fi
197 197
198 198 echo "********** Installing bootstrap calendar **********"
199 199 cd source/madpy/djangoMad/bootstrap_calendar/dist
200 200 rm -rf django-bootstrap-calendar-0.1.0
201 201 tar -xzf django-bootstrap-calendar-0.1.0.tar.gz
202 202 cd django-bootstrap-calendar-0.1.0
203 203 $MADROOT/bin/python setup.py install
204 204 if [ $? -ne 0 ]
205 205 then
206 206 exit -1
207 207 fi
208 208 cd ../../../../../..
209 209
210 210
211 211
212 212 echo "********** Installing madrigal python library **********"
213 213 cd source/madpy
214 214 rm -f -r build
215 215 $MADROOT/bin/python setup.py install
216 216 if [ $? -ne 0 ]
217 217 then
218 218 exit -1
219 219 fi
220 220 rm -f -r build
221 221
222 222 echo "********** Installing madrigalWeb python library **********"
223 223 cd madrigalWeb
224 224 rm -f -r build
225 225 $MADROOT/bin/python setup.py install
226 226 if [ $? -ne 0 ]
227 227 then
228 228 exit -1
229 229 fi
230 230 cd ../../..
231 231
232 232 echo "********** Verifying this site is set to at least 3 in siteTab.txt **********"
233 233 $MADROOT/bin/python source/madpy/scripts/bin/checkSiteIs3.py
234 234 if [ $? -ne 0 ]
235 235 then
236 236 exit -1
237 237 fi
238 238
239 239
240 240 # Install Experiments
241 241 # -------------------
242 242 echo "********** configureExperiments **********"
243 243 chmod +x configureExperiments
244 244 ./configureExperiments
245 245 if [ $? -ne 0 ]
246 246 then
247 247 exit -1
248 248 fi
249 249
250 250 # Update metadata
251 251 # -------------------
252 252 echo "********** Updating metadata tables **********"
253 253 chmod +x -R bin/
254 254 bin/updateMaster
255 255 if [ $? -ne 0 ]
256 256 then
257 257 exit -1
258 258 fi
259 259 echo "********** The following script will create all the summary and hdf5 files needed **********"
260 260 bin/rebuildInstParmTab.py
261 261 if [ $? -ne 0 ]
262 262 then
263 263 exit -1
264 264 fi
265 265
266 266 if [ $convert = 1 ]
267 267 then
268 268 bin/convertToMadrigal3.py --numCPU=2
269 269 if [ $? -ne 0 ]
270 270 then
271 271 exit -1
272 272 fi
273 273 fi
274 274
275 275
276 276 # Test the Libraries and Programs
277 277 echo "********** Testing installation **********"
278 278 # ------------------------------
279 279 bin/testGeolib
280 280 if [ $? -ne 0 ]
281 281 then
282 282 exit -1
283 283 fi
284 284 echo "--diff testGeolib.out source/madf/geolib/testGeolib.out.rock"
285 285 diff testGeolib.out source/madf/geolib/testGeolib.out.rock
286 286
287 287 echo "running test on Madrigal web services..."
288 288 bin/python source/madpy/madrigalWeb/madrigalWeb/examples/testMadrigalWebServices.py
289 289
290 290 echo "checking whether the web server needs extra configuration"
291 291 bin/python source/madpy/scripts/bin/testWebConfig.py
292 292
293 293
294 294 # Install complete
295 295 # ---------------------
296 296 echo ""
297 297 printf 'Elapsed time: %s\n' $(timer $tmr)
298 298 echo "Madrigal installation complete"
299 299
@@ -1,138 +1,139
1 1 """
2 2 Django settings for djangoMad project.
3 3
4 4 For more information on this file, see
5 5 https://docs.djangoproject.com/en/1.7/topics/settings/
6 6
7 7 For the full list of settings and their values, see
8 8 https://docs.djangoproject.com/en/1.7/ref/settings/
9 9 """
10 10
11 11 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12 12 import os
13 13 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
14 14
15 15 # Quick-start development settings - unsuitable for production
16 16 # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
17 17
18 18 # SECURITY WARNING: keep the secret key used in production secret!
19 19 SECRET_KEY = '^c1l3d35+q28^66d2pc1qlu(k$wmw^*gg3rfitz^s)t=9eu1ui'
20 20
21 21 # SECURITY WARNING: don't run with debug turned on in production!
22 22 DEBUG = True
23 23
24 24
25 25 ALLOWED_HOSTS = ['localhost:8000', '127.0.0.1', 'localhost', '10.10.120.60']
26 26
27 27 ADMINS = (('Bill Rideout', 'brideout@haystack.mit.edu'),)
28 28
29 29 EMAIL_HOST = 'hyperion.haystack.mit.edu'
30 30
31 31 SEND_BROKEN_LINK_EMAILS = True
32 32
33 33 MANAGERS = (('Bill Rideout', 'brideout@haystack.mit.edu'),)
34 34
35 35
36 36 # Application definition
37 37
38 38 INSTALLED_APPS = (
39 39 'django.contrib.admin',
40 40 'django.contrib.auth',
41 41 'django.contrib.contenttypes',
42 42 'django.contrib.sessions',
43 43 'django.contrib.messages',
44 44 'django.contrib.staticfiles',
45 45 'madweb',
46 46 'django_bootstrap_calendar',
47 47 'bootstrap3',
48 48 'apps.login',
49 49 'apps.updata',
50 50 )
51 51
52 52 MIDDLEWARE = [
53 53 'django.middleware.security.SecurityMiddleware',
54 54 'django.contrib.sessions.middleware.SessionMiddleware',
55 55 'django.middleware.common.CommonMiddleware',
56 56 'django.middleware.csrf.CsrfViewMiddleware',
57 57 'django.contrib.auth.middleware.AuthenticationMiddleware',
58 58 'django.contrib.messages.middleware.MessageMiddleware',
59 59 'django.middleware.clickjacking.XFrameOptionsMiddleware',
60 60 ]
61 61
62 62 ROOT_URLCONF = 'djangoMad.urls'
63 63
64 64 WSGI_APPLICATION = 'djangoMad.wsgi.application'
65 65
66 66
67 67 TEMPLATES = [
68 68 {
69 69 'BACKEND': 'django.template.backends.django.DjangoTemplates',
70 70 'DIRS': [
71 71 os.path.join(BASE_DIR, "templates"),
72 72 ],
73 73 'APP_DIRS': True,
74 74 'OPTIONS': {
75 75 'context_processors': [
76 76 'django.contrib.auth.context_processors.auth',
77 77 'django.template.context_processors.debug',
78 78 'django.template.context_processors.i18n',
79 79 'django.template.context_processors.media',
80 80 'django.template.context_processors.static',
81 81 'django.template.context_processors.tz',
82 82 'django.contrib.messages.context_processors.messages',
83 83 'django.template.context_processors.request',
84 84 ],
85 85 },
86 86 },
87 87 ]
88 88
89 89
90 90 # Database
91 91 # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
92 92
93 93 DATABASES = {
94 94 'default': {
95 95 'ENGINE': 'django.db.backends.sqlite3',
96 96 'NAME': 'madrigal.sqlite',
97 97 }
98 98 }
99 99
100 100
101 101 # Internationalization
102 102 # https://docs.djangoproject.com/en/1.7/topics/i18n/
103 103
104 104 LANGUAGE_CODE = 'en-us'
105 105
106 106 TIME_ZONE = 'UTC'
107 107
108 108 USE_I18N = True
109 109
110 110 USE_L10N = True
111 111
112 112 USE_TZ = True
113 113
114 114
115 115 # Absolute filesystem path to the directory that will hold user-uploaded files.
116 116 # Example: "/home/media/media.lawrence.com/media/"
117 117 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
118 118
119 119 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
120 120 # trailing slash.
121 121 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
122 122 MEDIA_URL = '/media/'
123 123
124 124 # Absolute path to the directory static files should be collected to.
125 125 # Don't put anything in this directory yourself; store your static files
126 126 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
127 127 # Example: "/home/media/media.lawrence.com/static/"
128 128 # STATIC_ROOT = os.path.join(BASE_DIR, 'static')
129 129
130 130 # URL prefix for static files.
131 131 # Example: "http://media.lawrence.com/static/"
132 132 STATIC_URL = '/madrigal/static/'
133 STATIC_ROOT = '/madrigal/source/madpy/djangoMad/static_files/'
133 134
134 135 BOOTSTRAP3 = {
135 136 # Include jQuery with Bootstrap JavaScript (affects django-bootstrap3 template tags)
136 137 'jquery_url': '/madrigal/static/jquery.min.js',
137 138 'include_jquery': True,
138 139 }
General Comments 0
You need to be logged in to leave comments. Login now