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

Defang dev command #718

Open
raphaeltm opened this issue Oct 3, 2024 · 1 comment
Open

Defang dev command #718

raphaeltm opened this issue Oct 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@raphaeltm
Copy link
Collaborator

Just had a good chat with @nullfunc about config, interpolation, etc. where we talked about stuff like this:
#682 (comment)

A thing that came up is something we've talked about many times before... which is "what is dev mode". My original concern in #449 was that it would be nice from a development workflow perspective to be able to have "throwaway" values in your compose file (PASSWORD=password) for example, and then override that with "real" values (which may need to be secure/sensitive) in different environments.

After talking about it, I have come back to that conclusion, personally: if I went through the effort of explicitly specifying an encrypted value in a given environment, it should probably override the insecure, plaintext value. As I think through it, my reasoning is the following: the compose file is a general structure, but each deployment is more "specific" in that it will take things like mode, etc. into account when deployed. As such, the config vals are part of the more "specific" context, which should override the more "general" ones.

There are weird things that come up, though, when talking through this stuff and differences in how things are handled in the cloud vs local. So I was thinking (and stuff similar to this has come up in the past) that we should have a defang dev "prefix" (or maybe it's a defang --dev global flag, but it would be nice to have two fewer characters to type).

What I'm suggesting is the following: you should be able to run any normal defang command with the dev prefix, and we should have a local version of that.

For example defang dev config set PASSWORD=potatoes would:

  1. check if we have a compose.dev.yaml file and if not, generate it with the standard that we're currently using (this would happen with any invocation of a command under defang dev
  2. check if we have a .env.dev file and create it if not
  3. write PASSWORD=potatoes in a .env.dev file (or update the value)

If you then run defang dev compose up it would, under the hood, invoke docker compose --env-file=.env.dev -f compose.dev.yaml up

We could do the same with logs, etc. just proxying through to the docker commands (using the sdk or otherwise).

The idea is essentially that by prefixing with dev we're sorta saying --provider=local and you should be able to do anything you do in the cloud on your own machine.

@raphaeltm raphaeltm added the enhancement New feature or request label Oct 3, 2024
@Prakash-Sundaresan
Copy link
Contributor

Related to #292

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

2 participants