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

Ability to print timings of the various steps performed #57

Closed
yorickpeterse opened this issue Jul 27, 2023 · 7 comments
Closed

Ability to print timings of the various steps performed #57

yorickpeterse opened this issue Jul 27, 2023 · 7 comments

Comments

@yorickpeterse
Copy link

I'm using this action to run tests of https://github.com/inko-lang/inko on FreeBSD. What I'm seeing is build times in the order of 15-20 minutes, even though the tests only run for about 5-10 minutes. Looking at the output it's not really clear where time is being spent, though I have a suspicion the syncing of files is taking up most of the time.

Is there a way to have the action print timings of the individual steps performed? That might help narrow down where the time is being spent. 😃

@jacob-carlborg
Copy link
Contributor

There are a couple of things you can try out of the box:

  • You can show timestamps of the workflow log by clicking the gear icon in the top right corner when viewing a job:
    Screenshot 2023-07-27 at 21 21 08
  • You can enable more logging by setting the following variables ACTIONS_RUNNER_DEBUG and ACTIONS_STEP_DEBUG to true. You can set them under repository settings -> Secrets and variables -> Actions:
    Screenshot 2023-07-27 at 21 26 20
    These variables will enable more logging of all actions.

@yorickpeterse
Copy link
Author

@jacob-carlborg

You can show timestamps of the workflow log by clicking the gear icon in the top right corner when viewing a job:

Oh my, I had completely forgotten about that. 🤦

From these timings, I found the following:

  • It seems to take about 3 minutes to set the VM up, of which 2 minutes are spent rsync'ing the files to the VM
  • Around 5 minutes are spent installing some dependencies I need (e.g. LLVM and Rust). It seems most time is spent installing the packages needed for Git. Perhaps it would make sense to have Git installed by default?
  • The rest of the time seems spent in the actual testing process, which is something I need to fix myself
  • Sending the files back to the host takes about 1 minute

Out of these, I think pre-installing Git is the only change that could be worth making, as I'm not sure the rsync commands could be made any faster, short of running it in parallel somehow.

@jacob-carlborg
Copy link
Contributor

Out of these, I think pre-installing Git is the only change that could be worth making

I'm a bit reluctant to add new pre installed packages. I want to keep the VM images as small as possible to reduce download time and boot overhead. There's always going to be someone that wants to add some other package that is not installed by default. Although, in this particular case, Git would be reasonable to have installed by default. I'll take a look at how much the size increases when Git is added.

Another alternative is allow custom VM images. Then anyone can add their particular default packages and the size increase won't affect anyone else.

as I'm not sure the rsync commands could be made any faster, short of running it in parallel somehow.

I'll look into that.

@yorickpeterse
Copy link
Author

yorickpeterse commented Jul 29, 2023

For the time being I ended up forking this action and the freebsd-builder project, pulling in #13 so I can use a custom image. Getting it up and running took a bid of fiddling around, but it seems to work well so far, and shaves off a good 10 minutes from my build times 😄

For those wanting to do the same, take a look at this and this, and this commit that applies it to my project in question.

@jacob-carlborg
Copy link
Contributor

For the time being I ended up forking this action and the freebsd-builder project, pulling in #13 so I can use a custom image.

Seems I need to finish this feature now 😄.

@jacob-carlborg
Copy link
Contributor

I've added official support for custom VM images now: https://github.com/cross-platform-actions/action/releases/tag/v0.18.0. Can we close this issue?

@yorickpeterse
Copy link
Author

@jacob-carlborg Yes, it's working perfectly. Thanks! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants