Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nightly #1906

Draft
wants to merge 100 commits into
base: develop
Choose a base branch
from
Draft

nightly #1906

Show file tree
Hide file tree
Changes from 99 commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
ff16106
workflow for nightly
truher Nov 21, 2024
e257c79
provide python version, calculate timestamp in cmake
truher Nov 21, 2024
b1de6e0
the python version isn't really a number
truher Nov 21, 2024
1282993
fix cmakelists
truher Nov 21, 2024
568782e
where to change the name?
truher Nov 22, 2024
7cd5042
publish?
truher Nov 22, 2024
a62c2be
build another wheel for dist
truher Nov 22, 2024
95adfd1
install build tools before building
truher Nov 22, 2024
9ce58d7
change build directory
truher Nov 22, 2024
c915da8
where's the python build dir?
truher Nov 22, 2024
fd7b1f3
specify pypi packages dir
truher Nov 22, 2024
c614853
add cephes lib, maybe fix the build?
truher Nov 22, 2024
88ab62c
add nightly version string
truher Nov 22, 2024
3e71c33
set nightly flag in workflow
truher Nov 23, 2024
b91569f
try wheel instead of build
truher Nov 23, 2024
c147421
why is it trying to deploy numpy?
truher Nov 23, 2024
92df105
i don't think this will do anything
truher Nov 23, 2024
5f58d32
can't add library twice
truher Nov 23, 2024
795c484
make all builds static; might fix the nightly
truher Nov 25, 2024
ffca176
try build instead of wheel
truher Nov 25, 2024
e6c3c9f
build not pip
truher Nov 25, 2024
53aac11
turn off boost
truher Nov 25, 2024
6240576
turn boost back on
truher Nov 25, 2024
6a030a3
cleanup the nightly branch
truher Nov 25, 2024
215e108
fiddling with flags
truher Nov 25, 2024
c483d52
twiddling flags
truher Nov 25, 2024
4e88b9c
remove a comment
truher Nov 25, 2024
10c79fe
working on the matrix
truher Nov 25, 2024
9b3ad53
oops, token
truher Nov 25, 2024
de62344
correct dist path
truher Nov 25, 2024
526fa8f
actually run the matrix
truher Nov 25, 2024
8af3264
try a different way to setup the python version
truher Nov 25, 2024
c27b541
specify python_requires in setup.py
truher Nov 26, 2024
628f20e
another attempt to specify python version
truher Nov 26, 2024
0306e56
try pyproject.toml
truher Nov 26, 2024
b89ce5a
try cibuildwheel
truher Nov 26, 2024
364b893
cmake silently swallows reference errors
truher Nov 26, 2024
af137e5
fix version string
truher Nov 26, 2024
eee5743
more pyproject fixes
truher Nov 26, 2024
2a43fa5
pyproject.toml find namespace packages.
truher Nov 26, 2024
48bd714
remove setuptools version
truher Nov 26, 2024
d0c5704
try to convince cibuildwheels that there are extensions here
truher Nov 26, 2024
ab5b757
add ext module name
truher Nov 26, 2024
f2b97c3
give up on cibuildwheel, try to do use pip
truher Nov 26, 2024
4c8c305
specify packages for pip wheel to build
truher Nov 26, 2024
46ef51b
try "find links"
truher Nov 26, 2024
7ce770b
another attempt with pip wheel
truher Nov 26, 2024
069fbae
another attempt
truher Nov 27, 2024
9187442
also add an output flag
truher Nov 27, 2024
32a528c
arg
truher Nov 27, 2024
ba8122a
add artifact name to avoid clash
truher Nov 27, 2024
adf6774
add auditwheel to rename "linux" to "manylinux" ... ?
truher Nov 27, 2024
0705cb7
oops install auditwheel
truher Nov 27, 2024
6817382
maybe the verbose flag goes last?
truher Nov 27, 2024
bd9fb2b
maybe there is no verbose
truher Nov 27, 2024
ab93f0e
only repair the gtsam wheel
truher Nov 27, 2024
940ad41
fix manylinux version
truher Nov 27, 2024
a2b8bde
start on raspberry pi job
truher Nov 27, 2024
fb9d544
rename
truher Nov 27, 2024
3810cb5
install the compiler
truher Nov 27, 2024
9d45b70
separate lines
truher Nov 27, 2024
62d56e1
typo
truher Nov 27, 2024
1268c51
use the right compiler name
truher Nov 27, 2024
824dbb2
change the name
truher Nov 27, 2024
a33f7a3
clean up
truher Nov 27, 2024
82f9abc
Merge pull request #2 from borglab/develop
truher Nov 27, 2024
056d84e
try the arm runner
truher Nov 28, 2024
2d6cdfc
Merge branch 'team100_nightly' of github.com:truher/gtsam into team10…
truher Nov 28, 2024
006bb68
more than nothing
truher Nov 28, 2024
8be02ff
add real build tasks
truher Nov 28, 2024
c5ea5a2
a whole lot more disk
truher Nov 28, 2024
25c10cc
remove multilib
truher Nov 28, 2024
16fa46a
add printing
truher Nov 28, 2024
ab7fbdf
move env setters out of arm runner
truher Nov 28, 2024
89bd62d
remove unnecesary requirements
truher Nov 28, 2024
5c731b0
break system
truher Nov 28, 2024
f10a784
debug
truher Nov 28, 2024
7ca6011
use the same path as the normal way
truher Nov 28, 2024
58b1c56
don't build geographic lib
truher Nov 28, 2024
18a6e36
adjust repository path
truher Nov 28, 2024
e5d26bf
repo path
truher Nov 28, 2024
77d04c1
break system packages
truher Nov 28, 2024
d0ab744
maybe fix some of the other builds
truher Nov 28, 2024
7812a47
comment out a broken test for now
truher Nov 28, 2024
1fe978c
turn off broken test temporarily
truher Nov 29, 2024
ed2630b
break system packages
truher Nov 29, 2024
5a13013
install patchelf
truher Nov 29, 2024
2ba8562
install patchelf with apt
truher Nov 29, 2024
d7e5d22
turn on uploading
truher Nov 29, 2024
963f62b
add BatchFixedLagSmoother.getFactors() to nightly2 to make more test…
truher Nov 30, 2024
7f4cfba
add const to getFactors()
truher Nov 30, 2024
70cfc3e
separate sh for nightly with switches; put the other stuff back
truher Dec 1, 2024
9e288fc
re-enable test_VisualISAMExample
truher Dec 1, 2024
14cf8e7
fix linux-nightly.yml
truher Dec 1, 2024
7d9ad67
add workflow_dispatch
truher Dec 1, 2024
792a459
try to fix the CI
truher Dec 1, 2024
21f692d
repair CI
truher Dec 2, 2024
62f9ecb
Merge pull request #4 from truher/team100_nightly2
truher Dec 2, 2024
9c809fa
revert build-linux.yml
truher Dec 2, 2024
b7c5f30
fix merge conflict
truher Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/scripts/nightly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash

##########################################################
# Build and test the GTSAM Python wrapper.
##########################################################

set -x -e

# install TBB with _debug.so files
function install_tbb()
{
echo install_tbb
if [ "$(uname)" == "Linux" ]; then
sudo apt-get -y install libtbb-dev

elif [ "$(uname)" == "Darwin" ]; then
brew install tbb
fi
}

if [ -z ${PYTHON_VERSION+x} ]; then
echo "Please provide the Python version to build against!"
exit 127
fi

export PYTHON="python${PYTHON_VERSION}"

function install_dependencies()
{
if [[ $(uname) == "Darwin" ]]; then
brew install wget
else
# Install a system package required by our library
sudo apt-get install -y wget libicu-dev python3-pip python3-setuptools
fi

export PATH=$PATH:$($PYTHON -c "import site; print(site.USER_BASE)")/bin

if [ "${GTSAM_WITH_TBB:-OFF}" == "ON" ]; then
install_tbb
fi
}

# Chirality exception is thrown by the camera projection when the solver
# randomly places the camera such that the landmarks are behind it.
# This breaks the dependent python custom factor with numeric derivatives.

# Build needs to be static to be included in the wheel at the end.

function build()
{
export CMAKE_GENERATOR=Ninja
BUILD_PYBIND="ON"
cmake $GITHUB_WORKSPACE \
-B build \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DGTSAM_BUILD_TESTS=OFF \
-DGTSAM_FORCE_SHARED_LIB=OFF \
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
-DGTSAM_THROW_CHEIRALITY_EXCEPTION=OFF \
-DGTSAM_USE_QUATERNIONS=OFF \
-DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
-DGTSAM_BUILD_PYTHON=${BUILD_PYBIND} \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_METIS=ON \
-DGTSAM_UNSTABLE_BUILD_PYTHON=${GTSAM_BUILD_UNSTABLE:-ON} \
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gtsam_install


# Set to 2 cores so that Actions does not error out during resource provisioning.
cmake --build build -j2

cmake --build build --target python-install
}

function test()
{
cd $GITHUB_WORKSPACE/python/gtsam/tests
$PYTHON -m unittest discover -v
cd $GITHUB_WORKSPACE

cd $GITHUB_WORKSPACE/python/gtsam_unstable/tests
$PYTHON -m unittest discover -v
cd $GITHUB_WORKSPACE

# cmake --build build --target python-test
# cmake --build build --target python-test-unstable
}

# select between build or test
case $1 in
-d)
install_dependencies
;;
-b)
build
;;
-t)
test
;;
esac
111 changes: 111 additions & 0 deletions .github/workflows/arm-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Nightly build for Raspberry Pi
# Uploads to test.pypi.org.

name: ARM Nightly

on: [workflow_dispatch]

env:
IMG: raspios_lite_arm64:latest
BIND: true
CPU: cortex-a76

jobs:
build:
name: Build
runs-on: ubuntu-24.04
# strategy:
# fail-fast: false
# matrix:
# python_version: ['3.9', '3.10', '3.11', '3.12']


env:
# quote the number because yaml thinks 3.10 and 3.1 are the same, like it's a number, man.
# https://yaml.org/spec/1.2.2/ the yaml spec is 50 pages
PYTHON_VERSION: '3.11'
# PYTHON_VERSION: ${{matrix.python_version}}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: env
run: |
echo "=== SET VARS ==="
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
echo "NIGHTLY=1" >> $GITHUB_ENV

- name: Run on ARM
uses: pguyot/arm-runner-action@v2
with:
base_image: $IMG
bind_mount_repository: $BIND
copy_repository_path: /home/runner/work/gtsam/gtsam
cpu: $CPU
debug: true
image_additional_mb: 20000
commands: |
echo "=== CPU INFO ==="
cat /proc/cpuinfo
echo "=== UPDATE ==="
sudo apt-get -y update
echo "=== INSTALL 1 ==="
sudo apt-get -y install python3 cmake build-essential pkg-config python3-numpy
echo "=== INSTALL 2 ==="
sudo apt-get -y install libboost-all-dev ninja-build
echo "=== INSTALL 3 ==="
sudo apt-get -y install g++ patchelf
echo "=== DEPEND ==="
bash .github/scripts/nightly.sh -d
echo "=== REQ ==="
python3 -m pip install --break-system-packages -r python/dev_requirements.txt
echo "=== PWD ==="
pwd
echo "=== ls ==="
ls -R
echo "=== BUILD ==="
bash .github/scripts/nightly.sh -b
echo "=== TEST ==="
bash .github/scripts/nightly.sh -t
echo "=== INSTALL AUDITWHEEL ==="
python3 -m pip install --break-system-packages --upgrade pip auditwheel
echo "=== BUILD WHEEL ==="
python3 -m pip wheel build/python -w build/python/dist
echo "=== CHECK LDD VERSION ==="
ldd --version
echo "=== AUDITWHEEL ==="
python3 -m auditwheel repair --plat manylinux_2_35_aarch64 -w build/python/repaired/ build/python/dist/truher_gtsam_nightly*


- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
# TODO: define the name as ENV, use it in CMakeLists.txt
name: artifact311
# name: artifact${{matrix.python_version}}
path: build/python/repaired/truher_gtsam_nightly*


upload_all:
# Waits for all the builds to finish
# Downloads all their wheels
# Uploads them all at once.
name: Upload All
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
repository-url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Linux CI

on: [pull_request]
on: [pull_request, workflow_dispatch]

# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: macOS CI

on: [pull_request]
on: [pull_request, workflow_dispatch]

# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Python CI

on: [pull_request]
on: [pull_request, workflow_dispatch]

# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-special.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Special Cases CI

on: [pull_request]
on: [pull_request, workflow_dispatch]

# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Windows CI

on: [pull_request]
on: [pull_request, workflow_dispatch]

# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/linux-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Nightly build for Linux.
# Uploads to test.pypi.org.

name: Linux Nightly

on: [workflow_dispatch]

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ['3.9', '3.10', '3.11', '3.12']


env:
# PYTHON_VERSION: '3.10'
PYTHON_VERSION: ${{matrix.python_version}}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
#python-version: '3.10'
python-version: ${{matrix.python_version}}

- name: Install (Linux)
run: |
sudo apt-get -y update
sudo apt-get -y install cmake build-essential pkg-config python3-numpy libboost-all-dev ninja-build

sudo apt-get install -y g++ g++-multilib
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV

- name: Set Swap Space (Linux)
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 6

- name: Install System Dependencies
run: bash .github/scripts/nightly.sh -d

- name: Install Python Dependencies
shell: bash
run: python3 -m pip install -r python/dev_requirements.txt

- name: Set Nightly Flag
run: echo "NIGHTLY=1" >> $GITHUB_ENV

- name: Build
# Builds the cmake "python-install" target which is a local install.
shell: bash
run: bash .github/scripts/nightly.sh -b

- name: Test
# Uses the local install for python3 -m unittest.
shell: bash
run: bash .github/scripts/python.sh -t

- name: Install Build Tools
run: python3 -m pip install --upgrade pip auditwheel

- name: Build for Publishing
run: python3 -m pip wheel build/python -w build/python/dist

- name: Repair Wheels
# TODO: use the actual glibc version here
run: python3 -m auditwheel repair --plat manylinux_2_35_x86_64 -w build/python/repaired/ build/python/dist/truher_gtsam_nightly*

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
# TODO: define the name as ENV, use it in CMakeLists.txt
name: artifact${{matrix.python_version}}
path: build/python/repaired/truher_gtsam_nightly*


upload_all:
# Waits for all the builds to finish
# Downloads all their wheels
# Uploads them all at once.
name: Upload All
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
repository-url: https://test.pypi.org/legacy/
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ set (GTSAM_VERSION_PATCH 0)
set (GTSAM_PRERELEASE_VERSION "a0")
math (EXPR GTSAM_VERSION_NUMERIC "10000 * ${GTSAM_VERSION_MAJOR} + 100 * ${GTSAM_VERSION_MINOR} + ${GTSAM_VERSION_PATCH}")

if ("${GTSAM_PRERELEASE_VERSION}" STREQUAL "")
# Use the current timestamp as the version string, if the "NIGHTLY" flag is set.
if (DEFINED ENV{NIGHTLY})
string(TIMESTAMP NOW "%Y.%m.%d.%H.%M")
message(NOTICE "NIGHTLY BUILD ${NOW}")
set (GTSAM_VERSION_STRING "${NOW}")
# TODO: use the correct pypi nightly name
set (SETUP_NAME "truher-gtsam-nightly")
elseif ("${GTSAM_PRERELEASE_VERSION}" STREQUAL "")
set (GTSAM_VERSION_STRING "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}")
set (SETUP_NAME "gtsam")
else()
set (GTSAM_VERSION_STRING "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}${GTSAM_PRERELEASE_VERSION}")
set (SETUP_NAME "gtsam")
endif()

project(GTSAM
Expand Down Expand Up @@ -70,6 +79,7 @@ include(GtsamPrinting)

############### Decide on BOOST ######################################
# Enable or disable serialization with GTSAM_ENABLE_BOOST_SERIALIZATION
# (Serialization tests fail when this is off.)
option(GTSAM_ENABLE_BOOST_SERIALIZATION "Enable Boost serialization" ON)
if(GTSAM_ENABLE_BOOST_SERIALIZATION)
add_definitions(-DGTSAM_ENABLE_BOOST_SERIALIZATION)
Expand Down
Loading