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 Everybody. When I Want To Force The Agent To Not Reproduce My Local Pip Environment, I Add

Hi everybody.
When I want to force the agent to not reproduce my local pip environment, I add
Task.force_requirements_env_freeze(force=False, requirements_file="requirements.txt") , just before Task.init .
My question is what should be the path to the requirements.txt file?
Is it relative to the repo base?
relative to where I execute the script in my local machine?
relative to the working dir specified by task.set_script(working_dir="...") ?

  
  
Posted 2 years ago
Votes Newest

Answers 11


This is actually in runtime (i.e. when running the code),

My script looks like that
` import clearml
clearml.Task.force_requirements_env_freeze(force=False, requirements_file="requirements.txt")
task = clearml.Task.init(...)
task.set_script(working_dir=dir, entry_point="my_script.py")
task.execute_remotely(queue_name='default')

rest of script goes here.... `When you refer to runtime, do you mean when the script is executed remotely, or when I run my_script.py locally (in order to create and enqueue the task)?

so relative to the working directory

So something like os.path.join(os.path.dirname(__file__), "requirements.txt") is the right way? (assuming the script and the requirements file are at the same directory)

  
  
Posted 2 years ago

Thanks

  
  
Posted 2 years ago

Absolute in my hard drive?

  
  
Posted 2 years ago

My question is what should be the path to the requirements.txt file?
Is it relative to the repo base?

This is actually in runtime (i.e. when running the code), so relative to the working directory. Make sense ? (you can specify absolute path, probably something I would avoid in the code base though...)

  
  
Posted 2 years ago

CostlyOstrich36
Is that command evaluated prior to the task creation?
Or only after the task is executed remotely?

  
  
Posted 2 years ago

I think if you provide an absolute path it should work 🙂

  
  
Posted 2 years ago

task.set_script(working_dir=dir, entry_point="my_script.py")Why do you have this part? isn't it the same code, the script entry point is auto detected ?

... or when I run my_script.py locally (in order to create and enqueue the task)?

the latter, When the script is running locally

So something like

os.path.join(os.path.dirname(file), "requirements.txt")

is the right way?

Sure this will work 🙂

  
  
Posted 2 years ago

The script is intended to be executed remotely.
Can I declare an absolute path in this case?

  
  
Posted 2 years ago

Hi CrookedWalrus33 , do you have an ability to provide an absolute path?

  
  
Posted 2 years ago

Why do you have this part? isn’t it the same code, the script entry point is auto detected ?

Because I don’t always run the script locally from it’s directory and I have additional modules in the same directory that I import.

Sure this will work

I’ll make sure to update it

  
  
Posted 2 years ago

👍

  
  
Posted 2 years ago
997 Views
11 Answers
2 years ago
one year ago
Tags
Similar posts