Skip to content

Commit 51a507d

Browse files
authored
[CI] Refactors directory layout (#80)
1 parent 49989f3 commit 51a507d

36 files changed

+59
-50
lines changed

.github/workflows/cpu-legacy-nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Download
3939
run: |-
4040
kubectl exec -it ${PODNAME} -- \
41-
sh -c 'tar -czf hybridbackend.tgz -C env/build/ .' && \
41+
sh -c 'tar -czf hybridbackend.tgz -C build/auditwheel/ .' && \
4242
kubectl cp ${PODNAME}:hybridbackend.tgz ./hybridbackend.tgz --retries=3 && \
4343
mkdir -p dist && tar -xzf ./hybridbackend.tgz -C dist/
4444
- name: Publish

.github/workflows/cpu-legacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Download
3838
run: |-
3939
kubectl exec -it ${PODNAME} -- \
40-
sh -c 'tar -czf hybridbackend.tgz -C env/build/ .' && \
40+
sh -c 'tar -czf hybridbackend.tgz -C build/auditwheel/ .' && \
4141
kubectl cp ${PODNAME}:hybridbackend.tgz ./hybridbackend.tgz --retries=3 && \
4242
mkdir -p dist && tar -xzf ./hybridbackend.tgz -C dist/
4343
- name: Publish

.github/workflows/cpu-nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Download
3939
run: |-
4040
kubectl exec -it ${PODNAME} -- \
41-
sh -c 'tar -czf hybridbackend.tgz -C env/build/ .' && \
41+
sh -c 'tar -czf hybridbackend.tgz -C build/auditwheel/ .' && \
4242
kubectl cp ${PODNAME}:hybridbackend.tgz ./hybridbackend.tgz --retries=3 && \
4343
kubectl cp ${PODNAME}:nosetests.xml ./nosetests.xml --retries=3 && \
4444
mkdir -p dist && tar -xzf ./hybridbackend.tgz -C dist/

.github/workflows/cpu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Download
3838
run: |-
3939
kubectl exec -it ${PODNAME} -- \
40-
sh -c 'tar -czf hybridbackend.tgz -C env/build/ .' && \
40+
sh -c 'tar -czf hybridbackend.tgz -C build/auditwheel/ .' && \
4141
kubectl cp ${PODNAME}:hybridbackend.tgz ./hybridbackend.tgz --retries=3 && \
4242
mkdir -p dist && tar -xzf ./hybridbackend.tgz -C dist/
4343
- name: Publish

.github/workflows/gpu-nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Download
3939
run: |-
4040
kubectl exec -it ${PODNAME} -- \
41-
sh -c 'tar -czf hybridbackend.tgz -C env/build/ .' && \
41+
sh -c 'tar -czf hybridbackend.tgz -C build/auditwheel/ .' && \
4242
kubectl cp ${PODNAME}:hybridbackend.tgz ./hybridbackend.tgz --retries=3 && \
4343
kubectl cp ${PODNAME}:nosetests.xml ./nosetests.xml --retries=3 && \
4444
mkdir -p dist && tar -xzf ./hybridbackend.tgz -C dist/

.github/workflows/gpu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Download
3838
run: |-
3939
kubectl exec -it ${PODNAME} -- \
40-
sh -c 'tar -czf hybridbackend.tgz -C env/build/ .' && \
40+
sh -c 'tar -czf hybridbackend.tgz -C build/auditwheel/ .' && \
4141
kubectl cp ${PODNAME}:hybridbackend.tgz ./hybridbackend.tgz --retries=3 && \
4242
mkdir -p dist && tar -xzf ./hybridbackend.tgz -C dist/
4343
- name: Publish

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
*.o
55
*.d
66
*.log
7-
build/
8-
dist/
7+
build/lib.*
8+
build/bdist.*
9+
build/temp.*
10+
build/reports/
11+
build/doc/
12+
build/wheel/
13+
build/auditwheel/
914
*.egg-info/
1015
__pycache__/
1116
.pylint.d/

BUILD.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[Docker is the future](https://docs.docker.com/engine/install/)
88

99
```bash
10-
env/run make -j$(nproc)
10+
build/run make -j$(nproc)
1111
```
1212

1313
### 1.2 Use customized container image for developers
@@ -32,7 +32,7 @@ Build HybridBackend on customized developer image, or build and push customized
3232
image from counterpart developer image:
3333

3434
```bash
35-
env/run make -j$(nproc)
35+
build/run make -j$(nproc)
3636
```
3737

3838
Or
@@ -77,7 +77,7 @@ Requirements:
7777
Build & install arrow:
7878

7979
```bash
80-
cd env/arrow/
80+
cd build/arrow/
8181
ARROW_USE_CXX11_ABI=${HYBRIDBACKEND_USE_CXX11_ABI} \
8282
ARROW_HDFS=ON \
8383
ARROW_S3=ON \
@@ -87,12 +87,12 @@ ARROW_S3=ON \
8787
Build & install sparsehash:
8888

8989
```bash
90-
cd env/sparsehash
90+
cd build/sparsehash
9191
./build.sh
9292
```
9393

9494
Install TensorFlow and other requirements, see
95-
[Dockerfiles](env/dockerfiles/) for more detail.
95+
[Dockerfiles](build/dockerfiles/) for more detail.
9696

9797
Configure & build:
9898

@@ -122,7 +122,7 @@ Requirements:
122122
Build & install arrow:
123123

124124
```bash
125-
cd env/arrow/
125+
cd build/arrow/
126126
ARROW_USE_CXX11_ABI=${HYBRIDBACKEND_USE_CXX11_ABI} \
127127
ARROW_HDFS=ON \
128128
ARROW_S3=ON \
@@ -132,7 +132,7 @@ ARROW_S3=ON \
132132
Build & install sparsehash:
133133

134134
```bash
135-
cd env/sparsehash
135+
cd build/sparsehash
136136
./build.sh
137137
```
138138

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ series [How to Contribute to an Open Source Project on GitHub](https://kcd.im/pu
1212
Before any commits, please use below tools to format and check code style:
1313

1414
```bash
15-
env/run tools/format
16-
env/run tools/lint
15+
build/run tools/format
16+
build/run tools/lint
1717
```
1818

1919
Commit message style should follow below format:
@@ -29,8 +29,8 @@ Commit message style should follow below format:
2929
Test your commit using default developer docker:
3030

3131
```bash
32-
env/run make -j8
33-
env/run make test
32+
build/run make -j8
33+
build/run make test
3434
```
3535

3636
Also, CI builds would be triggered if a commit is pushed.

Makefile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ endif
125125

126126
ifneq ($(OS),Darwin)
127127
D_FILES := $(shell \
128-
find \( -path ./env -o -path ./build -o -path ./dist \) \
128+
find \( -path ./build \) \
129129
-prune -false -o -type f -name '*.d' \
130130
-exec realpath {} --relative-to . \;)
131131

@@ -134,7 +134,7 @@ endif
134134

135135
THIRDPARTY_DEPS :=
136136
ifeq ($(HYBRIDBACKEND_WITH_ARROW),ON)
137-
ARROW_HOME ?= env/arrow/dist
137+
ARROW_HOME ?= build/arrow/dist
138138
ARROW_API_H := $(ARROW_HOME)/include/arrow/api.h
139139
THIRDPARTY_DEPS := $(THIRDPARTY_DEPS) $(ARROW_API_H)
140140
CFLAGS := $(CFLAGS) \
@@ -195,7 +195,7 @@ COMMON_LDFLAGS := $(COMMON_LDFLAGS) \
195195
endif
196196

197197
ifeq ($(HYBRIDBACKEND_WITH_SPARSEHASH),ON)
198-
SPARSEHASH_HOME ?= env/sparsehash/dist
198+
SPARSEHASH_HOME ?= build/sparsehash/dist
199199
SPARSEHASH_DENSE_HASH_MAP := $(SPARSEHASH_HOME)/include/sparsehash/dense_hash_map
200200
THIRDPARTY_DEPS := $(THIRDPARTY_DEPS) $(SPARSEHASH_DENSE_HASH_MAP)
201201
CFLAGS := $(CFLAGS) \
@@ -213,8 +213,7 @@ ifeq ($(HYBRIDBACKEND_WITH_TENSORFLOW),ON)
213213
TENSORFLOW_LIB := $(LIBNAME)/tensorflow/lib$(LIBNAME)_tensorflow.so
214214
-include $(LIBNAME)/tensorflow/Makefile
215215
CORE_DEPS := $(CORE_DEPS) $(TENSORFLOW_LIB)
216-
CFLAGS := $(CFLAGS) \
217-
-DHYBRIDBACKEND_TENSORFLOW="$(TENSORFLOW_DISTRO)"
216+
CFLAGS := $(CFLAGS) -DHYBRIDBACKEND_TENSORFLOW=1
218217
ifeq ($(HYBRIDBACKEND_WITH_TENSORFLOW_HALF),ON)
219218
CFLAGS := $(CFLAGS) -DHYBRIDBACKEND_TENSORFLOW_HALF=1
220219
endif
@@ -226,13 +225,13 @@ build: $(CORE_DEPS)
226225
WHEEL_BUILD="$(HYBRIDBACKEND_WHEEL_BUILD)" \
227226
WHEEL_REQUIRES="$(HYBRIDBACKEND_WHEEL_REQUIRES)" \
228227
WHEEL_DEBUG="$(HYBRIDBACKEND_WHEEL_DEBUG)" \
229-
$(PYTHON) setup.py bdist_wheel -d env/dist
230-
@ls env/dist/*.whl
228+
$(PYTHON) setup.py bdist_wheel -d build/wheel
229+
@ls build/wheel/*.whl
231230

232231
.PHONY: doc
233232
doc:
234-
mkdir -p env/dist
235-
sphinx-build -M html docs/ env/dist/doc
233+
mkdir -p build/doc
234+
sphinx-build -M html docs/ build/doc
236235

237236
TESTS := $(shell find hybridbackend/ -type f -name "*_test.py")
238237

@@ -246,8 +245,13 @@ test:
246245

247246
.PHONY: clean
248247
clean:
249-
rm -fr env/dist/
250-
rm -fr build/
248+
rm -fr build/doc/
249+
rm -fr build/reports/
250+
rm -fr build/wheel/
251+
rm -fr build/auditwheel/
252+
rm -fr build/lib.*
253+
rm -fr build/bdist.*
254+
rm -fr build/temp.*
251255
rm -fr *.egg-info/
252256
rm -rf .pylint.d/
253257
find -name *.c -exec rm -fr {} \;

0 commit comments

Comments
 (0)