-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
feat(runtime): add feature support runing in docker env #1930
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
HUAHUAI23 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
1 similar comment
HUAHUAI23 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
💥 laf nodejs runtime init image built successfully for pr 1930
digest: |
💥 laf nodejs runtime image built successfully for pr 1930
digest: |
💥 laf server image built successfully for pr 1930
digest: |
|
||
await fs.mkdir(WORKSPACE_PATH, { recursive: true }) | ||
|
||
const funcs = await DatabaseAgent.db |
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.
FunctionCache.getAll
await pipeline(readStream, res).then(() => { | ||
// after pipe the file stream, remove the tar file | ||
fsPromises.unlink(TAR_FILE_PATH).catch((unlinkError) => { | ||
console.error('Error removing file:', unlinkError) |
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.
logger.error
) | ||
} | ||
|
||
// /docker-file |
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.
remove
res: Response, | ||
) { | ||
try { | ||
// Save them to the workspace directory |
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.
上下注释的大小写对齐
try { | ||
await fs.rm(WORKSPACE_PATH, { recursive: true, force: true }) | ||
} catch (err) { | ||
console.error('Error removing the workspace directory:', err) |
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.
不是错误
} | ||
|
||
for (const [key, value] of Object.entries(ENV)) { | ||
if (keysToInclude.includes(key)) { |
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.
放到上面的conf.environments
envVariablesString = envVariablesString.replace(/\\\n\s*$/, '') | ||
|
||
// version from env todo | ||
const DOCKER_FILE = ` |
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.
DOCKERFILE
export async function handleDockerFile(_: IRequest, res: Response) { | ||
try { | ||
const ENV = process.env | ||
const keysToInclude = [ |
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.
去掉不需要的
USER node | ||
RUN npm install ${ENV.DEPENDENCIES} || true | ||
|
||
RUN curl -o /tmp/cloud_functions.tar https://${ENV.RUNTIME_DOMAIN}/_/${process.env.SERVER_SECRET}/cloud_functions/tar && tar -xf /tmp/cloud_functions.tar -C /app/cloud_functions && rm /tmp/cloud_functions.tar |
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.
${process.env.SERVER_SECRET} 放在 tar后面,最好用jwt
USER node | ||
RUN npm install ${ENV.DEPENDENCIES} || true | ||
|
||
RUN curl -o /tmp/cloud_functions.tar https://${ENV.RUNTIME_DOMAIN}/_/${process.env.SERVER_SECRET}/cloud_functions/tar && tar -xf /tmp/cloud_functions.tar -C /app/cloud_functions && rm /tmp/cloud_functions.tar |
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.
http的兼容
这个 pr 先不合, 等一起讨论后再决定 |
No description provided.