Skip to content

Commit dbe3b3a

Browse files
authored
Merge pull request #271 from abs-tudelft/arrow-3.0
Migrate Arrow to 3.0.0
2 parents a0c620b + 1f2284b commit dbe3b3a

File tree

17 files changed

+119
-75
lines changed

17 files changed

+119
-75
lines changed

.github/workflows/assets.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
CMAKE_VERSION: '3.19.2'
11-
ARROW_VERSION: '1.0.1'
11+
ARROW_VERSION: '3.0.0'
1212

1313
jobs:
1414
archive:
@@ -172,6 +172,7 @@ jobs:
172172
- 'cp36-cp36m'
173173
- 'cp37-cp37m'
174174
- 'cp38-cp38'
175+
- 'cp39-cp39'
175176
steps:
176177
- uses: actions/checkout@v2
177178
with:

.github/workflows/documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: Book
1919
runs-on: ubuntu-latest
2020
env:
21-
MDBOOK_VERSION: '0.4.1'
21+
MDBOOK_VERSION: '0.4.6'
2222
steps:
2323
- uses: actions/checkout@v2
2424
- name: Install mdbook

.github/workflows/examples.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
container: quay.io/pypa/manylinux2014_x86_64:latest
1414
env:
1515
CMAKE_VERSION: '3.17.3'
16-
ARROW_VERSION: '1.0.1'
17-
CPYTHON_VERSION: 'cp35-cp35m'
16+
ARROW_VERSION: '3.0.0'
17+
CPYTHON_VERSION: 'cp36-cp36m'
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Install Apache Arrow
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
needs: prepare
4242
env:
43-
PYTHON_VERSION: '3.5.x'
43+
PYTHON_VERSION: '3.6.x'
4444
strategy:
4545
fail-fast: false
4646
matrix:

.github/workflows/test.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
ARROW_VERSION: '1.0.1'
10+
ARROW_VERSION: '3.0.0'
1111

1212
jobs:
1313
cpp:
@@ -60,16 +60,21 @@ jobs:
6060
sudo apt-get install -y ./apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb
6161
sudo apt-get update
6262
sudo apt-get install -y libarrow-dev=$ARROW_VERSION-1 libarrow-python-dev=$ARROW_VERSION-1
63+
- uses: actions/setup-python@v2
64+
with:
65+
python-version: '3.x'
6366
- name: Install pyarrow
64-
run: pip3 install pyarrow==$ARROW_VERSION setuptools wheel
67+
run: |
68+
python -m pip install --upgrade pip setuptools wheel
69+
python -m pip install pyarrow==$ARROW_VERSION
6570
- name: Build and install
6671
working-directory: ${{ matrix.source }}
6772
run: |
68-
python3 setup.py build
69-
python3 setup.py bdist_wheel
70-
pip3 install build/dist/*.whl
73+
python setup.py build
74+
python setup.py bdist_wheel
75+
python -m pip install build/dist/*.whl
7176
- name: Import
72-
run: python3 -c "import ${{ matrix.package }}"
77+
run: python -c "import ${{ matrix.package }}"
7378

7479
vhdl:
7580
name: VHDL

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ generates the following:
5050
- Structs
5151
- Validity bitmaps
5252

53-
- Once the Arrow reference implementation and format specific reaches ensured
54-
stability (i.e. version 1.0), we would like to support:
53+
- In the future we would like to support:
5554
- Sparse and dense unions
5655
- Dictionaries
5756
- Chunked tabular structures (`Arrow::Table`)
@@ -128,15 +127,18 @@ External projects using Fletcher:
128127
- [Posit PairHMM](https://github.com/lvandam/pairhmm_posit_hdl_arrow)
129128

130129
## Publications
130+
131131
If you used or studied Fletcher, please cite:
132+
132133
- J. Peltenburg, J. van Straten, L. Wijtemans, L. van Leeuwen, Z. Al-Ars, and
133134
H.P. Hofstee, Fletcher: A Framework to Efficiently Integrate FPGA Accelerators
134-
with Apache Arrow*, in 29th International Conference on Field Programmable
135+
with Apache Arrow\*, in 29th International Conference on Field Programmable
135136
Logic and Applications (FPL) (2019) pp. 270–277.
136137

137138
Additional publications:
139+
138140
- J. Peltenburg, J. van Straten, M. Brobbel, H.P. Hofstee, and Z. Al-Ars,
139141
Supporting Columnar In-memory Formats on FPGA: The Hardware Design of Fletcher
140-
for Apache Arrow*, in Applied Reconfigurable Computing, edited by
141-
C. Hochberger, B. Nelson, A. Koch, R. Woods, and P. Diniz (Springer
142+
for Apache Arrow\*, in Applied Reconfigurable Computing, edited by
143+
C. Hochberger, B. Nelson, A. Koch, R. Woods, and P. Diniz (Springer
142144
International Publishing, Cham, 2019) pp. 32–47

codegen/cpp/fletchgen/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project(fletchgen
77
LANGUAGES CXX
88
)
99

10-
find_package(Arrow 1.0 CONFIG REQUIRED)
10+
find_package(Arrow 3.0.0 CONFIG REQUIRED)
1111

1212
include(FindThreads)
1313
include(FetchContent)
@@ -197,7 +197,7 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR}")
197197
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
198198
set(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
199199
set(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0")
200-
set(CPACK_RPM_PACKAGE_REQUIRES "arrow-libs >= 1.0.1, arrow-libs < 2.0.0")
200+
set(CPACK_RPM_PACKAGE_REQUIRES "arrow-libs >= 3.0.0, arrow-libs < 4.0.0")
201201

202202
set(CPACK_ARCHIVE_BINARY_FILE_NAME "${CMAKE_PROJECT_NAME}-${fletchgen_VERSION}-${CMAKE_SYSTEM_NAME}")
203203

codegen/cpp/fletchgen/README.md

+17-13
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ It currently supports only two top-level platforms.
3737
# Prerequisites
3838

3939
- [C++17 compliant compiler](https://clang.llvm.org/)
40-
- [Apache Arrow 1.0+](https://github.com/apache/arrow)
40+
- [Apache Arrow 3.0+](https://github.com/apache/arrow)
4141
- [CMake 3.14+](https://cmake.org/)
4242

4343
# Build & install
@@ -95,6 +95,7 @@ your kernel implementation.
9595
| fletcher_tag_width | 1 / 2 / 3 / ... | 1 | Width of the `tag` field of commands and unlock streams of RecordBatchReaders/Writers. Can be used to identify commands. |
9696

9797
# Custom MMIO registers
98+
9899
You can add custom MMIO registers to your kernel using `--reg`.
99100
More information [can be found here](../../../docs/mmio.md).
100101

@@ -114,32 +115,35 @@ bit.
114115
- record:
115116
name: platform
116117
fields:
117-
- record:
118-
name: complete
119-
fields:
120-
- field:
121-
name: req
122-
width: 1
123-
- field:
124-
name: ack
125-
width: 1
126-
reverse: true
118+
- record:
119+
name: complete
120+
fields:
121+
- field:
122+
name: req
123+
width: 1
124+
- field:
125+
name: ack
126+
width: 1
127+
reverse: true
127128
```
128129
129130
This will result in the following signals appearing at the top-level:
131+
130132
```vhdl
131133
ext_platform_complete_req : out std_logic;
132134
ext_platform_complete_ack : in std_logic
133135
```
134136
135-
* The signals are assumed to be driven by the kernel. To drive them from the top
137+
- The signals are assumed to be driven by the kernel. To drive them from the top
136138
level, use:
139+
137140
```yaml
138141
reverse: true
139142
```
140143
141-
* Fields with a width of 1 can be forced to be `std_logic_vector` instead of
144+
- Fields with a width of 1 can be forced to be `std_logic_vector` instead of
142145
`std_logic` by using:
146+
143147
```yaml
144148
vector: true
145149
```

codegen/cpp/fletchgen/test/fletchgen/srec/test_srec.cc

+23-12
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,22 @@ namespace fletchgen::srec {
3838
*/
3939

4040
TEST(SREC, ToString) {
41-
uint8_t data0[16] = {0x28, 0x5F, 0x24, 0x5F, 0x22, 0x12, 0x22, 0x6A, 0x00, 0x04, 0x24, 0x29, 0x00, 0x08, 0x23, 0x7C};
42-
uint8_t data1[16] = {0x00, 0x02, 0x00, 0x08, 0x00, 0x08, 0x26, 0x29, 0x00, 0x18, 0x53, 0x81, 0x23, 0x41, 0x00, 0x18};
43-
uint8_t data2[16] = {0x41, 0xE9, 0x00, 0x08, 0x4E, 0x42, 0x23, 0x43, 0x00, 0x18, 0x23, 0x42, 0x00, 0x08, 0x24, 0xA9};
41+
uint8_t data0[16] = {0x28, 0x5F, 0x24, 0x5F, 0x22, 0x12, 0x22, 0x6A,
42+
0x00, 0x04, 0x24, 0x29, 0x00, 0x08, 0x23, 0x7C};
43+
uint8_t data1[16] = {0x00, 0x02, 0x00, 0x08, 0x00, 0x08, 0x26, 0x29,
44+
0x00, 0x18, 0x53, 0x81, 0x23, 0x41, 0x00, 0x18};
45+
uint8_t data2[16] = {0x41, 0xE9, 0x00, 0x08, 0x4E, 0x42, 0x23, 0x43,
46+
0x00, 0x18, 0x23, 0x42, 0x00, 0x08, 0x24, 0xA9};
4447
uint8_t data3[4] = {0x00, 0x14, 0x4E, 0xD4};
4548
// Check header record. Default header is similar to example.
4649
ASSERT_EQ(Record::Header().ToString(), "S00600004844521B");
4750
// Check other records
48-
ASSERT_EQ(Record::Data<16>(0x00, data0, 16).ToString(), "S1130000285F245F2212226A000424290008237C2A");
49-
ASSERT_EQ(Record::Data<16>(0x10, data1, 16).ToString(), "S11300100002000800082629001853812341001813");
50-
ASSERT_EQ(Record::Data<16>(0x20, data2, 16).ToString(), "S113002041E900084E42234300182342000824A952");
51+
ASSERT_EQ(Record::Data<16>(0x00, data0, 16).ToString(),
52+
"S1130000285F245F2212226A000424290008237C2A");
53+
ASSERT_EQ(Record::Data<16>(0x10, data1, 16).ToString(),
54+
"S11300100002000800082629001853812341001813");
55+
ASSERT_EQ(Record::Data<16>(0x20, data2, 16).ToString(),
56+
"S113002041E900084E42234300182342000824A952");
5157
ASSERT_EQ(Record::Data<16>(0x30, data3, 4).ToString(), "S107003000144ED492");
5258
}
5359

@@ -64,9 +70,12 @@ TEST(SREC, FromString) {
6470

6571
TEST(SREC, File) {
6672
// Test a round trip via a file.
67-
uint8_t data[52] = {0x28, 0x5F, 0x24, 0x5F, 0x22, 0x12, 0x22, 0x6A, 0x00, 0x04, 0x24, 0x29, 0x00, 0x08, 0x23, 0x7C,
68-
0x00, 0x02, 0x00, 0x08, 0x00, 0x08, 0x26, 0x29, 0x00, 0x18, 0x53, 0x81, 0x23, 0x41, 0x00, 0x18,
69-
0x41, 0xE9, 0x00, 0x08, 0x4E, 0x42, 0x23, 0x43, 0x00, 0x18, 0x23, 0x42, 0x00, 0x08, 0x24, 0xA9,
73+
uint8_t data[52] = {0x28, 0x5F, 0x24, 0x5F, 0x22, 0x12, 0x22, 0x6A,
74+
0x00, 0x04, 0x24, 0x29, 0x00, 0x08, 0x23, 0x7C,
75+
0x00, 0x02, 0x00, 0x08, 0x00, 0x08, 0x26, 0x29,
76+
0x00, 0x18, 0x53, 0x81, 0x23, 0x41, 0x00, 0x18,
77+
0x41, 0xE9, 0x00, 0x08, 0x4E, 0x42, 0x23, 0x43,
78+
0x00, 0x18, 0x23, 0x42, 0x00, 0x08, 0x24, 0xA9,
7079
0x00, 0x14, 0x4E, 0xD4};
7180
// Check header record. Default header is similar to example.
7281
auto sro = File(0, data, 52);
@@ -75,7 +84,7 @@ TEST(SREC, File) {
7584
ofs.close();
7685
auto ifs = std::ifstream("srec_file_test.srec");
7786
auto sri = File(&ifs);
78-
uint8_t* result;
87+
uint8_t *result;
7988
size_t size;
8089
sri.ToBuffer(&result, &size);
8190
ASSERT_EQ(memcmp(data, result, 52), 0);
@@ -86,12 +95,14 @@ TEST(SREC, RecordBatchRoundTrip) {
8695
// Get a recordbatch with some integers
8796
auto rb = fletcher::GetStringRB();
8897
// Open an Arrow FileOutputStream
89-
arrow::Result<std::shared_ptr<arrow::io::OutputStream>> result = arrow::io::FileOutputStream::Open("test.rbf");
98+
arrow::Result<std::shared_ptr<arrow::io::OutputStream>>
99+
result = arrow::io::FileOutputStream::Open("test.rbf");
90100

91101
EXPECT_TRUE(result.ok());
92102
std::shared_ptr<arrow::io::OutputStream> aos = result.ValueOrDie();
93103
// Create a RecordBatchFile writer
94-
arrow::Result<std::shared_ptr<arrow::ipc::RecordBatchWriter>> afw = arrow::ipc::NewFileWriter(aos.get(), rb->schema());
104+
arrow::Result<std::shared_ptr<arrow::ipc::RecordBatchWriter>>
105+
afw = arrow::ipc::MakeFileWriter(aos.get(), rb->schema());
95106
EXPECT_TRUE(afw.ok());
96107

97108
// Write the RecordBatch to the FileOutputStream

codegen/python/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ def initialize_options(self):
127127
install_requires=[
128128
'numpy >= 1.14',
129129
'pandas',
130-
'pyarrow == 1.0.1',
130+
'pyarrow == 3.0.0',
131131
],
132132
setup_requires=[
133133
'cython',
134134
'numpy',
135-
'pyarrow == 1.0.1',
135+
'pyarrow == 3.0.0',
136136
'plumbum'
137137
],
138138
classifiers=[

common/cpp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
22

33
project(fletcher_common VERSION 0.0.0 LANGUAGES CXX)
44

5-
find_package(Arrow 1.0 CONFIG REQUIRED)
5+
find_package(Arrow 3.0.0 CONFIG REQUIRED)
66

77
include(FetchContent)
88

0 commit comments

Comments
 (0)