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

ws-daemon: Use a pair of veths instead of slirp4netns #8955

Merged
merged 3 commits into from
Apr 8, 2022
Merged

Conversation

utam0k
Copy link
Contributor

@utam0k utam0k commented Mar 25, 2022

Description

This PR creates a pair of veth between the workspace and ring1.

Related Issue(s)

Fixed #8106

How to test

in gitpod workspace
https://to-setup-veth.staging.gitpod-dev.com/workspaces

$ docker run hello-world

maybe you have to kill slirp4netns's process.

Release Notes

Use a pair of veths instead of slirp4netns

Documentation

No

@utam0k utam0k requested a review from a team March 25, 2022 06:47
@utam0k utam0k requested review from csweichel and aledbf as code owners March 25, 2022 06:47
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Mar 25, 2022
@github-actions github-actions bot removed the size/XXL label Mar 25, 2022
@utam0k
Copy link
Contributor Author

utam0k commented Mar 25, 2022

I will have more drawings and other information on Monday that will show more of what I intend to do.

@utam0k
Copy link
Contributor Author

utam0k commented Mar 25, 2022

/hold

)
}

cmd = exec.Command(ipCmd, "netns", "exec", netns, "ip", "link", "set", "lo", "up")
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to set lo up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aledbf Thanks for your review!
For now, I guess slirp4netns enable lo automatically. So, when we want to remove slirp4netns, we have to enable lo manually.

@iQQBot
Copy link
Contributor

iQQBot commented Mar 28, 2022

Is it ready for review?

@kylos101
Copy link
Contributor

kylos101 commented Mar 28, 2022

Hey @utam0k , given the commit message in 23346cf, I am going to mark this back as draft (it seems like you're unsure if netlink will work because you use the word "try" in the commit message). May I ask you to confirm if this is ready for review? If yes, feel free to mark as ready for review.

@kylos101 kylos101 marked this pull request as draft March 28, 2022 13:55
@kylos101
Copy link
Contributor

Hi @utam0k , while this is in draft, if you would like "an early review". that is totally okay to request. 💌 😍 See you tomorrow!

@utam0k
Copy link
Contributor Author

utam0k commented Mar 29, 2022

@kylos101 Thanks for organizing the PR. This PR will be available for review soon. I had a little trouble verifying it.

@utam0k
Copy link
Contributor Author

utam0k commented Mar 29, 2022

/unhold

@utam0k
Copy link
Contributor Author

utam0k commented Mar 29, 2022

@princerachit @aledbf @iQQBot @kylos101 Sorry to keep you waiting. I have finished brushing up on this PR. PTAL.
I recommend taking a look at this picture before you start reviewing. This whole attempt is too large to be in one PR, so it is divided into two phases(PRs). This PR is the first these. There should be no problem if only this PR is merged and deployed.

@utam0k utam0k marked this pull request as ready for review March 29, 2022 02:48
@@ -42,7 +42,7 @@ func main() {
Action: specs.ActAllow,
},

// slirp4netns requires setns, as do we for debugging
// Running docker on a workspace requires setns
Copy link
Contributor Author

Choose a reason for hiding this comment

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

docker is still using slirp4netns.

Copy link
Contributor

Choose a reason for hiding this comment

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

We disabled the docker slirp4netns use when we introduced slirp4netns for the workspace as a whole. We have however not yet removed that code from docker-up. We should do that in a follow-up PR.

@utam0k utam0k changed the title Enable a pair of veths between a container and a workspace ws-daemon: Use a pair of veths instead of slirp4netns Apr 6, 2022
@utam0k utam0k marked this pull request as ready for review April 6, 2022 07:46
@utam0k utam0k requested a review from Furisto as a code owner April 6, 2022 07:46
@utam0k utam0k requested a review from a team April 6, 2022 07:46
@utam0k
Copy link
Contributor Author

utam0k commented Apr 6, 2022

@princerachit @aledbf @iQQBot @kylos101 @csweichel This PR is ready for review again. PTAL. Load and other measurements will be done tomorrow, but the code itself is available for review.

@utam0k
Copy link
Contributor Author

utam0k commented Apr 6, 2022

/hold Until the numerical measurements are completed.

@utam0k
Copy link
Contributor Author

utam0k commented Apr 7, 2022

Network IO metrics

I measured the limits of traffic from workspace to ring1 using iperf3.

slirp4netns

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  9.78 GBytes  8.40 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  9.78 GBytes  8.40 Gbits/sec                  receiver

veth

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  50.5 GBytes  43.4 Gbits/sec  284             sender
[  5]   0.00-10.00  sec  50.5 GBytes  43.4 Gbits/sec                  receiver

CPU metrics

This is the CPU utilization when 8 Gbit/sec of traffic continues to flow(workspace -> ring1)

slirp4netns veth
avg of user 4.46 % 2.64 %
avg of system 10.07 % 1.69%

More details can be found in the vmstat results in this spreadsheet.

@utam0k
Copy link
Contributor Author

utam0k commented Apr 7, 2022

/unhold

@utam0k
Copy link
Contributor Author

utam0k commented Apr 7, 2022

@csweichel I think you are probably interested in these above metrics.

@utam0k utam0k requested a review from a team April 7, 2022 05:32
Copy link
Contributor

@csweichel csweichel left a comment

Choose a reason for hiding this comment

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

Works like a charm - love the new performance!
Really great work @utam0k.

@aledbf aledbf self-requested a review April 7, 2022 19:42
@iQQBot
Copy link
Contributor

iQQBot commented Apr 7, 2022

great work 👍 , will have a look for tomorrow
Another thing to consider is how to deploy, supervisor / workspacekit and ws-daemon has different deploy cycle

@kylos101
Copy link
Contributor

kylos101 commented Apr 7, 2022

Another thing to consider is how to deploy, supervisor / workspacekit and ws-daemon has different deploy cycle

@iQQBot We use installer to ship workspace-clusters. When we do this, it uses the versions.yaml to parse necessary versions. For example: docker run --rm -it eu.gcr.io/gitpod-core-dev/build/versions:main.2836 cat versions.yaml.ws-daemon and registry-facade, as well as supervisor and workspacekit, will use versions from that file. The configmap for registry-facade will specify supervisor and workspacekit versions.

For WebApp, they currently use helm, but I believe it uses a similar versions strategy, so if we merge to main, all these components should ship too. @geropl , can you confirm?

How do you deploy IDE changes? I see this job updates web app clusters using argo. So it seems like, if we merge to main, IDE should avoid doing IDE deploy until web app has deployed. WDYT?

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

i have not tried, clean up in supervisor looks good.

@roboquat roboquat merged commit a8d07cb into main Apr 8, 2022
@roboquat roboquat deleted the to/setup-veth branch April 8, 2022 08:11
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed: IDE IDE change is running in production deployed Change is completely running in production labels Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note size/XXL team: IDE team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[workspacekit] Use veth instead of slirp4netns
8 participants