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

remove gcc #2536

Merged
merged 1 commit into from
Jun 20, 2024
Merged

remove gcc #2536

merged 1 commit into from
Jun 20, 2024

Conversation

Shimada666
Copy link
Contributor

What is the problem that this fixes or functionality that this introduces? Does it fix any open issues?

We no longer need gcc. Installing GCC will increase the load time of jupyter plugin. After removing GCC, it still works finely on Ubuntu 22.04, Debian 11, and ghcr.io/opendevin/sandbox:main.

Give a brief summary of what the PR does, explaining any non-trivial design decisions

Remove gcc installation in jupyter's setup.sh

Other references

@Shimada666
Copy link
Contributor Author

Shimada666 commented Jun 20, 2024

Why did I need to install GCC before?
Because with psutil version < 6, GCC was required to install psutil. But recently, psutil released version 6.0.0, and we no longer need GCC to install it. Please refer to the following logs for details.
Installing jupyterlab will lead to install psutil

root@806d2675cadd:/# pip install psutil
Collecting psutil
  Downloading psutil-6.0.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (21 kB)
Downloading psutil-6.0.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (292 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 292.0/292.0 kB 500.1 kB/s eta 0:00:00
Installing collected packages: psutil
Successfully installed psutil-6.0.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv



root@806d2675cadd:/# pip install psutil==5.9.8
Collecting psutil==5.9.8
  Downloading psutil-5.9.8.tar.gz (503 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 503.2/503.2 kB 581.9 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: psutil
  Building wheel for psutil (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [46 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-310
      creating build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_pslinux.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_common.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_compat.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/__init__.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_pswindows.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_psbsd.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_pssunos.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_psposix.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_psosx.py -> build/lib.linux-aarch64-cpython-310/psutil
      copying psutil/_psaix.py -> build/lib.linux-aarch64-cpython-310/psutil
      creating build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_system.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/runner.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/__init__.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_process_all.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
      running build_ext
      building 'psutil._psutil_linux' extension
      creating build/temp.linux-aarch64-cpython-310
      creating build/temp.linux-aarch64-cpython-310/psutil
      creating build/temp.linux-aarch64-cpython-310/psutil/arch
      creating build/temp.linux-aarch64-cpython-310/psutil/arch/linux
      gcc -pthread -B /opendevin/miniforge3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O3 -Wall -fPIC -O3 -isystem /opendevin/miniforge3/include -fPIC -O3 -isystem /opendevin/miniforge3/include -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -DPSUTIL_LINUX=1 -I/opendevin/miniforge3/include/python3.10 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-310/psutil/_psutil_common.o
      psutil could not be installed from sources because gcc is not installed. Try running:
        sudo apt-get install gcc python3-dev
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

@tobitege
Copy link
Collaborator

Why did I need to install GCC before? Because with psutil version < 6, GCC was required to install psutil. But recently, psutil released version 6.0.0, and we no longer need GCC to install it. Please refer to the following logs for details.

I presume, they did that for all platforms we run then?

Less to install is certainly a good thing (without breakage 😏 ).

@Shimada666
Copy link
Contributor Author

Shimada666 commented Jun 20, 2024

@tobitege
Yes, we can remove GCC from the Dockerfile later as well. I'll first remove it in Jupyter's setup.sh since this is more urgent and can significantly reduce the jupyter plugin load time.
Can you help me rerun the tests? It looks like the macOS tests failed intermittently.

@tobitege
Copy link
Collaborator

@tobitege Yes, we can remove GCC from the Dockerfile later as well. I'll first remove it in Jupyter's setup.sh since this is more urgent and can significantly reduce the jupyter plugin load time.

Sure, agreed.

Can you help me rerun the tests? It looks like the macOS tests failed intermittently.

I think we can ignore the macOS tests status. It's unrelated to your PR.

@Shimada666
Copy link
Contributor Author

Oh, I just noticed the macOS tests are not necessary, please ignore them!

@tobitege
Copy link
Collaborator

Oh, I just noticed the macOS tests are not necessary, please ignore them!

Right. This change looks good to me, but I'd defer to other maintainers' expertise for approval.

@tobitege tobitege requested review from SmartManoj and li-boxuan June 20, 2024 07:39
@SmartManoj
Copy link
Contributor

@Shimada666 This will help you #2179

@Shimada666
Copy link
Contributor Author

@SmartManoj
Thanks, but that doesn't seem related. I just want to remove installing gcc when loading jupyter plugin. 😊

@SmartManoj
Copy link
Contributor

SmartManoj commented Jun 20, 2024

when loading jupyter plugin.

That relates to one-time loading which even saves time for you.

@SmartManoj SmartManoj merged commit 9ec5e4f into All-Hands-AI:main Jun 20, 2024
2 checks passed
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.

3 participants