-
Notifications
You must be signed in to change notification settings - Fork 33
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
Figure out why some deploys aren't working #134
Comments
since deploys app can not run any playground or exercises app, maybe you can modify workshops |
The deploy.yml isn't a problem here. It creates the docker images just fine and even starts the app without issue. It's just that it doesn't stay started... Actually, I just noticed that we're maybe hitting a size limit or something: https://community.fly.io/t/deploy-timing-out-but-actually-succeeding/14384/7?u=kentcdodds |
what i was meant was that on deployed you can modify |
Ok, let's see if this works: epicweb-dev/web-auth@57a02f0 I'm going to sleep. I'll find out in the morning. 😅 |
this command will do nothing if
maybe you need to add |
Interesting. It should be removed in the github action anyway. In any case, I had an idea last night that maybe I could make it more like this: Instead of adding all the content to the docker image, we just make the app download the repo on startup at runtime. I think GitHub has an API we could use to download a zip of the repo and then we unzip it and set the |
No, when i test it locally only 472 packages installed
|
Alright, I'll give it a shot 👍 |
Yeah, that made it much smaller. But I think it's still too big because it still failed to start up. I think we need to have a runtime solution. Just a script that downloads and extracts a zip of the project somewhere so all the projects don't have to be in the image. |
I'm really happy with this solution I developed (with ChatGPT). I think I want to adopt this with the other repos because I think it would be faster. The image is now closer to 600MB which is much better than 7.9GB 😅 Unfortunately turns out the size of the image was probably never the issue. Instead it's probably something wrong with having that number of projects which causes things to go wrong. If you check the ChatGPT conversation, you'll find logs like this:
esbuild is just really unhappy. I remember having a similar issue on my website (evanw/esbuild#1608), but I added the same queuing solution to avoid esbuild being run more than once at a time and it was ineffective. I'm at a total loss. I really want this to work because these deploys are very important for people wanting to quickly reference my material. |
Try to generate all the mdx cache files from docker before runing start script |
That thought occurred to me as well. It would require the huge docker image again, but if it gets this to work then that's better than not working at all! |
Ok, I've posted an issue on esbuild: evanw/esbuild#3287 I'm just at a total loss |
There are a couple ssh actions, you can shell into the actions runner and run the commands. |
Try to cmpile mdx directly with @mdx-js/mdx |
On deployed app instead of compiling all mdx files at statrtup. Do it only when each exercise start |
Unfortunately, we have to compile everything up front because it's how we know the titles of each exercise and step. I just tried applying this clone-at-runtime solution to another workshop with large files (the database files mostly) and the improvement is very noticeable. The workshop's not quite half finished and it was already taking almost 7 minutes to deploy (with a 2.3 GB image) and startup. With the new approach, it now deploys and starts up in 2.5 minutes (with a 664 MB image). So I definitely want to stick with this approach. Just need to figure out evanw/esbuild#3287 and we'll be golden. |
I figured it out! We were adding file watchers to all the files in the deployed version! I guess it was just too many files to watch and it was definitely unnecessary anyway, so I added a little code for skipping the watching in the deployed version and it works great now. I've applied this new deployment strategy to all the workshops now. |
I think it's because they're just so big, but they are exiting with exit code
1
during startup in the deployment so I really have no idea why... Will probably have to try and run docker locally to see what's up.The text was updated successfully, but these errors were encountered: