Page MenuHomePhabricator

blubber template for nodejs should allow defining configuration files to copy to the container
Open, MediumPublic

Description

Right now, projects that use both service_runner and Blubber are configured as follows:

This means that whenever running the image without overriding the entrypoint, we will end up using whatever config.yaml file present in the root directory of the source code tree.

So when running with any change in the configuration (as is the case in production, staging and beta) one would need to:

  • Mount a volume containing the config.yaml file
  • override the entrypoint

If we allowed blubber to create a directory /etc/<service-name> and copy config.$env.yaml in the image as /etc/<service-name>/config.yaml, (and explicitly add -c config.yaml to the entrypoint, we could run the image in any environment by just overriding the file present on disk by mounting a volume.

AIUI, blubber has no way to allow project owners to specify files to copy to specific locations inside the container, but if what I described is already possible, please advise :)

Event Timeline

FYI, we can also have an alternative mount point for the config file, and can tell service-runner where to look for it by setting the APP_BASE_PATH environment variable. This approach would make building images more flexible, probably.

FYI, we can also have an alternative mount point for the config file, and can tell service-runner where to look for it by setting the APP_BASE_PATH environment variable. This approach would make building images more flexible, probably.

Ok that makes things even easier. We can probably just modify the blubber manifest of the existing applications.

FYI, we can also have an alternative mount point for the config file, and can tell service-runner where to look for it by setting the APP_BASE_PATH environment variable. This approach would make building images more flexible, probably.

Euh, sorry, that won't actually work as APP_BASE_PATH is also used for loading other parts of the config, such as the spec. We could add another ENV variable to fix that, though.

AIUI, blubber has no way to allow project owners to specify files to copy to specific locations inside the container, but if what I described is already possible, please advise :)

This isn't currently possible with blubber. You can specify artifacts from multi-stage containers, copying from the local file-system is only supported as a boolean; i.e., we copy the project files into the Lives.In path.

@dduvall and I have been kicking around ideas about changes to this system on T211625.

I think adding an ENV variable to service-runner is probably the way to go.

As of services-runner v2.6.8, you can now set the APP_CONFIG_PATH variable that specifies where the configuration file will read the variable from.

herron triaged this task as Medium priority.Jan 4 2019, 5:25 PM