WEBVTT

NOTE Sentence-level transcript of https://www.youtube.com/watch?v=fz6-NS7qpZc

NOTE One cue per sentence. Cue ids are the line anchors on /transcripts/fz6-NS7qpZc.html. A cue ends where the next begins, or 2 s after its last word.

s1
00:00:24.880 --> 00:00:26.000
Hey y'all.

s2
00:00:26.000 --> 00:00:26.720
Okay, cool.

s3
00:00:26.720 --> 00:00:27.279
All right.

s4
00:00:27.279 --> 00:00:31.119
So, I see people still trickling in, but uh we're going to go ahead and get started.

s5
00:00:31.119 --> 00:00:32.800
Uh so, nice to meet y'all.

s6
00:00:32.800 --> 00:00:33.600
Uh I'm Matt.

s7
00:00:33.600 --> 00:00:35.040
I'm an engineer from E2B.

s8
00:00:35.040 --> 00:00:36.680
We do sandboxes.

s9
00:00:36.680 --> 00:00:36.719
[sighs]

s10
00:00:36.719 --> 00:00:41.280
Uh so, before we get started, uh how you all doing this morning?

s11
00:00:41.280 --> 00:00:41.760
All right.

s12
00:00:41.760 --> 00:00:43.440
So, my hearing is like really messed up.

s13
00:00:43.440 --> 00:00:44.320
Uh I couldn't hear that.

s14
00:00:44.320 --> 00:00:46.559
So, how are we doing this morning?

s15
00:00:46.559 --> 00:00:46.960
All right.

s16
00:00:46.960 --> 00:00:47.520
Great.

s17
00:00:47.520 --> 00:00:47.920
All right.

s18
00:00:47.920 --> 00:00:49.280
So, everyone's live.

s19
00:00:49.280 --> 00:00:51.600
Uh and uh also, where are we all from?

s20
00:00:51.600 --> 00:00:53.520
So, how many people here are from San Francisco?

s21
00:00:53.520 --> 00:00:55.520
Uh based out of San Francisco.

s22
00:00:55.520 --> 00:00:58.960
Okay, we got a couple uh coming out of state.

s23
00:00:58.960 --> 00:01:00.800
All right, a lot of people coming from out of state.

s24
00:01:00.800 --> 00:01:01.440
Great.

s25
00:01:01.440 --> 00:01:06.880
Uh also uh we're going to be uh talking sandboxes and then doing uh basically a capture the flag.

s26
00:01:06.880 --> 00:01:14.640
Uh I don't know if you all have done a capture the flag before, but uh what it's going to be is it's a series of different levels that we're going to go through uh solve it and that unlocks the next level.

s27
00:01:14.640 --> 00:01:20.799
Um uh as far as programming languages that we use, uh how many people here use Python?

s28
00:01:20.799 --> 00:01:22.080
Okay, most of us use Python.

s29
00:01:22.080 --> 00:01:22.479
Good.

s30
00:01:22.479 --> 00:01:25.439
Uh so our SDKs in both Python and JavaScript.

s31
00:01:25.439 --> 00:01:28.720
Uh good news also is that we don't need to code at all for the first couple levels.

s32
00:01:28.720 --> 00:01:31.840
A lot of these are going to be configs kind of looking at how sandboxes work.

s33
00:01:31.840 --> 00:01:34.159
Uh JavaScript.

s34
00:01:34.560 --> 00:01:35.119
Okay.

s35
00:01:35.119 --> 00:01:37.840
Uh Go, where's my Go engineers?

s36
00:01:37.840 --> 00:01:38.079
Great.

s37
00:01:38.079 --> 00:01:42.640
We are hiring by the way uh for people that uh uh code in Go uh for the back end.

s38
00:01:42.640 --> 00:01:46.560
Uh so uh come check out our page after this or during this.

s39
00:01:46.560 --> 00:01:47.439
Um let's see.

s40
00:01:47.439 --> 00:01:51.040
And then how many people here don't code at all?

s41
00:01:51.119 --> 00:01:52.720
All right, great.

s42
00:01:52.720 --> 00:01:54.079
All right, so let's get started.

s43
00:01:54.079 --> 00:01:57.280
Uh, oops.

s44
00:01:57.280 --> 00:01:57.920
So, all right.

s45
00:01:57.920 --> 00:02:07.119
I don't know if people can go to this link, but if you go to this uh tinyurl.com, y'all can see that if you go there, uh, that'll give you a sandbox.

s46
00:02:07.119 --> 00:02:09.200
Uh, so you have to log into E2B.

s47
00:02:09.200 --> 00:02:14.319
Um, but what this workshop is is everything is basically sandboxes all the way down.

s48
00:02:14.319 --> 00:02:20.879
Uh so what we put together for you is uh a bunch of different challenges that are issues that you run into running a uh sandbox.

s49
00:02:20.879 --> 00:02:24.319
Um we'll worry about visiting in a second.

s50
00:02:24.319 --> 00:02:26.879
Uh and then also you can just do the QR code.

s51
00:02:26.879 --> 00:02:29.440
Uh everyone able to get to that page?

s52
00:02:29.440 --> 00:02:31.360
Thumbs up, thumbs down.

s53
00:02:31.360 --> 00:02:32.879
Cool.

s54
00:02:32.879 --> 00:02:33.280
All right.

s55
00:02:33.280 --> 00:02:34.879
Uh and if you can't, don't worry about it.

s56
00:02:34.879 --> 00:02:36.160
We'll be walking through it.

s57
00:02:36.160 --> 00:02:40.720
So at this point, feel free to uh start going through the instructions, figuring out how to hack away.

s58
00:02:40.720 --> 00:02:51.599
Uh or if you actually want to listen to me drone on about sandboxes, you can do that instead and then go uh uh do the sandbox uh start the CTF uh with every with me.

s59
00:02:51.599 --> 00:02:54.239
Okay, so just a little bit about EDB.

s60
00:02:54.239 --> 00:02:56.239
Uh so what are sandboxes?

s61
00:02:56.239 --> 00:03:02.319
Uh sandboxes are uh basically let you run user specific code uh without messing with other users, right?

s62
00:03:02.319 --> 00:03:06.480
So a lot of the time uh with a traditional web stack, it would be like, hey, here's a web page.

s63
00:03:06.480 --> 00:03:07.360
It's a static web page.

s64
00:03:07.360 --> 00:03:08.959
You can go do stuff.

s65
00:03:08.959 --> 00:03:18.560
uh you know maybe had users that could code and what they wanted to be able to do is use something like collab uh where you go in there and you can you know play around uh you might want to have like AWS EC2

s66
00:03:18.560 --> 00:03:28.319
right get into that run your code uh what we're seeing with a lot of the modern stuff with agents is you know you've got this magical being in the cloud that can do all sorts of really cool tasks

s67
00:03:28.319 --> 00:03:37.680
and one of those tasks is coding um now there's a couple ways you can do that one thing is you can just run things locally on your own computer right who here's used like codeex

s68
00:03:37.680 --> 00:03:39.519
cloud code, right?

s69
00:03:39.519 --> 00:03:42.239
Uh so you can be like, hey, you have all the permissions you want to do.

s70
00:03:42.239 --> 00:03:45.760
Uh and it can go run around and then delete things, create things, whatever.

s71
00:03:45.760 --> 00:03:49.120
Uh some of the problems that you run into are, you know, it'll use up all your CPU.

s72
00:03:49.120 --> 00:03:50.879
It'll spawn a bunch of processes.

s73
00:03:50.879 --> 00:03:52.480
It'll delete things it's not supposed to.

s74
00:03:52.480 --> 00:03:54.720
Maybe able to start accessing environmental variables.

s75
00:03:54.720 --> 00:03:56.959
Uh there's a lot of things that are dangerous about that.

s76
00:03:56.959 --> 00:03:59.760
Um so that's where it's okay, hey, let's put it in the server.

s77
00:03:59.760 --> 00:04:01.439
Well, on the server, you have similar problems.

s78
00:04:01.439 --> 00:04:07.680
you've got secrets, you've got uh your environment is you need to make sure that everything that you want it to be able to interact with uh is present.

s79
00:04:07.680 --> 00:04:10.319
Uh and that's where sandboxes come in.

s80
00:04:10.319 --> 00:04:18.959
Uh also uh with uh one thing that's a little bit different uh the way that we view sandboxes and other things is that sandboxes you want to be able to very quickly spin these up.

s81
00:04:18.959 --> 00:04:23.600
Uh EDB we sp we aim to uh spin up sandboxes in less than 100 milliseconds.

s82
00:04:23.600 --> 00:04:27.199
Uh so that way you can run multiple things at the same time.

s83
00:04:27.199 --> 00:04:33.520
Uh so yes uh also so with our sandboxes uh there's a couple things that we uh try to do.

s84
00:04:33.520 --> 00:04:41.280
So it's uh when you go into a sandbox uh you're working and uh like when you close your laptop you open your laptop again you're back into your state.

s85
00:04:41.280 --> 00:04:43.440
Uh for us it's uh same thing.

s86
00:04:43.440 --> 00:04:46.720
So we try to uh snapshot the memory, snapshot the file system.

s87
00:04:46.720 --> 00:04:53.440
So that way uh whenever you stop working you pause everything, save everything to storage somewhere and then resume it.

s88
00:04:53.440 --> 00:04:55.120
Uh agents especially, right?

s89
00:04:55.120 --> 00:04:56.880
So you've got an agent working away.

s90
00:04:56.880 --> 00:04:59.199
Uh maybe it has to go do some sort of process elsewhere.

s91
00:04:59.199 --> 00:05:02.400
Uh and then it wants to come back uh to the state it was in.

s92
00:05:02.400 --> 00:05:08.560
Uh for the agent, it kind of doesn't know the time has passed and so it's expecting everything to be exactly the way it was when it uh left off.

s93
00:05:08.560 --> 00:05:15.600
Uh and so by snapshotting everything and making it so everything is still there when it comes back uh makes it so you get less errors.

s94
00:05:15.600 --> 00:05:25.840
Um so yeah the way our approach to these sandboxes is basically we start the processes first uh and then we as I just said before we're uh saving the disk in RAM

s95
00:05:25.840 --> 00:05:36.160
uh and we're resuming sandboxes from that state uh so that's a little bit different like if you think about docker when you start a docker image uh you have kind of you build up a bunch of things

s96
00:05:36.160 --> 00:05:45.280
uh and then when the process starts uh that's where you have your start command uh for E2B basing from everything already running.

s97
00:05:45.280 --> 00:05:57.440
Uh so for instance you uh when we have our templates uh which we'll talk about in a bit uh what you're doing is uh you start processes and then those processes are already running when you come back to the sandbox.

s98
00:05:57.440 --> 00:05:58.000
All right.

s99
00:05:58.000 --> 00:06:03.360
Uh we're also open source uh and so for infra uh you can see our links there.

s100
00:06:03.360 --> 00:06:08.319
You can also Google uh that we've got our back end's mostly in Go uh which is why I asked about the Go engineers.

s101
00:06:08.319 --> 00:06:09.600
We're desperately hiring.

s102
00:06:09.600 --> 00:06:12.319
Uh and then also our SDK is in Python and JavaScript.

s103
00:06:12.319 --> 00:06:17.680
uh working on extending that to other languages, but that covers quite a few of our use cases.

s104
00:06:19.280 --> 00:06:20.479
All right.

s105
00:06:20.479 --> 00:06:23.840
So, normal usage of sandboxes are uh we have an API key.

s106
00:06:23.840 --> 00:06:27.759
You go to edb.dev uh and then you can also go read our docs.

s107
00:06:27.759 --> 00:06:33.280
However, for this workshop, uh we're not going to need to worry about any of that because we're just going to do everything inside of our own sandboxes.

s108
00:06:33.280 --> 00:06:35.520
Uh we're going to spawn the sandboxes through our dashboard.

s109
00:06:35.520 --> 00:06:39.280
Uh that way we can hopefully get uh up and running very quickly.

s110
00:06:39.280 --> 00:06:44.319
uh and uh that should eliminate some of the issues that we've heard happen in workshops.

s111
00:06:44.319 --> 00:06:45.039
So, all right.

s112
00:06:45.039 --> 00:06:48.319
And again, uh I guess we found out most of us already know Python.

s113
00:06:48.319 --> 00:06:49.600
Uh which is good.

s114
00:06:49.600 --> 00:06:53.039
Uh but for this workshop, we're not going to need to code uh for the first several levels.

s115
00:06:53.039 --> 00:06:59.520
Uh once we get past, I think level seven, that's when uh we start needing to code in Python or JavaScript if you want to.

s116
00:06:59.520 --> 00:07:02.479
Uh and we'll have tests that make things uh fast.

s117
00:07:02.479 --> 00:07:03.840
Uh we would have liked it.

s118
00:07:03.840 --> 00:07:11.919
Uh one of the challenges that we uh had when coming up with hey how do we demo uh some of the issues that we run into sandboxes is uh a lot of issues happen at scale.

s119
00:07:11.919 --> 00:07:15.840
Uh so sometimes when you're managing just like one or two sandboxes it's pretty easy.

s120
00:07:15.840 --> 00:07:20.160
It's just like hey I've got one sandbox I go into it pause it resume it no issues.

s121
00:07:20.160 --> 00:07:27.199
Uh however uh once you start to deal with hundreds of sandboxes, thousands of sandboxes uh things start to take on a life of their own.

s122
00:07:27.199 --> 00:07:34.240
uh for that we have some uh basically simulations uh in in the uh workshop uh which hopefully are fun.

s123
00:07:34.240 --> 00:07:43.840
Uh also uh even I know it's 2026 and we have agents uh so most of us don't actually code by hand anymore or many of us don't code by hand anymore.

s124
00:07:43.840 --> 00:07:56.160
Uh you so most of the uh AI agents uh know the ED SDK and so what you'll be able to do is uh grab your sandbox ID that you get for each of the levels, give it to your agent and uh let the agent just figure out how to write the code for you.

s125
00:07:56.160 --> 00:07:58.639
Um, but this is for learning purposes.

s126
00:07:58.639 --> 00:08:01.520
So, if you want to do it by hand, it's probably better.

s127
00:08:01.520 --> 00:08:01.919
All right.

s128
00:08:01.919 --> 00:08:04.000
Also, uh, I'm supposed to point this out.

s129
00:08:04.000 --> 00:08:11.840
Uh, if you're at a startup, we have a startup program, uh, where, uh, we give, uh, credits and, uh, free plan.

s130
00:08:11.840 --> 00:08:12.639
All right.

s131
00:08:12.639 --> 00:08:14.160
So, let's get to the first level.

s132
00:08:14.160 --> 00:08:16.879
So, let's go back to Let's see.

s133
00:08:16.879 --> 00:08:23.120
I don't know if there's a way to keep this up, but was everyone able to get to this, uh, URL here?

s134
00:08:23.120 --> 00:08:23.520
Yep.

s135
00:08:23.520 --> 00:08:24.400
Cool.

s136
00:08:24.400 --> 00:08:24.800
All right.

s137
00:08:24.800 --> 00:08:25.759
So, let's go there.

s138
00:08:25.759 --> 00:08:28.960
I already have it open, but that's fine.

s139
00:08:29.840 --> 00:08:31.840
Okay.

s140
00:08:32.320 --> 00:08:35.440
So, it is uh this tinyurl.comwh46sx6.

s141
00:08:40.560 --> 00:08:51.279
Uh I don't know if there's an easy way to keep this up on the screen while we're going, but uh all of you have neighbors and so you can just go to your neighbor and be like, "Hey, what's what's that code again if if you need it again?"

s142
00:08:51.279 --> 00:08:53.920
Uh so, I'll give you another five seconds.

s143
00:08:53.920 --> 00:08:57.600
Can I just get a thumbs up as people have gotten there?

s144
00:08:57.600 --> 00:08:59.760
Okay, it looks like those guys over there are good.

s145
00:08:59.760 --> 00:09:02.080
Over here generally good.

s146
00:09:02.080 --> 00:09:04.399
All right, cool.

s147
00:09:05.680 --> 00:09:08.800
All right, so what we're inside of here is already a sandbox.

s148
00:09:08.800 --> 00:09:16.000
All right, so at the top, what we're going to have is uh so this is uh our uh web UI for viewing our sandboxes.

s149
00:09:16.000 --> 00:09:18.720
Um and again, as I said, we don't need to code yet.

s150
00:09:18.720 --> 00:09:20.480
Uh and so this is our dashboard.

s151
00:09:20.480 --> 00:09:30.320
uh inside of the dashboard, if you want to uh make an API key, you can uh you can go into your API keys here uh and uh create an API key, which you can then uh hook into this locally.

s152
00:09:30.320 --> 00:09:34.240
However, we've got this gorgeous UI uh that's going to tell us what to do.

s153
00:09:34.240 --> 00:09:40.080
Uh so inside of the sandbox, what we're doing is we're spawning a web server, and we're just going to go up here, right?

s154
00:09:40.080 --> 00:09:41.360
So, we can go there now.

s155
00:09:41.360 --> 00:09:43.600
Uh and so here is our uh lab.

s156
00:09:43.600 --> 00:09:44.959
All right.

s157
00:09:44.959 --> 00:09:47.040
So, uh our first task is very simple.

s158
00:09:47.040 --> 00:09:50.560
Uh it's basically can you find out the sandbox ID that you're inside of?

s159
00:09:50.560 --> 00:09:53.920
Uh now we have a bunch of instructions for how to get that from the sandbox itself.

s160
00:09:53.920 --> 00:09:55.519
Uh I'm going to show you a cheat code.

s161
00:09:55.519 --> 00:09:59.040
Uh now in the URL we actually have the uh ID of the sandbox.

s162
00:09:59.040 --> 00:10:01.519
Uh and so we can just copy that uh ID.

s163
00:10:01.519 --> 00:10:07.120
Uh again our first levels are mostly just to make sure that everyone's oriented and they can get the different pieces working.

s164
00:10:07.120 --> 00:10:09.440
Uh and you can just paste it here, right?

s165
00:10:09.440 --> 00:10:12.880
We check it and uh so we should be good.

s166
00:10:12.880 --> 00:10:16.880
Everyone So has everyone been able to get past the first level?

s167
00:10:17.120 --> 00:10:18.079
Okay.

s168
00:10:18.079 --> 00:10:21.040
Getting the ID is hard.

s169
00:10:24.399 --> 00:10:28.000
Do Well, everyone's going to have different sandbox IDs.

s170
00:10:30.480 --> 00:10:32.737
Oh, that is our helper, one of our uh

s171
00:10:32.737 --> 00:10:34.160
[laughter]

s172
00:10:34.160 --> 00:10:36.079
uh go to market people from E2B back there.

s173
00:10:36.079 --> 00:10:38.240
Uh uh just if you want to come up here.

s174
00:10:38.240 --> 00:10:39.680
Huh?

s175
00:10:39.680 --> 00:10:40.240
Sorry.

s176
00:10:40.240 --> 00:10:41.440
The Wi-Fi is not working.

s177
00:10:41.440 --> 00:10:42.480
The Wi-Fi is not working.

s178
00:10:42.480 --> 00:10:42.800
All right.

s179
00:10:42.800 --> 00:10:45.839
Anyone else having Wi-Fi issues?

s180
00:10:45.839 --> 00:10:46.560
I guess.

s181
00:10:46.560 --> 00:10:47.040
Great.

s182
00:10:47.040 --> 00:10:47.360
All right.

s183
00:10:47.360 --> 00:10:50.079
Uh, so one of the Okay, so I tested this before I came in.

s184
00:10:50.079 --> 00:10:57.760
Uh, so the Wi-Fi that we're supposed to be using is it was like AI engineer something.

s185
00:10:57.760 --> 00:10:58.079
Here we go.

s186
00:10:58.079 --> 00:10:59.440
It's on these things.

s187
00:10:59.440 --> 00:11:01.600
Uh, a engineer uh, Wi-Fi.

s188
00:11:01.600 --> 00:11:03.839
If you connect, you'll have one bar possibly.

s189
00:11:03.839 --> 00:11:09.519
What you do is you dis after you've connected, disconnect and reconnect, and it should give you five bars.

s190
00:11:09.760 --> 00:11:10.000
Okay.

s191
00:11:10.000 --> 00:11:12.720
I don't know why that worked.

s192
00:11:14.399 --> 00:11:16.399
Sorry.

s193
00:11:17.680 --> 00:11:20.800
You got here already or no?

s194
00:11:24.000 --> 00:11:24.560
Gotcha.

s195
00:11:24.560 --> 00:11:25.200
Okay.

s196
00:11:25.200 --> 00:11:28.480
So, all right.

s197
00:11:28.480 --> 00:11:28.720
All right.

s198
00:11:28.720 --> 00:11:30.560
So, set up.

s199
00:11:30.560 --> 00:11:31.519
So, okay.

s200
00:11:31.519 --> 00:11:35.040
At this tiny URL, this should give everyone a terminal, right?

s201
00:11:35.040 --> 00:11:36.800
You'll have to log into E2B.

s202
00:11:36.800 --> 00:11:38.000
Make the font bigger.

s203
00:11:38.000 --> 00:11:40.720
Oh, make the font bigger.

s204
00:11:46.160 --> 00:11:48.160
URL.

s205
00:11:50.399 --> 00:11:53.360
I'm just going to keep zooming in.

s206
00:11:55.360 --> 00:11:56.399
Okay.

s207
00:11:56.399 --> 00:11:57.920
URL.

s208
00:11:57.920 --> 00:12:01.040
Everyone had already gotten there.

s209
00:12:01.600 --> 00:12:02.160
Go back.

s210
00:12:02.160 --> 00:12:02.399
Okay.

s211
00:12:02.399 --> 00:12:04.560
We can give you the URL one more time.

s212
00:12:04.560 --> 00:12:10.240
Uh after this we have to start charging because uh screen time's expensive.

s213
00:12:11.920 --> 00:12:13.440
All right.

s214
00:12:13.440 --> 00:12:17.760
Got about 10 more seconds to try to get to this URL, but uh I I can also say it out loud.

s215
00:12:17.760 --> 00:12:31.839
This is uh tinyurl.com4 whiskey hotel for 6 Sierra X-ray 6. Okay.

s216
00:12:32.720 --> 00:12:36.160
And that should bring us to a terminal.

s217
00:12:36.399 --> 00:12:37.600
You need to sign up.

s218
00:12:37.600 --> 00:12:41.279
Yes, you do need to sign up for EDB to use this.

s219
00:12:46.480 --> 00:12:47.519
Huh.

s220
00:12:47.519 --> 00:12:54.160
Also, beautiful ASI art does not look as good on the big screen as it does on a smaller screen.

s221
00:12:54.639 --> 00:12:54.880
Cool.

s222
00:12:54.880 --> 00:12:55.920
Uh, can I get a show of hands?

s223
00:12:55.920 --> 00:12:58.720
Who was able to get to this page?

s224
00:12:58.720 --> 00:13:01.600
Okay, who was not able to get to this page?

s225
00:13:01.600 --> 00:13:03.120
All right, we don't want to leave you guys behind.

s226
00:13:03.120 --> 00:13:13.839
We're going to make sure that we get the first setup part, but uh for those of you that were able to get to this page, you're good to go ahead and keep going through levels if you're able to.

s227
00:13:17.519 --> 00:13:25.200
All right, I'm going to give another Let's see.

s228
00:13:29.440 --> 00:13:31.440
Okay.

s229
00:13:31.519 --> 00:13:31.760
Yeah.

s230
00:13:31.760 --> 00:13:37.360
Yeah, it's everything's running remotely in the sandbox, so hopefully we don't need much back and forth.

s231
00:13:37.920 --> 00:13:40.800
Uh, famous last words.

s232
00:13:44.639 --> 00:13:45.200
All right.

s233
00:13:45.200 --> 00:13:50.720
Uh, can I get So, for people that were still loading, uh, who's still waiting to try to get to the page?

s234
00:13:50.720 --> 00:13:51.600
One, two.

s235
00:13:51.600 --> 00:13:56.800
Uh, uh, Ally, are you able to help these guys out?

s236
00:13:56.800 --> 00:14:02.880
Uh so we've got our uh helpers that can come through and uh help debug what's going on.

s237
00:14:02.880 --> 00:14:04.399
Uh what's the main issue we still have?

s238
00:14:04.399 --> 00:14:07.120
It's just the internet connectivity.

s239
00:14:07.440 --> 00:14:08.560
Okay.

s240
00:14:08.560 --> 00:14:12.639
And then worst case, uh everyone here's friendly, right?

s241
00:14:12.639 --> 00:14:14.959
Uh what we can do is we can partner up.

s242
00:14:14.959 --> 00:14:17.199
Uh and so uh let's see.

s243
00:14:17.199 --> 00:14:18.399
Uh can I get that show of hands?

s244
00:14:18.399 --> 00:14:20.800
And who's still trying to get to the page?

s245
00:14:20.800 --> 00:14:21.600
One, two, three.

s246
00:14:21.600 --> 00:14:21.839
Okay.

s247
00:14:21.839 --> 00:14:26.720
Can I get a show of hands of uh people that are friendly and don't mind sitting next to somebody?

s248
00:14:26.720 --> 00:14:27.040
All right.

s249
00:14:27.040 --> 00:14:29.920
So, if you're still waiting, look around for someone that's got their hand raised.

s250
00:14:29.920 --> 00:14:33.360
Uh, and it can uh kind of pair up.

s251
00:14:33.440 --> 00:14:34.160
All right.

s252
00:14:34.160 --> 00:14:36.480
So, once we're here, All right.

s253
00:14:36.480 --> 00:14:36.720
Yeah.

s254
00:14:36.720 --> 00:14:39.279
Sorry, it's uh we've got limited time and we want to keep moving.

s255
00:14:39.279 --> 00:14:41.519
Uh but, uh yeah.

s256
00:14:41.519 --> 00:14:42.639
All right.

s257
00:14:42.639 --> 00:14:47.920
So, once we're here, uh we should have this URL now uh that our first sandbox is going to spawn for us.

s258
00:14:47.920 --> 00:14:49.440
And then we can just go straight to that.

s259
00:14:49.440 --> 00:14:49.680
All right.

s260
00:14:49.680 --> 00:14:52.639
And so, everyone should get to a page that looks something like this.

s261
00:14:52.639 --> 00:14:56.079
Uh that's going to have uh our CTF instructions.

s262
00:14:56.079 --> 00:14:58.079
Cool.

s263
00:14:58.399 --> 00:14:59.279
Show hands.

s264
00:14:59.279 --> 00:14:59.600
Yeah.

s265
00:14:59.600 --> 00:15:04.480
Also, you guys didn't know this, but this is like an interactive uh workshop, right?

s266
00:15:04.480 --> 00:15:06.720
Where it's Raise your hand, lower your hand, raise your hand.

s267
00:15:06.720 --> 00:15:08.880
Uh Simon says is next.

s268
00:15:08.880 --> 00:15:11.600
Um but yeah, so who got here?

s269
00:15:11.600 --> 00:15:13.360
Show hands.

s270
00:15:13.360 --> 00:15:14.959
Great.

s271
00:15:14.959 --> 00:15:15.279
All right.

s272
00:15:15.279 --> 00:15:19.120
And then so who was able to find out their sandbox ID?

s273
00:15:19.120 --> 00:15:19.519
All right.

s274
00:15:19.519 --> 00:15:20.079
Cool.

s275
00:15:20.079 --> 00:15:23.680
Who was not able to find out the sandbox ID, but is still here?

s276
00:15:23.680 --> 00:15:26.240
who is too embarrassed to say that they couldn't find their sandbox ID.

s277
00:15:26.240 --> 00:15:28.720
Uh, okay.

s278
00:15:28.720 --> 00:15:31.760
And again, so we can just pull the sandbox ID out of the URL.

s279
00:15:31.760 --> 00:15:35.120
Uh, this ID basically is is identifier for the sandbox, right?

s280
00:15:35.120 --> 00:15:42.480
So once you have a sandbox, you're going to want an identifier so that you can go back to that sandbox uh for E2B, the way that we construct our URLs

s281
00:15:42.480 --> 00:15:48.880
uh is basically the port that you're talking to dash uh the sandbox ID uh.app.

s282
00:15:48.880 --> 00:15:53.120
And that way whenever you spin up sandbox, you can expose services listening to those ports.

s283
00:15:53.120 --> 00:15:56.240
uh and and then uh get coms open.

s284
00:15:56.240 --> 00:16:01.680
So we'll uh refinish this uh first level.

s285
00:16:02.320 --> 00:16:03.440
All right.

s286
00:16:03.440 --> 00:16:09.440
So one of the things that happens uh uh is once you've got users in a sandbox, you've got AI writing code.

s287
00:16:09.440 --> 00:16:14.079
Uh a lot of the times what'll happen is the AI will write some something that does something that you're not expecting it to do.

s288
00:16:14.079 --> 00:16:20.560
Uh it turned out while writing uh this workshop, we ran into this issue a lot that we had processes that just took lots of CPU.

s289
00:16:20.560 --> 00:16:24.079
So, what we can do is we can start this sandbox and you'll see up here, right?

s290
00:16:24.079 --> 00:16:26.800
We are now inside of a new uh sandbox, right?

s291
00:16:26.800 --> 00:16:34.079
So, our new we got a new sandbox specifically for this uh project, which means we can break this and we're not going to break our initial stuff.

s292
00:16:34.079 --> 00:16:39.120
Uh if we want to restart a sandbox, we've got this uh fancy button over here to reload, right?

s293
00:16:39.120 --> 00:16:41.199
And then it'll reload it.

s294
00:16:41.199 --> 00:16:41.519
Yes.

s295
00:16:41.519 --> 00:16:50.320
Uh while we're here, I should kind of point out some of the things that are happening uh that we don't need to worry about too much, but more just kind of framework on how uh we just manage our dashboard.

s296
00:16:50.320 --> 00:16:55.120
Uh we've got this terminal here that lets us uh connect a pty uh session to a sandbox.

s297
00:16:55.120 --> 00:17:00.160
Uh and so uh we have this concept of templates which I mentioned earlier.

s298
00:17:00.160 --> 00:17:04.000
So a template uh for us is that snapshotted uh VM.

s299
00:17:04.000 --> 00:17:16.319
And so what we've done is we started a VM, ran a bunch of processes to start the capture the flag uh and then we saved this as this template which means all of you uh are basically taking that sandbox that I'd started before

s300
00:17:16.319 --> 00:17:18.160
uh and then you're starting it where I'd resumed it.

s301
00:17:18.160 --> 00:17:18.319
Right?

s302
00:17:18.319 --> 00:17:24.240
So we just made I don't know 200 copies of this thing uh which is pretty cool uh just but that we can do that by itself.

s303
00:17:24.240 --> 00:17:32.480
Uh there's a lot of use cases for this kind of thing depending on what you're doing at your business uh that you'll want to be like hey I've got uh this work I want other people to continue it.

s304
00:17:32.480 --> 00:17:36.240
Um and or even like if you're doing data science stuff, right?

s305
00:17:36.240 --> 00:17:39.600
So let's say you've got a bunch of uh data in a data frame.

s306
00:17:39.600 --> 00:17:41.360
You're like, "Hey, I want to try mutating this.

s307
00:17:41.360 --> 00:17:43.360
There's like five different experiments I want to run."

s308
00:17:43.360 --> 00:17:45.919
You can take that, fork that into five different things.

s309
00:17:45.919 --> 00:17:50.080
Uh and then in parallel uh spin that up into five different sandboxes.

s310
00:17:50.080 --> 00:17:53.120
So uh this up here is just the template ID that we're spawning.

s311
00:17:53.120 --> 00:17:58.320
Uh and then now that we have the sandbox ID, uh when we re reload this, we'll go back to the same page over and over again.

s312
00:17:58.320 --> 00:18:00.080
Um and we can connect to that.

s313
00:18:00.080 --> 00:18:08.000
Uh one thing also is so let's say that uh uh I mentioned later on we're going to have some code uh for those of us that are jumping ahead.

s314
00:18:08.000 --> 00:18:17.679
You can take the sandbox ID you can create an EDB uh API key uh and then in your local uh you know codeex cloud code whatever uh you can be like hey stuck these in environmental

s315
00:18:17.679 --> 00:18:21.840
uh file use EDB to go talk to the sandbox and solve the challenge for me.

s316
00:18:21.840 --> 00:18:23.120
Um, and that can make life easier.

s317
00:18:23.120 --> 00:18:28.640
So that way you don't have to code because again, uh, most of us are just letting the AI code for us nowadays or in some way.

s318
00:18:28.640 --> 00:18:31.039
Uh, don't just let it code for you.

s319
00:18:31.039 --> 00:18:33.120
Uh, you should always review what the AI does.

s320
00:18:33.120 --> 00:18:36.240
Um, do what I say, not what I do.

s321
00:18:36.240 --> 00:18:37.600
Uh, so, right.

s322
00:18:37.600 --> 00:18:43.840
So, each of these, uh, challenges is going to have, uh, just like the first one, we can just stick this up here.

s323
00:18:43.840 --> 00:18:44.080
All right.

s324
00:18:44.080 --> 00:18:46.400
And so, here's our CPU uh, runway task.

s325
00:18:46.400 --> 00:18:52.480
Uh for those of us that haven't coded a lot, haven't messed around with Linux recently, uh we've got instructions on how to uh figure out what's going on.

s326
00:18:52.480 --> 00:18:52.720
Right?

s327
00:18:52.720 --> 00:18:55.039
So we can see here uh we've got another terminal.

s328
00:18:55.039 --> 00:18:57.200
We're sandboxes and terminals all the way down.

s329
00:18:57.200 --> 00:19:01.200
Uh this is opening another pty into the local uh sandbox.

s330
00:19:01.200 --> 00:19:09.039
Uh and so basically uh our instructions here, hey, we've got a CPU uh we've got some processes taking a bunch of CPU uh for these early levels.

s331
00:19:09.039 --> 00:19:14.160
We've got instructions uh how to find uh what's taking up CPU, right?

s332
00:19:14.160 --> 00:19:14.320
All right.

s333
00:19:14.320 --> 00:19:16.960
And so we can list here, hey, what's going on?

s334
00:19:16.960 --> 00:19:26.400
And we have this uh process up here uh that's been running for a bit, taking up 99.7% of our CPU that we probably uh should kill.

s335
00:19:26.400 --> 00:19:29.440
Well, how do we kill uh a process?

s336
00:19:29.440 --> 00:19:30.720
I forgot how.

s337
00:19:30.720 --> 00:19:33.200
Uh but luckily, we have instructions here for how to do it.

s338
00:19:33.200 --> 00:19:35.600
Or could also ask our friendly AI, right?

s339
00:19:35.600 --> 00:19:38.160
So, what we're going to do is we're going to go ahead and kill that process.

s340
00:19:38.160 --> 00:19:40.160
Uh right, so we got the process ID up here, right?

s341
00:19:40.160 --> 00:19:40.320
Right.

s342
00:19:40.320 --> 00:19:46.320
So, this is showing our process uh how much CPU each of these guys is taking uh memory uh so forth.

s343
00:19:46.320 --> 00:19:49.760
Uh and so we're going to go kill 250 uh 1250.

s344
00:19:49.760 --> 00:19:50.080
Right.

s345
00:19:50.080 --> 00:19:54.640
Now that he's dead, we have now identified, hey, we have solved our runway process.

s346
00:19:54.640 --> 00:19:57.760
We copied this amazing code here.

s347
00:19:57.760 --> 00:20:00.400
Go back to our uh initial capture the flag.

s348
00:20:00.400 --> 00:20:02.960
And we've unlocked level three.

s349
00:20:02.960 --> 00:20:06.480
All right, everyone able to do that, right?

s350
00:20:06.480 --> 00:20:07.520
Cool.

s351
00:20:07.520 --> 00:20:10.000
Anyone stuck?

s352
00:20:10.160 --> 00:20:12.160
I don't want to embarrass their stock.

s353
00:20:12.160 --> 00:20:14.559
No. Cool.

s354
00:20:16.240 --> 00:20:16.720
All right.

s355
00:20:16.720 --> 00:20:19.919
Then we can open up our next level.

s356
00:20:22.480 --> 00:20:22.799
Okay.

s357
00:20:22.799 --> 00:20:23.919
And again, same thing, right?

s358
00:20:23.919 --> 00:20:26.640
So we get a new sandbox.

s359
00:20:28.159 --> 00:20:30.400
We can open this up.

s360
00:20:30.400 --> 00:20:30.799
Right.

s361
00:20:30.799 --> 00:20:32.720
And so this is another thing that happens a lot, right?

s362
00:20:32.720 --> 00:20:34.400
You've got an agent running code in a sandbox.

s363
00:20:34.400 --> 00:20:36.240
You've got you're running code in a sandbox.

s364
00:20:36.240 --> 00:20:37.679
Uh you're blowing up memory, right?

s365
00:20:37.679 --> 00:20:44.000
So, one of the things about these sandboxes is uh you've got some trade-offs in the amount of resources that you're using.

s366
00:20:44.000 --> 00:20:55.280
Uh a lot of the times you're going to want to have I don't know uh let's say uh you know there's a trade-off between if you have multiple CPUs, you're going to run faster,

s367
00:20:55.280 --> 00:20:57.120
fewer CPUs, it's going to go slower.

s368
00:20:57.120 --> 00:21:06.640
Also, in terms of resource utilization, uh one of the things that you start to run into uh with fleets is uh you have limited quotas on how many uh CPUs and how much RAM you're able to have for your instances.

s369
00:21:06.640 --> 00:21:09.919
Uh so there's trade-offs uh on can you just overuse it?

s370
00:21:09.919 --> 00:21:14.720
So you're going to want to be like hey how do I minimize uh my RAM utilization.

s371
00:21:14.720 --> 00:21:30.960
So again uh in this walkthrough we can easily go through here and then we can go into our sandbox show what's using up our memory uh right and then we can kill it

s372
00:21:30.960 --> 00:21:31.760
right same thing.

s373
00:21:31.760 --> 00:21:35.679
So for the first couple levels, all these instructions are here.

s374
00:21:35.679 --> 00:21:38.880
Uh 124 1248.

s375
00:21:40.400 --> 00:21:41.360
Bam.

s376
00:21:41.360 --> 00:21:44.080
And then we get our key.

s377
00:21:44.640 --> 00:21:44.880
Okay.

s378
00:21:44.880 --> 00:21:45.919
Am I going too slow?

s379
00:21:45.919 --> 00:21:47.840
Too fast.

s380
00:21:47.840 --> 00:21:50.159
Right speed.

s381
00:21:50.400 --> 00:21:50.880
Good.

s382
00:21:50.880 --> 00:21:51.600
Right speed.

s383
00:21:51.600 --> 00:21:53.600
Okay.

s384
00:21:57.600 --> 00:21:59.600
Cool.

s385
00:21:59.840 --> 00:22:00.159
All right.

s386
00:22:00.159 --> 00:22:11.120
And then so finally it's uh hey what happens once we start filling our disk right so all these things have limited resources uh and all these things you're going to run into at some point or another things are going to blow this up

s387
00:22:11.120 --> 00:22:21.679
so same process um right you can see we're in a new sandbox we can ls around right we can see hey we've got our instructions in here we've also got a read me if uh you want to

s388
00:22:21.679 --> 00:22:30.400
uh see more info on here right so we can c the read me Okay, then.

s389
00:22:30.400 --> 00:22:33.679
So, uh, yeah.

s390
00:22:33.679 --> 00:22:35.360
All right.

s391
00:22:35.360 --> 00:22:41.440
Uh, so let's go to here.

s392
00:22:41.440 --> 00:22:43.520
So, here we've, uh, filled our disk, right?

s393
00:22:43.520 --> 00:22:44.720
So, same thing.

s394
00:22:44.720 --> 00:22:50.720
Uh, we can check, hey, what's going on as far as what's taking up our, uh, our disc.

s395
00:22:57.679 --> 00:22:57.840
All right.

s396
00:22:57.840 --> 00:22:58.000
All right.

s397
00:22:58.000 --> 00:23:05.039
And then we just got to figure out, hey, what is the path uh in here that's taking up all of our uh this, right?

s398
00:23:13.200 --> 00:23:18.240
Actually, this used to have all of our instructions in here, but right, we can see in here.

s399
00:23:18.240 --> 00:23:21.840
Uh let's remove this guy.

s400
00:23:24.799 --> 00:23:25.840
Okay.

s401
00:23:25.840 --> 00:23:30.000
And again now I should say that we've succeeded.

s402
00:23:38.960 --> 00:23:45.200
We also have a Oh, we were supposed to put it here.

s403
00:23:47.600 --> 00:23:49.840
Just kidding.

s404
00:23:51.840 --> 00:24:14.880
All right.

s405
00:24:14.880 --> 00:24:19.760
So, the easy levels apparently were not as simple.

s406
00:24:19.760 --> 00:24:27.760
So in theory, well, what we can do is we can actually just reload this uh s I broke the demo.

s407
00:24:27.760 --> 00:24:28.400
That's okay.

s408
00:24:28.400 --> 00:24:31.200
We can just start a new one.

s409
00:24:31.600 --> 00:24:34.159
Let's try again.

s410
00:24:35.039 --> 00:24:38.400
And let's pretend I didn't break that.

s411
00:24:42.720 --> 00:24:44.720
Okay.

s412
00:24:51.120 --> 00:24:56.159
Okay, we should have just been able to delete it.

s413
00:24:56.960 --> 00:25:00.240
But let's do it here then.

s414
00:25:06.000 --> 00:25:08.799
Okay, there we go.

s415
00:25:08.799 --> 00:25:11.120
So, okay.

s416
00:25:12.159 --> 00:25:12.320
All right.

s417
00:25:12.320 --> 00:25:12.559
All right.

s418
00:25:12.559 --> 00:25:18.159
And then so we were then we get the uh we were supposed to paste the uh path in there instead of remove it.

s419
00:25:18.159 --> 00:25:20.320
I guess I broke that.

s420
00:25:20.320 --> 00:25:25.120
Um and so everyone able to get to this uh flag or cool.

s421
00:25:25.120 --> 00:25:25.520
All right.

s422
00:25:25.520 --> 00:25:27.200
Great.

s423
00:25:27.200 --> 00:25:30.159
Anyone not able to get to this flag?

s424
00:25:30.159 --> 00:25:31.760
Okay.

s425
00:25:31.760 --> 00:25:35.919
So uh real quick for how I solve that one.

s426
00:25:35.919 --> 00:25:47.360
Uh what you do is so uh on the disk fill uh challenge what we're looking for is uh which uh what is taking up all of our file uh

s427
00:25:47.360 --> 00:25:48.640
space.

s428
00:25:48.640 --> 00:25:56.960
Uh and so what we need to do is we need to find uh up here in the hints uh you can copy the uh the uh script uh to find where

s429
00:25:56.960 --> 00:25:59.600
uh what's taking up all of our uh disk space.

s430
00:25:59.600 --> 00:26:04.880
And then here we should be able to see that we have this slashtemp selfone discill.bin.

s431
00:26:04.880 --> 00:26:12.559
Um and then what we can do is just paste it uh down here into the path uh checker.

s432
00:26:12.559 --> 00:26:13.600
All right.

s433
00:26:13.600 --> 00:26:15.679
And then click uh here to clean it up.

s434
00:26:15.679 --> 00:26:18.159
And that'll run the delete command for us.

s435
00:26:18.159 --> 00:26:22.400
And then uh we should get this uh task uh complete flag.

s436
00:26:22.400 --> 00:26:24.960
Everyone got there?

s437
00:26:25.440 --> 00:26:25.919
So

s438
00:26:25.919 --> 00:26:27.840
I don't get this.

s439
00:26:27.840 --> 00:26:30.400
You don't get this.

s440
00:26:30.799 --> 00:26:31.360
path.

s441
00:26:31.360 --> 00:26:34.000
Disk fill path.

s442
00:26:36.080 --> 00:26:36.880
Okay, one second.

s443
00:26:36.880 --> 00:26:41.760
So, you've gotten to uh disf level level four.

s444
00:26:42.159 --> 00:26:44.159
Cool.

s445
00:26:45.200 --> 00:26:47.679
Third time's the charm.

s446
00:26:47.679 --> 00:26:48.000
All right.

s447
00:26:48.000 --> 00:26:52.799
So, we can open uh the page for the challenge.

s448
00:26:54.320 --> 00:27:02.240
Uh and then so what we want to do is so up here we have uh some code that we can run in order to find uh what the uh

s449
00:27:02.240 --> 00:27:04.880
what what files uh are taking up the most disk.

s450
00:27:04.880 --> 00:27:06.159
Okay.

s451
00:27:06.159 --> 00:27:09.679
So are we able to get to here so far?

s452
00:27:09.679 --> 00:27:11.600
Cool.

s453
00:27:11.600 --> 00:27:12.080
Right.

s454
00:27:12.080 --> 00:27:24.240
Then uh when we run this uh dua uh we should be able to find the temp file the file in temp uh this uh disk fill.bin uh that's taking up 512 megs of uh disk space.

s455
00:27:31.120 --> 00:27:33.039
You don't have that.

s456
00:27:33.039 --> 00:27:35.520
What do you have?

s457
00:27:38.480 --> 00:27:40.480
Sorry.

s458
00:27:41.279 --> 00:27:42.880
There's nothing inside of there.

s459
00:27:42.880 --> 00:27:43.200
All right.

s460
00:27:43.200 --> 00:27:48.000
So, what we can do, right, and that's where uh the great thing about sandboxes, you can restart them.

s461
00:27:48.000 --> 00:27:48.640
Uh right.

s462
00:27:48.640 --> 00:27:57.520
So, if you go back into here, when you uh click on the start sandbox, uh we can reload the snapshot by clicking on this reload button up here, right?

s463
00:27:57.520 --> 00:28:00.960
And so, this will spawn us a new copy of it.

s464
00:28:09.520 --> 00:28:12.320
Okay, everyone else good?

s465
00:28:12.799 --> 00:28:14.159
Yep.

s466
00:28:14.159 --> 00:28:14.880
Yeah, exactly.

s467
00:28:14.880 --> 00:28:16.399
So, it's this button here.

s468
00:28:16.399 --> 00:28:17.039
Refreshes it.

s469
00:28:17.039 --> 00:28:24.960
And then you can see here it's saying hey uh start here open this browser page uh for this uh set of uh tutorials.

s470
00:28:24.960 --> 00:28:28.640
Um it'll say we've returned uh if it's the same one

s471
00:28:28.640 --> 00:28:30.640
and that resets like original

s472
00:28:30.640 --> 00:28:32.080
exactly.

s473
00:28:32.080 --> 00:28:32.960
Yep.

s474
00:28:32.960 --> 00:28:44.880
And so that's where uh yeah it's it's you can see like our start time is pretty fast right clicking here able to create a sandbox and relatively quickly.

s475
00:28:44.880 --> 00:28:49.360
Uh and so it's we can create as many sandboxes as we want to create.

s476
00:28:50.080 --> 00:28:50.640
Question.

s477
00:28:50.640 --> 00:28:51.600
Yeah.

s478
00:28:51.600 --> 00:28:58.320
You don't have any funny characters that have some supporting agent go and scrape this or things like that.

s479
00:28:58.320 --> 00:28:59.600
We won't have any issues.

s480
00:28:59.600 --> 00:29:00.000
Nope.

s481
00:29:00.000 --> 00:29:00.240
Yeah.

s482
00:29:00.240 --> 00:29:01.279
I mean, yeah.

s483
00:29:01.279 --> 00:29:03.520
Uh this is just a terminal showing the sandbox.

s484
00:29:03.520 --> 00:29:05.679
Most of the time when people interact with this, it's all programmatic.

s485
00:29:05.679 --> 00:29:10.880
So you have a web server that's going in programmatically and running code in the sandbox purely for demonstration purposes.

s486
00:29:10.880 --> 00:29:17.039
Uh, and also for debugging purposes, uh, being able to quickly go into the browser and pull up a sandbox can be useful.

s487
00:29:17.039 --> 00:29:23.840
Um, and also here it's kind of we're able to spin up a web page really quickly to get in and see what's going on.

s488
00:29:24.240 --> 00:29:24.880
Yes.

s489
00:29:24.880 --> 00:29:25.200
Yes.

s490
00:29:25.200 --> 00:29:26.320
Yes.

s491
00:29:26.320 --> 00:29:27.360
And that's what I was saying.

s492
00:29:27.360 --> 00:29:30.559
So, uh, yeah.

s493
00:29:30.559 --> 00:29:36.240
Um, we'll come to that in a couple levels where we actually start uh interacting uh programmatically with uh these sandboxes.

s494
00:29:36.240 --> 00:29:44.559
But mostly it's right now we just want to make sure everyone's on the same page for what is CPU, what is RAM, uh what's going to blow up uh when we're starting to run a whole bunch of different

s495
00:29:44.559 --> 00:29:48.960
uh things that we're getting arbitrary code execution run on.

s496
00:29:48.960 --> 00:29:49.440
Cool.

s497
00:29:49.440 --> 00:29:52.000
Everyone good now?

s498
00:29:52.080 --> 00:29:53.279
Awesome.

s499
00:29:53.279 --> 00:29:55.120
All right.

s500
00:29:55.120 --> 00:29:59.279
Um one thing I didn't do was get the code for that level.

s501
00:29:59.279 --> 00:30:06.880
I'm just going to go uh restart him real quick.

s502
00:30:08.080 --> 00:30:11.120
I'm just clicking around on buttons.

s503
00:30:20.880 --> 00:30:25.679
Let me find our pro our uh file that's taking up all of our disk.

s504
00:30:25.679 --> 00:30:28.159
this guy here.

s505
00:30:30.799 --> 00:30:32.559
And then we can check our path.

s506
00:30:32.559 --> 00:30:33.440
Okay.

s507
00:30:33.440 --> 00:30:36.559
And we'll click on clean up.

s508
00:30:37.440 --> 00:30:39.360
Great.

s509
00:30:39.360 --> 00:30:39.600
All right.

s510
00:30:39.600 --> 00:30:44.320
And so that's the end of our easy uh easy tasks.

s511
00:30:45.039 --> 00:30:45.360
All right.

s512
00:30:45.360 --> 00:30:46.320
How's everyone feeling?

s513
00:30:46.320 --> 00:30:48.640
We we know all about how to mess around with Linux now.

s514
00:30:48.640 --> 00:30:49.360
Feel comfortable?

s515
00:30:49.360 --> 00:30:49.679
Yes.

s516
00:30:49.679 --> 00:30:50.960
No. Great.

s517
00:30:50.960 --> 00:30:53.200
Uh let's stand up for like a minute real quick.

s518
00:30:53.200 --> 00:30:54.880
Uh get the blood flowing.

s519
00:30:54.880 --> 00:30:57.679
uh kind of stretch out.

s520
00:30:58.159 --> 00:30:58.880
Okay.

s521
00:30:58.880 --> 00:31:02.720
We're also a calisthenics uh company.

s522
00:31:05.600 --> 00:31:07.600
Okay.

s523
00:31:08.960 --> 00:31:10.960
Cool.

s524
00:31:11.679 --> 00:31:12.559
All right.

s525
00:31:12.559 --> 00:31:15.279
So, that was hey, this is what Linux is.

s526
00:31:15.279 --> 00:31:20.480
Uh our next set of uh uh tutorials are going to get us into actually looking at the sandbox life cycle.

s527
00:31:20.480 --> 00:31:25.840
Uh so with a normal server, you spin up the server and it lasts there until you're like, "Hey, I want to shut it down."

s528
00:31:25.840 --> 00:31:27.919
Or Amazon is like, "You haven't paid your bill in a while.

s529
00:31:27.919 --> 00:31:29.679
We're shutting it down for you."

s530
00:31:29.679 --> 00:31:38.640
Uh or actually, if they're doing anyway, TLDDR, uh for sandboxes, a lot of what you're doing is looking around the life cycle of the sandbox.

s531
00:31:38.640 --> 00:31:41.120
Uh there's multiple things that we need to care about here.

s532
00:31:41.120 --> 00:31:44.720
So one is let's say you've got thousands of users or tens of thousands of users.

s533
00:31:44.720 --> 00:31:48.320
You're like, I want to give every single one of these guys a sandbox when they come to my application.

s534
00:31:48.320 --> 00:31:50.159
Well, how long should that sandbox last?

s535
00:31:50.159 --> 00:31:50.399
Right?

s536
00:31:50.399 --> 00:31:53.200
A lot, you know, intuitively it's like, hey, I'll give them the sandbox.

s537
00:31:53.200 --> 00:31:54.000
They land on my web page.

s538
00:31:54.000 --> 00:31:55.600
I'll give them the sandbox for 20 minutes.

s539
00:31:55.600 --> 00:31:57.600
If they don't use it, I'll shut it down.

s540
00:31:57.600 --> 00:32:04.640
But if you got thousands of users and they're only going to use it once or maybe not even interact interact with the sandbox, you're wasting a whole lot of resources

s541
00:32:04.640 --> 00:32:07.360
spinning up sandboxes that no one's ever going to use.

s542
00:32:07.360 --> 00:32:12.480
Uh, and so that's where, but maybe it's like you've got people that are going to come in and bounce, right?

s543
00:32:12.480 --> 00:32:15.600
They'll come in, try it for a second, be like, "Hey, does this thing work?"

s544
00:32:15.600 --> 00:32:16.320
And then bounce.

s545
00:32:16.320 --> 00:32:23.360
Uh, in that case, what you want to be able to do is you want to be able to have the sandbox there, have it be able to run their initial command, and then have it go away once,

s546
00:32:23.360 --> 00:32:28.159
uh, you know, once they've done the command and maybe, you know, they'll come back again 10 minutes or so.

s547
00:32:28.159 --> 00:32:30.720
Uh, you want to have that sandbox come back once they're there.

s548
00:32:30.720 --> 00:32:40.720
Uh, so that's where for the sandbox life cycle, um, you need to make sure that you're basically using as little sandboxes uh, as you can at a time.

s549
00:32:40.720 --> 00:32:44.640
However, you know, let's say you've got people that are running long long run processes, right?

s550
00:32:44.640 --> 00:32:44.799
All right.

s551
00:32:44.799 --> 00:32:47.440
So, let's say you're doing data science, web scraping, whatever.

s552
00:32:47.440 --> 00:32:50.880
Uh you don't know how long uh the user's tasks are going to run, right?

s553
00:32:50.880 --> 00:32:58.000
So, maybe you've got the users coming in, they're running a task that takes 10, 15 minutes, uh and then they're doing whatever, right?

s554
00:32:58.000 --> 00:33:06.240
So, it's how do you get that trade-off uh between how long you keep the sandboxes sitting around uh versus not eating money into the sun.

s555
00:33:06.240 --> 00:33:15.200
So with this task, what we're going to do uh is we're going to take an approach uh to our sandbox management where what we're going to do is we're going to give sandboxes a really long time

s556
00:33:15.200 --> 00:33:16.000
uh to live, right?

s557
00:33:16.000 --> 00:33:25.360
We're going to say, "Hey, when a user comes in and runs a command, we want that sandbox to run for as you know, as long as we want it to, but once the sandbox finishes its task,

s558
00:33:25.360 --> 00:33:26.880
we're going to give it a very short timeout.

s559
00:33:26.880 --> 00:33:31.200
So it'll stick around in case they give it, you know, another command, but then it'll shut itself down.

s560
00:33:31.200 --> 00:33:36.559
And then that way we can free up those resources to spin up another sandbox for somebody else.

s561
00:33:36.720 --> 00:33:40.720
So, we're going to go ahead open this up, right?

s562
00:33:40.720 --> 00:33:43.279
Uh, this one, uh, there's no code involved, right?

s563
00:33:43.279 --> 00:33:52.320
And so, all we're going to have to do here is think about, hey, when we've got these, uh, people coming in, uh, running, uh, commands, how long should things, uh, uh, the state machine,

s564
00:33:52.320 --> 00:33:54.640
uh, for how long should this run, right?

s565
00:33:54.640 --> 00:33:56.960
Uh, so you can read up here, right?

s566
00:33:56.960 --> 00:33:58.640
This thing can take a long time.

s567
00:33:58.640 --> 00:34:06.640
Uh let's say we've got a task and we think uh the initial task uh we should have the instructions on here somewhere.

s568
00:34:07.360 --> 00:34:08.560
We've got a policy.

s569
00:34:08.560 --> 00:34:13.919
But basically what we want to do is we want to uh allow this task along as long as as long as it wants to.

s570
00:34:13.919 --> 00:34:16.800
But afterwards we want to shut it off after a minute.

s571
00:34:16.800 --> 00:34:21.760
So what we'll do is we'll say hey we want this command to be able to run for an hour.

s572
00:34:21.760 --> 00:34:22.079
Okay.

s573
00:34:22.079 --> 00:34:24.079
So we set our command to run for an hour.

s574
00:34:24.079 --> 00:34:26.240
We can then run our task.

s575
00:34:26.240 --> 00:34:27.679
Okay.

s576
00:34:27.679 --> 00:34:32.639
And this is all simulated because we're not going to have you guys actually wait an hour for a task to run in a sandbox.

s577
00:34:32.639 --> 00:34:38.320
Uh, and what we'll do afterwards is we'll say, "Hey, I want the sandbox to only uh stick around for a minute.

s578
00:34:38.320 --> 00:34:40.879
Uh, and then it should shut down afterwards."

s579
00:34:40.879 --> 00:34:42.480
All right, very simple.

s580
00:34:42.480 --> 00:34:53.760
What I just did there uh because we're cheating, but uh that's basically uh what the goal is here is thinking about when we've got a a sandbox that we're just going to have it uh do a task.

s581
00:34:53.760 --> 00:34:57.359
Uh we wanted to stay uh around as long as the task is going to take.

s582
00:34:57.359 --> 00:35:02.320
Uh but then afterwards once we get that result back we can be like hey have it go away later.

s583
00:35:02.320 --> 00:35:02.640
Cool.

s584
00:35:02.640 --> 00:35:12.000
So everyone able to get to this flag or is that um did I spin that uh go through that too quick?

s585
00:35:14.640 --> 00:35:14.880
Up.

s586
00:35:14.880 --> 00:35:15.280
Thumbs up.

s587
00:35:15.280 --> 00:35:15.359
Okay.

s588
00:35:15.359 --> 00:35:16.560
I see a lot of thumbs up.

s589
00:35:16.560 --> 00:35:18.560
Great.

s590
00:35:18.880 --> 00:35:19.200
All right.

s591
00:35:19.200 --> 00:35:22.000
And then if you want to cheat uh you can just put in the code here.

s592
00:35:22.000 --> 00:35:26.320
So, it's right size runtime lifetime.

s593
00:35:26.320 --> 00:35:30.160
Uh, let me zoom in on that for you guys.

s594
00:35:30.800 --> 00:35:31.680
All right.

s595
00:35:31.680 --> 00:35:39.359
Uh, so we can come around or uh would it help if I went through that again real quick for anybody here just to show how that worked.

s596
00:35:39.359 --> 00:35:42.480
Okay, I'll go through it one more time.

s597
00:35:42.480 --> 00:35:42.960
All right.

s598
00:35:42.960 --> 00:35:46.880
So, I'll just spin off this uh that task again.

s599
00:35:46.880 --> 00:35:47.760
Yeah.

s600
00:35:47.760 --> 00:35:50.560
that just like you say

s601
00:35:51.119 --> 00:35:52.400
exactly

s602
00:35:52.400 --> 00:35:59.359
or let's say the user has like um they're having to read a large file or they want to do video processing, right?

s603
00:35:59.359 --> 00:36:01.440
That can you don't know how long that's going to take.

s604
00:36:01.440 --> 00:36:07.440
Uh and so what you want to do is you want to give the sandbox a long life cycle uh so it can complete that task.

s605
00:36:07.440 --> 00:36:12.800
Uh but then after it finishes the task, you don't want to keep it sitting around using resources.

s606
00:36:12.800 --> 00:36:21.440
Uh so you give it a shorter timeout afterwards to be like hey unless the user starts interacting with this shut pause it shut it down put it into so you can resume it later

s607
00:36:21.440 --> 00:36:24.400
if it's like a web server

s608
00:36:25.839 --> 00:36:27.839
right

s609
00:36:28.320 --> 00:36:32.160
exactly well cloud session is similar right so with a cloud session

s610
00:36:32.160 --> 00:36:41.920
yeah speed matters right and so it's all these things uh you end up dealing with like a speed versus cost trade-off um where if a sandbox is running things are fast

s611
00:36:41.920 --> 00:36:53.760
uh if it's paused, it's cheap because you can have as many of them, you know, you can have lots of them paused and not be paying for them or, you know, if you're CPU limited, you just you can't run that many sandboxes at a time.

s612
00:36:53.760 --> 00:36:59.680
Um, but like for something like cloud, you don't know when the AI is going to come back to reuse that sandbox, right?

s613
00:36:59.680 --> 00:37:01.920
Maybe it's using 20 sandboxes, right?

s614
00:37:01.920 --> 00:37:06.640
And it uses the sandbox and it's going to So, uh, that's where it's Yeah.

s615
00:37:06.640 --> 00:37:10.560
you end up having to do your sandbox.

s616
00:37:11.839 --> 00:37:12.240
Yeah.

s617
00:37:12.240 --> 00:37:12.480
Okay.

s618
00:37:12.480 --> 00:37:18.880
So, if if if you're talking demons where it's like you want something that's persistent and long running, sandbox may not be the best thing to do there.

s619
00:37:18.880 --> 00:37:19.839
Uh you can, right?

s620
00:37:19.839 --> 00:37:23.040
You can definitely have a sandbox that you're like run it for a day, right?

s621
00:37:23.040 --> 00:37:32.000
Uh but there's probably cheaper uh or more kind of traditional methods to do that, but again, we're running all this stuff inside of a sandbox right now inside of multiple sandboxes.

s622
00:37:32.000 --> 00:37:34.240
So, you can definitely run web servers inside of them.

s623
00:37:34.240 --> 00:37:37.280
Um but they're just not gonna be optimized like as far as CDNs and that.

s624
00:37:37.280 --> 00:37:38.480
Yeah.

s625
00:37:38.480 --> 00:37:40.480
Um

s626
00:37:40.560 --> 00:37:43.040
can you use this in your main development?

s627
00:37:43.040 --> 00:37:44.560
Yeah.

s628
00:37:44.560 --> 00:37:50.160
Sandbox you keep adding it other folks get some replic.

s629
00:37:53.920 --> 00:37:54.160
Yeah.

s630
00:37:54.160 --> 00:37:55.920
So how to uh fork things.

s631
00:37:55.920 --> 00:37:56.240
Exactly.

s632
00:37:56.240 --> 00:38:03.839
But that's kind of where a lot of people are using these things is that you can give the AI sandbox say, "Hey, let's install the base dependencies like you would with your GitHub actions."

s633
00:38:03.839 --> 00:38:09.200
So you've got kind of a basic cache thing and then you can pull it in and then build on top of it, right?

s634
00:38:09.200 --> 00:38:12.720
And then that way if you're doing like work trees, right, you've got a single one.

s635
00:38:12.720 --> 00:38:15.280
Each work tree has Yeah.

s636
00:38:15.280 --> 00:38:17.280
Yep.

s637
00:38:17.280 --> 00:38:17.599
Okay.

s638
00:38:17.599 --> 00:38:21.040
So anyway, so for here, uh, go back to our life cycle, right?

s639
00:38:21.040 --> 00:38:25.119
Real quick, what we want to do is basically we want to give it a really long runtime, right?

s640
00:38:25.119 --> 00:38:25.359
All right.

s641
00:38:25.359 --> 00:38:38.240
So, here we're going to give it an hour and then but once it once it finishes the command, we want to spin the uh the uh spin the timeout back down to a minute.

s642
00:38:38.240 --> 00:38:41.359
And so, what we're going to do is we're going to set our command timeout.

s643
00:38:41.359 --> 00:38:44.240
We're going to run a fake task.

s644
00:38:44.240 --> 00:38:47.040
Uh and then we're going to set our uh Whoops.

s645
00:38:47.040 --> 00:38:51.359
Set our lifetime back to something very uh short.

s646
00:38:52.960 --> 00:38:53.280
Okay.

s647
00:38:53.280 --> 00:38:57.280
And then that should give us, hey, we've solved this uh challenge.

s648
00:39:00.480 --> 00:39:01.920
Cool.

s649
00:39:01.920 --> 00:39:02.320
Yay.

s650
00:39:02.320 --> 00:39:04.320
Complete.

s651
00:39:04.960 --> 00:39:05.440
All right.

s652
00:39:05.440 --> 00:39:06.160
Uh not so.

s653
00:39:06.160 --> 00:39:12.160
And then this gets us into uh our next uh lab, which is our background process leaks, right?

s654
00:39:12.160 --> 00:39:19.119
So uh definitely when you're coming back and reusing the same sandbox over and over again, uh you're going to run on uh run into orphans, right?

s655
00:39:19.119 --> 00:39:33.119
So basically you start a process uh and then you go and do something else you come back to your machine if that machine is still running right you you end up accumulating a whole bunch of different processes running over time uh and that can kill performance of the sandbox.

s656
00:39:33.119 --> 00:39:36.079
Uh for some reason with sandboxes we see this a lot.

s657
00:39:36.079 --> 00:39:42.640
Um but it kind of makes sense because like you're pausing your process and coming back to it rather than getting like a new image every single time.

s658
00:39:42.640 --> 00:39:47.599
Uh so it's the advantage of right resuming this old state.

s659
00:39:47.599 --> 00:39:49.280
things are fast, things are where you left them.

s660
00:39:49.280 --> 00:39:53.359
Downside is things are where they left them and you if you haven't cleaned up after yourself.

s661
00:39:53.359 --> 00:39:59.359
So a lot of times what you have to do is you'll have to come in and try to figure out how do I uh kill my orphans.

s662
00:40:01.520 --> 00:40:05.200
Actually I think a lot of sandbox management ends up being killing orphans.

s663
00:40:05.200 --> 00:40:12.400
Uh you end up with uh a lot of the time also is uh related to this is uh when you start up sandboxes you need to keep track of them.

s664
00:40:12.400 --> 00:40:20.400
Uh, and if you lose track of your sandboxes, uh, you need to figure out how do I go find the sandboxes that or or that I'm not managing anymore,

s665
00:40:20.400 --> 00:40:22.560
uh, and make sure that I remove those resources.

s666
00:40:22.560 --> 00:40:29.760
Um, so here is a demo of how to go, uh, find our orphans, right?

s667
00:40:29.760 --> 00:40:39.200
And so, uh, we have our code here, uh, that we can, uh, in this nifty terminal, uh, we can go ahead and, uh, we can run some code to figure out how many orphans we have, right?

s668
00:40:39.200 --> 00:40:39.359
Right.

s669
00:40:39.359 --> 00:40:47.520
So, right here we can see we hop into the sandbox and we've got uh three orphans uh uh that are alive, right?

s670
00:40:47.520 --> 00:40:50.400
So, we've got three children, right?

s671
00:40:50.400 --> 00:40:56.160
And then if we uh search for them, what we can do is uh often your uh processes that you orphaned are going to be the same.

s672
00:40:56.160 --> 00:41:01.839
Uh here uh we're able to grip for them by this nifty uh somehow they're called orphan worker.

s673
00:41:01.839 --> 00:41:05.520
Uh in real world, unfortunately, they're not normally named this.

s674
00:41:05.520 --> 00:41:12.720
Um, but uh for simplicity sake uh here we're going to be able to easily find them by just looking for orphans.

s675
00:41:12.720 --> 00:41:17.680
And so all we need to do now is kill our uh leaked children.

s676
00:41:22.000 --> 00:41:22.480
Okay.

s677
00:41:22.480 --> 00:41:30.240
And actually while I'm doing this uh so how many people here have run into orphan problems on their just regular servers as far as having a bunch of processes running?

s678
00:41:30.240 --> 00:41:30.560
Yep.

s679
00:41:30.560 --> 00:41:30.800
Okay.

s680
00:41:30.800 --> 00:41:32.079
These guys over here.

s681
00:41:32.079 --> 00:41:32.319
Right.

s682
00:41:32.319 --> 00:41:35.920
It's like a very common problem that you're going to run into.

s683
00:41:36.880 --> 00:41:42.960
Um but uh so right, we're going to kill 448.

s684
00:41:42.960 --> 00:41:45.440
Uh then we can run our script again, see how many orphans we have.

s685
00:41:45.440 --> 00:41:47.359
Now we know there's two running.

s686
00:41:47.359 --> 00:41:47.680
All right.

s687
00:41:47.680 --> 00:41:50.079
So we still got our two orphans.

s688
00:41:50.079 --> 00:41:53.440
And we're going to kill 449 and 50.

s689
00:41:53.440 --> 00:41:53.760
All right.

s690
00:41:53.760 --> 00:41:55.280
And now this should notice.

s691
00:41:55.280 --> 00:41:56.079
There we go.

s692
00:41:56.079 --> 00:42:05.119
Once we've uh gotten rid of all our orphan processes, uh the web page should notice uh that they're no longer there and give us the code to get to the next level.

s693
00:42:05.119 --> 00:42:05.920
Cool.

s694
00:42:05.920 --> 00:42:11.359
So, everyone able to clean up their box and uh get this code.

s695
00:42:11.359 --> 00:42:12.240
Cool.

s696
00:42:12.240 --> 00:42:17.599
Anyone having a hard time finding the processes that are running around and uh hasn't been able to get them yet?

s697
00:42:17.599 --> 00:42:19.599
Great.

s698
00:42:21.280 --> 00:42:26.400
So, we will take the slag and drop it into here.

s699
00:42:29.680 --> 00:42:31.280
Okay.

s700
00:42:31.280 --> 00:42:39.280
Uh so uh next thing for sandbox management that we want to uh cover real quick is uh our uh workspaces.

s701
00:42:39.280 --> 00:42:39.520
All right.

s702
00:42:39.520 --> 00:42:46.400
So when you first start dealing with sandboxes uh one of the first things that you do is like hey I've got all these servers I will just hand them out to users.

s703
00:42:46.400 --> 00:42:52.400
Uh here we're kind of coming into we've done this at naive approach to sandbox management that we're just roundroining the sandboxes.

s704
00:42:52.400 --> 00:43:03.839
So rather than uh keeping track of what user gets what sandbox uh we're just you know you come in you get a sandbox and then uh right and so what we want to do here is this is the first uh code exercise

s705
00:43:03.839 --> 00:43:11.040
uh is we're going to want to go look at our Python code that's on uh so we have a little basically uh handler inside of here uh and we're going to want to modify it.

s706
00:43:11.040 --> 00:43:17.119
So instead of giving us a roundroin uh sandbox assignment we're going to keep track by user of what sandbox they get.

s707
00:43:17.119 --> 00:43:22.640
Um, we didn't want to blow up our servers uh with spawning a ton of set boxes that we don't need.

s708
00:43:22.640 --> 00:43:29.119
So, we have a bunch of mocks uh that are going to let us uh test what happens uh with our management.

s709
00:43:29.119 --> 00:43:36.079
And so, if we open up this uh terminal, we can go into our uh router.py or router.js.

s710
00:43:36.079 --> 00:43:40.400
I think most of us know Python, so we're going to go with the Python today.

s711
00:43:40.960 --> 00:43:42.160
All right.

s712
00:43:42.160 --> 00:43:47.680
Um, we have a read me in here as well, but we're running out of time.

s713
00:43:47.680 --> 00:43:52.960
So, um, actually, let's see if I have instructions on this page, too.

s714
00:43:52.960 --> 00:43:53.280
Yeah.

s715
00:43:53.280 --> 00:43:56.800
So, basically, it's right now we've got a a code that runs around Robin.

s716
00:43:56.800 --> 00:43:57.680
We want to change our code.

s717
00:43:57.680 --> 00:44:00.720
So, instead of being around Robin, we're going to assign this to users.

s718
00:44:00.720 --> 00:44:04.160
Uh, the way that you do it normally is you'll have a database keeping track of, hey, here's all my users.

s719
00:44:04.160 --> 00:44:06.880
Here, here's all the active sandboxes for each of the users.

s720
00:44:06.880 --> 00:44:10.079
Uh, keeping this persistent generally is useful.

s721
00:44:10.079 --> 00:44:17.359
Uh so that way you can go back historic over historic data and figure out like were we reassigning too many sandboxes to users or what was going on.

s722
00:44:17.359 --> 00:44:22.880
Um but for here uh we're just going to have this assignment dictionary.

s723
00:44:23.119 --> 00:44:27.200
And so all we're going to need to do is we've got this assign sandbox function down here.

s724
00:44:27.200 --> 00:44:30.880
And so right now it's just assigning it.

s725
00:44:30.880 --> 00:44:33.920
And so what we're going to do is we're just going to quick modify this.

s726
00:44:33.920 --> 00:44:34.160
Right.

s727
00:44:34.160 --> 00:44:37.119
So we've got that nifty assignments.

s728
00:44:37.680 --> 00:44:39.839
Oh, okay.

s729
00:44:39.839 --> 00:44:41.040
15 minutes left.

s730
00:44:41.040 --> 00:44:45.680
So, check if we've already kept track of this guy in our assignments.

s731
00:44:46.720 --> 00:44:50.560
Also, very hard to uh type on a screen that's way down there.

s732
00:44:50.560 --> 00:44:53.390
Uh, and we're going to return assignments of

s733
00:44:53.390 --> 00:44:53.920
[snorts]

s734
00:44:53.920 --> 00:44:56.319
user ID.

s735
00:44:58.000 --> 00:45:01.920
We've already got this function here that's going to get us the sandbox ID from a sandbox.

s736
00:45:01.920 --> 00:45:06.079
So, we'll say sandbox ID equals that thing.

s737
00:45:07.520 --> 00:45:07.839
All right.

s738
00:45:07.839 --> 00:45:09.280
And basically, we're just following this.

s739
00:45:09.280 --> 00:45:11.040
Uh, you should have instructions.

s740
00:45:11.040 --> 00:45:12.160
Oh, we don't have instructions.

s741
00:45:12.160 --> 00:45:13.599
All right.

s742
00:45:13.599 --> 00:45:15.440
So, we're going to cheat.

s743
00:45:15.440 --> 00:45:20.720
So, uh, uh, if anyone is, has anyone already gotten past this level?

s744
00:45:20.720 --> 00:45:20.960
Okay.

s745
00:45:20.960 --> 00:45:22.960
So, a couple of us have already gotten past this level.

s746
00:45:22.960 --> 00:45:26.079
Uh, so it is solvable in the time that we had here.

s747
00:45:26.079 --> 00:45:32.960
Uh, but so all we're going to do is we're going to assign uh, the sandbox ID here and we'll return the sandbox ID.

s748
00:45:34.400 --> 00:45:34.880
Right?

s749
00:45:34.880 --> 00:45:46.960
So what this is going to do is now assignments is going to be our cache of hey this is the ID that each user gets assigned uh and then we'll return that otherwise we'll have to create new sandboxes for everybody uh and return that sandbox ID.

s750
00:45:46.960 --> 00:45:48.079
Okay.

s751
00:45:48.079 --> 00:45:50.160
Uh okay great question.

s752
00:45:50.160 --> 00:45:58.160
All right so basically what we want to do is all we need uh the point of this is just saying we want to keep track of what user had what sandbox.

s753
00:45:58.160 --> 00:46:02.720
So you're creating a map of user to sandbox ID.

s754
00:46:02.720 --> 00:46:04.720
Right?

s755
00:46:05.839 --> 00:46:07.280
That's that's that's the only point.

s756
00:46:07.280 --> 00:46:12.000
Uh so kind of starting with, hey, we're not keeping track of any of our sandboxes.

s757
00:46:12.000 --> 00:46:19.119
So now it's like, hey, each user is going to have a dedicated sandbox so they can rerun code uh in the same sandbox every time.

s758
00:46:19.119 --> 00:46:20.640
Okay.

s759
00:46:20.640 --> 00:46:26.720
And then we should have some tests in here uh that we can run.

s760
00:46:26.720 --> 00:46:32.160
And hopefully uh y'all are better coders than me.

s761
00:46:32.160 --> 00:46:36.400
Uh, line 2. What did I mess up?

s762
00:46:50.560 --> 00:46:53.760
All right, it'll run the test real quick.

s763
00:46:54.000 --> 00:46:56.960
And I'm going to fail my tests.

s764
00:46:58.160 --> 00:47:01.280
It's not false is not true.

s765
00:47:04.400 --> 00:47:07.119
Uh, one second.

s766
00:47:08.960 --> 00:47:10.960
Sorry.

s767
00:47:13.040 --> 00:47:13.920
Oh, good point.

s768
00:47:13.920 --> 00:47:14.319
Exactly.

s769
00:47:14.319 --> 00:47:16.800
See, that was a test of the audience and good job.

s770
00:47:16.800 --> 00:47:19.040
You passed.

s771
00:47:19.920 --> 00:47:23.280
So, right, we need to add it to the assignments.

s772
00:47:32.960 --> 00:47:41.200
And so now that uh we're actually adding our sandbox ID to the assignments, uh we should then um pass.

s773
00:47:41.200 --> 00:47:42.160
Great.

s774
00:47:42.160 --> 00:47:51.920
And now that we passed, we should pick up over here that we have passed or come on.

s775
00:48:02.960 --> 00:48:03.359
All right.

s776
00:48:03.359 --> 00:48:10.640
So, remember how I told you about how we learned about the uh uh we learned about the uh orphans?

s777
00:48:10.640 --> 00:48:12.319
Well, we have quite a few orphans running now.

s778
00:48:12.319 --> 00:48:14.880
Okay, there we go.

s779
00:48:16.480 --> 00:48:21.359
So, took a minute, but this let's just get to the next lag.

s780
00:48:21.359 --> 00:48:22.960
Uh, right.

s781
00:48:22.960 --> 00:48:23.280
Cool.

s782
00:48:23.280 --> 00:48:26.079
Everyone able to get that?

s783
00:48:26.480 --> 00:48:28.480
Cool.

s784
00:48:30.480 --> 00:48:33.359
And we'll post that here.

s785
00:48:35.839 --> 00:48:36.559
All right.

s786
00:48:36.559 --> 00:48:38.000
Uh, file system permissions.

s787
00:48:38.000 --> 00:48:38.319
All right.

s788
00:48:38.319 --> 00:48:46.319
So, uh I I think both cloud code and codeex have this is that a lot of times you don't want your agents writing to every single part of your file system.

s789
00:48:46.319 --> 00:48:50.720
You're going to have different parts of your file system uh that you want people writing to and reading to.

s790
00:48:50.720 --> 00:48:57.119
Um normally this will go into your agents.mmd saying, "Hey, this is what I want you to write to, what I uh want you to read to."

s791
00:48:57.119 --> 00:49:01.760
Uh for these purposes, we're just going to hardcode this.

s792
00:49:02.079 --> 00:49:08.720
But same thing uh right so you're going to have uh often you want to have read uh write parts of your file system.

s793
00:49:08.720 --> 00:49:21.599
So here let's take a look uh so uh we've got a cache config and so uh v cache.

s794
00:49:25.280 --> 00:49:27.200
All right and then we can do the same thing.

s795
00:49:27.200 --> 00:49:30.640
So here uh basically we've got a template cache and a runtime cache.

s796
00:49:30.640 --> 00:49:37.680
Uh so this is where when we build our templates, we're going to have a cache that we're putting our template uh information to that might be uh readon.

s797
00:49:37.680 --> 00:49:40.160
We've got a different cache that we want to uh write to.

s798
00:49:40.160 --> 00:49:48.400
So all we're going to do is for our crasher, we're going to have uh refer to this uh cashier which we're going to spell correctly.

s799
00:49:50.480 --> 00:49:53.839
And uh there we go.

s800
00:49:54.000 --> 00:49:54.960
Cool.

s801
00:49:54.960 --> 00:50:01.839
So, that was a very fast one where all we're doing is making sure that we're uh writing to our uh runtime cache.

s802
00:50:02.000 --> 00:50:03.040
All right.

s803
00:50:03.040 --> 00:50:06.559
Uh at this point, let's see.

s804
00:50:06.559 --> 00:50:09.040
I think you all can do the rest of this on your own.

s805
00:50:09.040 --> 00:50:13.200
We've got about 10 minutes left uh to talk about sandboxes.

s806
00:50:13.200 --> 00:50:16.559
Um so, yeah.

s807
00:50:16.559 --> 00:50:24.000
Uh hopefully that was a good introduction to hear uh issues that you're going to run into with your sandboxes as far as managing uh what's able to do what, what's able to read to what.

s808
00:50:24.000 --> 00:50:28.079
Uh, we've got about eight more levels.

s809
00:50:28.079 --> 00:50:30.240
Um, actually, I'll leave this to you guys.

s810
00:50:30.240 --> 00:50:36.160
Do you think it'd be helpful to continue walking through all these or more fun to just talk about sandboxes?

s811
00:50:36.240 --> 00:50:37.920
All right, let's talk about sandboxes.

s812
00:50:37.920 --> 00:50:38.400
Great.

s813
00:50:38.400 --> 00:50:41.200
Um, let's see.

s814
00:50:41.200 --> 00:50:44.800
Uh, so who here who here is currently running sandboxes in production?

s815
00:50:44.800 --> 00:50:45.280
Oh, wow.

s816
00:50:45.280 --> 00:50:46.640
Those guys back there are running sandboxes.

s817
00:50:46.640 --> 00:50:48.000
Anyone else here running sandboxes?

s818
00:50:48.000 --> 00:50:49.119
Those guys over there.

s819
00:50:49.119 --> 00:50:51.440
Uh, what are you guys doing with sandboxes?

s820
00:50:51.440 --> 00:50:53.520
agent works.

s821
00:50:53.520 --> 00:50:54.880
Agent workloads.

s822
00:50:54.880 --> 00:50:55.119
Cool.

s823
00:50:55.119 --> 00:50:57.760
Do you need to be

s824
00:50:58.079 --> 00:50:58.640
Oh, okay.

s825
00:50:58.640 --> 00:51:00.160
You know, no one's perfect.

s826
00:51:00.160 --> 00:51:00.800
Not yet.

s827
00:51:00.800 --> 00:51:01.280
Okay.

s828
00:51:01.280 --> 00:51:02.880
Uh we've Travis is over there.

s829
00:51:02.880 --> 00:51:05.119
You should go talk to him.

s830
00:51:05.119 --> 00:51:08.480
Uh and then what do you do?

s831
00:51:10.559 --> 00:51:11.119
Okay, cool.

s832
00:51:11.119 --> 00:51:11.520
Woohoo.

s833
00:51:11.520 --> 00:51:12.640
He a great.

s834
00:51:12.640 --> 00:51:14.079
Um yeah.

s835
00:51:14.079 --> 00:51:14.720
Yeah.

s836
00:51:14.720 --> 00:51:19.680
So, any of the uh issues that we just covered, have you run into any of those?

s837
00:51:19.680 --> 00:51:20.800
Uh not yet.

s838
00:51:20.800 --> 00:51:22.319
Oh, okay.

s839
00:51:22.319 --> 00:51:23.040
Gotcha.

s840
00:51:23.040 --> 00:51:23.200
Yeah.

s841
00:51:23.200 --> 00:51:23.359
Yeah.

s842
00:51:23.359 --> 00:51:27.520
And so we are uh part of what we do is we try to make it so you don't run into issues.

s843
00:51:27.520 --> 00:51:32.640
Um but your user you're always going to run into something where it's uh something is happening on the sandbox.

s844
00:51:32.640 --> 00:51:36.000
You need to hop in debug it and figure out why is this thing breaking.

s845
00:51:36.000 --> 00:51:36.880
Um great.

s846
00:51:36.880 --> 00:51:38.880
And then we had some guys doing sandboxes over here.

s847
00:51:38.880 --> 00:51:39.280
Yeah.

s848
00:51:39.280 --> 00:51:41.839
So I have a slightly different use case.

s849
00:51:41.839 --> 00:51:43.839
Yeah.

s850
00:51:48.960 --> 00:51:49.280
Okay.

s851
00:51:49.280 --> 00:51:50.000
So sorry.

s852
00:51:50.000 --> 00:51:51.359
Uh just so everyone else can hear.

s853
00:51:51.359 --> 00:51:54.000
So you've got your vanilla production on your on your laptop.

s854
00:51:54.000 --> 00:51:54.319
Okay.

s855
00:51:54.319 --> 00:52:02.480
Then I want to spread it across on several GPUs which are like small what you call small GPUs.

s856
00:52:02.480 --> 00:52:03.119
Okay.

s857
00:52:03.119 --> 00:52:04.400
Collect the data back.

s858
00:52:04.400 --> 00:52:05.280
Okay.

s859
00:52:05.280 --> 00:52:09.440
Processes over here and they are across what you call networks different providers.

s860
00:52:09.440 --> 00:52:10.559
Yep.

s861
00:52:10.559 --> 00:52:20.400
So basically you're saying you you've got your code local local you want to put it onto a bunch of distributed GPUs process the uh the workload and then send it all back to to local okay

s862
00:52:20.400 --> 00:52:22.160
I want back

s863
00:52:22.160 --> 00:52:25.520
yeah so you want the data back yep

s864
00:52:25.520 --> 00:52:35.200
yeah so right now we don't support GPUs but that's of course a common use case that you can you know when you're spinning up these contain uh whatever they are so for us we use VMs a lot of people also use containers

s865
00:52:35.200 --> 00:52:44.480
uh common use case is you'll be like hey uh take the output of whatever's running into and send a post request home with the data that I want it to uh to have.

s866
00:52:44.480 --> 00:52:53.440
Uh that's like all these depending on how how big the workload are, uh you're going to have different bottlenecks and challenges.

s867
00:52:53.440 --> 00:53:03.680
Um where we've had, you know, it's one of the weirdest things about sandboxes, right, is that uh when you're just running a couple, you've got certain problems that are like, hey, why is this behavior,

s868
00:53:03.680 --> 00:53:05.599
you know, why is one or two sandboxes breaking?

s869
00:53:05.599 --> 00:53:14.640
Once you're dealing with a lot of sandboxes, uh then your problems become how do I manage all, you know, just just the logging overhead of how do I keep track of these?

s870
00:53:14.640 --> 00:53:19.839
How do I make sure that I'm assigning all these um uh keep track of the network for the machines that it's running on, right?

s871
00:53:19.839 --> 00:53:23.040
So each machine can only be talking to so many sandboxes at a time.

s872
00:53:23.040 --> 00:53:27.599
But uh yeah, definitely if you're running on GPUs, EDB doesn't do GPUs.

s873
00:53:27.599 --> 00:53:39.280
Um and I guess so yeah that's where the sandbox solution might not be although why would you need sandboxes for that as opposed to just having the GPU

s874
00:53:39.280 --> 00:53:43.839
because I can get it at any place at whatever cost.

s875
00:53:43.920 --> 00:53:45.920
Gotcha.

s876
00:53:47.359 --> 00:53:54.240
I want it.

s877
00:53:54.319 --> 00:53:54.880
Makes sense.

s878
00:53:54.880 --> 00:53:55.200
Yeah.

s879
00:53:55.200 --> 00:53:56.640
And that's that's a common use case.

s880
00:53:56.640 --> 00:54:00.720
Uh, I just don't know enough about that, I guess, to give a good answer.

s881
00:54:00.720 --> 00:54:01.040
Cool.

s882
00:54:01.040 --> 00:54:03.680
Uh, and then we had someone else over here using sandboxes.

s883
00:54:03.680 --> 00:54:05.680
Okay.

s884
00:54:08.000 --> 00:54:10.319
Something Kubernetes.

s885
00:54:11.520 --> 00:54:14.000
Cloud and Kubernetes.

s886
00:54:24.880 --> 00:54:25.599
Yes.

s887
00:54:25.599 --> 00:54:26.160
So, okay.

s888
00:54:26.160 --> 00:54:33.440
So one of his questions is how do you deal with the storage over time right so how do you prune uh the resources that you you develop so one of the problems with sandboxes

s889
00:54:33.440 --> 00:54:42.960
is uh you can create lots of them but then it's where do you store them uh that's an active challenge that we're currently working on if you if that interests you we are hiring

s890
00:54:42.960 --> 00:54:53.680
um uh and again uh if if you do go uh we're uh hiring go engineers so our backends go uh a lot of really fun challenges there how do we uh optimize speed

s891
00:54:53.680 --> 00:55:00.720
uh performance and then especially on storage uh how do you deal with the compression uh and uh uh that sort of challenge.

s892
00:55:00.720 --> 00:55:00.960
uh

s893
00:55:00.960 --> 00:55:01.920
volumes

s894
00:55:01.920 --> 00:55:03.839
that sorry

s895
00:55:03.839 --> 00:55:15.680
volumes right oh yes we also have volumes um and so that's where if you have shared resources that multiple things can share uh volumes are great for that um but yeah it's I think all this is very early and nobody knows where it's going to go

s896
00:55:15.680 --> 00:55:29.359
uh so as the smart pe you smart people in this room are going to come up with better solutions uh that optimize things uh don't know if that's a good answer uh but yeah so for your question on cloud right so it's you can run cloud in sandboxes pretty easy

s897
00:55:29.359 --> 00:55:32.640
Um uh where where'd we go?

s898
00:55:32.640 --> 00:55:33.520
So it need to be right.

s899
00:55:33.520 --> 00:55:42.640
So the same way that we uh spun up these guys, we can just be like template equals I think claude should spin us up a cloud code.

s900
00:55:42.800 --> 00:55:44.240
I'm guessing at what things do.

s901
00:55:44.240 --> 00:55:44.480
Okay.

s902
00:55:44.480 --> 00:55:47.520
Yeah, I think we have claude on here, right?

s903
00:55:47.520 --> 00:55:49.520
So yeah, you can run cloud in a sandbox.

s904
00:55:49.520 --> 00:55:51.760
Um right, you can run open code, right?

s905
00:55:51.760 --> 00:55:53.440
Uh codec in a sandbox.

s906
00:55:53.440 --> 00:55:59.760
Uh basically these give us places where you can have agents run remotely or locally you can have the agent talk to it.

s907
00:55:59.760 --> 00:56:02.240
Um and uh you get the same thing.

s908
00:56:02.240 --> 00:56:14.559
But yeah as far as cube uh so we are firecracker uh based um and so we're trying there's some technical issues uh with cube uh that we have that we haven't quite solved.

s909
00:56:14.559 --> 00:56:20.480
Uh so right now we're uh running Nomad uh but working on getting uh into cube.

s910
00:56:20.480 --> 00:56:21.920
Yeah.

s911
00:56:21.920 --> 00:56:23.359
Cool.

s912
00:56:23.359 --> 00:56:25.680
across sandboxes.

s913
00:56:30.480 --> 00:56:31.040
Yes.

s914
00:56:31.040 --> 00:56:31.280
Yeah.

s915
00:56:31.280 --> 00:56:31.440
Yeah.

s916
00:56:31.440 --> 00:56:32.480
So that's definitely common.

s917
00:56:32.480 --> 00:56:33.680
Uh definitely doable.

s918
00:56:33.680 --> 00:56:35.760
Uh we didn't do that for this exercise.

s919
00:56:35.760 --> 00:56:40.319
Uh so what we kind of did for this where you were the coordinator, right?

s920
00:56:40.319 --> 00:56:48.000
So basically the sandbox uh you clicked on a thing and said, "Hey, start a new sandbox uh from this template."

s921
00:56:48.000 --> 00:56:53.119
uh that wasn't automated in this case because I didn't want to deal with uh making everyone grab their API keys.

s922
00:56:53.119 --> 00:57:00.319
Uh I also didn't trust myself to this is being recorded uh and to not expose my own API keys by putting them up on the screen.

s923
00:57:00.319 --> 00:57:00.720
Yeah.

s924
00:57:00.720 --> 00:57:06.640
Um but yeah, definitely that's kind of cool that you can get that inception that you have a sandbox and then it spawns more things.

s925
00:57:06.640 --> 00:57:07.280
Cool.

s926
00:57:07.280 --> 00:57:09.520
Uh we got time for two more.

s927
00:57:09.520 --> 00:57:10.240
Yeah.

s928
00:57:10.240 --> 00:57:22.400
So what's the ecosystem of these sandboxes like after the all of these do you see that like a docker ecosystem of sandboxes are everywhere.

s929
00:57:22.400 --> 00:57:22.640
Yeah.

s930
00:57:22.640 --> 00:57:25.359
So the question is what's the ecosystem of sandboxes?

s931
00:57:25.359 --> 00:57:26.880
Uh is it going to be like docker?

s932
00:57:26.880 --> 00:57:35.760
Uh and I mean all this is early right so like these AI agents are what like two years old LLM as a service 5 years old.

s933
00:57:35.760 --> 00:57:43.599
Um nobody knows what the ecosystem is going to look like but definitely as people build cool things uh we tend to standardize around them share how to do it.

s934
00:57:43.599 --> 00:57:55.680
Uh and then that leads to uh yeah so and that's where our templates come in right where again you know here I had a template and 200 of you guys were able to then reuse that same sandbox

s935
00:57:55.680 --> 00:58:03.680
uh without too much of a uh yeah so we're going that direction but time will tell yes

s936
00:58:09.359 --> 00:58:17.040
we actually okay so internally a to b uh we're running I Yes, we run locally especially for testing, right?

s937
00:58:17.040 --> 00:58:19.920
Um because uh running in the cloud is just a pain.

s938
00:58:19.920 --> 00:58:27.520
But as far as like uh and so yeah, actually we're doing a lot of local uh uh development.

s939
00:58:33.280 --> 00:58:33.599
Yeah.

s940
00:58:33.599 --> 00:58:38.400
So I mean that's where so our sandboxes have different rules that you can set for the uh network.

s941
00:58:38.400 --> 00:58:45.359
Uh that's where if you give it access to secrets, you defin want to uh prevent what it's going to be able to send out.

s942
00:58:45.359 --> 00:58:48.720
Uh if it doesn't have secrets or just got dev keys maybe.

s943
00:58:48.720 --> 00:58:50.079
And so that's right.

s944
00:58:50.079 --> 00:58:53.119
It's the ease versus uh security.

s945
00:58:53.119 --> 00:58:54.799
Cool.

s946
00:58:54.799 --> 00:58:56.079
Anybody else?

s947
00:58:56.079 --> 00:58:57.760
Going once, going twice.

s948
00:58:57.760 --> 00:58:59.200
Anyway, hope you all had fun.

s949
00:58:59.200 --> 00:59:03.119
Uh the you can go ahead and complete this uh these challenges on your own.

s950
00:59:03.119 --> 00:59:09.440
Uh thanks for coming and again I'm Matt with E2B and uh it was a pleasure meeting you all.

s951
00:59:10.140 --> 00:59:12.140
[applause]

s952
00:59:30.446 --> 00:59:32.446
[music]
