Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagged parameters on the same line of file within generator files #40

Closed
al-rigazzi opened this issue Apr 19, 2021 · 0 comments · Fixed by #107
Closed

Tagged parameters on the same line of file within generator files #40

al-rigazzi opened this issue Apr 19, 2021 · 0 comments · Fixed by #107
Labels
area: generation Issues related to Experiment file generation

Comments

@al-rigazzi
Copy link
Collaborator

Description

If there are two tagged parameters on the same line (e.g. ray start --head --port=;port; --redis-password=;password;), the two parameters get collapsed to a single one (in the same example, we may end up with ray start --head --port=6379). It seems that the substitution is implicitly assuming that there is only a single parameter per line (which makes sense in standard config files, but not for other use cases of generation/configuration).

How to reproduce

Put in a template.sh file:

echo "My two parameters are ;port; and ;password;, OK?"

and then in SmartSim run:

from smartsim import Experiment
from smartsim.settings import RunSettings

exp = Experiment("param_test")
model_params = {"port": 6379, "password": "unbreakable_password"}
model_settings = RunSettings("bash", "template.sh")
parameterized_model = exp.create_model("param-model", path="./param_test",
                                   run_settings=model_settings, params=model_params)
parameterized_model.attach_generator_files(to_configure=['./template.sh'])
exp.generate(parameterized_model, overwrite=True)
exp.start(parameterized_model)

The result will be

My two parameters are 6379, OK?

Expected behavior

Every parameter should be correctly substituted and the result should be:

My two parameters are 6379 and unbreakable_password, OK?

System

  • OS: RHEL
  • Commit of library: c2b848b
  • Workload manager: local, but I guess any
@Spartee Spartee changed the title Can't put tagged parameters on the same line Tagged parameters on the same line of file within generator files Apr 19, 2021
@Spartee Spartee added the area: generation Issues related to Experiment file generation label Apr 19, 2021
@al-rigazzi al-rigazzi linked a pull request Nov 1, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: generation Issues related to Experiment file generation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants