252 karma · joined Aug 14, 2015 (11y ago) · 95 submissions
- Co-Founder Biscuit (biscuit.so) - (Previously) Co-Founder of CodeSandbox, acquired by Together
My email is first name @ biscuit.so
meet.hn/city/nl-Amsterdam
Socials: - x.com/compuives
---
comment 4y ago · link · parent
Using XFS with CoW has been the easiest way to enable this, but if there's a way that we can do this purely in-memory, that would be even faster.
That said, for hibernation we would still have to persist to disk, but timing is less important there.
comment 4y ago · link · parent
I'll make sure we write about the other topics as well. For the network, we run the VM in its own network namespace on the host, and we give every VM the same IP. We then use an iptable rule to rewrite every incoming and outgoing packet to the IP that the host has assigned for the VM.
comment 4y ago · link · parent
Another (unrelated) test we've done is on overprovisioning memory. We were able to run 200 VMs (all running Vite dev server where a file was changed every second) with 2GB RAM per VM, on a node with 128GB RAM. Because we were mapping the memory files on disk directly to the VM, the VM would automatically "swap" the memory back to the memory file when it had memory pressure. The bottleneck here was CPU.
comment 4y ago · link · parent
In our case we changed Firecracker to use a shared mmap instead of an private mmap, so in our case the dirtied pages were synced back automatically to the backing memory file. The main reason for this was to reduce IO on snapshot time. I'm also looking at other ways we can do this, because using a shared mmap fragments the underlying xfs fs pretty fast. Maybe we can batch writes more instead of writing single pages.
comment 4y ago · link · parent
Once uniqueness has been solved though, VM cloning would become a real solution for serverless hosting (and many of other cases), exciting prospect!
69.
How we clone a running VM in 2 seconds(codesandbox.io ↗)
12 points · by CompuIves · 4y ago · 1 comment
comment 4y ago · link · parent
The plans currently don't reflect the beta of Projects, there we do have specs (by default 4vCPUs + 4GB RAM) with upgrades up to 12GB RAM and 8vCPUs. We're still exploring other machine specs there too.
The place where this differentiates is that every branch runs its own dev env, based on a memory snapshot from the main branch. This way when you switch branches, you switch to a new environment and you won't have to think about running migrations/installing dependencies/pulling changes just for that branch.
comment 5y ago · link · parent
A hidden "feature" is that we automatically run tests defined (e.g. index.test.js) using jest, and dispatch the test results. So you can listen to that as well.
comment 5y ago · link · parent
The fact that we made your projects public and kept charging is definitely a big mistake, and shouldn't have happened in the first place. When you cancel a subscription, we should keep your existing work private. Could you send me an email at ives@codesandbox.io so we can fix it?
Apologies for the fact this happened to you, that's a severe mistake and shouldn't have happened!
comment 5y ago · link · parent
Also nice side-effect is that it's amazing to explore other code-bases, just being able to put a console.log somewhere to see how often it's run when using an application is a lot of fun.
comment 6y ago · link · parent
After 3 sudden blocks from them, they now give us a warning before they're planning to block us, but it took many calls before we got to that stage.
comment 6y ago · link · parent
The one thing that we struggled with Elixir with is that it's quite hard to find people that know Elixir. For a long time I was the only one doing Elixir in the company, which introduced a bottleneck. That said, when you find someone who knows Elixir they tend to know Elixir (and a bit of infra) quite well.
comment 8y ago · link · parent
comment 8y ago · link · parent
I don't want to give a comparison of StackBlitz and CodeSandbox, because my view as one of the creators would be skewed. I want to note though that CodeSandbox existed before StackBlitz released, I published CodeSandbox in April ([1] [2]) and StackBlitz released in August [3].
[1] https://hackernoon.com/codesandbox-an-online-react-editor-b8...
[2] https://news.ycombinator.com/item?id=14022860
[3] https://medium.com/@ericsimons/stackblitz-online-vs-code-ide...
comment 8y ago · link · parent
comment 8y ago · link · parent
2) Ah that's really stupid of me, `.stream` was our staging server. I should mention this somewhere, codesandbox.io should have the latest version with live.
3) Good one! I'll update it.
4) That's a super nice sandbox, I love tutorials that use gameplay, makes it much more fun to learn. I'd move it to the io domain, because our stream database is horribly outdated. I'll add a redirect from stream soon to avoid confusion.
comment 8y ago · link · parent
I learned most from the official Kubernetes tutorials (https://kubernetes.io/docs/tutorials/). I also used mix_docker (https://github.com/Recruitee/mix_docker) as a reference on how to build the image. The advantage of Kubernetes is that you can have the same way to deploy for all servers, so if you learn how Kubernetes deploys you automatically know how to deploy Phoenix applications.
comment 8y ago · link · parent
And if you really want to make sure, we're open source: https://github.com/CompuIves/codesandbox-client.
comment 8y ago · link · parent
I started working on this on March 15th, and the past few days was about testing everything, preparing the release and squashing bugs. The advantage of this type of functionality is that there are tons of high quality papers and articles already written on the subject, especially this one helped me a lot: http://www.codecommit.com/blog/java/understanding-and-applyi.... There were a lot of sleepless nights involved too.
I'm not sure about the VS Code and Atom teams, but I imagine that there are more constraints and there is more functionality to implement since they work with hundreds of potentially big files. I think those factors make it harder to implement this functionality than in the case of CodeSandbox.
comment 8y ago · link · parent
The server is mostly responsible for keeping all room state (the editors, the owner, operations per module) and transforming operations. When an operation comes in at the server, like an insertion, the server will check what revision that operation is at and transform it accordingly if the sent operation is based on outdated code. Then that operation will be broadcasted to the clients and again transformed on the clients to handle any inconsistency.
The library we use for doing the transformations is called ot_ex.
I hope this quick view is clearly written, let me know if there are any other questions!
comment 9y ago · link · parent
1. Open https://stackblitz.com/fork/react
2. Disconnect from internet
3. Refresh the tab
At least for me this gives me a 404. I'm on Chrome. However, when I open the preview tab while offline it doesn't 404 on me.