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

feat: improve dependency installation experience #1298

Merged
merged 26 commits into from Jul 4, 2023

Conversation

MegaRedHand
Copy link
Contributor

@MegaRedHand MegaRedHand commented Jun 29, 2023

Description

This PR:

  • updates the rust version in the list of dependencies (compilation in 1.66.1 is broken)
  • adds the install.sh script, that detects the OS/distro and calls the corresponding installation script and make deps
  • adds instructions on the README for running the script
  • modifies the test_install workflow to use the script and to compile the whole project, to catch any missing dependencies
  • disables the test_install workflow, so it runs only on pushes to main branch

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #1298 (30da4a4) into main (6fc69cd) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1298   +/-   ##
=======================================
  Coverage   97.88%   97.88%           
=======================================
  Files          89       89           
  Lines       35473    35473           
=======================================
  Hits        34724    34724           
  Misses        749      749           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

github-actions bot commented Jun 29, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 5.437 ± 0.068 5.358 5.538 1.03 ± 0.04
head big_factorial 5.266 ± 0.175 4.967 5.512 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 4.631 ± 0.140 4.395 4.915 1.03 ± 0.05
head big_fibonacci 4.477 ± 0.148 4.137 4.642 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 13.682 ± 0.465 12.999 14.242 1.00
head blake2s_integration_benchmark 14.007 ± 0.745 13.046 14.883 1.02 ± 0.06
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.833 ± 0.177 4.669 5.286 1.01 ± 0.04
head compare_arrays_200000 4.768 ± 0.104 4.659 4.999 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.235 ± 0.140 3.046 3.474 1.01 ± 0.06
head dict_integration_benchmark 3.189 ± 0.118 3.044 3.450 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 2.352 ± 0.053 2.267 2.419 1.01 ± 0.05
head field_arithmetic_get_square_benchmark 2.339 ± 0.105 2.194 2.482 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 12.650 ± 0.312 12.256 13.169 1.00
head integration_builtins 12.910 ± 0.135 12.701 13.134 1.02 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 14.690 ± 0.503 13.921 15.412 1.04 ± 0.05
head keccak_integration_benchmark 14.159 ± 0.542 13.459 14.950 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.643 ± 0.153 4.494 4.928 1.00
head linear_search 4.920 ± 0.258 4.557 5.332 1.06 ± 0.07
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.573 ± 0.156 3.266 3.751 1.10 ± 0.06
head math_cmp_and_pow_integration_benchmark 3.260 ± 0.124 3.132 3.458 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.976 ± 0.091 2.828 3.080 1.00
head math_integration_benchmark 3.097 ± 0.064 2.969 3.196 1.04 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.805 ± 0.098 2.653 2.945 1.01 ± 0.05
head memory_integration_benchmark 2.790 ± 0.095 2.615 2.895 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.785 ± 0.068 2.711 2.942 1.00
head operations_with_data_structures_benchmarks 2.931 ± 0.100 2.788 3.081 1.05 ± 0.04
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 934.4 ± 21.3 899.6 960.4 1.00
head pedersen 1046.4 ± 23.0 1017.4 1082.3 1.12 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.694 ± 0.050 1.611 1.776 1.00
head poseidon_integration_benchmark 1.753 ± 0.058 1.695 1.872 1.04 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.675 ± 0.137 3.458 3.830 1.00
head secp_integration_benchmark 3.763 ± 0.220 3.338 4.051 1.02 ± 0.07
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.197 ± 0.058 2.101 2.272 1.07 ± 0.03
head set_integration_benchmark 2.051 ± 0.017 2.020 2.075 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 8.708 ± 0.236 8.353 9.164 1.04 ± 0.06
head uint256_integration_benchmark 8.390 ± 0.442 7.913 9.420 1.00

@MegaRedHand MegaRedHand force-pushed the better-installation-experience branch from f58c378 to 3a52a42 Compare June 29, 2023 23:17
@MegaRedHand MegaRedHand marked this pull request as ready for review June 29, 2023 23:18
Just having PyEnv and make installed suffices for running `make deps`.
I don't think we need to list cairo-lang as a dependency.
@Oppen
Copy link
Member

Oppen commented Jun 30, 2023

A few questions:

  1. Can we use the setup-python action instead? It has an option to cache pip deps.
  2. Why can't we use ${HOME} rather than explicitly spelling out the home path?

@MegaRedHand
Copy link
Contributor Author

  1. I was trying to leave the Python installation to the script.
  2. The action treats the ${HOME} syntax as a literal part of a relative path.

It seems the install-python action doesn't support Debian containers anyways 😞

@@ -26,4 +26,3 @@ source ~/cairo_venv/bin/activate

# Install cairo & its dependencies
pip3 install -r requirements.txt

Copy link
Member

Choose a reason for hiding this comment

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

I think we should install pyenv install 3.9.15

Copy link
Member

Choose a reason for hiding this comment

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

Also, this isn't duplicated? Since then install_macos runs make deps-macos
But we can leave it duplicate because make deps-macos won't fail.

What we need to check is to add the CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib before the pip install

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Removed the whole Python install 👍

@pefontana pefontana added this pull request to the merge queue Jul 4, 2023
Merged via the queue into main with commit 44dae41 Jul 4, 2023
34 checks passed
@pefontana pefontana deleted the better-installation-experience branch July 4, 2023 22:20
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jul 25, 2023
* Add installation instructions to README

* Add compilation step to installation testing

* Add script for universal dependency installation

* Update changelog

* Enable test_install workflow only on main

* Update optional dependencies

Just having PyEnv and make installed suffices for running `make deps`.
I don't think we need to list cairo-lang as a dependency.

* Don't compile, only check

* Push again

* Use swatinem cache

* Cache all crates even on failure

* Fix debian rust cache

* Use manual cache

* Test cache

* Cache cairo compiler

* Add pyenv dependency caching

* Cache pip instead of pyenv

* Try fixing cache

* Use setup-python action

* Use ~ instead of ${HOME}

* Use manual cache in Debian container

* Add some comments

* Make cache owned by current user and add logs

* Remove python install from script
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jul 25, 2023
* Add installation instructions to README

* Add compilation step to installation testing

* Add script for universal dependency installation

* Update changelog

* Enable test_install workflow only on main

* Update optional dependencies

Just having PyEnv and make installed suffices for running `make deps`.
I don't think we need to list cairo-lang as a dependency.

* Don't compile, only check

* Push again

* Use swatinem cache

* Cache all crates even on failure

* Fix debian rust cache

* Use manual cache

* Test cache

* Cache cairo compiler

* Add pyenv dependency caching

* Cache pip instead of pyenv

* Try fixing cache

* Use setup-python action

* Use ~ instead of ${HOME}

* Use manual cache in Debian container

* Add some comments

* Make cache owned by current user and add logs

* Remove python install from script
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

Successfully merging this pull request may close these issues.

None yet

3 participants