-
Notifications
You must be signed in to change notification settings - Fork 165
Add output bundle spec to common module #244
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
Changes from 7 commits
b77d82a
1eeba44
a48b66f
4ed5abd
9408d8f
fb46067
006ca24
fe13e1b
71797db
9c9929b
91766c5
1fb06f7
f947fbb
0a98b37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,63 @@ | ||
import { spawn } from "child_process"; | ||
|
||
// Output bundle metadata specifications to be written to bundle.yaml | ||
export interface OutputBundleConfigs { | ||
version: "v1"; | ||
serverConfig: ServerConfig; | ||
metadata: Metadata; | ||
} | ||
|
||
// Fields needed to configure the App Hosting server | ||
interface ServerConfig { | ||
// Command to start the server (e.g. ["node", "dist/index.js"]). Assume this command is run from the root dir of the workspace | ||
runCommand: string[]; | ||
tonyjhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Environment variables set when the app is run | ||
environmentVariables?: EnvVarConfig[]; | ||
// The maximum number of concurrent requests that each server instance can receive. | ||
// Defaults to 80. | ||
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. Do we want to drop these defaults now that we know GCP can adjust default values per user? 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. The defaults are set the same way the apphosting.yaml defaults are set. The comments are more just a fyi. Do they no longer apply? If not we should probably change the public docs too to reflect that https://firebase.google.com/docs/app-hosting/configure#configure-backend 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. What if we link to the product docs instead so we have a single source of truth? 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. Removed the defaults in favor of linking the docs. |
||
concurrency?: number; | ||
// The number of CPUs used in a single server instance. | ||
tonyjhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Defaults to 1. | ||
cpu?: "fractional" | 1 | 2 | 4 | 6 | 8; | ||
// The amount of memory available for a server instance. | ||
// Commonly one of: "256" | "512" | "1024" | "2048" | "4096" | "8192" | "16384" | ||
// Defaults to 512MiB. | ||
memoryMiB?: string; | ||
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. why string? 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. Good catch, we probably want number here too |
||
// The limit on the minimum number of function instances that may coexist at a given time. | ||
// Defaults to 0. | ||
minInstances?: number; | ||
// The limit on the maximum number of function instances that may coexist at a given time. | ||
// Defaults to 100. | ||
maxInstances?: number; | ||
} | ||
|
||
// Additonal fields needed for identifying the framework and adapter being used | ||
interface Metadata { | ||
// Name of the adapter (this should be the official package name) e.g. "@apphosting/adapter-nextjs" | ||
adapterPackageName: string; | ||
// Version of the adapter, e.g. "18.0.1" | ||
adapterVersion?: string; | ||
tonyjhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Name of the framework that is being supported, e.g. "angular" | ||
framework: string; | ||
// Version of the framework that is being supported, e.g. "18.0.1" | ||
frameworkVersion?: string; | ||
sjjj986 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// Represents a single environment variable. | ||
interface EnvVarConfig { | ||
// Name of the variable | ||
variable: string; | ||
// Value associated with the variable | ||
value: string; | ||
// Where the variable will be available, for now only RUNTIME is supported | ||
availability: Availabilities.Runtime[]; | ||
} | ||
|
||
// Represents where environment variables are available from | ||
tonyjhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
enum Availabilities { | ||
tonyjhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Runtime, | ||
tonyjhuang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// Options to configure the build of a framework application | ||
export interface BuildOptions { | ||
// command to run build script (e.g. "npm", "nx", etc.) | ||
|
Uh oh!
There was an error while loading. Please reload this page.