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

Using Anaconda to Execute .sh Test Run File on Windows #13

Open
i-sayuh opened this issue Feb 22, 2024 · 2 comments
Open

Using Anaconda to Execute .sh Test Run File on Windows #13

i-sayuh opened this issue Feb 22, 2024 · 2 comments
Assignees

Comments

@i-sayuh
Copy link

i-sayuh commented Feb 22, 2024

When a bash job is submitted through anaconda (powershell prompt) on a windows machine, anaconda opens an external application called Git Bash which is a bash environment that is used to execute the bash job. Git Bash basically enables bash and git operations with the command line of a Windows operating system. The nice thing about using anaconda is that you can easily specify which python environment you want the job to be executed under and make changes to that environment as needed. However, the Git Bash interface which logs what is going on as the model runs, is only open for as long as the model runs, and then it automatically closes. Whether a run is successful or not, it is important to have access to the output log. Therefore, one must manually open Git Bash and submit the job directly through Git Bash so that there is no issue of the output log disappearing. However, this presents the following error: When the 'test_run.sh' file is submitted through anaconda, the line "python main.py --datapath=$DATADIR --lca_config_file=$DATADIR/$yaml.yaml" gives no issues because anaconda knows where the python executable is stored based on the active python environment. However, this line throws an error when 'test_run.sh' is submitted directly through Git Bash because there is no active python environment specified in Git Bash. An active python environment cannot be specified in Git Bash because Git Bash is not fundamentally tied to python. This means that the 'test_run.sh' file has to be adjusted so that the computer knows which python environment to use and execute the job under when using Git Bash directly on a Windows Machine. This is what the file looks for me (note 'python' was changed to the specific local directory of the python executable file associated with my liaison python environment):

image

@tjlca
Copy link
Collaborator

tjlca commented Feb 28, 2024

This is great feedback. The primary reason for using bash commands over here was that users do not have to manually mention

CODEDIR
and
DATADIR.

What is CODEDIR?

path_to_LiAISON_folder/code

What is DATADIR?
path_to_LiAISON_folder/data

I used the bash method so that users do not have to enter the path_to_LiAISON_folder manually in the test_run, run and run_all sh files.

However, it seems its not working.

Resolution 1: As @i- suggested, point to the Anaconda python which is again an issue.
Resolution 2: Do not use bash capture of PATH_DIR. Make the user enter the proper path by giving examples in the run.sh file.

@tjlca tjlca self-assigned this Feb 28, 2024
@i-sayuh
Copy link
Author

i-sayuh commented Feb 28, 2024

I honestly do not know which resolution is best. I just know that the resolution I provided solves the issue for windows users who do python coding and have to submit bash jobs on their internal machine (assuming they use Git Bash for this which I believe all windows machines have installed but this we would need to confirm to make sure the solution we implement works ideally for all windows users)

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

2 participants