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

Suggestions for speeding up installation? #174

Open
schmidtw opened this issue Mar 15, 2023 · 3 comments
Open

Suggestions for speeding up installation? #174

schmidtw opened this issue Mar 15, 2023 · 3 comments

Comments

@schmidtw
Copy link

I noticed that the installation of licensed via the gems takes around 1min 17s. I'm wondering if I have the setup-licensed configured/tuned the best.

My workflow:
https://github.com/goschtalt/.github/blob/dfc77e139ee278bd4e7acdd92b03d037c0998919/.github/workflows/ci.yml#L208

Below is a snippet of running the above workflow. What is interesting to me is that the majority of the time is being taken around this line:

2023-03-15T06:13:58.9854894Z Building native extensions. This could take a while...

Full log of the time that is interesting:

2023-03-15T06:13:53.9974155Z ##[group]Run jonabc/setup-licensed@d6b3a6f7058c2b40c06d205e13e15c2418977566
2023-03-15T06:13:53.9974500Z with:
2023-03-15T06:13:53.9974706Z   version: 4.x
2023-03-15T06:13:53.9974957Z   dependabot_skip: true
2023-03-15T06:13:53.9975226Z   cleanup_on_success: true
2023-03-15T06:13:53.9975885Z   github_token: ***
2023-03-15T06:13:53.9976141Z   install-dir: /usr/local/bin
2023-03-15T06:13:53.9976403Z ##[endgroup]
2023-03-15T06:13:54.0984692Z attempting to install licensed gem matching "4.x"
2023-03-15T06:13:54.1073677Z [command]/opt/hostedtoolcache/Ruby/3.2.1/x64/bin/gem list licensed --exact --remote --all --quiet
2023-03-15T06:13:57.3524868Z licensed (4.2.0, 4.1.0, 4.0.4, 4.0.3, 4.0.2, 4.0.1, 4.0.0, 3.9.1, 3.9.0, 3.8.0, 3.7.5, 3.7.4, 3.7.3, 3.7.2, 3.7.1, 3.7.0, 3.6.0, 3.5.0, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4.0, 3.3.1, 3.3.0, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.1.0, 3.0.1, 3.0.0, 2.15.2, 2.15.1, 2.15.0, 2.14.4, 2.14.3, 2.14.2, 2.14.1, 2.14.0, 2.13.0, 2.12.2, 2.12.1, 2.12.0, 2.11.1, 2.11.0, 2.10.0, 2.9.2, 2.9.1, 2.9.0, 2.8.0, 2.7.0, 2.6.2, 2.6.1, 2.6.0, 2.5.0, 2.4.0, 2.3.2, 2.3.1, 2.3.0, 2.2.0, 2.1.0, 2.0.1, 2.0.0, 1.5.2, 1.5.1, 1.4.0, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0, 1.1.0, 1.0.1, 1.0.0, 0.11.1, 0.11.0, 0.10.0, 0.6.0)
2023-03-15T06:13:57.3794003Z [command]/opt/hostedtoolcache/Ruby/3.2.1/x64/bin/gem install licensed -v 4.2.0
2023-03-15T06:13:58.9849568Z Successfully installed tomlrb-2.0.3
2023-03-15T06:13:58.9850322Z Successfully installed thor-1.2.1
2023-03-15T06:13:58.9851049Z Successfully installed ruby-xxHash-0.4.0.2
2023-03-15T06:13:58.9851873Z Successfully installed nokogiri-1.14.2-x86_64-linux
2023-03-15T06:13:58.9852663Z Successfully installed reverse_markdown-2.1.1
2023-03-15T06:13:58.9853472Z Successfully installed pathname-common_prefix-0.0.1
2023-03-15T06:13:58.9854219Z Successfully installed parallel-1.22.1
2023-03-15T06:13:58.9854894Z Building native extensions. This could take a while...
2023-03-15T06:15:15.3005999Z Successfully installed rugged-1.5.1
2023-03-15T06:15:15.3006505Z Successfully installed faraday-net_http-3.0.2
2023-03-15T06:15:15.3006913Z Successfully installed faraday-2.7.4
2023-03-15T06:15:15.3007334Z Successfully installed public_suffix-5.0.1
2023-03-15T06:15:15.3007735Z Successfully installed addressable-2.8.1
2023-03-15T06:15:15.3051129Z Successfully installed sawyer-0.9.2
2023-03-15T06:15:15.3051572Z Successfully installed octokit-6.1.0
2023-03-15T06:15:15.3051966Z Successfully installed dotenv-2.8.1
2023-03-15T06:15:15.3052361Z Successfully installed licensee-9.16.0
2023-03-15T06:15:15.3054903Z Successfully installed licensed-4.2.0
2023-03-15T06:15:15.3055825Z 17 gems installed
2023-03-15T06:15:15.3101860Z licensed (4.2.0) gem installed

Thanks for any suggestions.

@jonabc
Copy link
Contributor

jonabc commented Mar 15, 2023

👋 I don't think there's a clear option for speeding up licensed installation right now, your workflow file looks fine. There are some options here to speed up licensed installation

  1. the rugged gem adds support for precompiled binary gems to get rid of the time spent building native extensions altogether
  2. this action supports caching the gem installation, either as an option or as an always-on feature. similar to the ruby/setup-ruby caching feature
  3. users of the action add caching into their workflow file manually, i.e. implementing the caching that this action would support individually in each workflow
    • I'm adding this for completeness and as a potential option to unblock you in the near term if the runtime cost for installing this gem in your workflow is a serious issue. This is not something I'd suggest as a general, permanent solution at a large scale 😓 😂

@schmidtw
Copy link
Author

Thanks for checking. The time isn't a large issue for me today, but wanted to make sure I got it right.

One idea I had was to create a composite action that is container based where everything is preinstalled. Then run a periodic job that rebuilds the container at some interval. Not sure if there are dragons lurking, but thought that might be a quick, easy win.

@jonabc
Copy link
Contributor

jonabc commented Mar 17, 2023

One idea I had was to create a composite action that is container based where everything is preinstalled. Then run a periodic job that rebuilds the container at some interval. Not sure if there are dragons lurking, but thought that might be a quick, easy win.

If that is an option for you I'd say give it a shot! I'd be interested in hearing how that goes. I've tried to do that in the past and it can work well for specific usages but it's hard to implement in a general way due to the different requirements from each language and/or package manager.

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