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

rad env init for self-hosted is taking too long to initialize (~3/4 minutes in average) #2582

Closed
Tracked by #2752
asilverman opened this issue Jun 14, 2022 · 18 comments
Labels
triaged This issue has been reviewed and triaged

Comments

@asilverman
Copy link
Contributor

asilverman commented Jun 14, 2022

Observed behavior
rad env init for self-hosted is taking too long to initialize (~3/4 minutes in average), we should improve this to less than 1 minute to meet a good user experience aligned with our OKR: Developers love using azure

Desired behavior
A self-hosted rad environment should start within at most 60 sec
OS/rad version
Any

Screenshots

Additional context

AB#6945

@rynowak
Copy link
Contributor

rynowak commented Jun 15, 2022

I super agree with the feedback. We should reassess this when we get rid of the old CustomRP code. Right now the CustomRP runs Mongo in the cluster, which has a really big image size and slow startup.

@rynowak
Copy link
Contributor

rynowak commented Jul 11, 2022

I just tested this locally AFTER the removal of the Radius CustomRP + Mongo. It took 5m36s.

image

This numbers were all taken on my machine with my slow home internet. Pull times will have less of an impact in the cloud, so consider these a worst-case.

Image Pull Time (seconds) Size (mb)
ucpd 12 44
appcore-rp 56 245
bicep-extensibility 59 223
deployments 57 243

Reciepts

appcore-rp

image

image

ucpd

image

image

bicep-extensibility

image

deployments

image

@rynowak
Copy link
Contributor

rynowak commented Jul 11, 2022

Radius needs a diet 🥗 🥗 🥗 🥗 🥗 🥗 🥗 🥗 🥗 🥗

@rynowak
Copy link
Contributor

rynowak commented Jul 11, 2022

I think it's also worth looking into why the ucpd binary is 44mb https://www.cockroachlabs.com/blog/go-file-size/

@jkotalik
Copy link
Contributor

I think we should be able to do some trimming (hopefully) for the .NET images.

@rynowak
Copy link
Contributor

rynowak commented Jul 11, 2022

We should be able to get to ~60mb for .NET-based images with just assembly-level trimming.

@emily-potyraj
Copy link
Contributor

emily-potyraj commented Jul 12, 2022

triage decision: We need to make improvements here for v0.12. If the work ends up taking longer than we expect, we might decide not to hold the release for it.

Comparison: Dapr installation takes ~45 sec and installs more containers than we do.

Let's aim to get radius install time down to 90 sec by v0.12.

@rynowak - has some ideas here for low hanging fruit.

@jkotalik
Copy link
Contributor

@emily-potyraj @rynowak can we just not install dapr as a starting point?

@rynowak
Copy link
Contributor

rynowak commented Jul 12, 2022

That's already planned. The time taken (because of download size) just for the radius part is unacceptable even if we remove Dapr.

@rynowak
Copy link
Contributor

rynowak commented Jul 13, 2022

FYI in our CI runs it looks like this is taking about 1 minute from end to end. So this confirms that download size is the biggest factor.

@emily-potyraj
Copy link
Contributor

@rynowak - can you please add your ideas for low-hanging next steps here? sorry @jkotalik I forgot what we had in mind when we also assigned you to this issue.

@rynowak
Copy link
Contributor

rynowak commented Jul 14, 2022

For AppCoreRP we should be able to get down to ~40mb with distroless and avoiding redundant copies. We should use the way the UCP and CustomRP images are built as the starting point

For the two .NET projects we need to move them to alpine as self-contained apps. We can then add assembly-level trimming which will get them down to ~50mb or less. I'm not sure if we build the bicep-extensibility image today or if we reuse that from elsewhere. We'd probably need to build it ourselves.

These steps will remove ~ 550mb of deadweight.

rynowak added a commit that referenced this issue Jul 14, 2022
Part of: #2582

This change switches us to distroless for the appcore rp docker image
from mariner. The overall impact is that the reduces the size from 245mb
to 53mb.

Additionally added ca-certificates to the UCP image. We will need these
to proxy to clouds like AWS and Azure, so adding them now.
rynowak added a commit that referenced this issue Jul 15, 2022
Part of: #2582

This change switches us to distroless for the appcore rp docker image
from mariner. The overall impact is that the reduces the size from 245mb
to 53mb.

Additionally added ca-certificates to the UCP image. We will need these
to proxy to clouds like AWS and Azure, so adding them now.
@rynowak rynowak assigned rynowak and unassigned jkotalik and nithyatsu Jul 15, 2022
rynowak added a commit that referenced this issue Jul 15, 2022
Part of: #2582

This change switches us to distroless for the appcore rp docker image
from mariner. The overall impact is that the reduces the size from 245mb
to 53mb.

Additionally added ca-certificates to the UCP image. We will need these
to proxy to clouds like AWS and Azure, so adding them now.
@rynowak
Copy link
Contributor

rynowak commented Jul 15, 2022

Here's an update after getting all of the low-hanging fruit:

Install Time Image Size (Radius Only)
Before 5m36s 755mb
After 3m52s 307mb

image

image

@rynowak
Copy link
Contributor

rynowak commented Jul 15, 2022

If we remove Dapr and execute Contour and Dapr in parallel:

image

Just Radius (no Contour or Dapr)

image

@emily-potyraj
Copy link
Contributor

Great investigation. let's call it done for v0.12.
For v0.12, Radius installation may take up to ~3 min, faster with good internet: 30 sec in AKS.

filed #2952 for possibly removing Dapr installation in the future.

@jkotalik
Copy link
Contributor

I think removing contour will be a no-go for now, but great work here Ry dawg.

@rynowak rynowak removed their assignment Jul 15, 2022
@rynowak
Copy link
Contributor

rynowak commented Jul 15, 2022

Great, removed this from the board for now.

@AaronCrawfis AaronCrawfis mentioned this issue Aug 25, 2022
37 tasks
@rynowak
Copy link
Contributor

rynowak commented Dec 13, 2022

With the removal of Dapr we're down to ~2 mins on my terrible home internet.

image

@AaronCrawfis AaronCrawfis added sync and removed sync labels Mar 24, 2023
@shalabhms shalabhms added the triaged This issue has been reviewed and triaged label Apr 24, 2023
@shalabhms shalabhms closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged This issue has been reviewed and triaged
Projects
None yet
Development

No branches or pull requests

7 participants