Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi Team, I Am Trying To Run A Pipeline Remotely Using Clearml Pipeline And I’M Encountering Some Issues. Could Anyone Please Assist Me In Resolving Them?

Hi Team,

I am trying to run a pipeline remotely using ClearML pipeline and I’m encountering some issues. Could anyone please assist me in resolving them?

Issue 1 : After executing the code, the pipeline is initiated on the “queue_remote_start” queue and the tasks of the pipeline are initiated on the “queue_remote” queue. However, the creation of the dataset failed because it couldn’t find the Python modules from the current directory.

Issue 2 : I also attempted to use the same queue for both pipe.start and pipe.set_default_execution_queue . However, the tasks of the pipeline remained in the pending and queued state and didn’t proceed to the next step.

To run the pipeline remotely, I have created two different queues and assigned a worker to each using the following commands:

clearml-agent daemon --detached --create-queue --queue queue_remote
clearml-agent daemon --detached --create-queue --queue queue_remote_start

I then executed the following command to run the pipeline remotely:

python3 pipeline.py

The code for the Pipeline from Functions is as follows:

# Create the PipelineController object
    pipe = PipelineController(
        name="pipeline",
        project=project_name,
        version="0.0.2",
        add_pipeline_tags=True,
    )

pipe.set_default_execution_queue('queue_remote')

pipe.add_function_step(
    name='step_one',
    function=step_one,
    function_kwargs={
            "train_file": constants.TRAINING_DATASET_PATH,
            "validation_file": constants.VALIDATAION_DATASET_PATH,
            "s3_output_uri": constants.CLEARML_DATASET_OUTPUT_URI,
            "dataset_project": project_name,
            "dataset_name": constants.CLEARML_TASK_NAME,
            "use_dummy_dataset": use_dummy_model_dataset,
        },
        project_name=project_name,
        task_name=create_dataset_task_name,
        task_type=Task.TaskTypes.data_processing,
    )

pipe.start(queue="queue_remote_start")

Could anyone please provide a solution on how to successfully run the pipeline remotely? Any help would be greatly appreciated.

  
  
Posted 3 months ago
Votes Newest

Answers 39


@<1523701435869433856:profile|SmugDolphin23> I run the code in order to step1, step2 and step3. And then I run the "pipeline_from_task.py" scripts. I follow the ClearML documentation so whole of the codes taken from github repo.

  
  
Posted 3 months ago

I ran it via IDE. I am using conda environment and when I list the clearml packages it looks like in the below. The interpreter match with base environment.
image

  
  
Posted 3 months ago

what do you get when you run this code?

from clearml.backend_api import Session
print(Session.check_min_api_server_version("2.17"))
  
  
Posted 3 months ago

what about import clearml; print(clearml.__version__)

  
  
Posted 3 months ago

This print string like in below. """
if not self._task:
task_name = name or project or '{}'.format(datetime.now())
if self._pipeline_as_sub_project:
parent_project = (project + "/" if project else "") + self._pipeline_section
project_name = "{}/{}".format(parent_project, task_name)
else:
parent_project = None
project_name = project or 'Pipelines'
# if user disabled the auto-repo, we force local script storage (repo="" or repo=False) """

  
  
Posted 3 months ago

Can you please screenshot the INFO tab on the pipeline controller task?

  
  
Posted 3 months ago

how did you install clearml?

  
  
Posted 3 months ago

@<1523701435869433856:profile|SmugDolphin23> I used clearml==1.13.2 and now I am upgrading to clearml=1.14.1 version.Also I would give extra information about Clearml-server docker-compose file images versions is latest right now.

  
  
Posted 3 months ago

There are two task available in the experiments list as you can see in below. I click the step_1 INFO tab and informations like this. There is no available pipeline controller task maybe thats why UI does not show up the pipeline.

  
  
Posted 3 months ago

For the clearml-server installation I follow the documentation steps one by one. Link is : None

  
  
Posted 3 months ago

@<1657556312684236800:profile|ManiacalSeaturtle63> can you share how you are creating your pipeline?

  
  
Posted 3 months ago

Hi!
It is possible to use the same queue for the controller and the steps, but there needs to be at least 2 agents that pull tasks from that queue. Otherwise, if there is only 1 agent, then that agent will be busy running the controller and it won't be able to fetch the steps.

Regarding missing local packages: the step is ran in a temporary directory that is different than the directory the script is originally in. To solve this, you could add all the modules/files you are interested in in a git repository. If you do, that repository will be cloned by the agent when running the steps, which will make the packages accessible.

  
  
Posted 3 months ago

Regarding pending pipelines: please make sure a free agent is bound to the queue you wish to run the pipeline in. You can check queue information by accessing the INFO section of the controller (as in the first screenshort)
then by pressing on the queue, you should see the worker status. There should be at least one worker that has a blank "CURRENTLY EXECUTING" entry
image
image

  
  
Posted 3 months ago

I also encountered a similar problem. When I run pipeline code I could not see in the deployed pipeline in the ClearML UI and the pipeline's first step does not start in the remote agent machine. It is queued with pending status.

  
  
Posted 3 months ago

@<1657556312684236800:profile|ManiacalSeaturtle63> what clearml SDK version are you using? I believe there was a bug related to pipelines not showing in the UI, but that was fixed in clearml==1.14.1

  
  
Posted 3 months ago

It prints "1.13.3rc0"

  
  
Posted 3 months ago

how about this one?

import clearml
import os
print("\n".join(open(os.path.join(clearml.__path__[0], "automation/controller.py")).read().split("\n")[310:320]))
  
  
Posted 3 months ago

@<1626028578648887296:profile|FreshFly37> can you share also logs of task ? It may give an idea.

  
  
Posted 3 months ago

sure, I'll add those details & check. Thank you

  
  
Posted 3 months ago

@<1523701435869433856:profile|SmugDolphin23> I have attached two screenshots, One is pipeline initialization & other one is the task of the pipeline.

The project's directory is as follows:
The pipeline.py includes the code to run the pipeline & tasks of the pipeline.

├── Makefile
├── README.md
├── ev_xxxxxx_detection
│   ├── __init__.py
│   ├── __pycache__
│   │   └── __init__.cpython-311.pyc
│   ├── clearml
│   │   ├── __pycache__
│   │   ├── clearml_wrapper.py
│   │   ├── constants.py
│   │   ├── data_loader.py
│   │   ├── ev_trainer.py
│   │   ├── pipeline.py
│   │   └── util.py
├── poetry.lock
├── pyproject.toml

image

  
  
Posted 3 months ago

@<1523701435869433856:profile|SmugDolphin23> I have tried the same method as suggested by you and the pipeline still failed, as it couldn't find "modules". Could you please help me here?

I would like to describe the process again, which I was following:

  • I created a queue and assigned 2 workers to the queue.
  • In the pipeline.py file, to start the pipeline I used pipe.start(queue="queue_remote") and for the tasks I used pipe.set_default_execution_queue('queue_remote')
  • In the working_dir = ev_xxxx_xxtion/clearml I executed the code using python3 pipeline.py
  • The pipeline was initiated on queue " queue_remote " on worker 01 & the next tasks were initiated on queue " queue_remote " on worker 02 and it failed, as it couldn't find the modules in worker 02.
  
  
Posted 3 months ago

@<1523701435869433856:profile|SmugDolphin23> Sure, Thank you for the suggestion. I'll try to add imports as mentioned by you and execute the pipeline & check the functionality.

In Local I'm running using python3 pipelin.py and used pipe.start_locally(run_pipeline_steps_locally=True) in the pipeline to initialize & it's working fine.

  
  
Posted 3 months ago

I have attached the screenshot of logs earlier

  
  
Posted 3 months ago

@<1523701435869433856:profile|SmugDolphin23> , I’ve updated both the ClearML server and client to the latest version, 1.14.0, as per our previous conversation. However, I’m still encountering the same issue as described earlier.
WebApp: 1.14.0-431
Server: 1.14.0-431
API: 2.28

I attempted to use the same queue for both the controller and the steps, and assigned two workers to this queue. Upon executing the code, the pipeline was initiated on the “queue_remote” queue, and the tasks of the pipeline were also initiated on another worker in the “queue_remote” queue. However, the dataset creation failed because it was unable to locate the Python modules from the current directory as shown in the below screenshot.

Note: I stored the code and its dependencies in a GitHub repository when I executed the pipeline.

Please refer to the attached error screenshot and the code I used to run the pipeline for more details
image

  
  
Posted 3 months ago

@<1523701435869433856:profile|SmugDolphin23> I have tried another way by including pipeline.py in the root directory of the code and executed “python3 pipeline.py” & still faced same issue

  
  
Posted 3 months ago

@<1626028578648887296:profile|FreshFly37> how are you running this locally in the first place?
If you are running pipeline.py with cwd as ev_xx_detection/clearml , then I would not expect you to be able to do from ev_xx_detection.clearml import constants (for example), but import constants directly would work (as constants.py is in the same directory as pipeline.py ). The reason your remote run doesn't work is basically because of this:
cwd is ev_xx_detection/clearml and ev_xx_detection.clearml.constants is imported, but the module that should be imported is actually constants

  
  
Posted 3 months ago

I just use "pip install clearml" command for sdk.

  
  
Posted 3 months ago

ok, that is very useful actually

  
  
Posted 3 months ago

It prints "True"

  
  
Posted 3 months ago

When I run it from command line everything return back to normal and pipeline is visible for now. Thank you very much for your helps, time and feedbacks 🙂 @<1523701435869433856:profile|SmugDolphin23>
image

  
  
Posted 3 months ago
6K Views
39 Answers
3 months ago
3 months ago
Tags
Similar posts