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

Automatically (or semi-automatically) map TMPDIR into VM #297

Closed
rix0rrr opened this issue Mar 16, 2023 · 2 comments
Closed

Automatically (or semi-automatically) map TMPDIR into VM #297

rix0rrr opened this issue Mar 16, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@rix0rrr
Copy link

rix0rrr commented Mar 16, 2023

What is the problem you're trying to solve?.

CDK will sometimes put directories with Dockerfiles into a user's temporary directory, and ask finch to build them. Right now, since the user's temporary directory isn't mounted into the finch VM, they get a confusing error like:

time="2023-03-16T09:43:07Z" level=fatal msg="lstat /private/var/folders/zx/d5wln9n10sn0tcj1v9798f1c0000gr/T/jsii-kernel-9VYgrO/node_modules/@aws-cdk/aws-lambda-python-alpha/lib/Containerfile: no such file or directory"

It's confusing on many levels:

  • There is indeed no Containerfile, but there is a Dockerfile
  • It's not obvious to a user that this path is inside the finch VM, instead of their own file system

Describe the feature you'd like

Right now we're telling users to put this into their finch.yaml:

additional_directories:
  - path: /var/folders
  - path: /private/var/folders

It would be nice if finch could do this automatically.

If not, I wonder if there are performance implications of mapping everything under /var/folders. If so, could finch maybe support a symbolic name for the temporary directory instead?

additional_directories:
  - path: TMPDIR

And either map that automatically always, or give the user the ability to add the above.

Additional context

Our issue: aws/aws-cdk#24458

@rix0rrr
Copy link
Author

rix0rrr commented Mar 16, 2023

Slight complication in the fact that:

$ echo $TMPDIR  
/var/folders/zx/d5wln9n10sn0tcj1v9798f1c0000gr/T/

But actually

/var -> /private/var

And the actual directory (that should probably be mapped) is:

/private/var/folders/zx/d5wln9n10sn0tcj1v9798f1c0000gr/T/

But now, unless the VM also has the /var -> /private/var symlink, it matters whether we use the unresolved $TMPDIR or the resolved $TMPDIR, because they will contain different path names and only one of them will be mapped...

Can you add a symlink for /var/folders -> /private/var/folders into the VM?

@ahsan-z-khan ahsan-z-khan added the enhancement New feature or request label Mar 20, 2023
@vsiravar vsiravar self-assigned this Jul 24, 2023
vsiravar added a commit that referenced this issue Aug 14, 2023
Issue #, if available:
#297

*Description of changes:*
Mount /var/folders into finch vm automatically to improve compatibility
with docker.

Docker mount directories
<img width="567" alt="image"
src="https://github.com/runfinch/finch/assets/69735799/61e561f9-6ac7-4610-9a88-aa044794ce00">


*Testing done:*
Yes


- [X] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

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

Signed-off-by: Vishwas Siravara <[email protected]>
@vsiravar vsiravar closed this as completed Sep 6, 2023
@vsiravar
Copy link
Contributor

vsiravar commented Sep 6, 2023

Released in v0.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants