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

moved image diff logging to their respective workspace #819

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ccharest93
Copy link
Contributor

#809 was flawed and didn't change the programming logic. I tried to think of any way for build_workspace_and_update_role() to return whether a change in the built image is detected. There isn't one, so the logging message needs to be printed at the workspace level:

  • tmpDirworkspace -> always creates a directory using workspace
  • dirworkspace -> has no logic to be able to determine if the directory is changed
  • dockerworkspace -> used docker_client to determine whether a new image is built

The alternative would be to not test for changes to the image and always print the same thing, or modify build_workspace_and_update_role() abstract function and its implementations to return a BOOL of whether a change happened.

In docker workspace we add a test whether a cfg.image_repo is provided because local_docker does not define it/ use it (it is accepted as an argument because its a runopts for dockerworkspace)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 11, 2024
Copy link
Member

@d4l3k d4l3k left a comment

Choose a reason for hiding this comment

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

@ccharest93 sorry for the delay -- thoughts on doing a hybrid of this? Some users of torchx have custom workspace implementations that won't have this added logging. Maybe we can keep something similar to what we currently have but also add some more information for the specific dir/docker workspaces on the exact operation?

@yikaiMeta @manav-a we would need to update the Meta workspaces as well to add similar details if we want to land this.

@ccharest93
Copy link
Contributor Author

After reviewing, the easiest way to not affect other implementations would just be to print an extra message within the docker_workspace. You would then end up with contradictory message when reusing an image however. E.g

torchx 2024-03-28 20:38:29 INFO     Building workspace docker image (this may take a while)...
torchx 2024-03-28 20:38:29 INFO     Reused image with tag `sha256:4aad7a6e24d58bb66404dead0c5b2f91e97acb76875c69e238dbabb9b8cd3be0`
torchx 2024-03-28 20:38:29 INFO     Built new image `sha256:4aad7a6e24d58bb66404dead0c5b2f91e97acb76875c69e238dbabb9b8cd3be0` based on original image `nvcr.io/nvidia/pytorch:23.10-py3` and changes in workspace `#######`

Personally, i no longer require knowing through the console whether or not my image tag was updated or reused.
Implementing the log message properly seems to be more likely to cause harm then good.
Going forward, i can either:

  1. Modify the PR to just be a change within docker workspace that prints an extra message within it.
  2. I can close this PR, but it would be good to rollback Docker pull for image change comparison #809 in that case since it added complexity without actually fixing the problem.

ccharest93 added a commit to ccharest93/torchx that referenced this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants