在slurm脚本中指定git分支
我正在远程计算集群上运行slurm作业提交文件。该作业调用了一个git存储库下的一些脚本,该脚本具有两个分支main
和test_branch
。在远程群集的目录中,我可以使用git Checkout
轻松地在两者之间切换。我希望Slurm Job使用test_branch
分支。但是,如果我只检查该分支,然后使用sbatch file.sh
运行作业提交文件,我可以从输出文件中分辨出它正在使用main
的脚本。 (我在test_branch
中修复了某些错误,但不是main
)。我已经尝试将git Checkout test_branch
直接添加到作业提交脚本中,但这并没有改变任何内容。我该如何解决?不确定它是否相关,但是作业提交文件正在运行一个python脚本,在调用脚本之前,我让文件激活特定的conda环境。
编辑: 这是我正在运行的脚本。
# Clear the environment from any previously loaded modules
module purge > /dev/null 2>&1
# Load the module environment I need
module load anaconda
conda activate my_env
# Checkout the right branch
git checkout test_branch
# Run the actual python script
python ./my_python_script.py
I am running a slurm job submission file on a remote computing cluster. The job calls some scripts that are under a git repository that has two branches main
and test_branch
. In my directory on the remote cluster I can easily switch between the two using git checkout
. I would like the slurm job to use the test_branch
branch. However, if I just checkout that branch and then run the job submission file with sbatch file.sh
, I can tell from the output file that it is using the scripts from main
(there are certain bugs I fixed in test_branch
but not main
). I have tried adding git checkout test_branch
directly into the job submission script, but that doesn't change anything. How can I fix this? Not sure if its relevant, but the job submission file is running a python script, and before calling the script I have the file activate a specific conda environment.
Edit:
Here is the script I am running.
# Clear the environment from any previously loaded modules
module purge > /dev/null 2>&1
# Load the module environment I need
module load anaconda
conda activate my_env
# Checkout the right branch
git checkout test_branch
# Run the actual python script
python ./my_python_script.py
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论