Compare commits

...

4 Commits

Author SHA1 Message Date
Sam Freund
121433fd90 Loosely pin numpy to 2.3 (#2303) 2026-01-15 16:41:39 -06:00
Sam Freund
22567dea74 Smoketest after uploading images (#2294) 2026-01-14 18:39:21 -08:00
Rikhil Chilka
ba4eb621c3 Rknn numpy fix (#2298) 2026-01-14 15:22:35 -06:00
David Vo
43608c5113 fix: simplify version regex and fix rc tag handling (#2296) 2026-01-13 14:17:36 +00:00
4 changed files with 51 additions and 43 deletions

View File

@@ -555,32 +555,32 @@ jobs:
minimum_free_mb: ${{ matrix.minimum_free_mb }}
root_location: ${{ matrix.root_location || 'partition=2' }}
shrink_image: ${{ matrix.shrink_image || 'yes' }}
commands: |
chmod +x scripts/armrunner.sh
./scripts/armrunner.sh
java -jar *.jar --smoketest --platform=${{ matrix.plat_override }}
commands: ./scripts/armrunner.sh
- name: Compress image
# Compress the standard images
if: ${{ ! startsWith(matrix.image_suffix, 'rubik') }}
run: |
set -ex
new_jar=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
new_image_name=$(basename "${new_jar/.jar/_${{ matrix.image_suffix }}.img}")
sudo mv ${{ steps.generate_image.outputs.image }} $new_image_name
sudo xz -T 0 -v $new_image_name
sudo xz -T 0 -kv $new_image_name
echo "smoketest_image_loc=${new_image_name}" >> $GITHUB_ENV
- name: Tar built image
- name: Tar built image (Rubik)
# Build the RubikPi3-specific tar file
if: ${{ startsWith(matrix.image_suffix, 'rubik') }}
run: |
set -ex
new_jar=$(realpath $(find . -name photonvision\*-linuxarm64.jar))
new_image_name=$(basename "${new_jar/.jar/_${{ matrix.image_suffix }}.img}")
tardir=$(basename "${new_jar/.jar/_${{ matrix.image_suffix }}.img}")
imagedir=$(dirname ${{ steps.generate_image.outputs.image }})
tardir=${new_image_name}
sudo mkdir --parents ${tardir}
sudo mv ${imagedir}/* ${tardir}/
sudo tar -I 'xz -T0' -cf ${new_image_name}.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
sudo cp ${imagedir}/* ${tardir}/
sudo tar -I 'xz -T0' -cf ${tardir}.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
# Point smoketest to the old image
echo "smoketest_image_loc=${{ steps.generate_image.outputs.image }}" >> $GITHUB_ENV
- uses: actions/upload-artifact@v6
name: Upload image
@@ -588,6 +588,16 @@ jobs:
name: image-${{ matrix.image_suffix }}
path: photonvision*.xz
# This is done after uploading the image to avoid contaminating the image with logs, caches, etc.
- uses: photonvision/photon-image-runner@HEAD
name: Smoketest Image
with:
image_url: file://${{ env.smoketest_image_loc }}
minimum_free_mb: ${{ matrix.minimum_free_mb }}
root_location: ${{ matrix.root_location || 'partition=2' }}
shrink_image: ${{ matrix.shrink_image || 'yes' }}
commands: java -jar *.jar --smoketest --platform=${{ matrix.plat_override }}
matrix-checker:
# This job always runs last to set the overall result based on the matrix jobs. If any matrix job failed, this job will fail.
# This makes it so that we don't need to add each matrix job individually to CI checks.

View File

@@ -4,15 +4,13 @@ import subprocess
from setuptools import find_packages, setup
gitDescribeResult = (
subprocess.check_output(
["git", "describe", "--tags", "--match=v*", "--exclude=*rc*", "--always"]
)
subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--always"])
.decode("utf-8")
.strip()
)
m = re.search(
r"(v[0-9]{4}\.[0-9]{1}\.[0-9]{1})-?((?:beta)?(?:alpha)?)-?([0-9\.]*)",
r"v([0-9]{4}\.[0-9]{1}\.[0-9]{1})-?((?:beta|alpha|rc)?)-?([0-9\.]*)",
gitDescribeResult,
)
@@ -26,7 +24,7 @@ if m:
prefix = m.group(1)
maturity = m.group(2)
suffix = m.group(3).replace(".", "")
versionString = f"{prefix}.{maturity}.{suffix}"
versionString = f"{prefix}{maturity}{suffix}"
else:
split = gitDescribeResult.split("-")
if len(split) == 3:
@@ -35,8 +33,7 @@ if m:
versionString = f"{year[1:]}post{commits}"
print("using dev release " + versionString)
else:
year = gitDescribeResult
versionString = year[1:]
versionString = gitDescribeResult[1:]
print("using full release " + versionString)
@@ -60,7 +57,7 @@ setup(
package_data={"photonlibpy": ["py.typed"]},
version=versionString,
install_requires=[
"numpy~=2.4",
"numpy~=2.3",
"wpilib==2026.1.1",
"robotpy-wpimath==2026.1.1",
"robotpy-apriltag==2026.1.1",

0
scripts/armrunner.sh Normal file → Executable file
View File

View File

@@ -33,6 +33,27 @@
],
"id": "500d656b7cc0ebd7"
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"#### *Numpy Fix* - Important for Google Colab Users\n",
"\n",
"Google Colab comes with an incompatible version of Numpy installed. To fix this, please run the following cells below and **restart your session** when prompted."
],
"id": "b3a9e1a334bce144"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"%pip uninstall numpy -y\n",
"%pip install \"numpy==1.26.4\""
],
"id": "7156e69495f48f49"
},
{
"metadata": {},
"cell_type": "markdown",
@@ -41,7 +62,7 @@
"\n",
"Please run the cell below to be able to use the `create_onnx` and `create_rknn` functions."
],
"id": "798298b1dbe33d2d"
"id": "51566ff74470e57"
},
{
"metadata": {},
@@ -132,6 +153,7 @@
" os.path.join(ultralytics_folder_name_yolov5, \"requirements.txt\"),\n",
" \"torch<2.6.0\",\n",
" \"onnx==1.18.0\",\n",
" \"numpy==1.26.4\",\n",
" \"onnxscript\",\n",
" ]\n",
" )\n",
@@ -172,7 +194,7 @@
"def run_onnx_conversion_no_anchor(model_path):\n",
" check_or_clone_rockchip_repo(yolo_non_anchor_repo)\n",
" run_pip_install_or_else_exit(\n",
" [\"-e\", ultralytics_default_folder_name, \"onnx==1.18.0\", \"onnxscript\"]\n",
" [\"-e\", ultralytics_default_folder_name, \"onnx==1.18.0\", \"numpy==1.26.4\", \"onnxscript\"]\n",
" )\n",
"\n",
" sys.path.insert(0, os.path.abspath(ultralytics_default_folder_name))\n",
@@ -384,28 +406,7 @@
" except SystemExit:\n",
" print(\"RKNN Conversion failed, see output above\")\n"
],
"id": "ea6869140a61126d"
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"#### *Numpy Fix* - Important for Google Colab Users\n",
"\n",
"Google Colab comes with an incompatible version of Numpy installed. To fix this, please run the following cells below and **restart your session** when prompted."
],
"id": "b3a9e1a334bce144"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"%pip uninstall numpy -y\n",
"%pip install \"numpy>=1.23.0,<2.0.0\""
],
"id": "7156e69495f48f49"
"id": "4d7a8adee7a03377"
},
{
"metadata": {},