forked from blue-yonder/turbodbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
488 lines (397 loc) · 16.3 KB
/
Earthfile
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
os-base:
FROM condaforge/mambaforge:latest
ENV DEBIAN_FRONTEND=noninteractive
# set locale to utf-8, which is required for some odbc drivers (mysql);
ENV LC_ALL=C.UTF-8
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y unixodbc odbc-postgresql postgresql-client gnupg apt-transport-https && \
apt-get clean
# we need an mysql odbc driver for the integration tests
# currently the test fail with a newer driver
RUN cd /opt && \
wget -q https://downloads.mysql.com/archives/get/p/10/file/mysql-connector-odbc-5.1.13-linux-glibc2.5-x86-64bit.tar.gz && \
tar xzf mysql-connector-odbc-5.1.13-linux-glibc2.5-x86-64bit.tar.gz && \
mysql-connector-odbc-5.1.13-linux-glibc2.5-x86-64bit/bin/myodbc-installer -d -a -n MySQL -t DRIVER=`ls /opt/mysql-*/lib/libmyodbc*w.so` && \
rm /opt/*.tar.gz
# we need an mssql odbc driver for the integration tests
RUN wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | apt-key add - && \
wget -q https://packages.microsoft.com/config/debian/9/prod.list -O- > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install msodbcsql17 mssql-tools && \
ls -l /opt/microsoft/msodbcsql17/lib64/ && \
odbcinst -i -d -f /opt/microsoft/msodbcsql17/etc/odbcinst.ini
# not used for the moment as Exasol is not tested here
# RUN cd /opt && \
# wget -q https://www.exasol.com/support/secure/attachment/111075/EXASOL_ODBC-6.2.9.tar.gz && \
# tar xzf EXASOL_ODBC-6.2.9.tar.gz && \
# echo "\n[EXASOL]\nDriver=`ls /opt/EXA*/lib/linux/x86_64/libexaodbc-uo2214lv1.so`\nThreading=2\n" >> /etc/odbcinst.ini && \
# rm /opt/*.tar.gz
python:
ARG PYTHON_VERSION=3.8.12
ARG ARROW_VERSION_RULE="<2.0.0"
ARG NUMPY_VERSION_RULE=""
ARG CONDA_EXTRA=""
FROM +os-base
RUN mamba create -y -q -n turbodbc-dev \
c-compiler \
make \
ninja \
cmake \
coveralls \
gmock=1.10.0 \
gtest \
cxx-compiler \
mock \
pytest \
pytest-cov \
python=${PYTHON_VERSION} \
unixodbc \
boost-cpp \
numpy$NUMPY_VERSION_RULE \
pyarrow$ARROW_VERSION_RULE \
pybind11 \
$CONDA_EXTRA
RUN echo "conda activate turbodbc-dev" >> ~/.bashrc
RUN echo 'export UNIXODBC_INCLUDE_DIR=$CONDA_PREFIX/include' >> ~/.bashrc
RUN cd /opt && \
wget -q https://github.com/pybind/pybind11/archive/v2.9.1.tar.gz && \
tar xvf v2.9.1.tar.gz
build:
ARG PYTHON_VERSION=3.8.12
ARG ARROW_VERSION_RULE="<2.0.0"
ARG NUMPY_VERSION_RULE=""
ARG CONDA_EXTRA=""
FROM --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE="$ARROW_VERSION_RULE" \
--build-arg NUMPY_VERSION_RULE="$NUMPY_VERSION_RULE" \
--build-arg CONDA_EXTRA="$CONDA_EXTRA" \
+python
COPY . /src
# remove a potential available host build
RUN rm -rf /src/build && mkdir /src/build
WORKDIR /src/build
ENV ODBCSYSINI=/src/earthly/odbc
ENV TURBODBC_TEST_CONFIGURATION_FILES="query_fixtures_postgresql.json,query_fixtures_mssql.json,query_fixtures_mysql.json"
RUN ln -s /opt/pybind11-2.9.1 /src/pybind11
RUN bash -ic " \
cmake -DBOOST_ROOT=\${CONDA_PREFIX} -DBUILD_COVERAGE=ON \
-DCMAKE_INSTALL_PREFIX=./dist \
-DPYTHON_EXECUTABLE=\$(which python) \
-GNinja .. && \
ninja && \
cmake --build . --target install && \
cd dist && \
python setup.py sdist \
"
SAVE ARTIFACT /src/build/dist/dist /dist
test:
ARG PYTHON_VERSION=3.8.12
ARG ARROW_VERSION_RULE=""
ARG NUMPY_VERSION_RULE=""
ARG CONDA_EXTRA=""
FROM --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE="$ARROW_VERSION_RULE" \
--build-arg NUMPY_VERSION_RULE="$NUMPY_VERSION_RULE" \
--build-arg CONDA_EXTRA="$CONDA_EXTRA" \
+build
WITH DOCKER --compose ../earthly/docker-compose.yml
RUN /bin/bash -ic "\
(r=20;while ! pg_isready --host=localhost --port=5432 --username=postgres ; do ((--r)) || exit; sleep 1 ;done) && \
(r=10;while ! /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'StrongPassword1' -Q 'SELECT @@VERSION' ; do ((--r)) || exit; sleep 3 ;done) && \
sleep 5 && \
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'StrongPassword1' -Q 'CREATE DATABASE test_db' && \
ctest --verbose \
"
END
RUN /bin/bash -ic '\
mkdir ../gcov && cd ../gcov && \
gcov -l -p `find ../build -name "*.gcda"` > /dev/null && \
echo "Removing coverage for boost and C++ standard library" && \
(find . -name "*#boost#*" | xargs rm) || echo "error while removing boost files" && \
(find . -name "*#c++#*" | xargs rm) || echo "error while removing stdlib files" \
'
SAVE ARTIFACT python_cov.xml /result/cov/python/python_cov.xml
SAVE ARTIFACT ../gcov /result/cov/cpp
SAVE ARTIFACT /src/build/dist/dist /result/dist
test-python3.8-arrow1.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=1,<2" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow2.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=2,<3" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow3.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=3,<4" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow4.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=4,<5" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow5.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=5,<6" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow6.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=6,<7" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow7.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=7,<8" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow8.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=8,<9" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow9.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=9,<10" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow10.x.x:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=10,<11" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.8-arrow-nightly:
ARG PYTHON_VERSION="3.8.12"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
--build-arg CONDA_EXTRA="-c arrow-nightlies" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result/$EARTHLY_TARGET_NAME
test-python3.9-arrow1.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=1,<2" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow2.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=2,<3" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow3.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=3,<4" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow4.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=4,<5" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow5.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=5,<6" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow6.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=6,<7" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow7.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=7,<8" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow8.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=8,<9" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow9.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=9,<10" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow10.x.x:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=10,<11" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.9-arrow-nightly:
ARG PYTHON_VERSION="3.9.10"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg NUMPY_VERSION_RULE=">=1.20.0" \
--build-arg CONDA_EXTRA="-c arrow-nightlies" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result/$EARTHLY_TARGET_NAME
test-python3.10-arrow1.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=1,<2" \
--build-arg NUMPY_VERSION_RULE=">=1.21.4" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow2.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=2,<3" \
--build-arg NUMPY_VERSION_RULE=">=1.21.4" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow3.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=3,<4" \
--build-arg NUMPY_VERSION_RULE=">=1.21.4" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow4.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=4,<5" \
--build-arg NUMPY_VERSION_RULE=">=1.21.4" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow5.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=5,<6" \
--build-arg NUMPY_VERSION_RULE=">=1.21.4" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow6.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=6,<7" \
--build-arg NUMPY_VERSION_RULE=">=1.21.2" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow7.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=7,<8" \
--build-arg NUMPY_VERSION_RULE=">=1.21.2" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow8.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=8,<9" \
--build-arg NUMPY_VERSION_RULE=">=1.21.2" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow9.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=9,<10" \
--build-arg NUMPY_VERSION_RULE=">=1.21.2" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow10.x.x:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE=">=10,<11" \
--build-arg NUMPY_VERSION_RULE=">=1.21.2" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result
test-python3.10-arrow-nightly:
ARG PYTHON_VERSION="3.10.2"
COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg NUMPY_VERSION_RULE=">=1.21.4" \
--build-arg CONDA_EXTRA="-c arrow-nightlies" \
+test/result /result
SAVE ARTIFACT /result AS LOCAL result/$EARTHLY_TARGET_NAME
test-python3.8-all:
BUILD test-python3.8-arrow1.x.x
BUILD test-python3.8-arrow2.x.x
BUILD test-python3.8-arrow3.x.x
BUILD test-python3.8-arrow4.x.x
BUILD test-python3.8-arrow5.x.x
BUILD test-python3.8-arrow6.x.x
BUILD test-python3.8-arrow7.x.x
BUILD test-python3.8-arrow8.x.x
BUILD test-python3.8-arrow9.x.x
BUILD test-python3.8-arrow10.x.x
BUILD test-python3.8-arrow-nightly
test-python3.9-all:
BUILD test-python3.9-arrow1.x.x
BUILD test-python3.9-arrow2.x.x
BUILD test-python3.9-arrow3.x.x
BUILD test-python3.9-arrow4.x.x
BUILD test-python3.9-arrow5.x.x
BUILD test-python3.9-arrow6.x.x
BUILD test-python3.9-arrow7.x.x
BUILD test-python3.9-arrow8.x.x
BUILD test-python3.9-arrow9.x.x
BUILD test-python3.9-arrow10.x.x
BUILD test-python3.9-arrow-nightly
test-python3.10-all:
BUILD test-python3.10-arrow1.x.x
BUILD test-python3.10-arrow2.x.x
BUILD test-python3.10-arrow3.x.x
BUILD test-python3.10-arrow4.x.x
BUILD test-python3.10-arrow5.x.x
BUILD test-python3.10-arrow6.x.x
BUILD test-python3.10-arrow7.x.x
BUILD test-python3.10-arrow8.x.x
BUILD test-python3.10-arrow9.x.x
BUILD test-python3.10-arrow10.x.x
BUILD test-python3.10-arrow-nightly
test-all:
BUILD +test-python3.8-all
BUILD +test-python3.9-all
BUILD +test-python3.10-all
docker:
ARG PYTHON_VERSION=3.8.12
ARG ARROW_VERSION_RULE="<2.0.0"
ARG NUMPY_VERSION_RULE="<1.20.0"
FROM --build-arg PYTHON_VERSION="$PYTHON_VERSION" \
--build-arg ARROW_VERSION_RULE="$ARROW_VERSION_RULE" \
--build-arg NUMPY_VERSION_RULE="$NUMPY_VERSION_RULE" \
+build
RUN apt-get install -y vim
CMD ["/bin/bash"]
SAVE IMAGE turbodbc:latest