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, What Is The Best Way To Get The Agent To Install A Dependency From Github. I Have Tried This In This Sample Script:

Hi,

What is the best way to get the agent to install a dependency from github.
I have tried this in this sample script:

import clearml clearml.Task.add_requirements("git+ ` <user>/rmdatasets")

import time
import rmdatasets

def main():

task = clearml.Task.init(project_name="sample_project", task_name="test_task")
task.set_base_docker(
    docker_image="nvidia",
)
task.execute_remotely(queue_name="default")

time.sleep(50)
task.report_scalar("loss", 0.1)

if name == "main":
main() `But the agent still tries to install the rmdatasets from pypi and the task execution fails.

Actually, I would like to know if there is a way to use de environment introspection, but inform clearml that some packages should not be gathered from pypi, but from a given location.

  
  
Posted 2 years ago
Votes Newest

Answers 8


Yes, but the issue is caused because rmdatasets is installed in the local environments, I needed it installed in order to test the code locally, so it is caught on the package list.
I will probably stop installing the sibling packages and adding them manually to sys.path.

  
  
Posted 2 years ago

please remove rmdatasets == 0.0.1

  
  
Posted 2 years ago

SkinnyPanda43 , did Gabriel's tip help?

  
  
Posted 2 years ago

Follows the failure part of the log:
` Requirement already satisfied: pip in /root/.clearml/venvs-builds/3.1/lib/python3.10/site-packages (22.2.2)
Collecting Cython
Using cached Cython-0.29.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)
Installing collected packages: Cython
Successfully installed Cython-0.29.32
Collecting boto3==1.24.59
Using cached boto3-1.24.59-py3-none-any.whl (132 kB)
ERROR: Could not find a version that satisfies the requirement rmdatasets==0.0.1 (from versions: none)
ERROR: No matching distribution found for rmdatasets==0.0.1

clearml_agent: ERROR: Could not install task requirements!
Command '['/root/.clearml/venvs-builds/3.1/bin/python', '-m', 'pip', '--disable-pip-version-check', 'install', '-r', '/tmp/cached-reqsfuwxoren.txt']' returned non-zero exit status 1.
2022-09-18 19:59:20
Process failed, exit code 1 `

How the dependencies are displayed:
` # Python 3.10.6 (main, Aug 18 2022, 15:20:36) [Clang 13.1.6 (clang-1316.0.21.2.5)]

boto3 == 1.24.59
clearml == 1.7.0
rmdatasets == 0.0.1
git+ <user>/rmdatasets `How do requirements should be added manually? Through a requirements.txt file? This way, all requirements will have to be listed in the file, or it works together with the environment introspection?

  
  
Posted 2 years ago

Right, you don’t want ClearML to track that package, but there isn’t much you can do there I believe. I was trying to tackle how to run your code with an agent given those dependencies.
I think that if you clone the experiment, and remove that line in the dependencies sections in the UI you should be able to launch it correctly (as long as your clearml-agent has the correct permissions)
and btw
if " @" in line: line = line.replace(" @", "https://")should be the same as
line = line.replace(" @", "https://")

  
  
Posted 2 years ago

Hi, sorry for the delay. rmdatasets == 0.0.1 is the name of the local package that lives in the same repo as the training code. Instead of picking the relative path to the package.

As as work around I set the setting to force the use of requirements.txt and I am using this script to generate it:

` import os
import subprocess

output = subprocess.check_output(["pip", "freeze"]).decode()

with open("requirements.txt", "w") as f:
for line in output.split("\n"):
if " @" in line:
line = line.replace(" @", "https://")
f.write(line + "\n") `It works but it is kind of a hack, also I have to remember to run the script when I change the local library.

Another option would be to modify the sys.apth to include the local libs.

  
  
Posted 2 years ago

Hi SkinnyPanda43 ,

Can you please add a log of the failure? I think if you add specific requirements manually it should override auto detection

  
  
Posted 2 years ago

but would installing
git+ <user>/rmdatasetsinstall rmdatasets == 0.0.1 ?
Aren’t they redundant?

  
  
Posted 2 years ago