Skip to content

Introduce containerd-shim-runhcs-v1 on Windows#2538

Merged
estesp merged 1 commit intocontainerd:masterfrom
jterry75:runtime_v2_windows
Aug 22, 2018
Merged

Introduce containerd-shim-runhcs-v1 on Windows#2538
estesp merged 1 commit intocontainerd:masterfrom
jterry75:runtime_v2_windows

Conversation

@jterry75
Copy link
Copy Markdown
Contributor

@jterry75 jterry75 commented Aug 8, 2018

Implements the containerd-shim-runhcs-v1 shim on Windows for the runtime
v2 shim API.

Signed-off-by: Justin Terry (VM) [email protected]

@jterry75
Copy link
Copy Markdown
Contributor Author

jterry75 commented Aug 8, 2018

@crosbymichael - PTAL

@jterry75 jterry75 force-pushed the runtime_v2_windows branch from 32ea2fd to d507eac Compare August 9, 2018 00:04
@codecov-io
Copy link
Copy Markdown

codecov-io commented Aug 9, 2018

Codecov Report

Merging #2538 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2538   +/-   ##
=======================================
  Coverage   44.59%   44.59%           
=======================================
  Files          95       95           
  Lines       10007    10007           
=======================================
  Hits         4463     4463           
  Misses       4822     4822           
  Partials      722      722
Flag Coverage Δ
#linux 48.4% <ø> (ø) ⬆️
#windows 41.54% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a96db4...019b0c3. Read the comment docs.

Comment thread runtime/v2/runhcs/process.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we may want to use a channel for this. There would be multiple people waiting on a single container and a channel handles this well. I cannot remember, but I tried this in the past with a waitgroup and had issues with multiple wait calls

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This logic is written such that N number of waiters can wait by calling p.waitForExit(). Once the process's background goroutine actually completes it calls p.exitWg.Done() so a process has exactly 1 call to p.exitWg.Add(1) done internally and all external waiters are blocked until this is completed. For a call like Stat(...) we expose a call p.safeExitCode() that is a non-blocking variant of p.waitForExit() with the expectation that the exitCode and exitTime might be invalid if it has not exited (255, time.Time{}). I could certainly expose a channel here but I don't see any benefit to the pattern over using wait groups. Am I missing something?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok, no worries

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed based on your feedback.

@jterry75 jterry75 force-pushed the runtime_v2_windows branch from d507eac to 46ee2dd Compare August 9, 2018 18:56
@crosbymichael
Copy link
Copy Markdown
Member

@johnstep can you help review on this one as well?

@johnstep
Copy link
Copy Markdown

@crosbymichael Yes, but may not have time until Monday morning.

@crosbymichael crosbymichael added this to the 1.2 milestone Aug 10, 2018
Comment thread runtime/v2/runhcs/io.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cool didnt know this existed!

Comment thread runtime/v2/runhcs/cmdutil.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This struct field should be removed, CI is catching it as unused

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@jterry75 jterry75 force-pushed the runtime_v2_windows branch 2 times, most recently from 77494ef to 8dfbb3d Compare August 21, 2018 18:37
@jterry75
Copy link
Copy Markdown
Contributor Author

@crosbymichael - Just rebased/squashed. This revendors go-runc and adds go-runhcs from hcsshim. This should now be working and ready for final review. From here it should just be spot fixes really.

@jterry75 jterry75 changed the title WIP: Introduce containerd-shim-runhcs-v1 on Windows Introduce containerd-shim-runhcs-v1 on Windows Aug 21, 2018
@jterry75 jterry75 force-pushed the runtime_v2_windows branch 2 times, most recently from e4cde6f to d3588ed Compare August 21, 2018 21:49
@crosbymichael
Copy link
Copy Markdown
Member

It looks like the vendor failed or does not match the commits in the vendor.conf

Implements the containerd-shim-runhcs-v1 shim on Windows for the runtime
v2 shim API.

Signed-off-by: Justin Terry (VM) <[email protected]>
@jterry75 jterry75 force-pushed the runtime_v2_windows branch from d3588ed to 019b0c3 Compare August 22, 2018 15:17
@jterry75
Copy link
Copy Markdown
Contributor Author

@crosbymichael - I updated hcsshim and pushed the changes here. Looks like some files were checked in with CRLF which caused them to not match the versions in the commit.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

I have a console change that can be updated after this that will fix windows Terminal usage but other than that, this is solid.

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 53a8c94 into containerd:master Aug 22, 2018
@jterry75 jterry75 deleted the runtime_v2_windows branch August 22, 2018 16:41
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.

6 participants