Skip to content

Conversation

vors
Copy link
Contributor

@vors vors commented Jun 11, 2022

Bazel quality of life improvement.

This change adds a new option --config=shell which allows you to drop-in the shell right before the bazel run command is executed. For example you will have ability to examine bazel sandbox this way, run things under gdb instead of a normal run and so on.

Example usage:

bazel run --config=shell //:init_test

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jun 11, 2022

🔗 Helpful links

✅ No Failures (24 Pending)

As of commit 4dbe368 (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@vors
Copy link
Contributor Author

vors commented Jun 12, 2022

Current failure is a flake RuntimeError: CUDA driver error: out of memory

@mikaylagawarecki mikaylagawarecki added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jun 14, 2022
Copy link
Collaborator

@dagitses dagitses left a comment

Choose a reason for hiding this comment

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

sounds awesome!

# OR
# bazel run --config=shell //:target

shell="/bin/bash"
Copy link
Collaborator

Choose a reason for hiding this comment

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

these should be single quotes or unquoted. Only use double quotes if you want something expanded within the string.

# OR
# bazel run --config=shell //:target

shell="/bin/bash"
Copy link
Collaborator

Choose a reason for hiding this comment

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

should shell default to user's shell?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are using a shell specific --noprofile and --rcfile.
zsh for example doesn't have the --noprofile (I think it has but under different name).

export PYTORCH_SHELL_COMMAND=$*
echo "alias run=\"$*\"" > "$rcfile"
echo "PS1='\s-\v\$ '" >> "$rcfile"
echo "cat"
Copy link
Collaborator

Choose a reason for hiding this comment

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

what are these three lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, it's my debug output :P removed

@vors vors force-pushed the sergei/shellwrap branch from bd41d6a to 7830385 Compare June 17, 2022 16:37
@vors
Copy link
Contributor Author

vors commented Jun 24, 2022

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Merge failed due to This PR is too stale; the last push date was more than 3 days ago. Please rebase and try again.
Raised by https://github.com/pytorch/pytorch/actions/runs/2558545092

@vors
Copy link
Contributor Author

vors commented Jun 24, 2022

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a rebase job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased sergei/shellwrap onto refs/remotes/origin/master, please pull locally before adding more changes (for example, via git checkout sergei/shellwrap && git pull --rebase)

@vors
Copy link
Contributor Author

vors commented Jun 24, 2022

@pytorchbot merge

@vors
Copy link
Contributor Author

vors commented Jun 24, 2022

@pytorchbot help

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 24, 2022

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'help' (choose from 'merge', 'revert', 'rebase')

usage: @pytorchbot [-h] {merge,revert,rebase} ...

Try @pytorchbot --help for more info.

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

Hey @vors.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

facebook-github-bot pushed a commit that referenced this pull request Jun 27, 2022
Summary:
Bazel quality of life improvement.

This change adds a new option `--config=shell` which allows you to drop-in the shell right before the `bazel run` command is executed. For example you will have ability to examine bazel sandbox this way, run things under gdb instead of a normal run and so on.

Example usage:

```
bazel run --config=shell //:init_test
```

Pull Request resolved: #79350
Approved by: https://github.com/dagitses

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/972a209284c0f0795738a4b872c6c693cce0b619

Reviewed By: atalman

Differential Revision: D37455718

Pulled By: atalman

fbshipit-source-id: 4e212326c24100fad7556ecb0d7854bdc97d4a09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed Merged open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants