-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdeno_deploy.deno.txt
319 lines (257 loc) · 15.6 KB
/
deno_deploy.deno.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
┏━━━━━━━━━━━━━━━━━┓
┃ DENO_DEPLOY ┃
┗━━━━━━━━━━━━━━━━━┛
VERSION ==> #2024-07-07
┌────────────────────┐
│ INFRASTRUCTURE │
└────────────────────┘
PRICING ==> #0$ for free, 20$ for pro
#Can set spending limits|notifications in UI
SUPPORT ==> #Pro-only
INFRASTRUCTURE ==> #Runs on AWS Lambda or GCP
#Memory 512MB
ENVVAR DENO_REGION #AWS region. There are 12 of them. Readonly
REQUESTS COUNT ==> #Max 1e6/month and 1e3/min (free), 5e6/month then 1$/5e5
DURATION ==> #Max 50ms per request
EGRESS ==> #100GB/month (free), 200GB/month then 1$/2GB (pro)
SUBHOSTING ==> #White-labelling solution for companies
#Not documented yet
┌─────────┐
│ API │
└─────────┘
DEPLOY API ==> #Not documented yet
#Does CRUD on PROJECT|deployment, and stream logs
ENVVAR DEPLOY_API_ENDPOINT #API ENDPOINT (def: 'https://dash.deno.com')
Bearer: ACCESS_TOKEN [C] #Generated from the UI
dash.deno.com #Web UI
deployctl api API_PATH #Call API endpoint
--method=HTTP_METHOD #Def: 'GET'
--body=JSON #
--format=overview|body #Output format:
# - 'overview' (def if TTY): headers + maybe truncated body
# - 'body' (def otherwise): full response body
┌─────────┐
│ CLI │
└─────────┘
deployctl WRNUE#CLI for the Deploy API
#Version 1.13.1
ENVVAR DENO_DEPLOY_TOKEN
--token=ACCESS_TOKEN #Def: auto OAuth flow
deployctl upgrade [X.Y.Z] #Upgrade deployctl
#Def X.Y.Z: latest
deployctl deploy|projects
|deployments|logs|top
--config=CONFIG_PATH #Def: ./deno.json
CONFIG.deploy #DCONFIG
--color=auto|always|never #Def: 'auto'
deployctl
projects|deployments delete
--force #Bypass any confirmation prompt
┌──────────────┐
│ REQUESTS │
└──────────────┘
Deno.serve() #Must be used to handle REQs
#Cannot use Deno.listenTls()
TOP-LEVEL SCOPE ==> #Is run on start, like AWS Lambda
#Frozen between requests, i.e. can be used to keep state
BroadcastChannel #Sends message to all clients
#Max 64KB/s egress per REGION
Deno.Kv #Backed by a database instead of local SQLite
#Price:
# - Storage: max 1GB (free), 5GB then 1$/1.3GB (pro) per user
# - Igress: max 3e5 (free), 9e5 then 1$/4e5 (pro) writes in 1KB chunks
# - multiplied by number of REGIONs|replicas
# - Egress: max 4.5e5 (free), 1.3e6 then 1$/1e6 (pro) reads in 4KB chunks
#Works with KV queues
# - max 1e5 pending KVVALs
#Can specify multiple REGIONs for reads, replicated (pro)
#Should prefer OPTS.consistency 'eventual', as it is much faster
#Locally, can use Deno.openKv('https://api.deno.com/databases/DATABASE_ID/connect')
# - must set ENVVAR DENO_KV_ACCESS_TOKEN
#Can also self-host using `denokv` binary
# - Not documented yet
#Can automatically backup to S3 or GCP
# - done in the UI
# - must first create a ROLE and ACCESS_KEY in S3 or GCP
# - continuous backup with PITR
# - including self-hosted, can have replica
deployctl --db=STR #Which KV database to use
#Can be 'prod', 'preview' or UUID
#Def: 'prod' if --prod, 'preview' otherwise
Deno.cron(...) #Automatically registered on deploy (not on request)
# - done by running top-level scope on deploy
#Then automatically run on cron schedule
#Should not await PROMISE
#Can see cron tasks in UI
RESPONSE COMPRESSION ==> #Automatic providing all of:
# - Content-Type [S] is compressible (using mime-db)
# - Accept-Encoding [C]
# - size > 20 bytes
# - no Content-Encoding [S]
# - no Content-Range [S]
# - no Cache-Control: no-transform [S]
#Either Brotli (preferred) or gzip
caches #Web cache API is available
#Kept at least 30 days, but can customize with Cache-Control [C] and Expires [C]
#Except: cannot delete
NOT SUPPORTED ==> #Any --unstable
#Important:
# - localStorage|sessionStorage
# - Deno.ChildProcess|Command|Process, Worker, node:child_process, node:worker_threads
# - node:vm
#Less important:
# - location
# - Deno.open|readFile() OPTS
# - FILE.write|seek()
# - FILE_INFO: only has size and isDirectory|isFile|isSymlink
# - ABORT_SIGNAL with file operations
# - onload|beforeunload|onunload
# - Deno.version|osRelease
# - Deno.[un]refTimer
#Not relevant when single file:
# - Deno.mainModule
#Not relevant when not run locally:
# - Deno.consoleSize
# - alert|confirm|prompt
# - Deno.hostname|networkInterfaces
# - Deno.osUptime|Deno.loadavg
# - Deno.uid|gid, Deno.std*
# - Deno.memoryUsage|systemMemoryInfo
# - Unix sockets
┌──────────────┐
│ PROJECTS │
└──────────────┘
PROJECT ==> #Similar to a repository
#Max 20 (free), 50 (pro)
deployctl deploy|projects
|deployments|logs|top
DCONFIG.project
--project|-p=PROJECT_NAME|ID #Def: guessed based on DIR or git repo, or automatically created
deployctl projects
create|show|delete [PROJECT_NAME]
deployctl projects list
deployctl projects rename #CRUD for projects
[PROJECT_NAME] NEW_PROJECT_NAME #Def PROJECT_NAME: guessed
┌──────────────────┐
│ ORGANIZATION │
└──────────────────┘
ORGANIZATION ==> #Group of members
#Max 5 (free), 10 then 20$/month per member (pro)
deployctl deploy|projects
--org=ORG #Def: 'personal' (i.e. current)
┌────────────────┐
│ DEPLOYMENT │
└────────────────┘
DEPLOYMENT ==> #Sets of assets.
#Associated with a URL which runs the main file.
#Max 30/h
ENVVAR DENO_DEPLOYMENT_ID #'DEPLOYMENT_ID'
PRODUCTION ==> #One deployment of a given PROJECT is production. Others are "preview"
ASSETS ==> #Files which can be read|written by:
# - imports
# - file operations
#Uploaded at each deployment
# - assets checksums are computed, i.e. never uploaded twice unless changed
#Cwd is root
#Max 1000 JavaScript|TypeScript files per deployment, with max 1GB
PROJECT_ID.deno.dev #Production URL
#Can use custom domain
# - max 50 (free), 100 (pro)
# - including wildcards (pro)
PROJECT_ID--DEPLOYMENT_ID.deno.dev#Preview URL
PROJECT_ID--BRANCH.deno.dev #Git branch URL
deployctl deployments
show|delete [DEPLOYMENT_ID] #CRUD for deployments
deployctl deployments list #Def DEPLOYMENT_ID: --id
deployctl deployments
show|delete|redeploy
--id DEPLOYMENT_ID #
--prev|next[=NUM] #Select DEPLOYMENT_ID NUM times before|after the one targetted by --id|--project
#Def NUM: 1
deployctl deployments list
--page=NUM
--limit=NUM #Pagination
deployctl deployments
--format=STR #Output format: 'overview' (def if TTY), 'json' (def otherwise)
┌────────────┐
│ DEPLOY │
└────────────┘
deployctl deploy [UPATH] #Deploy. UPATH is --entrypoint
DCONFIG.entrypoint
--entrypoint=UPATH #Main file
#Def: guessed
--save-config #Save UPATH into CONFIG_PATH
DCONFIG.include|exclude
--include=GLOB,... #From assets
#Def --include: ./**
--exclude=GLOB,... #From assets
#Always excluded: .git, node_modules
--import-map=IMPORT_MAP #
--dry-run #
deployctl deployments
redeploy [DEPLOYMENT_ID] #Create a new deploy, but re-using the build of a previous deploy and only changing config
deployctl [re]deploy
--prod #Make it production deployment
#Def: true for first deploy, false otherwise
--env=ENVVAR=VAL #Set ENVVAR
#Max 8KB
--env-file[=PATH] #Same as file (def: '.env')
PROJECT ENVIRONMENT VARIABLES ==> #Done in UI
ROLLBACK ==> #Can rollback to a previous deployment, in UI
┌──────────┐
│ LOGS │
└──────────┘
LOGS ==> #stdout|stderr for a given run
#Persisted for last 1d (free), 7d (pro)
#Max 2KB per line
deployctl logs [PROJECT_ID] #Print logs, in streaming mode
#Logs can also be seen in UI
--deployment=DEPLOYMENT_ID #Def: latest deployment
--prod #Use product deployment
--limit=NUM #Def: 100
--levels=LOG_LEVEL,... #Among LOG_LEVEL 'error', 'info', 'debug'. Def: all
--grep=STR #
--since|until=DATE #
--regions=REGION,... #Def: all
┌───────────────┐
│ ANALYTICS │
└───────────────┘
ANALYTICS ==> #Among:
# - request count
# - CPU
# - memory
# - igress|egress
# - KV|queue reads|writes
#Last 1m (free), 3m (pro)
deployctl top #Print analytics in realtime
--format=STR #Output format. 'table' (def if TTY) or 'json' (def otherwise)
--region=REGION #
┌───────────────────┐
│ GITHUB ACTION │
└───────────────────┘
denoland/deployctl #GitHub action running same logic as deployctl deploy
#Requires JOB.permissions.id-token 'write', contents 'read'
#Version: same as deployctl
INPUTS.root #'DIR' (def: '.')
INPUTS.project
INPUTS.entrypoint
INPUTS.include|exclude
INPUTS.import-map #Like --*
OUTPUTS.deployment-id #DEPLOYMENT_ID
OUTPUTS.url #'URL'
┌────────┐
│ CI │
└────────┘
GITHUB APP ==> #Must be installed to use GitHub features
CI INTEGRATION ==> #Deploy on GitHub push
#Main branch is production, others are previews
#Uploads all files as assets
# - no build step
#No IMPORT_MAP
┌────────────────┐
│ PLAYGROUND │
└────────────────┘
PLAYGROUND ==> #Deploy and edit a single file through a web editor
#Can convert to GitHub repo
#Can be made public|private
#Can format on save