-
Notifications
You must be signed in to change notification settings - Fork 37
support initialize local volume mapping in hyper run #119
Conversation
| execJobs []string | ||
| execID string | ||
| errCh chan error | ||
| execCount uint32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync.WaitGroup seems better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chan error can pass error, but sync.WaitGroup can't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WaitGroup has to wait for all ExecCmd goroutines to stop before checking results, while current implementation can check for results as it goes and returns failure as soon as any command fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chan error has to stay even if execCount is changed to sync.WaitGroup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the code before this patch, the execs are running parallel.
only the requests are sent in order. it is more efficient to send the requests parallel, but the changelog is confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more about waiting in parallel rather than issuing requests in parallel. I'll fix up the changelog.
It is more effecient than waiting in order, and can be reused for local volume init/wait implementation. Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Upload local files/directories in initSpecialVolumes if it is a local volume that starts with a leading "/". Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
|
updated to address @laijs's comments and rebase to latest master. |
This is based on top of #117 and adds local volume initialisation support.
User can use
hyper run -v /local/dir:/container/dirto map a local file or directory to container.NOTE: this will be broken with the incoming port mapping support. That is the reason I pushed this local volume support PR separate from original #117
Test results: