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

No way to reasonably customize core and horizon configuration files #469

Closed
nyetwurk opened this issue Jul 10, 2023 · 8 comments
Closed
Assignees
Labels

Comments

@nyetwurk
Copy link

nyetwurk commented Jul 10, 2023

https://github.com/stellar/quickstart#customizing-configurations reads

It is recommended that you stop the container before editing any of these files, then restart the container after completing your customization.
NOTE: Be wary of editing these files. It is possible to break the services started within this container with a bad edit. It’s recommended that you learn about managing the operations of each of the services before customizing them, as you are taking responsibility for maintaining those services going forward.

We cannot deploy this way. We need a way to be able to reasonably configure every one of these files, but /start copy_defaults does not copy any of the critical files if their corresponding /etc dirs already exist (e.g. by providing a docker volume mount on the corresponding /etc directory). This makes it impossible to build custom configurations without a ton of work.

There should be a better way to merge the three following types of settings cleanly, and in the following order:

  1. compile time defaults if no config file is specified (this appears to be a fatal error for core at least)
  2. vendor provided configs
  3. user configs

Many other programs provide various ways of doing this.

The ones that work the best are the ones where 2 and 3 are as minimal as possible, such that they only include the relevant differences from the default behavior.

The canonical way in many unix apps is by utilizing a config.d/ directory, which has a number of configuration files, possibly prefixed by an integer, e.g. 1- or 01- or 99- etc. such they can be parsed in a deterministic order.

Unfortunately, toml (let alone yaml/json) isn't very conducive to this approach.

Environment variables, however, are ideal for this as they are simple k/v pairs.

The hack of using sed to create toml files (from, say, a template) is one approach, but that requires that every possible user configurable option has a corresponding env var to go with it, which is probably impractical.

@nyetwurk nyetwurk changed the title No way to reasonably customize No way to reasonably customize core and horizon configuration files Jul 10, 2023
@nyetwurk
Copy link
Author

nyetwurk commented Jul 10, 2023

In core's case, this might be done most easily by separating core configuration (which is key/value pairs) from quorum set configuration (which is a more complex set of structured data).

@nyetwurk
Copy link
Author

Instead of quickstart, we are using this for soroban directly
https://github.com/stellar/soroban-tools/blob/main/cmd/soroban-rpc/docker/Dockerfile

@sreuland
Copy link
Contributor

Hello, wanted to mention another alternative to consider in deployment, if it can leverage kubernetes, there are helm charts available, one for core, horizon, soroban-rpc here:

https://github.com/stellar/helm-charts/tree/main/charts

if kubernetes not an option, the manifests in those charts may still be good references for showing how to run the docker containers and the configurations.

@nyetwurk
Copy link
Author

Hello, wanted to mention another alternative to consider in deployment, if it can leverage kubernetes, there are helm charts available, one for core, horizon, soroban-rpc here:

https://github.com/stellar/helm-charts/tree/main/charts

if kubernetes not an option, the manifests in those charts may still be good references for showing how to run the docker containers and the configurations.

Absolutely; i used exactly that to do our own configs.

@nyetwurk
Copy link
Author

I don't think quickstart is suitable for production environments.

@mollykarcher
Copy link
Contributor

I don't think quickstart is suitable for production environments.

Yes, we do not recommend it for production environments, which is why issues like this tend to fall in priority and not get a lot of engagement. That said, I think we could do more to make that explicit/clear in the README here and in our API documentation. And I realize that some partners were explicitly pointed to quickstart for soroban-rpc, given the timelines and lack of other available options yet, so I apologize for that!

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity. It will be closed in 30 days unless the stale label is removed.

@github-actions github-actions bot added the stale label Sep 25, 2023
@leighmcculloch leighmcculloch self-assigned this Sep 25, 2023
@leighmcculloch
Copy link
Member

In #487 we removed the instructions for customizing the image. The instructions weren't consistent with what was actually possible. The image isn't maintained in such a way that customizing is really practical. Changes to the images routinely break any customization. Very likely custom setups would benefit from setups such as what is being used here: #469 (comment).

Please feel free to comment with alternatives if any occur. I'm going to close it since this aspect of the image is likely not to be improved.

@leighmcculloch leighmcculloch closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants