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

Pipeline generator utils #31

Merged
merged 8 commits into from
Sep 20, 2024
Merged

Pipeline generator utils #31

merged 8 commits into from
Sep 20, 2024

Conversation

khluu
Copy link
Collaborator

@khluu khluu commented Sep 19, 2024

No description provided.

p
Signed-off-by: kevin <[email protected]>
p
Signed-off-by: kevin <[email protected]>
p
Signed-off-by: kevin <[email protected]>
p
Signed-off-by: kevin <[email protected]>
@khluu khluu requested review from simon-mo and aslonnie September 19, 2024 21:34
p
Signed-off-by: kevin <[email protected]>
p
Signed-off-by: kevin <[email protected]>
Signed-off-by: kevin <[email protected]>


class AgentQueue(str, enum.Enum):
AWS_CPU = "cpu_queue"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why some have the _queue suffix and some do not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ones with _queue are those that we name it ourselves.. the one without are from AMD ..

def get_full_test_command(test_commands: List[str], step_working_dir: str) -> str:
"""Convert test commands into one-line command with the right directory."""
working_dir = step_working_dir or DEFAULT_WORKING_DIR
test_commands_str = "; ".join(test_commands)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still a bit worried that this is not the write way. maybe concating with end-lines will be safer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added endline char!

"""Convert test commands into one-line command with the right directory."""
working_dir = step_working_dir or DEFAULT_WORKING_DIR
test_commands_str = "; ".join(test_commands)
return f"cd {working_dir}; {test_commands_str}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need to add cd working_dir here? the docker plugin has builtin workdir field?

https://github.com/buildkite-plugins/docker-buildkite-plugin?tab=readme-ov-file#workdiroptional-string

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if kubernetes plugin has it ... this will be used to generate command for both k8s & docker plugin

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might work with workingDir in the k8s podspec.. I can try it out after the pipeline generator is up and if it works, remove cd .. from the command and specify working dir in the plugin

p
Signed-off-by: kevin <[email protected]>
@khluu khluu requested a review from aslonnie September 20, 2024 18:44
Comment on lines +42 to +43
test_commands_str = ";\n".join(test_commands)
return f"cd {working_dir};\n{test_commands_str}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you added the \n, do you still need to add the ; ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not but let's just leave it there for now... I can test again & take it out later when it's up and running

@khluu khluu merged commit 8272857 into main Sep 20, 2024
1 check passed
@khluu khluu deleted the khluu/pipeline_gen_utils branch October 9, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants