Skip to content

Commit c848f44

Browse files
committed
upgrade manylinux version
1 parent 21bb13a commit c848f44

File tree

8 files changed

+69
-36
lines changed

8 files changed

+69
-36
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
contents: write
1515
container:
16-
image: fxiangucsd/sapien-build-env:3.4
16+
image: fxiangucsd/sapien-build-env:3.6
1717
env:
1818
CMAKE_BUILD_PARALLEL_LEVEL: 2
1919
steps:
@@ -29,7 +29,7 @@ jobs:
2929
path: docker_sapien_build/_sapien_deps
3030
key: ${{ runner.os }}.${{ hashFiles('**/*.cmake', '**/CMakeLists.txt') }}
3131
- name: Build wheels
32-
run: "git config --global --add safe.directory '*' && ./build.sh"
32+
run: "git config --global --add safe.directory '*' && ./scripts/build.sh"
3333
- name: Upload wheels
3434
uses: actions/upload-artifact@v3
3535
with:

docker/Dockerfile

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
FROM quay.io/pypa/manylinux2014_x86_64:latest
2-
RUN yum update -y && mkdir /workspace
1+
FROM quay.io/pypa/manylinux_2_28_x86_64:latest
32

4-
ENV CC=/opt/rh/devtoolset-10/root/usr/bin/cc CXX=/opt/rh/devtoolset-10/root/usr/bin/c++
5-
ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib PCP_DIR=/opt/rh/devtoolset-10/root DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-10/root MANPATH=/opt/rh/devtoolset-10/root/usr/share/man: PATH=/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
3+
RUN yum install -y libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel zip wget openssh-clients git-lfs gcc-toolset-11
64

7-
# X11
8-
RUN yum install -y libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel zip wget openssh-clients git-lfs
5+
RUN mkdir -p /workspace && cd /workspace && wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \
6+
sh cuda_11.8.0_520.61.05_linux.run --silent --toolkit --toolkitpath=/workspace/cuda --override && rm -f cuda_11.8.0_520.61.05_linux.run
7+
ENV CUDA_PATH=/workspace/cuda PATH="/workspace/cuda/bin:$PATH" LD_LIBRARY_PATH="/workspace/cuda/lib64:$LD_LIBRARY_PATH"
8+
9+
RUN pipx install cmake==3.26.3 --force
10+
11+
RUN /opt/python/cp313-cp313/bin/python -m pip install setuptools wheel
912

1013
# custom auditwheel
11-
RUN /opt/python/cp38-cp38/bin/pip install git+https://github.com/fbxiang/auditwheel.git@088b034ae497b0add794da13f8e0f3b0a3b2d651
12-
RUN echo "#!/opt/python/cp38-cp38/bin/python" > /usr/local/bin/auditwheel && \
14+
RUN /opt/python/cp313-cp313/bin/pip install git+https://github.com/fbxiang/auditwheel.git@fe61bcdfb78f3955d9a3b6fbb05e3852c32239b0
15+
RUN echo "#!/opt/python/cp313-cp313/bin/python" > /usr/local/bin/auditwheel && \
1316
echo "import re, sys" >> /usr/local/bin/auditwheel && \
1417
echo "from auditwheel.main import main" >> /usr/local/bin/auditwheel && \
1518
echo "if __name__ == '__main__':" >> /usr/local/bin/auditwheel && \
1619
echo " sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])" >> /usr/local/bin/auditwheel && \
1720
echo " sys.exit(main())" >> /usr/local/bin/auditwheel
1821

19-
RUN cd /workspace && wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run && \
20-
sh cuda_11.8.0_520.61.05_linux.run --silent --toolkit --toolkitpath=/workspace/cuda --override && rm -f cuda_11.8.0_520.61.05_linux.run
21-
ENV CUDA_PATH=/workspace/cuda PATH="/workspace/cuda/bin:$PATH" LD_LIBRARY_PATH="/workspace/cuda/lib64:$LD_LIBRARY_PATH"
2222

23-
RUN pipx install cmake==3.26.3 --force
24-
ENV PATH=/opt/python/cp311-cp311/bin:$PATH
23+
ENV CC=/opt/rh/gcc-toolset-11/root/usr/bin/cc CXX=/opt/rh/gcc-toolset-11/root/usr/bin/c++
24+
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-11/root/usr/lib64:/opt/rh/gcc-toolset-11/root/usr/lib:/opt/rh/gcc-toolset-11/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-11/root/usr/lib/dyninst PCP_DIR=/opt/rh/gcc-toolset-11/root/ DEVTOOLSET_ROOTPATH=/opt/rh/gcc-toolset-11/root MANPATH=/opt/rh/gcc-toolset-11/root/usr/share/man PATH=/opt/rh/gcc-toolset-11/root/usr/bin:/usr/share/Modules/bin:/opt/rh/gcc-toolset-11/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
25+
26+
ENV PATH=/opt/python/cp313-cp313/bin:$PATH

scripts/apply_license/apply_license.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,59 @@ def has_existing_header(file_content, header):
4040

4141
def has_copyright(file_content):
4242
lines = file_content.splitlines()
43-
header = "\n".join(lines[:20].lower())
43+
header = "\n".join(lines[:20]).lower()
4444
return "copyright" in header or "spdx-license" in header
4545

4646

4747
def has_hillbot_line(file_content):
4848
lines = file_content.splitlines()
49-
header = "\n".join(lines[:5].lower())
49+
header = "\n".join(lines[:5]).lower()
5050
return "hillbot inc" in header
5151

5252

53+
def split_skip(content: str, skip):
54+
skip = [re.compile(s) for s in skip]
55+
lines = content.splitlines()
56+
i = 0
57+
for i, l in enumerate(lines):
58+
if any(s.match(l) for s in skip):
59+
continue
60+
break
61+
head = lines[:i]
62+
tail = lines[i:]
63+
head = "\n".join(head)
64+
tail = "\n".join(tail)
65+
if head != "":
66+
head += "\n"
67+
return head, tail
68+
69+
5370
# Update or add the header to the file
5471
def update_file_header(file_path, header, comment_style):
5572
with open(file_path, "r") as file:
5673
content = file.read()
74+
content_header, content = split_skip(content, comment_style["skip"])
5775

5876
# If the file already has a header, check if it needs to be replaced
5977
if has_existing_header(content, header):
6078
# If the header is already up-to-date, return
6179
if content.startswith(header):
80+
print("Skip:", file_path)
6281
return
6382
# Otherwise, remove the old header
6483
content = re.sub(
6584
r"^{}.*?\n".format(re.escape(comment_style.get("start", ""))), "", content, flags=re.DOTALL
6685
)
6786

6887
if has_copyright(content):
88+
print("Skip 3rd party: ", file_path)
6989
# If there is copyright added by someone else, return
7090
return
7191

7292
# Add the new header
7393
with open(file_path, "w") as file:
74-
file.write(header + content)
94+
print("Apply license: ", file_path)
95+
file.write(content_header + header + content)
7596

7697

7798
# Remove the header from the file
@@ -110,12 +131,18 @@ def process_directory(directory, header_content, comment_styles, delete_mode=Fal
110131
else:
111132
header = generate_header(comment_style, header_content)
112133
update_file_header(file_path, header, comment_style)
134+
else:
135+
print("Skip unknown extension: ", file_path)
113136

114137

115138
def main(config_file, delete_mode=False):
116139
config = load_config(config_file)
117140
header_content = config.get("header_content", [])
118-
comment_styles = config.get("comment_styles", {})
141+
comment_styles = config.get("comment_styles", {}) # lang -> style
142+
comment_styles = dict(
143+
(e, comment_styles[lang]) for lang, exts in config.get("language", {}).items() for e in exts
144+
)
145+
119146
target_files = config.get("target_files", [])
120147
target_directories = config.get("target_directories", [])
121148

scripts/apply_license/license_config.yaml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,48 @@ header_content:
22
- "Copyright 2025 Hillbot Inc."
33
- "Copyright 2020-2024 UCSD SU Lab"
44
- ""
5-
- "Licensed under the Apache License, Version 2.0 (the \"License\");"
5+
- 'Licensed under the Apache License, Version 2.0 (the "License");'
66
- "you may not use this file except in compliance with the License."
77
- "You may obtain a copy of the License at:"
88
- ""
99
- " http://www.apache.org/licenses/LICENSE-2.0"
1010
- ""
1111
- "Unless required by applicable law or agreed to in writing, software"
12-
- "distributed under the License is distributed on an \"AS IS\" BASIS,"
12+
- 'distributed under the License is distributed on an "AS IS" BASIS,'
1313
- "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."
1414
- "See the License for the specific language governing permissions and"
1515
- "limitations under the License."
1616

17+
language:
18+
c: ["h", "hpp", "c", "cpp", "cxx", "cc", "cu", "cuh"]
19+
python: ["py"]
20+
glsl: ["glsl", "vert", "geom", "frag", "comp", "rgen", "rmiss", "rchit", "rahit", "rint"]
1721

1822
comment_styles:
19-
cpp:
23+
c:
2024
start: "/*"
2125
middle: " * "
2226
end: " */"
23-
py:
27+
skip: []
28+
python:
2429
start: "#"
2530
middle: "# "
2631
end: "#"
27-
frag:
28-
start: "//"
29-
middle: "// "
30-
end: "//"
31-
vert:
32-
start: "//"
33-
middle: "// "
34-
end: "//"
35-
comp:
32+
skip: []
33+
glsl:
3634
start: "//"
3735
middle: "// "
3836
end: "//"
37+
skip: ["^\\#version .*$"]
3938

4039
# include
4140
target_files: []
4241

4342
# include
4443
target_directories:
4544
- "include"
45+
- "src"
46+
- "python"
47+
- "vulkan_shader"
48+
# - "3rd_party/sapien-vulkan-2/include"
49+
# - "3rd_party/sapien-vulkan-2/src"

scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function build_pybind() {
7878
if test -f "$WHEEL_NAME"; then
7979
echo "$FILE exist, begin audit and repair"
8080
fi
81-
auditwheel repair ${WHEEL_NAME} --exclude libvulkan,libOpenImageDenoise --internal libsapien,libsvulkan2
81+
auditwheel repair ${WHEEL_NAME} --exclude 'libvulkan*' --exclude 'libOpenImageDenoise*' --internal libsapien --internal libsvulkan2
8282
}
8383

8484
build_sapien

scripts/docker_build_wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
docker run -v `pwd`:/workspace/SAPIEN -it --rm \
44
-u $(id -u ${USER}):$(id -g ${USER}) \
5-
fxiangucsd/sapien-build-env:3.4 bash -c \
5+
fxiangucsd/sapien-build-env:3.6 bash -c \
66
"export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh $1 --profile"

scripts/docker_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rm -f wheelhouse/*.whl
1111

1212
docker run -v `pwd`:/workspace/SAPIEN -it --rm \
1313
-u $(id -u ${USER}):$(id -g ${USER}) \
14-
fxiangucsd/sapien-build-env:3.3 bash -c "export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh ${PYTHON_VERSION}"
14+
fxiangucsd/sapien-build-env:3.6 bash -c "export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh ${PYTHON_VERSION}"
1515

1616
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1717

scripts/docker_install_debug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo Python ${PYTHON_VERSION} detected
88

99
docker run -v `pwd`:/workspace/SAPIEN -it --rm \
1010
-u $(id -u ${USER}):$(id -g ${USER}) \
11-
fxiangucsd/sapien-build-env:latest bash -c "export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh ${PYTHON_VERSION} --debug"
11+
fxiangucsd/sapien-build-env:3.6 bash -c "export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL} && cd /workspace/SAPIEN && ./scripts/build.sh ${PYTHON_VERSION} --debug"
1212

1313
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1414

0 commit comments

Comments
 (0)