Skip to content

Commit

Permalink
Tzx/230627 (#8)
Browse files Browse the repository at this point in the history
* add build script

* update

* update

* not good

* update index

* update

---------

Co-authored-by: TANG ZHIXIONG <zhixiong.tang@momenta.ai>
  • Loading branch information
district10 and zhixiong-tang authored Jun 27, 2023
1 parent cb5e294 commit a39bf38
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 50 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
dist
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ghcr.io/cubao/build-env-manylinux2014-x64:v0.0.3
WORKDIR /index
ADD requirements.txt /index/requirements.txt
ADD docs/requirements.txt /index/docs/requirements.txt
RUN python3 -m pip install -r requirements.txt
42 changes: 40 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
PROJECT_SOURCE_DIR ?= $(abspath ./)
PROJECT_NAME ?= $(shell basename $(PROJECT_SOURCE_DIR))
all:
@echo nothing special

clean:
rm -rf build dist site
force_clean:
Expand All @@ -8,15 +13,48 @@ lint:
pre-commit run -a
lint_install:
pre-commit install
.PHONY: lint lint_install

install:
python3 -m pip install -r requirements.txt
.PHONY: install

docs_build:
mkdocs build
JUPYTER_PLATFORM_DIRS=1 mkdocs build
docs_serve:
mkdocs serve -a 0.0.0.0:8088
.PHONY: docs_build docs_serve

jupyterlab:
jupyter lab --ip=0.0.0.0 --port 8899 --LabApp.token='' --no-browser \
--ServerApp.iopub_msg_rate_limit 10000000
--ServerApp.iopub_msg_rate_limit 10000000 --allow-root
.PHONY: jupyterlab

DOCKER_TAG_WINDOWS ?= ghcr.io/cubao/build-env-windows-x64:v0.0.1
DOCKER_TAG_LINUX ?= ghcr.io/cubao/build-env-manylinux2014-x64:v0.0.3
DOCKER_TAG_MACOS ?= ghcr.io/cubao/build-env-macos-arm64:v0.0.1
DOCKER_TAG_JUPYTERLAB ?= ghcr.io/cubao/build-env-jupyterlab:v0.0.1

docker_build:
docker build -t $(DOCKER_TAG_JUPYTERLAB) -f Dockerfile .
.PHONY: docker_build

test_in_jupyterlab:
docker run --rm -w `pwd` -v `pwd`:`pwd` -it $(DOCKER_TAG_JUPYTERLAB) bash
test_in_win:
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/win:`pwd`/build -it $(DOCKER_TAG_WINDOWS) bash
test_in_mac:
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/mac:`pwd`/build -it $(DOCKER_TAG_MACOS) bash
test_in_linux:
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/linux:`pwd`/build -it $(DOCKER_TAG_LINUX) bash
.PHONY: test_in_jupyterlab test_in_win test_in_mac test_in_linux

DEV_CONTAINER_NAME ?= $(USER)_$(subst /,_,$(PROJECT_NAME)____$(PROJECT_SOURCE_DIR))
DEV_CONTAINER_IMAG ?= $(DOCKER_TAG_JUPYTERLAB)
test_in_dev_container:
docker ps | grep $(DEV_CONTAINER_NAME) \
&& docker exec --network host -it $(DEV_CONTAINER_NAME) bash \
|| docker run --rm --name $(DEV_CONTAINER_NAME) \
--network host --security-opt seccomp=unconfined \
-v `pwd`:`pwd` -w `pwd` -it $(DEV_CONTAINER_IMAG) bash
.PHONY: test_in_dev_container
12 changes: 11 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,22 @@ Let's see what we can bring about.
🎁 Packages
============

**Featured**

| Package | Description |
| :-- | :-- |
| [cmake-example](https://cmake-example.readthedocs.io) | Example pybind11 module built with a CMake-based build system. |
| [concave-hull](https://concave-hull.readthedocs.io) | A very fast 2D concave hull algorithm. |
| [fast-crossing](https://fast-crossing.readthedocs.io) | Fast polyline (line segments) intersection (fast version of bentley-ottmann). |
| [geobuf-cpp](https://geobuf-cpp.readthedocs.io) | C++ port of mapbox/geobuf, and with python binding. |
| [polyline-ruler](https://polyline-ruler.readthedocs.io) | Init from mapbox/cheap-ruler but more than that. |
| [pybind11-rdp](https://pybind11-rdp.readthedocs.io) | C++/pybind11/NumPy implementation of the Ramer-Douglas-Peucker algorithm, a fast and correct drop-in replacement for python [rdp](https://github.com/fhirschmann/rdp) |

![](notebooks/fast-crossing.gif)

**More**

| Package | Description |
| :-- | :-- |
| [cmake-example](https://cmake-example.readthedocs.io) | Example pybind11 module built with a CMake-based build system. |
| [pybind11-union-find](https://pybind11-union-find.readthedocs.io) | C++ version of union-find, with python binding. |
| [ubuntu16.04/open3d](https://github.com/cubao/Open3D) | open3d build scripts and wheels for ubuntu 16.04 (officially not supported now by [isl-org/open3d](https://github.com/isl-org/Open3D) |
18 changes: 9 additions & 9 deletions docs/notebooks/concave-hull.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "fbc23c16-9596-4307-9226-0b8c2cf1def9",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "d0ec51df-f8cd-46c1-b57b-d99d6e12508e",
"metadata": {},
"outputs": [
Expand All @@ -71,7 +71,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2020973d69304d64af75c9d925bfc5d6",
"model_id": "91023e5886f04bd8b4c5072378c43b92",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -85,7 +85,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0920f371566d4a779544464eba7bcc22",
"model_id": "c2447823cd07419583ba6fe06e90b729",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -116,7 +116,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"id": "3d213c2c-ebd3-4e12-8290-7d74e434bf16",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -155,14 +155,14 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "5620feb5-8b26-44bd-b143-b43afbad8d4a",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0eea80261e2542f4b14e8d292c9b6716",
"model_id": "acbe16e108f54f54a5a16d69c3ff21ba",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -176,7 +176,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9b02c5624f8148ae926f992d44121752",
"model_id": "bb1ff0469b0e42b2af9e18d1a0e9d4ab",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -229,7 +229,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
21 changes: 18 additions & 3 deletions docs/notebooks/fast-crossing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,22 @@
"execution_count": 7,
"id": "492f3655-e0dd-403d-b11f-e447e92b303d",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e9b6fceb21bd47148a9e08e3c2000ca5",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import k3d\n",
"import numpy as np\n",
Expand All @@ -155,7 +170,7 @@
"for line in poles:\n",
" plot += k3d.line(line, color=0xff0000)\n",
" \n",
"# plot.display()"
"plot.display()"
]
},
{
Expand Down Expand Up @@ -183,7 +198,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.6"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit a39bf38

Please sign in to comment.