Skip to content

Conversation

@rcurtin
Copy link
Member

@rcurtin rcurtin commented Feb 13, 2025

This is a "warmup" to defining the CI jobs on Jenkins for embedded systems. It will take me some attempts to transfer our existing Jenkins job configurations to a .jenkins/ directory full of Jenkinsfiles. The Jenkinsfile syntax is truly awful (it is Groovy), but, better to have the configurations here instead of hidden inside of the Jenkins configuration.

Update: this is ready!

This PR moves the Jenkins jobs into the mlpack repository, just like the Github Actions jobs. This makes them a lot more visible to users and developers, and easier to modify. (We should hopefully no longer need to give out permissions to Jenkins, but we'll see!)

There are five jobs I've defined:

  • .jenkins/cross-compilation/Jenkinsfile: cross-compile mlpack for an RPi5 and run mlpack_test on the RPi5; in another PR, I will add more embedded targets.
  • .jenkins/doc-link-check/Jenkinsfile: check all the links in the documentation, maintaining a cache of links that are known-good to accelerate the job.
  • .jenkins/doc-snippet-build/Jenkinsfile: build all the C++ documentation snippets and make sure they all run.
  • .jenkins/memory-checks/Jenkinsfile: run any tests that have changed through valgrind to make sure there are no memory problems. I don't think this job was working correctly before this PR, but hopefully it will be useful in the future.
  • .jenkins/style-checks/Jenkinsfile: run the style linter to make sure there are no problems.

The style check and link check job take less than 10 minutes each, so they are pretty fast. The other jobs use ccache, but the compile times seem to be long. I am not totally sure why that is. I also think the C++ documentation snippets may need some amount of auditing because the slowdown there is runtime, not compile time... but I will leave that for another time.

I've disabled all the other Jenkins jobs and updated the documentation. The static code analysis job used Facebook's infer tool, which was so computationally intensive that I made the call to just remove the job.

There were a couple other small changes and bugfixes, especially make the junit test reporter work correctly for Catch2. They should hopefully be pretty self-explanatory in the diff.

@rcurtin
Copy link
Member Author

rcurtin commented Feb 13, 2025

@mlpack-jenkins test this please

@rcurtin rcurtin marked this pull request as ready for review March 5, 2025 16:48
@rcurtin
Copy link
Member Author

rcurtin commented Mar 5, 2025

Ok, I made everything work here and it is ready for review! I updated the description of the PR with the details.

@eddelbuettel
Copy link
Contributor

Very amazing patience and persistence! Congratulations for seeing it through.

Copy link
Member

@shrit shrit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for doing all of migration, I know how tedious this looks like

Comment on lines +404 to +405
// Make sure the data loaded okay.
REQUIRE(!dataset.is_empty());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix

Comment on lines +112 to +129
ssh jenkins@${hostname} -t mkdir -p test_${BRANCH_NAME}_${BUILD_ID}/
scp build/bin/mlpack_test jenkins@${hostname}:test_${BRANCH_NAME}_${BUILD_ID}/
scp -r src/mlpack/tests/data/* jenkins@${hostname}:test_${BRANCH_NAME}_${BUILD_ID}/
# Unpack all compressed test data.
ssh jenkins@${hostname} -t "
cd test_${BRANCH_NAME}_${BUILD_ID};
find ./ -iname '*.bz2' -exec tar xvf \\{\\} \\;"
mkdir -p reports;
ssh jenkins@${hostname} -t "
cd test_${BRANCH_NAME}_${BUILD_ID};
mkdir -p reports;
./mlpack_test -r junit -o reports/mlpack_test.junit.xml"
# Clean up afterwards.
scp jenkins@${hostname}:test_${BRANCH_NAME}_${BUILD_ID}/reports/mlpack_test.junit.xml reports/mlpack_test.${hostname}.junit.xml;
ssh jenkins@${hostname} -t rm -rf test_${BRANCH_NAME}_${BUILD_ID}/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this part took much of the time

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, most of the time was actually figuring out that I was compiling with 4KB page sizes but couscous (that RPi5) was running with 16KB page sizes and so it would just segfault...

Comment on lines +20 to +25
def setBuildStatus(Map paramsMap)
{
// Extract arguments from the map.
def result = paramsMap.result;
def context = paramsMap.context;
def successMessage = paramsMap.successMessage;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Groovy looks interesting

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not bad, but I am tired of having so many different languages... I would have rather just had a shell script.

Comment on lines +135 to +136
-DTOOLCHAIN_PREFIX=/path/to/bootlin/toolchain/aarch64--glibc--stable-2024.02-1/bin/aarch64-buildroot-linux-gnu-
-DCMAKE_SYSROOT=/path/to/bootlin/toolchain/aarch64--glibc--stable-2024.02-1/aarch64-buildroot-linux-gnu/sysroot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this change ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like it was a typo in the original; the gnueabihf prefix doesn't exist:

$ ls /opt/bootlin/aarch64--glibc--stable-2024.02-1/bin/aarch64-buildroot-linux-*-g++
/opt/bootlin/aarch64--glibc--stable-2024.02-1/bin/aarch64-buildroot-linux-gnu-g++

This may be an issue with some of the other boards too; I didn't check fully.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second approval provided automatically after 24 hours. 👍

@rcurtin rcurtin merged commit a44fbe4 into mlpack:master Mar 12, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants