-
Notifications
You must be signed in to change notification settings - Fork 54
/
buildout.cfg
174 lines (153 loc) · 6.2 KB
/
buildout.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
[buildout]
parts =
environment
pg
postgis
pgdata
pgstart
pginit
configs
dssat
syseggs
psycopg2
netcdf4
vic-build
symlinks
paths
earthdata
rheas
test-nowcast-data
test-forecast-data
tests
develop = .
[paths]
recipe = collective.recipe.template
input = src/rpath.in
output = src/rpath.py
[environment]
recipe = collective.recipe.environment
[syseggs]
recipe = osc.recipe.sysegg
eggs =
numpy
gdal
argparse
scipy
dateutil
lxml
h5py
[rheas]
recipe = zc.recipe.egg
interpreter = rheaspy
extra-paths =
${buildout:directory}/lib/python2.7/site-packages
eggs =
rheas
psycopg2
netcdf4
[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
environment = psycopg2-env
[psycopg2-env]
PATH=${buildout:directory}/bin:%(PATH)s
[netcdf4]
recipe = zc.recipe.egg
[pg]
recipe = zc.recipe.cmmi
url = https://ftp.postgresql.org/pub/source/v9.5.3/postgresql-9.5.3.tar.bz2
configure-options = --prefix=${buildout:directory}
[pgdata]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds = ${buildout:directory}/bin/pg_ctl -D ${buildout:directory}/data/postgres initdb
[pgstart]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds = ${buildout:directory}/bin/pg_ctl -D ${buildout:directory}/data/postgres -w start
[pginit]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds =
${buildout:directory}/bin/createuser --superuser --createdb --createrole ${environment:USER}
${buildout:directory}/bin/createdb rheas
echo 'CREATE EXTENSION postgis;CREATE EXTENSION postgis_topology;' | ${buildout:directory}/bin/psql -U ${environment:USER} -d rheas
[postgis]
recipe = zc.recipe.cmmi
url = http://download.osgeo.org/postgis/source/postgis-2.2.2.tar.gz
extra_options =
--with-pgconfig=${buildout:directory}/bin/pg_config
[vic-build]
recipe = collective.recipe.cmd
on_install = true
on_update = true
cmds =
cd ${buildout:directory}/external/VIC/src
make
[symlinks]
recipe = cns.recipe.symlink
symlink =
${buildout:directory}/external/VIC/src/vicNl = ${buildout:directory}/bin/vicNl
${buildout:directory}/external/dssat/DSSAT_Ex.exe = ${buildout:directory}/bin/DSSAT_Ex.exe
${buildout:directory}/external/dssat/DSSAT_EnKF.exe = ${buildout:directory}/bin/DSSAT_EnKF.exe
autocreate = false
[configs]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds =
echo "begin; create schema vic; create schema dssat; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create schema crops; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create table vic.input (resolution double precision,snowbandfile text,vegparam text,veglib text,soilfile text,rootzones integer,basefile text);commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; insert into vic.input values (0.25, 'vic/global_snowbands_0.25deg.txt', 'vic/global_lai_0.25deg.txt', 'vic/vic_veglib.txt', 'vic/global_soil_0.25deg.txt', 2, 'vic/dssat.inp.base'); commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create schema precip; create schema tmax; create schema tmin; create schema wind; create schema lai; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create table dssat.cultivars (gid serial primary key, ensemble int, geom geometry, p1 numeric, p2 numeric, p5 numeric, g2 numeric, g3 numeric, phint numeric, p2r numeric, p2o numeric, g1 numeric, g4 numeric, name text, crop text); commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
gunzip ${buildout:directory}/data/vic/global_snowbands_0.25deg.txt.gz
gunzip ${buildout:directory}/data/vic/global_lai_0.25deg.txt.gz
gunzip ${buildout:directory}/data/vic/global_soil_0.25deg.txt.gz
gunzip ${buildout:directory}/scripts/vicsoils.sql.gz
${buildout:directory}/bin/psql -d rheas -U ${environment:USER} -f ${buildout:directory}/scripts/vicsoils.sql
[dssat]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds =
gunzip ${buildout:directory}/data/crops/mask/modis.cropland.tif.gz
${buildout:directory}/bin/raster2pgsql -d -I -t auto -s 4326 ${buildout:directory}/data/crops/mask/modis.cropland.tif dssat.cropland | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
${buildout:directory}/bin/raster2pgsql -s 4326 -d -t auto -I ${buildout:directory}/data/crops/calendar/Maize.crop.calendar.fill/plant.start.tif crops.plantstart | ${buildout:directory}/bin/psql -d rheas
${buildout:directory}/bin/raster2pgsql -s 4326 -a -t auto -I ${buildout:directory}/data/crops/calendar/Maize.2.crop.calendar.fill/plant.start.tif crops.plantstart | ${buildout:directory}/bin/psql -d rheas
echo "alter table crops.plantstart add column type text;update crops.plantstart set type='maize';" | ${buildout:directory}/bin/psql -d rheas
${buildout:directory}/bin/raster2pgsql -s 4326 -a -t auto -I ${buildout:directory}/data/crops/calendar/Rice.crop.calendar.fill/plant.start.tif crops.plantstart | ${buildout:directory}/bin/psql -d rheas
${buildout:directory}/bin/raster2pgsql -s 4326 -a -t auto -I ${buildout:directory}/data/crops/calendar/Rice.2.crop.calendar.fill/plant.start.tif crops.plantstart | ${buildout:directory}/bin/psql -d rheas
echo "update crops.plantstart set type='rice' where type is null;" | ${buildout:directory}/bin/psql -d rheas
[tests]
recipe = pbp.recipe.noserunner
eggs =
rheas
psycopg2
netcdf4
script = test
[test-nowcast-data]
recipe = collective.recipe.template
input = data/tests/nowcast.in
output = data/tests/nowcast.conf
[test-forecast-data]
recipe = collective.recipe.template
input = data/tests/forecast.in
output = data/tests/forecast.conf
[earthdata]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds =
echo "machine urs.earthdata.nasa.gov login ${environment:EARTHDATA_USER} password ${environment:EARTHDATA_PASSWORD}" > ~/.netrc
[eafrica]
recipe = collective.recipe.cmd
shell = bash
on_install = true
on_update = false
cmds =
sh ${buildout:directory}/scripts/init_db.sh