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

[Bug Report] conda activate orbit using incorrect path for setup_python_env.sh #407

Closed
2 tasks done
mattmazzola opened this issue May 10, 2024 · 2 comments
Closed
2 tasks done

Comments

@mattmazzola
Copy link
Contributor

mattmazzola commented May 10, 2024

If you are submitting a bug report, please fill in the following details and use the tag [bug].

Describe the bug

Another issue noticed when attempting to resolve installations issue described in #406

When attempting to activate orbit environment, it fails to find setup_python_env.sh because it is looking in the current, Orbit repo directory instead of the _isaac_sim symbolic linked directory where it should.

Steps to reproduce

Please try to provide a minimal example to reproduce the bug. Error messages and stack traces are also helpful.

conda activate orbit
/home/mattm/repos/orbit/_isaac_sim/setup_conda_env.sh:.:20: no such file or directory: /home/mattm/repos/orbit/setup_python_env.sh```

setup_conda_env.sh

#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MY_DIR="$(realpath -s "$SCRIPT_DIR")"
# path=$SCRIPT_DIR
# while [[ $path != / ]];
# do
    
#     if ! find "$path" -maxdepth 1 -mindepth 1 -iname "_build" -exec false {} +
#     then
#         break
#     fi
#     # Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)"
#     path="$(readlink -f "$path"/..)"
    
# done
# build_path=$path/_build
export CARB_APP_PATH=$SCRIPT_DIR/kit
export EXP_PATH=$MY_DIR/apps
export ISAAC_PATH=$MY_DIR
. ${MY_DIR}/setup_python_env.sh

Work around?

Running conda activate orbit from the ISAACSIM_PATH allows the script to find the setup_python_env.sh file; however, I don't think this should be required

System Info

Describe the characteristic of your environment:

  • Commit: 0753e22
  • Isaac Sim Version: 2023.1.1-rc.8+2023.1.688.573e0291.tc
  • OS: Ubuntu 20.04.6
  • GPU: RTX 3080
  • CUDA: 12.2
  • GPU Driver: 535.171.04

Additional context

Add any other context about the problem here.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo
@mattmazzola
Copy link
Contributor Author

mattmazzola commented May 10, 2024

Upon further investigation I think the issue is with the use of BASH_SOURCE[0]
I am using Zsh and this variable is not defined when running the script resulting in the wrong path being set for $MY_DIR thus the wrong path to find setup_python_env.sh

I changed ${BASH_SOURCE[0]}" to $0 and added log statements to verify, and conda activate seems to work now!

(orbit) ➜  orbit git:(main) ✗ conda deactivate    
(base) ➜  orbit git:(main) ✗ conda activate orbit
BASH_SOURCE_0: 
0: /home/mattm/repos/orbit/_isaac_sim/setup_conda_env.sh

It looks like BASH_SOURCE[0] is used in different places throughout the repo which may mean this problem would exist in many places.

Solution

I think setup_conda_env.sh comes from installation of Isaac sim so I am not sure where to send PR to fix, but this is what I arrived at so both Bash and Zsh (and hopefully others work)

if [ -n "$BASH_VERSION" ]; then
    # Bash
    SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
else
    # Fallback for other shells
    SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
fi

@mattmazzola
Copy link
Contributor Author

The above comment only solved the issue about activating orbit environment.
However, it did not fix the issue with modules.

Here is more complete solution: #103 (comment)

Ruthrash pushed a commit to Ruthrash/Orbit that referenced this issue May 10, 2024
# Description

Specifies that the `--timeout` argument to `run_all_tests.py` is an int

Fixes isaac-sim#407 

## Type of change


- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have run all the tests with `./orbit.sh --test` and they pass
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: AutonomousHansen <50837800+AutonomousHansen@users.noreply.github.com>
Co-authored-by: jsmith-bdai <142246516+jsmith-bdai@users.noreply.github.com>
Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
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

1 participant