-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add automatic generation of conda binary packages for Windows, macOS and Linux in robotology channel #652
Add automatic generation of conda binary packages for Windows, macOS and Linux in robotology channel #652
Conversation
040f529
to
da7265a
Compare
…and Linux in robotology channel
da7265a
to
d520cb2
Compare
As just a bunch of technical details is not a fun, this is a quick peek to what can be done now that we have (obviously all the instructions use Use robotology-superbuild software built with ROBOTOLOGY_USES_MATLAB in MATLAB onlineIf you are a user of MATLAB online, you may want to run your scripts directly on the cloud, but this could be problematic if you depend on some MATLAB or Simulink libraries provided by the robotology-superbuild, given that
(At this moment Quickly install software on WindowsWhile the process of installing the robotology-superbuild and its dependencies has been historically relatively smooth on Ubuntu and macOS, it has always been quite complex on Windows. The typical pattern indeed was of Windows user that had to run Docker, a Virtual Machine or WSL just to install it. The conda binaries drastically simplify the process of installing robotology packages on Windows, for example if you have conda installed (see instructions in https://github.com/robotology/robotology-superbuild/blob/32fa9c33fb597b83aef936528e2d476576e96a5d/doc/install-miniforge.md) you just need to run the following commands:
to be able to run Gazebo and an iCub simulation: Easily run Continuous Integration of C++ libraries that depend on robotology librariesThanks to the conda binaries provided by the name: C++ CI Workflow with conda-forge dependencies
on:
push:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
- cron: '0 2 * * *'
jobs:
build:
name: '[${{ matrix.os }}@${{ matrix.build_type }}@conda]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release]
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
- name: Dependencies
shell: bash -l {0}
run: |
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config
# Actual dependencies
mamba install -c robotology-staging idyntree yarp matio-cpp lie-group-controllers eigen qhull casadi cppad manif spdlog catch2
- name: Configure [Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -GNinja -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
- name: Configure [Windows]
if: contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -G"Visual Studio 16 2019" -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
- name: Build
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Test
shell: bash -l {0}
run: |
cd build
ctest --output-on-failure -C ${{ matrix.build_type }} If you have a CMake project, the only line that you will need to modify to adapt it to your project is just the line:
using your dependencies instead of the one of Quickly create small Docker imagesThe conda binaries provided by the |
I also plan to eventually do in-person training on this new Conda-based tools to group of people, but before reaching that point I would prefer to have all the package generation machinery up and running. |
if(NOT APPLE) | ||
list(APPEND ICUB_CONDA_DEPENDENCIES freeglut) | ||
endif() | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've often seen "UNIX AND NOT APPLE" - not sure which one is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UNIX AND NOT APPLE
is typically used to include *bsd systems, as conda-forge do not support any *bsd or similar target at the moment I think it is more clear to indicate it as "do something if we are on linux". If conda-forge will ever support other non-Linux targets (such as WebAssembly ( pyodide/pyodide#795 ), that would be a dream!) we will eventually fix this.
@@ -5,10 +5,6 @@ | |||
include(YCMEPHelper) | |||
include(FindOrBuildPackage) | |||
|
|||
find_package(ACE QUIET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of interest, doesn't that break non-conda builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACE
needs to be installed in the system on all platforms supported by the robotology-superbuild. In general, in the superbuild build files there were a few of these find_package
for dependencies that are not handled by the superbuild, but to avoid problems in the conda recipe generation process I just removed them for now, so that eventually we can add them back consistently for all packages.
conda/conda_build_config.yml
Outdated
@@ -0,0 +1,3 @@ | |||
# bipedal-locomotion-framework requires 10.13 for std::bad_cast_any | |||
MACOSX_DEPLOYMENT_TARGET: # [osx] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use this, make sure to add the __osx
run dependency: https://conda-forge.org/docs/maintainer/knowledge_base.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 05593fd .
@@ -0,0 +1,139 @@ | |||
import argparse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mistake in filename? metadatadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
{% for dep in dependencies %} - {{ dep }} | ||
{% endfor %} | ||
{# Handle specific packages required for gl on Linux, see https://conda-forge.org/docs/maintainer/knowledge_base.html?#libgl #} | ||
{% if require_opengl_linux %} - xorg-libxfixes {% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the osx run stuff here I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 05593fd .
doc/conda-forge.md
Outdated
|
||
If you want to develop some C++ code on the top of this libraries, it is recommended to also install the necessary compiler and development tools directly in the same environment: | ||
~~~ | ||
conda installl compilers cmake pkg-config make ninja |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo installl
doc/conda-recipe-generation.md
Outdated
## Rationale | ||
|
||
See the [documentation on conda-forge and the robotology-superbuild](conda-forge.md) for a general discussion on how the robotology-superbuild and conda can work together. | ||
This document describes how to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran out of energy there? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Fixed in f0c615e .
doc/developers-faqs.md
Outdated
* If your package needs to set or modify some environment variables to work correctly, it should provide a pair [multisheller](https://github.com/wolfv/multisheller) scripts name `<condaPkgName>_activate.msh` and `<condaPkgName>_activate.msh` in the `conda/multisheller` directory to describe how the environment should be modified, see the existing scripts for more details. | ||
|
||
|
||
## How ofter are conda binary packages generated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ofter -> often
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in cfe30cd .
Amazing work, well done @traversaro. This is super exciting :) |
…recipes_from_metametadata.py
Thanks a lot for the feedback @Tobias-Fischer ! I should have fixed all of them. |
Co-authored-by: Nuno Guedelha <[email protected]>
Sorry @traversaro , there is a minor typo I forgot to mention, and actually is not among the modified files. It's in https://github.com/robotology/robotology-superbuild/blob/master/doc/install-miniforge.md#install-1:
Second line should be |
Fix for this proposed in #664 . |
Thanks @nunoguedelha ! |
As robotology/robotology-superbuild#652 has been merged, we now have officially generated packages coming from the robotology-superbuild in the [robotology anaconda channel](https://anaconda.org/robotology), so we can switch to use that instead of the experimental and test-only `robotology-staging`.
As robotology/robotology-superbuild#652 has been merged, we now have officially generated packages coming from the robotology-superbuild in the [robotology anaconda channel](https://anaconda.org/robotology), so we can switch to use that instead of the experimental and test-only `robotology-staging`.
This PR fixes #620 . In particular, it adds machinery to generate the conda recipes for each subproject of the superbuild, and a GitHub Action job that build binaries once a week for all the generated recipes for the latest release of the robotology-superbuild projects and loads them in the robotology conda channel, that builds on top of the
conda-forge
similarly to who therobostack
channel for ROS software build on top ofconda-forge
as well.It is unfortunately a relatively large PR, but I preferred to experiment with it a bit to understand there is something functional before adding it to the official robotology-superbuild repo. In particular, the test binaries were generated in the channel https://anaconda.org/robotology-staging . The modifications can be largely divided in 5 main categories:
conda
directory, that contain all the machinery required to generate conda recipes out for all superbuild projects. These internal mechanism are described indoc/conda-recipe-generation.md
document.github/workflows/generate-conda-packages.yaml
) that uses the machinery described before to actually compile the conda binaries and upload them to robotology conda channelcmake/Build***.cmake
scripts, that are basically just adding metadata required to generate conda packagesdoc/developers-faqs.md
(https://github.com/robotology/robotology-superbuild/pull/652/files#diff-f9b520063217385eaf8b07ab7805449c26b59ccb1158241d51497bff72e92100) that are oriented towards package and profile mantainers describing how to add the required conda metadata when they add a new packagedoc/conda-forge.md
( https://github.com/robotology/robotology-superbuild/pull/652/files#diff-58f523b9fc5050a95da9ce381d330a2cf3ad7f1c88e6fb407fad9fd87d09d091 ): this are meant for end-users of robotology software that want to install the robotology packages directly in binary format. As this is still experimental and therobotology
channel is still empty, this documentation is still not linked in the main README.Given the size of the PR, I think it would be ideal if reviewer could focus their attention to points 4. and 5. , while the first three points are mainly internal implementation details.