Add external config environment variable file for stack deploy #280

Closed
opened 2023-04-04 12:15:15 +00:00 by dboreham · 4 comments
Owner

Currently all deploy environment variables are either defined in the compose files or fetched from a static file inside the stack orchestrator package. Add the capability to load environment variables from an arbitrary file e.g. with laconic-so --stack foo --env-file /my/file/name.env deploy up

Currently all deploy environment variables are either defined in the compose files or fetched from a static file inside the stack orchestrator package. Add the capability to load environment variables from an arbitrary file e.g. with `laconic-so --stack foo --env-file /my/file/name.env deploy up`
Author
Owner

Some implementation notes:

Pass the env file name, if present here: https://github.com/cerc-io/stack-orchestrator/blob/main/app/deploy_system.py#L54 in the compose_env_file parameter documented here.

Parsing --env-file from the command line may be tricky -- I don't think we have any --foo for the subcommands yet, but memory is hazy. That functionality is implemented in click.

Some implementation notes: Pass the env file name, if present here: https://github.com/cerc-io/stack-orchestrator/blob/main/app/deploy_system.py#L54 in the `compose_env_file` parameter documented [here](https://gabrieldemarmiesse.github.io/python-on-whales/docker_client/). Parsing `--env-file` from the command line may be tricky -- I don't think we have any `--foo` for the subcommands yet, but memory is hazy. That functionality is implemented in [click](https://click.palletsprojects.com/en/8.1.x/).
prathamesh0 commented 2023-04-11 10:55:52 +00:00 (Migrated from github.com)

@dboreham Have added an option (--env-file) to pass env file for the deploy command in #304

An example usage would look like this:

laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism --env-file ./my-env.env up

As can be seen in the PR changes, the env-file is not made part of the cluster_context unlike other deploy options. We discussed this, but it wasn't clear whether we should somehow accommodate the env-file value in a cluster's context. What do you think?

@dboreham Have added an option (`--env-file`) to pass env file for the `deploy` command in #304 An example usage would look like this: ```bash laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism --env-file ./my-env.env up ``` As can be seen in the PR [changes](https://github.com/cerc-io/stack-orchestrator/pull/304/files#diff-049386f3d017d80afa53ccabc6856fa8ce28127cd4407e75b6e42a6797eac4ceR52), the `env-file` is not made part of the `cluster_context` unlike other deploy options. We discussed this, but it wasn't clear whether we should somehow accommodate the `env-file` value in a cluster's context. What do you think?
Author
Owner

@dboreham Have added an option (--env-file) to pass env file for the deploy command in #304

An example usage would look like this:

laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism --env-file ./my-env.env up

As can be seen in the PR changes, the env-file is not made part of the cluster_context unlike other deploy options. We discussed this, but it wasn't clear whether we should somehow accommodate the env-file value in a cluster's context. What do you think?

I think it should probably be in the cluster context so these envs are available to orchestration scripts, and execs and so on. I will file a bug for this.

> @dboreham Have added an option (`--env-file`) to pass env file for the `deploy` command in #304 > > An example usage would look like this: > > ```shell > laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism --env-file ./my-env.env up > ``` > > As can be seen in the PR [changes](https://github.com/cerc-io/stack-orchestrator/pull/304/files#diff-049386f3d017d80afa53ccabc6856fa8ce28127cd4407e75b6e42a6797eac4ceR52), the `env-file` is not made part of the `cluster_context` unlike other deploy options. We discussed this, but it wasn't clear whether we should somehow accommodate the `env-file` value in a cluster's context. What do you think? I think it should probably be in the cluster context so these envs are available to orchestration scripts, and execs and so on. I will file a bug for this.
Author
Owner

Feature has been implemented.

Feature has been implemented.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/stack-orchestrator#280
No description provided.