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

Testing a bare minimum of HITL functionality #1787

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open

Conversation

henrysamer
Copy link
Contributor

@henrysamer henrysamer commented Feb 2, 2024

Motivation and Context

Add ability to test HITL apps in CI
Ensure habitat-hitl can be installed alongside habitat-lab and habitat-baselines
Improve testability by using Compose API instead of @hydra.main

How Has This Been Tested

tested locally

Types of changes

  • [Experiment]
    Created minimal HITL app in test_main_hitl.py
    Runs app for 1 step using headless mode
    Uses Compose API to load config
    Added habitat-hitl installation to .circleci/config.yml

Checklist

  • [x ] My code follows the code style of this project.
  • [ x] I have updated the documentation if required.
  • [ x] I have read the CONTRIBUTING document.
  • [ x] I have completed my CLA (see CONTRIBUTING)
  • [ x] I have added tests to cover my changes if required.

@henrysamer henrysamer self-assigned this Feb 2, 2024
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 2, 2024
@henrysamer henrysamer added the do not merge Not ready to merge. This label should block merging. label Feb 3, 2024
@henrysamer henrysamer changed the title Testing a bare minimum of HITL functionality including minimal, pick_throw_vr, basic_viewer, and rearrange Testing a bare minimum of HITL functionality Feb 5, 2024
@henrysamer henrysamer removed the do not merge Not ready to merge. This label should block merging. label Feb 5, 2024
Copy link
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

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

I left some comments. I expect part of the problem with this failing test is that you aren't downloading hab3-episodes (something like python -m habitat_sim.utils.datasets_download --uids hab3-episodes). Let's make sure this test is running through pytest and passing before we merge. Let me know when to take another look!

main(cfg)


if __name__ == "__main__":
Copy link
Contributor

Choose a reason for hiding this comment

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

This block shouldn't be needed. Pytest should run test_hitl_main automatically.

@@ -43,7 +43,7 @@ def _parse_debug_third_person(hitl_config, viewport_multiplier=(1, 1)):
return do_show, width, height


def hitl_main(app_config, create_app_state_lambda=None):
def hitl_main(app_config, create_app_state_lambda=None, test_flag=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see that you're using this. I guess it could be removed.

. activate habitat; cd habitat-lab
export PYTHONPATH=.:$PYTHONPATH
export MULTI_PROC_OFFSET=0 && export MAGNUM_LOG=quiet && export HABITAT_SIM_LOG=quiet
python test/hitl/test_hitl_main.py -s
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't need to run this file explicitly. We should use pytest like the other tests in this file.

@henrysamer henrysamer marked this pull request as ready for review February 7, 2024 12:41
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
. activate habitat; cd habitat-lab
ln -s ../habitat-sim/data data
python -m habitat_sim.utils.datasets_download --uids hab3-episodes habitat_humanoids hab_spot_arm ycb hssd-hab --data-path data/ --no-replace --no-prune
Copy link
Contributor

Choose a reason for hiding this comment

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

We can't download hssd-hab in a CI test--it is quite large (~20GB). Talk to @aclegg3 about a CI-friendly version of this dataset.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI @henrysamer we still need to change this PR to not download hssd-hab. I realize the test is passing, but we shouldn't have CI doing such a large download.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might need to understand why dataset episodes aren't being found here

Copy link
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

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

Some more comments. Good progress!

@@ -0,0 +1,20 @@
# test_cfg.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

As this is a config for testing only, it should probably live with the tests, not in the library itself. test/config/habitat_hitl/test_cfg.yaml would be consistent with the other test configs.

):
cfg = compose(config_name="test_cfg")
main(cfg)
print("done!")
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to print this.

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to add these binary output files to source control.


- run:
name: Run HITL functionality
no_output_timeout: 60m
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like your recent successful run took about 4 minutes. I'm actually shocked it downloaded HSSD so quickly! Anyway let's reduce this timeout to something like 10 or 15 minutes.

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to add these binary output files to source control.

python -m habitat_sim.utils.datasets_download --uids hab3-episodes habitat_humanoids hab_spot_arm ycb hssd-hab --data-path data/ --no-replace --no-prune
export PYTHONPATH=.:$PYTHONPATH
export MULTI_PROC_OFFSET=0 && export MAGNUM_LOG=quiet && export HABITAT_SIM_LOG=quiet
export TEST_BASELINE_SMALL=1
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this env var TEST_BASELINE_SMALL is needed for your test.

henrysamer and others added 17 commits February 9, 2024 10:07
…p_recent_server_keyframe_id to help the server measure client latency (#1796)
* Add type annotations to app_service.

* Propagate AppService type annotations to the apps.

* Move displaced comment.

* Force keyword argument usage in AppService constructior.
* correction

* correction

* correction

* correction

* correction

* correction

* correction
…mo (#1810)

* nicer instructions for installing Magnum on Mac
* add MVP rearrange_v2 HITL app
* add GuiPlacementHelper
* add ClientHelper
* changes to GuiPickHelper.
* add config habitat_hitl.debug_line_width
* changes to how connection_record/connection_params are handled
* add config habitat_hitl.networking.wait_for_app_ready_signal
* support for tracking client latency
* add color and billboard-versus-up-facing options for highlight messages
* minor bugfix to unity_dataset_processing.py
* add hydra-core to requirements.txt
* Add camera sync support to HITL.

* Renaming and refactoring.
* Pass skinning keyframe data to the client.

* Add configuration to activate or deactivate skinning.

* Formatting fix.

* Add checks for rig removal from keyframes.

* Refactoring. Remove conditional consolidation of rigs.
@facebook-github-bot
Copy link
Contributor

Hi @henrysamer!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants