-
Notifications
You must be signed in to change notification settings - Fork 77
feat: websocket server proxying to provider websocket #1802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b8421bd
cdd9697
9d8d983
258c24d
6ba503a
7b498fb
fdb6e92
d8adb1e
2aa5b2f
6304b18
f0c39f6
8dae75d
a44a793
9cd0052
c873688
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type { Span } from "@opentelemetry/api"; | ||
| import { context } from "@opentelemetry/api"; | ||
| import { trace } from "@opentelemetry/api"; | ||
|
|
||
| export function traceActiveSpan<T extends (span: Span) => any>(name: string, callback: T): ReturnType<T> { | ||
| return trace.getTracer("default").startActiveSpan(name, callback); | ||
| } | ||
|
|
||
| export function propagateTracingContext<T extends (...args: any[]) => any>(callback: T): T { | ||
| const currentContext = context.active(); | ||
| return ((...args) => context.with(currentContext, () => callback(...args))) as T; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -101,11 +101,7 @@ export const DepositDeploymentResponseSchema = z.object({ | |||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| export const UpdateDeploymentRequestSchema = z.object({ | ||||||||||||||||||||||||||||||||||||||||||||||
| data: z.object({ | ||||||||||||||||||||||||||||||||||||||||||||||
| sdl: z.string(), | ||||||||||||||||||||||||||||||||||||||||||||||
| certificate: z.object({ | ||||||||||||||||||||||||||||||||||||||||||||||
| certPem: z.string(), | ||||||||||||||||||||||||||||||||||||||||||||||
| keyPem: z.string() | ||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||
| sdl: z.string() | ||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
102
to
106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Tighten SDL validation (min length, sensible size cap, OpenAPI metadata) The update payload now only carries SDL, which is good. Add basic constraints and docs to prevent empty/oversized bodies and improve API docs. export const UpdateDeploymentRequestSchema = z.object({
data: z.object({
- sdl: z.string()
+ sdl: z
+ .string()
+ .min(1, "SDL is required")
+ .max(1_000_000, "SDL too large (max 1MB)")
+ .openapi({
+ description: "Akash SDL manifest (YAML)",
+ example: "services:\n web:\n image: nginx\n expose:\n - port: 80"
+ })
})
});If 1MB is too restrictive/lenient for your providers, adjust accordingly. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid any in TS and auto-end spans to prevent leaks; preserve this binding when propagating context
Note: If callers currently call span.end() manually, double end is a no-op in OTel SDKs; still, consider removing redundant ends where feasible.
🤖 Prompt for AI Agents