Skip to content

Commit ff3514f

Browse files
author
Saurav Agarwal
committed
Update setup and actions
1 parent 9ce1174 commit ff3514f

File tree

16 files changed

+216
-80
lines changed

16 files changed

+216
-80
lines changed

.github/workflows/cd.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: docker-deploy
22
on:
3+
workflow_dispatch:
34
release:
45
types: [published]
56

7+
env:
8+
FORCE_COLOR: 3
9+
610
jobs:
711
docker-deploy:
812
permissions: write-all
@@ -15,26 +19,26 @@ jobs:
1519
- name: 'CI docker base'
1620
uses: ./.github/docker-base-action
1721
with:
18-
base_tag: pytorch2.2.1-cuda12.3.1-ros2humble
22+
base_tag: pytorch2.2.2-cuda12.2.2-ros2humble
1923
github_token: ${{ secrets.GITHUB_TOKEN }}
2024
- name: cleanup
2125
run: docker system prune -a -f
2226
- name: 'CI docker base'
2327
uses: ./.github/docker-base-action
2428
with:
25-
base_tag: pytorch2.2.1-ros2humble
29+
base_tag: pytorch2.2.2-ros2humble
2630
github_token: ${{ secrets.GITHUB_TOKEN }}
2731
- name: cleanup
2832
run: docker system prune -a -f
2933
- name: 'CI docker base'
3034
uses: ./.github/docker-base-action
3135
with:
32-
base_tag: pytorch2.2.1-cuda12.3.1
36+
base_tag: pytorch2.2.2-cuda12.2.2
3337
github_token: ${{ secrets.GITHUB_TOKEN }}
3438
- name: cleanup
3539
run: docker system prune -a -f
3640
- name: 'CI docker base'
3741
uses: ./.github/docker-base-action
3842
with:
39-
base_tag: pytorch2.2.1
43+
base_tag: pytorch2.2.2
4044
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cd_wheels.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: wheels
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
env:
10+
FORCE_COLOR: 3
11+
12+
jobs:
13+
make_sdist:
14+
name: Make SDist
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Install dependencies
22+
run: sudo bash ./setup_utils/install_dependencies.sh --boost --gmp --mpfr --eigen --cgal
23+
24+
- name: Build SDist
25+
run: pipx run build --sdist
26+
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: cibw-sdist
30+
path: dist/*.tar.gz
31+
32+
build_wheels:
33+
name: Wheel on ${{ matrix.os }}
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: [ubuntu-latest]
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
45+
- uses: pypa/[email protected]
46+
47+
- name: Upload wheels
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
51+
path: wheelhouse/*.whl
52+
53+
upload_all:
54+
needs: [build_wheels, make_sdist]
55+
environment:
56+
name: pypi
57+
url: https://pypi.org/p/coverage-control
58+
permissions:
59+
id-token: write
60+
runs-on: ubuntu-latest
61+
if: github.event_name == 'release' && github.event.action == 'published'
62+
63+
steps:
64+
- uses: actions/download-artifact@v4
65+
with:
66+
pattern: cibw-*
67+
path: dist
68+
merge-multiple: true
69+
70+
- uses: pypa/gh-action-pypi-publish@release/v1
71+
# with:
72+
# Remember to tell (test-)pypi about this repo before publishing
73+
# Remove this line to publish to PyPI
74+
# repository-url: https://test.pypi.org/legacy/

.github/workflows/ghaction-doxygen-ghpages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: doxygen-ghpages
22
on:
3+
workflow_dispatch:
34
release:
45
types: [published]
56
push:
@@ -16,7 +17,7 @@ jobs:
1617
uses: actions/checkout@v4
1718
- name: Action Doxygen and GitHub Pages
1819
id: ghaction
19-
uses: AgarwalSaurav/ghaction-doxygen-ghpages@v2.0.1
20+
uses: AgarwalSaurav/ghaction-doxygen-ghpages@release/v2
2021
with:
2122
github_token: ${{ secrets.GITHUB_TOKEN }}
2223
doxyfile-path: doc/Doxyfile

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ set(CMAKE_CXX_STANDARD 17)
1010
set(CMAKE_CXX_STANDARD_REQUIRED True)
1111
set(CMAKE_COLOR_DIAGNOSTICS True)
1212

13+
if(NOT CMAKE_BUILD_TYPE)
14+
set(CMAKE_BUILD_TYPE Release)
15+
endif()
16+
1317
include(FetchContent)
1418

1519
find_package(Python COMPONENTS Interpreter Development)
@@ -22,7 +26,7 @@ else()
2226
FetchContent_Declare(
2327
pybind11
2428
GIT_REPOSITORY https://github.com/pybind/pybind11.git
25-
GIT_TAG v2.11.1
29+
GIT_TAG v2.12.0
2630
)
2731
FetchContent_MakeAvailable(pybind11)
2832
endif()

cppsrc/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dynamic_version(PROJECT_PREFIX "CoverageControl_" GIT_ARCHIVAL_FILE "${CMAKE_CUR
1212

1313
project(CoverageControl VERSION ${PROJECT_VERSION} LANGUAGES CXX)
1414

15-
if (NOT CMAKE_BUILD_TYPE)
15+
if(NOT CMAKE_BUILD_TYPE)
1616
set(CMAKE_BUILD_TYPE Release)
1717
endif()
1818

cppsrc/core/include/CoverageControl/extern/gnuplot/gnuplot-iostream.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ THE SOFTWARE.
103103

104104
// Patch for Windows by Damien Loison
105105
#ifdef _WIN32
106-
# include <windows.h>
107106
# define GNUPLOT_PCLOSE _pclose
108107
# define GNUPLOT_POPEN _popen
109108
# define GNUPLOT_FILENO _fileno
@@ -113,14 +112,6 @@ THE SOFTWARE.
113112
# define GNUPLOT_FILENO fileno
114113
#endif
115114

116-
#ifdef _WIN32
117-
# define GNUPLOT_ISNAN _isnan
118-
#else
119-
// cppreference.com says std::isnan is only for C++11. However, this seems to work on Linux
120-
// and I am assuming that if isnan exists in math.h then std::isnan exists in cmath.
121-
# define GNUPLOT_ISNAN std::isnan
122-
#endif
123-
124115
// MSVC gives a warning saying that fopen and getenv are not secure. But they are secure.
125116
// Unfortunately their replacement functions are not simple drop-in replacements. The best
126117
// solution is to just temporarily disable this warning whenever fopen or getenv is used.
@@ -141,9 +132,9 @@ THE SOFTWARE.
141132
// "pgnuplot" is considered deprecated according to the Internet. It may be faster. It
142133
// doesn't seem to handle binary data though.
143134
//# define GNUPLOT_DEFAULT_COMMAND "pgnuplot -persist"
144-
// On Windows, gnuplot echos commands to stderr. So we forward its stderr to the bit bucket.
145-
// Unfortunately, this means you will miss out on legitimate error messages.
146-
# define GNUPLOT_DEFAULT_COMMAND "gnuplot -persist 2> NUL"
135+
// The default install path for gnuplot is written here. This way the user doesn't have to add
136+
// anything to their %PATH% environment variable.
137+
# define GNUPLOT_DEFAULT_COMMAND "\"C:\\Program Files\\gnuplot\\bin\\gnuplot.exe\" -persist"
147138
#else
148139
# define GNUPLOT_DEFAULT_COMMAND "gnuplot -persist"
149140
#endif
@@ -510,7 +501,7 @@ template<> struct TextSender< unsigned char> : public CastIntTextSender< unsigne
510501
template <typename T>
511502
struct FloatTextSender {
512503
static void send(std::ostream &stream, const T &v) {
513-
if(GNUPLOT_ISNAN(v)) { stream << "nan"; } else { stream << v; }
504+
if(std::isnan(v)) { stream << "nan"; } else { stream << v; }
514505
}
515506
};
516507
template<> struct TextSender< float> : FloatTextSender< float> { };
@@ -1642,7 +1633,10 @@ struct FileHandleWrapper {
16421633
void fh_close() {
16431634
if(should_use_pclose) {
16441635
if(GNUPLOT_PCLOSE(wrapped_fh)) {
1645-
std::cerr << "pclose returned error: " << strerror(errno) << std::endl;
1636+
perror("pclose");
1637+
//char msg[1000];
1638+
//strerror_s(msg, sizeof(msg), errno);
1639+
//std::cerr << "pclose returned error: " << msg << std::endl;
16461640
}
16471641
} else {
16481642
if(fclose(wrapped_fh)) {

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ skip = ["pp*", "*musllinux*"]
6262
test-skip = ""
6363

6464
# archs = ["x86_64", "aarch64"]
65+
# archs = ["aarch64"]
6566
archs = ["x86_64"]
6667
build-frontend = "default"
6768
config-settings = {}
@@ -71,10 +72,11 @@ build-verbosity = 1
7172

7273
repair-wheel-command = ""
7374

74-
test-command=""
75-
before-test=""
76-
# test-command = "pytest -ra --showlocals --ignore={project}/python/tests/deprecated {project}/python/tests"
77-
# before-test = "pip install pytest torch torchvision torch_geometric"
75+
# test-command=""
76+
# before-test=""
77+
test-command = "pytest -ra --showlocals --ignore={project}/python/tests/deprecated {project}/python/tests/test_coverage_env_utils.py {project}/python/tests/test_coverage.py {project}/python/tests/test_env_io.py {project}/python/tests/test_map_generation.py {project}/python/tests/test_models.py {project}/python/tests/test_package.py {project}/python/tests/test_parameters.py {project}/python/tests/test_parity.py"
78+
79+
before-test = "pip install pytest torch torchvision torch_geometric && wget https://github.com/KumarRobotics/CoverageControl/files/14644475/pytest_data.tar.gz && tar -xvf pytest_data.tar.gz -C python/tests/ && rm pytest_data.tar.gz"
7880
test-requires = []
7981
test-extras = []
8082

python/coverage_control/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66

77
from __future__ import annotations
88

9+
import os.path as _osp
10+
911
from ._version import version as __version__
1012
from .core import *
1113
from .io_utils import IOUtils
1214

1315
# from .nn import *
1416

1517
__all__ = ["__version__", "core", "nn", "IOUtils"]
18+
19+
cmake_prefix_path = _osp.join(_osp.dirname(_osp.dirname(__file__)), "lib", "cmake")

setup.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
#!/usr/bin/env bash
2-
ORIG_INPUT_PARAMS="$@"
3-
params="$(getopt -o d:hctpg -l directory:,help,clean,torch,python,global,with-cuda,with-deps,pip-path: --name "$(basename "$0")" -- "$@")"
4-
5-
if [ $? -ne 0 ]
6-
then
7-
print_usage
8-
fi
9-
102
print_usage() {
11-
printf "bash $0 [-h|--help] [-d|--directory <workspace directory>] [-p|--python] [--with-cuda] [--with-deps] [-g|--global] [-c|--clean] [-t|--torch]\n"
3+
printf "bash %s [-h|--help] [-d|--directory <workspace directory>] [-p|--python] [--with-cuda] [--with-deps] [-g|--global] [-c|--clean] [-t|--torch]\n" "$0"
124
printf "Options:\n"
135
printf " -h, --help : Prints this help message\n"
146
printf " -d, --directory <workspace directory> : Builds and installs the package in the specified directory\n"
@@ -18,6 +10,15 @@ print_usage() {
1810
printf " -g, --global : Installs the package globally. Needs sudo permissions\n"
1911
}
2012

13+
ORIG_INPUT_PARAMS="$@"
14+
15+
params="$(getopt -o d:hctpg -l directory:,help,clean,torch,python,global,with-cuda,with-deps,pip-path: --name "$(basename "$0")" -- "$@")"
16+
17+
if [ $? -ne 0 ]
18+
then
19+
print_usage
20+
fi
21+
2122
eval set -- "$params"
2223
echo "Params: $params"
2324
unset params

setup_utils/docker/base_images/build_all_images.sh

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,29 @@ print_usage() {
44
echo "Example: ./build_all_images.sh ghcr.io/johndoe/repo_name"
55
exit 1
66
}
7-
echo "Building image pytorch2.2.1"
8-
docker buildx build --no-cache -t ${1}:pytorch2.2.1 -f ubuntu22.04.Dockerfile .
9-
docker image tag ${1}:pytorch2.2.1 ghcr.io/${1}:pytorch2.2.1
10-
docker push ${1}:pytorch2.2.1
11-
docker push ghcr.io/${1}:pytorch2.2.1
12-
echo "Building image pytorch2.2.1-cuda12.3.1"
13-
docker buildx build --no-cache -t ${1}:pytorch2.2.1-cuda12.3.1 -f ubuntu22.04-cuda.Dockerfile .
14-
docker image tag ${1}:pytorch2.2.1-cuda12.3.1 ghcr.io/${1}:pytorch2.2.1-cuda12.3.1
15-
docker push ${1}:pytorch2.2.1-cuda12.3.1
16-
docker push ghcr.io/${1}:pytorch2.2.1-cuda12.3.1
17-
echo "Building image pytorch2.2.1-ros2humble"
18-
docker buildx build --no-cache -t ${1}:pytorch2.2.1-ros2humble -f ubuntu22.04-ros2.Dockerfile .
19-
docker image tag ${1}:pytorch2.2.1-ros2humble ghcr.io/${1}:pytorch2.2.1-ros2humble
20-
docker push ${1}:pytorch2.2.1-ros2humble
21-
docker push ghcr.io/${1}:pytorch2.2.1-ros2humble
22-
echo "Building image pytorch2.2.1-cuda12.3.1-ros2humble"
23-
docker buildx build --no-cache -t ${1}:pytorch2.2.1-cuda12.3.1-ros2humble -f ubuntu22.04-cuda-ros2.Dockerfile .
24-
docker image tag ${1}:pytorch2.2.1-cuda12.3.1-ros2humble ghcr.io/${1}:pytorch2.2.1-cuda12.3.1-ros2humble
25-
docker push ${1}:pytorch2.2.1-cuda12.3.1-ros2humble
26-
docker push ghcr.io/${1}:pytorch2.2.1-cuda12.3.1-ros2humble
7+
8+
# Function build image takes 2 arguments: 1. username/repo_name 2. tag_name 3. Dockerfile
9+
# Example: build_image johndoe/repo_name pytorch2.2.2 ubuntu22.04.Dockerfile
10+
build_image() {
11+
echo "Building image $2"
12+
TAG_NAME=$2
13+
docker buildx build --no-cache -t ${1}:${TAG_NAME} -f $3 .
14+
docker push ${1}:${TAG_NAME}
15+
}
16+
17+
echo "Building image pytorch2.2.2-cuda12.2"
18+
TAG_NAME=pytorch2.2.2-cuda12.2.2
19+
# build_image $1 $TAG_NAME ubuntu22.04-cuda.Dockerfile
20+
21+
echo "Building image pytorch2.2.2-ros2humble"
22+
TAG_NAME=pytorch2.2.2-ros2humble
23+
build_image $1 $TAG_NAME ubuntu22.04-ros2.Dockerfile
24+
25+
echo "Building image pytorch2.2.2-cuda12.2.2-ros2humble"
26+
TAG_NAME=pytorch2.2.2-cuda12.2.2-ros2humble
27+
build_image $1 $TAG_NAME ubuntu22.04-cuda-ros2.Dockerfile
28+
29+
echo "Building image pytorch2.2.2"
30+
TAG_NAME=pytorch2.2.2
31+
build_image $1 $TAG_NAME ubuntu22.04.Dockerfile
32+

0 commit comments

Comments
 (0)