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

feat(lambda-nodejs): run parcel in a docker container #7842

Merged
merged 5 commits into from
May 7, 2020

Conversation

jogold
Copy link
Contributor

@jogold jogold commented May 7, 2020

Commit Message

feat(lambda-nodejs): run parcel in a docker container

Redo of #7169.

End Commit Message


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Comment on lines 94 to 97
// Find the git root and mount it in the container. This allows Parcel to
// find the same modules/dependencies as the ones available "locally". It
// also supports monorepos.
const projectRoot = path.dirname(findGitPath());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eladb this is the fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies that the project root is the git root which means:

  1. That the project directory must be inside a git repo. This is not always the case. For example, last time I checked, when you used GitHub as a source for CodePipeline, the CodeBuild project did not include a git clone but rather a copy of the source tree (without a .git directory).
  2. Maybe we need to allow people to configure this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have maybe a suggestion to find the root of a monorepo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we allow people to specify it and default to searching for .git, but if we can't find we omit an error explaining how to manually configure.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: c4d4764
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

eladb
eladb previously requested changes May 7, 2020
Comment on lines 94 to 97
// Find the git root and mount it in the container. This allows Parcel to
// find the same modules/dependencies as the ones available "locally". It
// also supports monorepos.
const projectRoot = path.dirname(findGitPath());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies that the project root is the git root which means:

  1. That the project directory must be inside a git repo. This is not always the case. For example, last time I checked, when you used GitHub as a source for CodePipeline, the CodeBuild project did not include a git clone but rather a copy of the source tree (without a .git directory).
  2. Maybe we need to allow people to configure this?

@mergify mergify bot dismissed eladb’s stale review May 7, 2020 14:07

Pull request has been modified.

@@ -104,6 +118,7 @@ export class NodejsFunction extends lambda.Function {
cacheDir: props.cacheDir,
nodeVersion: extractVersion(runtime),
nodeDockerTag: props.nodeDockerTag || `${process.versions.node}-alpine`,
projectRoot: path.dirname(path.resolve(projectRoot)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dirname?

Copy link
Contributor Author

@jogold jogold May 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong... was because findGitPath() returned the path with .git/.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: fb0504d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 7dbef6f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: e103927
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jogold
Copy link
Contributor Author

jogold commented May 7, 2020

@eladb do you have/can you share usage statistics for aws-lambda-nodejs?

@mergify
Copy link
Contributor

mergify bot commented May 7, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 6124a66
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented May 7, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit d86e500 into aws:master May 7, 2020
@jogold jogold deleted the nodejs-parcel-docker branch May 31, 2020 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants