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

CREO2URDF – Build a GA on a self-hosted runner for automatically generate the urdfs #87

Closed
Nicogene opened this issue Apr 5, 2024 · 15 comments
Assignees
Labels
domain-software Related to Software team-fix Related to Team Fix

Comments

@Nicogene
Copy link
Member

Nicogene commented Apr 5, 2024

Task description

Since now creo2urdf can be run from terminal:

and we have run_creo2urdf.ps1 script, we need to prepare our self-hosted runner for generating automatically the ergocub-software models

DoD

The github action and the self-hosted runner are ready.

@pattacini
Copy link
Member

pattacini commented Apr 6, 2024

Because of https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#self-hosted-runner-security, we ought to rely on a private repository.

I've churned out a brand-new one:

That said, it could be still beneficial for the community to document here (i.e., public-wise) how to set up the infrastructure for the GA.

@Nicogene, could you please draft below what the GitHub Action is supposed to be doing in terms of input/output? This will help me organize the work.

@Nicogene
Copy link
Member Author

Nicogene commented Apr 8, 2024

As agreed f2f w/ @pattacini, we thought about creating a central GitHub action in the creo2urdf-private repo that handles the generation of urdf coming hosted on several repositories (e.g. ergocub-software, icub-models-generator).
This GA will run on our self-hosted runner, the idea is that a commit on the master branch of a repository triggers a repository dispatch that will be received by this new GitHub action that will generate the URDFs and will open a PR on that repository.

ccing @traversaro since he may be interested

@traversaro
Copy link
Member

If I am not wrong, we should have trigger repository on both the repos that host the configuration files and the one that host the CAD, right?

@pattacini
Copy link
Member

Ideally yes, @traversaro.

To start with, I would honestly send the triggers via the green button (i.e., workflow_dispacth).
This will allow us to check all the intermediate steps on both ways.

@Nicogene
Copy link
Member Author

Nicogene commented Apr 9, 2024

I managed to install and run creo2urdf in our shared windows machine. I put all the necessary repositories/files under Users/Public/icub-tech-iit in this way they should be accessible by any logged user, and I put as creo starting folder Public/icub-tech-iit/cad-libraries.

I will move on setting the self hosted runner

cc @davidelasagna @pattacini @mfussi66

@Nicogene
Copy link
Member Author

Nicogene commented Apr 9, 2024

I built a first draft of the GA that runs from a manual dispatch that simply execute this commands:

          cd C:\Users\Public\icub-tech-iit\cad-libraries
          mkdir output_urdf
          .\run_creo2urdf.ps1 -asmPath "C:\Users\Public\icub-tech-iit\cad-mechanics\projects\simulation_model\ergocub_1-1\sim_ergocub_1-1.asm" -yamlPath "$env:GITHUB_WORKSPACE\ergocub-software\urdf\creo2urdf\data\ergocub1_1\ERGOCUB_all_options.yaml" -csvPath "$env:GITHUB_WORKSPACE\ergocub-software\urdf\creo2urdf\data\ergocub1_1\ERGOCUB_joint_all_parameters.csv" -outputPath "C:\Users\Public\icub-tech-iit\cad-libraries\output_urdf"
          cp .\output_urdf\model.urdf $env:GITHUB_WORKSPACE\ergocub-software\urdf\ergoCub\robots\ergoCubSN001
          .\run_creo2urdf.ps1 -asmPath "C:\Users\Public\icub-tech-iit\cad-mechanics\projects\simulation_model\ergocub_1-1\sim_ergocub_1-1.asm" -yamlPath "$env:GITHUB_WORKSPACE\ergocub-software\urdf\creo2urdf\data\ergocub1_1\ERGOCUB_all_options_gazebo.yaml" -csvPath "$GITHUB_WORKSPACE\ergocub-software\urdf\creo2urdf\data\ergocub1_1\ERGOCUB_joint_all_parameters.csv" -outputPath "C:\Users\Public\icub-tech-iit\cad-libraries\output_urdf"
          cp .\output_urdf\model.urdf $env:GITHUB_WORKSPACE\ergocub-software\urdf\ergoCub\robots\ergoCubGazeboV1_1
          .\run_creo2urdf.ps1 -asmPath "C:\Users\Public\icub-tech-iit\cad-mechanics\projects\simulation_model\ergocub_1-1\sim_ergocub_1-1.asm" -yamlPath "$env:GITHUB_WORKSPACE\ergocub-software\urdf\creo2urdf\data\ergocub1_1\ERGOCUB_all_options_minContacts.yaml" -csvPath "$GITHUB_WORKSPACE\ergocub-software\urdf\creo2urdf\data\ergocub1_1\ERGOCUB_joint_all_parameters.csv" -outputPath "C:\Users\Public\icub-tech-iit\cad-libraries\output_urdf"
          cp .\output_urdf\model.urdf $env:GITHUB_WORKSPACE\ergocub-software\urdf\ergoCub\robots\ergoCubGazeboV1_1_minContacts
          cp .\output_urdf\*.stl $env:GITHUB_WORKSPACE\ergocub-software\urdf\ergoCub\meshes\simmechanics
          rmdir -Recurse C:\Users\Public\icub-tech-iit\cad-libraries\output_urdf

The problem seems that the first time the urdf is generated fine, then creo seems to remain zombie and the following generations fails, I need to investigate a little bit about it.

@Nicogene
Copy link
Member Author

Nicogene commented Apr 10, 2024

The strange thing is that I can run creo2urdf from the shared machine using the GUI, but it does not work via the command line starts and immediately stops.
In theory, I am using the very same version of creo2urdf, cad-libraries, cad-mechanics, the only differernce is that when I load the simulation model asm I am getting this error on the shared machine:

���Could not read from Model Tree config file .\config\tree.cfg.

.\config\tree.cfg is not present neither in my cad-libraries but for some reason, I am not getting that error.

@Lawproto @fiorisi do you know what that file is for? Is it necessary?

@Nicogene
Copy link
Member Author

In theory, I am using the very same version of creo2urdf, cad-libraries, cad-mechanics, the only differernce is that when I load the simulation model asm I am getting this error on the shared machine:

Actually now I pulled cad-libraries and cad-mechanics and the problem is happening also on my machine 👀

@Nicogene
Copy link
Member Author

Bingo! Here what was the problem:

���'sim_ergocub_1-1' cannot be retrieved.

I remembered I had these local changes in cad-libraries:

--- a/config/search_path.pro
+++ b/config/search_path.pro
@@ -85,6 +85,8 @@ search_path ".\..\cad-mechanics\projects\icub\koroibot"
 search_path ".\..\cad-mechanics\projects\simulation_model"
 search_path ".\..\cad-mechanics\projects\simulation_model\head"
 search_path ".\..\cad-mechanics\projects\simulation_model\icub3"
+search_path ".\..\cad-mechanics\projects\simulation_model\ergocub_1-1"
+search_path ".\..\cad-mechanics\projects\simulation_model\cer"

cc @fiorisi

@Nicogene
Copy link
Member Author

Fixing locally cad-libraries I managed to generate the urdf of the ergocub V1_1

image

Now we should:

  • create a script to be committed in the creo2urdf-private for incapsulate those commands
  • Change the action in order to trigger the open of the PR in ergocub-software

Future improvements:

  • Shall we clone cad-libraries, cad-mechanics from scratch ? (they are quite heavy, and we should repeat the installation of creo2urdf)
  • Add the installation of the latest creo2urdf ( If we add this feature there is the problem of the first time prompt of creo that ask you if creo2urdf is safe to be run)
  • Think about an infrastructure for starting the job from external repository trigger, not manual dispatch

cc @traversaro @mfussi66 @pattacini

@pattacini
Copy link
Member

Shall we clone cad-libraries, cad-mechanics from scratch ? (they are quite heavy, and we should repeat the installation of creo2urdf)

To start with, we could just guarantee that those repos are aligned via a pull with what is needed to generate the URDF.

@Nicogene
Copy link
Member Author

Fix in cad-libraries:

@Nicogene
Copy link
Member Author

Unfortunately sometimes some creo background process remains stuck even if the generation exit fine, I put a wait of 30 sec with a forced kill of the process

@Nicogene
Copy link
Member Author

With the latest version of the action the output of the generation is a PR in ergocub-software:

@xela-95 @traversaro now the versions of all the repo used is both in the commit message and PR body

@Nicogene
Copy link
Member Author

An MVP has been achieved, closing in favour of:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-software Related to Software team-fix Related to Team Fix
Projects
None yet
Development

No branches or pull requests

3 participants