Skip to content
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

Improvements v2 #278

Merged
merged 3 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions packages/gcp-functions/src/executors/deploy/deploy.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function deployExecutor(
concurrency = 1,
cloudSqlInstance = null,
timeout = null,
cpu
cpu = 1
} = options

let runtime = options.runtime || 'nodejs20'
Expand All @@ -82,10 +82,18 @@ export async function deployExecutor(
} = options

let correctMemory = memory as string

// Use the correct memory for the right gen
if (gen === 2 && memory.endsWith('MB')) {
correctMemory = memory.replace('MB', 'Mi')
let correctCPU = cpu as number

if (gen === 2) {
// Use the correct memory for the right gen
if (memory.endsWith('MB')) {
correctMemory = memory.replace('MB', 'Mi')
}

if (concurrency > 1 && correctCPU < 1) {
logger.warn('Setting "cpu" to "1" because concurrency is higher the 1')
correctCPU = 1
}
}

if (triggerValue && trigger === 'http') {
Expand All @@ -112,6 +120,8 @@ export async function deployExecutor(
`--runtime=${runtime}`,
`--memory=${correctMemory}`,
`--region=${region}`,
concurrency > 0 && `--concurrency=${concurrency}`,
correctCPU && `--cpu=${correctCPU}`,

entryPoint && `--entry-point=${entryPoint}`,
envVarsFile && `--env-vars-file=${envVarsFile}`,
Expand Down Expand Up @@ -142,7 +152,7 @@ export async function deployExecutor(
if (
success &&
gen === 2 &&
(concurrency > 0 || validSecrets.length > 0 || cloudSqlInstance)
cloudSqlInstance
) {
logger.info('Updating service with more configurations')

Expand All @@ -151,8 +161,6 @@ export async function deployExecutor(
'gcloud run services update',
functionName,

concurrency > 0 && `--concurrency=${concurrency}`,
cpu && `--cpu=${cpu}`,
cloudSqlInstance && `--add-cloudsql-instances=${cloudSqlInstance}`,

`--region=${region}`,
Expand Down
3 changes: 2 additions & 1 deletion packages/pulumi/src/executors/config/config.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface PreviewOptions {
stack?: string
root?: string
parent?: string

showSecrets?: boolean
action: string
secret?: boolean
path?: boolean
Expand All @@ -30,6 +30,7 @@ export default async function configExecutor(
'PULUMI_EXPERIMENTAL=true',
'pulumi config',
options.action,
options.showSecrets && `--show-secrets`,
options.secret && `--secret`,
options.path && `--path`,
options.name && options.value && `"${options.name}" "${options.value}"`,
Expand Down
4 changes: 1 addition & 3 deletions packages/translations/src/executors/extract/extract.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ export async function extractExecutor(
`--out-file='${templatedOutputDirectory}/${defaultLanguage}.json'`,
'--id-interpolation-pattern=\'[sha512:contenthash:base64:6]\'',
'--format=simple'
]), {
silent: !options.debug && !USE_VERBOSE_LOGGING
})
]))

logger.info('Translations extracted')

Expand Down
Loading