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

Fix lunar lander dependency issues #367

Merged
merged 48 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f22c908
reorder dask imports
btjanaka Sep 10, 2023
629ddd3
upgrade to latest version of gymnasium
btjanaka Sep 10, 2023
b9d3d88
add period
btjanaka Sep 10, 2023
2643f78
Ignore long pip install lines in pylint
btjanaka Sep 10, 2023
f679a6b
history
btjanaka Sep 10, 2023
5fc9e5d
history
btjanaka Sep 10, 2023
2c7507d
Merge branch 'master' into lander-deps
btjanaka Sep 10, 2023
a508ede
Support multiple pip installation commands in examples.sh
btjanaka Sep 10, 2023
4de4f68
Update deps in lunar lander example
btjanaka Sep 10, 2023
e7381c3
Fix swig comment
btjanaka Sep 10, 2023
1cb417c
check swig installation
btjanaka Sep 10, 2023
baace00
Try hash -r
btjanaka Sep 10, 2023
6e142e2
Remove swig check
btjanaka Sep 10, 2023
c06f885
Revert "Try hash -r"
btjanaka Sep 10, 2023
80012b0
Try printing paths
btjanaka Sep 10, 2023
32e98c6
More debug
btjanaka Sep 10, 2023
b89d3f5
Try hash here
btjanaka Sep 10, 2023
80772bf
Comment out tests for now
btjanaka Sep 10, 2023
0c6f90b
Try calling swig
btjanaka Sep 10, 2023
fcb6a0d
Proper removal of swig?
btjanaka Sep 10, 2023
4e416e4
Use apt-get instead of apt
btjanaka Sep 10, 2023
57caeb4
Remove swig from tutorial to check failure
btjanaka Sep 10, 2023
124523e
Revert "Remove swig from tutorial to check failure"
btjanaka Sep 10, 2023
aba3869
More debug
btjanaka Sep 10, 2023
5f1e4b7
Check paths again
btjanaka Sep 10, 2023
266633b
Try changing cmd
btjanaka Sep 10, 2023
c43e872
Try python 3.10
btjanaka Sep 10, 2023
7114b3e
Revert "Try python 3.10"
btjanaka Sep 10, 2023
bf53abb
Move to separate cmd
btjanaka Sep 10, 2023
ed68512
Try combining cmd
btjanaka Sep 10, 2023
8372a1f
Try simple install
btjanaka Sep 10, 2023
764f912
Move deps to ci?
btjanaka Sep 10, 2023
468f307
Revert debugging
btjanaka Sep 10, 2023
adb9dd7
Revert "Comment out tests for now"
btjanaka Sep 10, 2023
d898cca
Comment on swig
btjanaka Sep 10, 2023
8acbc36
Remove extra install cmd
btjanaka Sep 10, 2023
5f0c722
Re-run notebook and update times
btjanaka Sep 10, 2023
15bae77
Update times
btjanaka Sep 10, 2023
cc5c7b8
Update time again
btjanaka Sep 10, 2023
8926530
Remove redundant code
btjanaka Sep 10, 2023
98cf0e6
Bring back swig removal
btjanaka Sep 10, 2023
0f43755
Try older version of swig
btjanaka Sep 10, 2023
ca0854b
Check pip version
btjanaka Sep 10, 2023
607291e
Try printing path
btjanaka Sep 10, 2023
0cbf341
Try using virtualenv
btjanaka Sep 10, 2023
7d644b7
Clean up lunar lander example virtual env
btjanaka Sep 10, 2023
faa6566
Remove swig version
btjanaka Sep 10, 2023
a2ef0e0
Do virtualenv with conda
btjanaka Sep 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,30 +113,29 @@ jobs:
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# SWIG should not be installed so that we can test that lunar lander is
# installing SWIG properly. See https://github.com/icaros-usc/pyribs/pull/366
- name: Remove swig
run: sudo rm -rf /usr/bin/swig
- name: Set up Python 3.8
uses: actions/setup-python@v4
run: sudo apt-get remove swig
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.8"
- name: Upgrade pip
run: python -m pip install --upgrade pip
python-version: 3.8
- name: Install deps
shell: bash -el {0}
run: pip install .[visualize]
- name: Test Examples
shell: bash -el {0}
run: bash tests/examples.sh
tutorials:
runs-on: ubuntu-latest
steps:
# We use Python 3.10 instead of 3.8 here since Google Colab uses 3.10.
- uses: actions/checkout@v4
# SWIG should not be installed so that we can test that lunar lander is
# installing SWIG properly. See https://github.com/icaros-usc/pyribs/pull/366
- name: Remove swig
run: sudo rm -rf /usr/bin/swig
run: sudo apt-get remove swig
# We use Python 3.10 instead of 3.8 here since Google Colab uses 3.10.
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
Expand Down
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ max-nested-blocks=5
max-line-length=80

# Regexp for a line that is allowed to be longer than the limit. The first group
# (before the `|`) matches URLs, and the second matches Sphinx links.
ignore-long-lines=(^\s*(# )?<?https?://\S+>?$)|(^\s*<.*>`_.?$)
# (before the `|`) matches URLs, the second matches Sphinx links, the third
# matches pip install commands.
ignore-long-lines=(^\s*(# )?<?https?://\S+>?$)|(^\s*<.*>`_.?$)|(^\s*pip install .*)

# Allow the body of an if to be on the same line as the test if there is no
# else.
Expand Down
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

- Use dask instead of multiprocessing for lunar lander tutorial ({pr}`346`)
- pip install swig before gymnasium[box2d] in lunar lander tutorial ({pr}`346`)
- Fix lunar lander dependency issues ({pr}`366`)
- Fix lunar lander dependency issues ({pr}`366`, {pr}`377`)

#### Improvements

Expand Down
6 changes: 4 additions & 2 deletions examples/lunar_lander.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Uses CMA-ME to train agents with linear policies in Lunar Lander.

Install the following dependencies before running this example:
pip install ribs[visualize] tqdm fire gymnasium[box2d]==0.27.0 moviepy>=1.0.0 dask>=2.0.0 distributed>=2.0.0 bokeh>=2.0.0
Install the following dependencies before running this example -- swig must be
installed before box2d can be installed, hence it is a separate command:
pip install swig
pip install ribs[visualize] tqdm fire gymnasium[box2d]==0.29.1 moviepy>=1.0.0 dask>=2.0.0 distributed>=2.0.0 bokeh>=2.0.0

This script uses the same setup as the tutorial, but it also uses Dask instead
of Python's multiprocessing to parallelize evaluations on a single machine and
Expand Down
7 changes: 5 additions & 2 deletions tests/examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ if [ ! -d "${TMPDIR}" ]; then
fi

function install_deps() {
install_cmd=$(grep "pip install" "$1")
$install_cmd
# Loop through all instances of `pip install` in the script and run the
# installation commands.
grep '^\s*pip install' "$1" | while read -r install_cmd ; do
$install_cmd
done
}

# Single-threaded for consistency.
Expand Down
Loading