Hello,
We are trying to use the scheduler but are getting a file path error. The scheduler file and the experiment files are committed to a remote repo (experiments_e9) and then fetched to a local bare repo (experiments_e9.git).

from artiq.experiment import * 

class Scheduling_experiments(EnvExperiment):
def build(self):
    self.setattr_device("core") 
    self.setattr_device("scheduler")

@kernel    
def run(self):
    expid_1 = {
    "file": "experiments_e9.git/TEST_zot_test.py",
    "class_name": "zot_test",
        "log_level": 30,
        #"repo_rev": "N/A",
        }

    self.scheduler.submit("main", expid_1)

We get the error:
root:Terminating with exception (FileNotFoundError: [Errno 2] No such file or directory: 'experiments_e9.git\\TEST_zot_test.py')
Traceback (most recent call last):
File "C:\Users\E9-ARTIQ\anaconda3\envs\artiq\lib\site-packages\artiq\master\worker_impl.py", line 322, in main
exp = get_experiment_from_file(experiment_file, expid["class_name"])
File "C:\Users\E9-ARTIQ\anaconda3\envs\artiq\lib\site-packages\artiq\master\worker_impl.py", line 141, in get_experiment_from_file
module = tools.file_import(file, prefix="artiq_worker_")
File "C:\Users\E9-ARTIQ\anaconda3\envs\artiq\lib\site-packages\artiq\tools.py", line 87, in file_import
spec.loader.exec_module(module)
File "C:\Users\E9-ARTIQ\anaconda3\envs\artiq\lib\site-packages\artiq\compiler\import_cache.py", line 23, in hook_exec_module
im_exec_module(self, module)
File "<frozen importlib._bootstrap_external>", line 879, in exec_module
File "<frozen importlib._bootstrap_external>", line 1016, in get_code
File "<frozen importlib._bootstrap_external>", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'experiments_e9.git\\TEST_zot_test.py'

We have also tried removing .git from the repository name (experiments_e9), and get the same error. Does anyone know how to properly write the file path in the scheduler when using git integration?

Hi. Have you tried to input the absolute path of the experiment in the scheduler?

    fsagbuya input the absolute path of the experiment in the scheduler

    This isn't the correct solution.

    Hi. Upon testing you can apply the following solution:

    Firstly, you should not put your working file inside the bare git repo. In the case of artiq_master with git integration, it checks out the bare repository into a temporary folder using the latest commit. To ensure that the scheduler can access this, you can add a "repo_rev" parameter in the expid and set it to None. By doing this, the system will automatically retrieve the latest revision of the repository.

    Here is an example of how you can modify the code:

    @kernel    
    def run(self):
        expid_1 = {
        "repo_rev": None,
        "file": "experiments_e9/TEST_zot_test.py",
        "class_name": "zot_test",
        "log_level": 30
        }

    Additionally you can also submit the scheduler using the command-line client to run the experiment from the working repository. You can submit the experiment using the following command:

    artiq_client submit -R  /path_to/scheduler_file

    Thanks so much, @fsagbuya, that worked! (Though I'll mention that I also had to add a line ' "arguments": None ' to avoid getting a key error.)