question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize asset bundling execution

See original GitHub issue

We should offer a way for users to customize how docker is executed during asset bundling at the app level in order to allow users that can’t use docker to leverage bundling.

Use Case

Asset bundling relies on docker to offer a ubiquitous experience for library consumers (see “why we use docker” below). However, running docker in some environments is a major barrier or even not allowed.

As an escape hatch, we should allow users at the application level to override the way docker is executed so they can still use asset bundling in their systems.

Proposed Solution

Introduce some inversion of control when executing the various docker commands during bundling.

This is something that should be done (only?) at the app level since it’s about the specific synthesis environment and it should not be possible for libraries to override this behavior given their don’t know what the synthesis environment will be.

I wonder if it is sufficient to simply say “docker is in PATH and you are welcome to simply provide your own docker command that does whatever you want as long as it respects the contract.”

Another alternative is to defer to an environment variable such as CDK_DOCKER if it is defined.

Why we use Docker?

Consider the use case in which an app consumes a third-party library which leverages asset bundling (like NodeJsFunction) under the hood (or even multi-level deep).

This app doesn’t even know that somewhere in their dependency graph, someone wants to bundle a Nodejs library with Parcel, let alone interested in setting up their dev and build environments to include these tools.

Docker offers a way to abstract this completely. Granted - this app will need docker available during synthesis, which I could be a barrier in some environments, but once they have docker, they can use any construct library.

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

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eladbcommented, Jun 10, 2020

@jogold I am going to make this change. I’ll send a PR for a review.

0reactions
eladbcommented, Jun 10, 2020

How would users “discover” what dependencies they need for this to work outside docker?

They will just tailor their shim based on the use case. For example, they can explore the source of the docker image in Docker Hub and install those dependencies in their environments. Case by case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AssetBundle workflow - Unity - Manual
This script creates a menu item at the bottom of the Assets menu called Build AssetBundles that executes the code in the function...
Read more >
aws-cdk/aws-s3-assets module - AWS Documentation
The files under /asset-output will be zipped and uploaded to S3 as the asset. The following example uses custom asset bundling to convert...
Read more >
Manage asset bundles from your inventory - ServiceNow Docs
Create asset bundles from existing assets in your inventory to track, reserve, or deploy a group of assets as a single entity.
Read more >
Symfony Assetic is not linking own bundles - Stack Overflow
but it didn't create symlinks for my own bundles. (Own my dev system they are there). Here's the output: php app/console assets:install Installing...
Read more >
Using the New Asset Bundle Browser & Graph Tool - YouTube
Enjoy a preview of new features that make working with dynamically loaded content simple and efficient, while drastically reducing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found