-
Notifications
You must be signed in to change notification settings - Fork 29
Support Universal Modules in turtle in order to enable customizable builds #7
Comments
I think the time has come. I'll put my focus on adding support for customizable Turtle builds. First of all, I need to note that things have changed since creating this issue. We have Implementing this feature is more challenging with iOS builds than with Android builds. What's the difference? Turtle builds Android standalone apps from sources and it takes ~12 minutes to complete, whereas on iOS we have a prebuilt (on our CI) shell app and then we are only configuring some stuff, creating an archive and signing the app. An iOS build is less time consuming, the average build time is around 3 minutes, but pre-building (aka compiling the sources) shell app takes ~30 minutes. In order to add support for customizable iOS Turtle builds we'd need to skip the process of pre-building the shell app and it would cause significant increase of the app build time. If a user wanted to choose unimodules to include/exclude from the build he would need to wait at least 30 minutes + time for waiting in the queue. It means the iOS builds queue wouldn't be empty anymore unless we add more VMs (and therefore more physical MacPro machines) and it's expensive in terms of paying more for the infrastructure. What's my idea then? We have |
Yaaaaay, that's super exciting! Re: Doing this in turtle-cli first, I'm a little hesitant. The main goal of accepting payments is to shut down this line of thinking: (from https://www.reddit.com/r/reactnative/comments/9v94q9/expo_questions/)
So we need the payment plan to be something people look at and say:
Things like in app purchases and smaller bundle sizes are deal breakers for a lot of people, so this absolutely should make its way to expo-cli, but turtle-cli should be following turtle services, not the other way around. Needing 10x capacity on mac stadium is pretty rough though. Is the complexity of the matrix solution just in needing a matrix at all, or would it help to reduce the matrix to something like:
I think it would probably make sense to do this the naive, uncached way and have this as a premium only feature for turtle services as well. I don't see it making sense in the free tier without caching though. |
From a maintenance and quality-of-service perspective, I think investing in Turtle CLI and having our builder service be "Turtle as a service" will help us ensure that Turtle CLI continues to work well. There might be some features that only our service supports or features that only Turtle CLI supports, but the more we can achieve parity and one codebase, the better our tools/services are going to be.
I agree with this. For 30 minutes of macOS time, CircleCI charges about $1 and I assume MacStadium is similar. Given that builds may take even longer and we have engineering overhead as well, I think structuring our premium pricing plans so that custom builds cost a few dollars each is reasonable. One thing not mentioned in this conversation is custom native modules. I foresee many issues with them and would greatly prefer to support only Expo-authored unimodules in our build service. This avoids many problems: much higher reliability by working with known code, much less frustration for developers needing to debug native code, no need to upload code from the developer's computer, much less chance of remote code execution (especially bad on Macs since we don't have good isolation between builds), etc. So for this reason, making ExpoKit and Turtle CLI great so people can use custom native modules on their own computers is also really important. |
Well, I guess I might haven't said it precisely. I never wanted to allow users to include their own modules. I agree with you that we should only add support for including / excluding expo-unimodules. @tcdavis you said that it doesn't make sense to add any feature to Turtle CLI prior to adding it to Turtle. Well, since it's the same codebase and we don't need to add these things separately, it doesn't apply here and we can make the releases independently. Also, I think that caching shell apps with a certain subset of modules after a user builds an app with this subset is not worth doing because it sometimes happens that we deploy Turtle (and change a shell app) few times in a day. I'd go with doing this the naive way. So if I understand you guys correctly, we're in agreement that:
Did I get it right? |
Short description of how will changes in all repos work together
|
released in sdk33 |
Goals
exp build
behavior should do the same thing it does now, provide all modules. (we might change this later.)app.json
.xcodebuild
whenever possible in order to save time and resources.Prerequisites
Turtle details
Mostly TBD. We probably need to construct a matrix of build caches (instead of having just a single build per release) on the server. The turtle agent can check to see if it has a cached artifact for the user's module configuration, and if not, build one. We may also need to stop running the build our CI machines and do it on the turtle machines instead? There is a (probably old, outdated) description of this here: https://github.com/expo/universe/issues/2032
On iOS, optional module dependencies are expressed with cocoapods. I think on Android they are gradle deps. So the agent will probably need to generate the correct Podfile/gradle file in order to assemble a build.
Lastly, certain parts of the native bundle configuration step will change depending on used modules. As one simple example, we only need to configure
NSCameraUsageDescription
for builds which use the camera. That means we might need a way for each module to express its own "configure step" in JS.The text was updated successfully, but these errors were encountered: