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

lambda-nodejs: Support additional arguments from user and environments when building the builder and running builder container #8117

Closed
2 tasks
zxkane opened this issue May 21, 2020 · 3 comments · Fixed by #9035
Assignees
Labels
@aws-cdk/aws-lambda-nodejs effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on.

Comments

@zxkane
Copy link
Contributor

zxkane commented May 21, 2020

Since moving to use docker container to build the source of lambda-nodejs, the users might have problem to downloading the dependencies in docker build.

Use Case

When I synthesis/deploy a CDK app with lambda-nodejs code in China. I failed to build the source code of lambda-nodejs due to network issue in Docker container.

See error message below,

Failed to build file at /path/assets/ecs-task-def/ecs.ts: Error: [Status 1] stdout: Sending build context to Docker daemon  2.048kB
Step 1/5 : ARG NODE_TAG
Step 2/5 : FROM node:${NODE_TAG}
 ---> 87c43f8d8077
Step 3/5 : RUN yarn global add parcel-bundler@^1
 ---> Running in 29b5567d211a
yarn global v1.22.4
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/parcel-bundler: ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/usr/local/share/.config/yarn/global/yarn-error.log".

Actually I can install the dependencies manually via proxy server in earlier CDK versions.

Proposed Solution

Docker build supports specifying build arguments about proxy like below,

docker build --build-arg HTTP_PROXY=$http_proxy \
--build-arg HTTPS_PROXY=$http_proxy

docker run --env HTTP_PROXY=$http_proxy \
--env HTTPS_PROXY=$http_proxy

Add a capability to support the user specifying the builder arguments or directly passing the proxy arguments if they are set in env.

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@zxkane zxkane added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 21, 2020
@eladb
Copy link
Contributor

eladb commented May 27, 2020

@jogold

@eladb
Copy link
Contributor

eladb commented May 27, 2020

@jogold I think all of these should be address in #7898 - correct?

@eladb eladb added the effort/small Small work item – less than a day of effort label May 27, 2020
@jogold
Copy link
Contributor

jogold commented May 27, 2020

@jogold I think all of these should be address in #7898 - correct?

Yes and we will expose the required props to achieve this in lambda-nodejs.

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Jun 2, 2020
jogold added a commit to jogold/aws-cdk that referenced this issue Jul 13, 2020
Add support for passing build arguments when building the bundling
image.

Closes aws#8117
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Jul 13, 2020
@mergify mergify bot closed this as completed in #9035 Jul 14, 2020
mergify bot pushed a commit that referenced this issue Jul 14, 2020
Add support for passing build arguments when building the bundling
image.

Closes #8117


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
curtiseppel pushed a commit to curtiseppel/aws-cdk that referenced this issue Aug 11, 2020
Add support for passing build arguments when building the bundling
image.

Closes aws#8117


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants