-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add preCommand option to support configuring experimental environment by user #2875
Conversation
|
@QuanluZhang The example may not be particularly clear. It is an example for export python path directly, but not only |
got it. so it is not specifically for specifying python environment, it is a general command which is executed before trial code. suggest to make it clear how to specify python environment with this command in doc |
Indeed, I will add more detailed instructions in the doc. |
bae7a1a
to
37a1401
Compare
This |
Yes, if user don't set |
``` | ||
|
||
Files in `codeDir` will be uploaded to remote machines automatically. You can run below command on Windows, Linux, or macOS to spawn trials on remote Linux machines: | ||
Files in `codeDir` will be uploaded to remote machines automatically. The `preCommand` will be executed before the remote machine executes other commands. So if you need to configure the experimental environment such as activate the conda environment, set `preCommand`. You can run below command on Windows, Linux, or macOS to spawn trials on remote Linux machines: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to use a subsection to explain how to config python environment with preCommand
37a1401
to
5128de3
Compare
5128de3
to
1fd74c5
Compare
Please add UT and/or IT test cases. |
Since this preCommand will be added to all commands executed on remote machine, so in doc/config example, please mention that: user should not use those commands may make changes to system, like |
remote machine support windows as local / remote system, have we checked whether it works on windows? |
Got it.
This should indeed remind users. I will add note for it.
Yes, it works on windows. |
preCommand: command1 && command2 && command3 | ||
``` | ||
|
||
__Note__: Because __preCommand__ will execute before other commands each time, it is strongly not recommended to set __preCommand__ that will make changes to system, i.e. `mkdir` or `touch`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doc is very clear!
preCommand: call activate ${replace_to_conda_env_name} | ||
``` | ||
|
||
If there are multiple commands want to execute, you can use `&&` to connect these commands: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"If there are multiple commands want to execute" -> "If you want multiple commands to be executed"
a1bb3e0
to
01020d8
Compare
It can be used in remote mode by set preCommand in experiment config. It is an optional key with string value.
An example is as below: