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

Reset db settings to docker-specific values when using Docker (and check start-up time) #26

Open
PsychoThinker opened this issue Nov 26, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@PsychoThinker
Copy link

Its not a big deal, but right now you need to edit the database file to migrate from python to docker config.

This configuration should be converted automatically, or it should be possible to edit all settings (like "backup directory").

@jzohrab jzohrab added the question Further information is requested label Nov 27, 2023
@jzohrab
Copy link
Collaborator

jzohrab commented Nov 27, 2023

I'm not clear on what the request here is.

  • Do you mean "edit the config file," instead of "edit the database file"?
  • There's no config file required for the python code, unless you're specifically configuring it for some reason (which is possible, but not required). Actually, there is no docker config, I'm assuming you're talking about the docker compose, which is up to the user to create.
  • are you talking about the config from v2 to v3?

Perhaps you could reply with an example of the config you want converted ... but this is going to be an error-prone script which will be useful only in a very small number of cases, so I'm unlikely to do it myself. :-) As nice/slick as this request is, I'm going to push this small effort on to the users.

@PsychoThinker
Copy link
Author

I will try to explain it with an example.

I'm talking about the scenario of migrating from a lute v3 python installation to a v3 docker-compose installation (actually in my case it's just docker). I thought the only thing I had to do was unpack my backup into the data directory, but that wasn't the case. The "backup directory" parameter cannot be changed from the user interface (at least not when running lute from docker) - I had to restore the original values for "backup directory" and also "MECAB_PATH environment variable" parameters in the lute.db file.

Then I realized that I could set this second parameter using the user interface, but I still think it would be nicer to detect that migration has happened and set proper values for these parameters.

But as I said, it wasn't a big deal for me (and I already have a working migrated installation).

@jzohrab
Copy link
Collaborator

jzohrab commented Nov 27, 2023

Ah yes, I see. With Docker, there's no real "config file", you just have to create a docker compose file to mount host folders to the container. There's no real correspondence between the two setups. But I see what you mean about the backup folder ... with docker, it has to be set to a particular value, to ensure that the dirs are mounted. ... but then again, really users could map it anywhere, if they know what they're doing.

Perhaps the right thing to do in Docker is just to reset those settings to the correct values for Docker, overwriting what you might have set. Does that sound right? No matter what I do, it feels like it could be messy -- but perhaps is good enough.

@PsychoThinker
Copy link
Author

Perhaps the right thing to do in Docker is just to reset those settings to the correct values for Docker, overwriting what you might have set. Does that sound right?

I think this would solve the problem.

It seems to me that if you try to run docker with the lute.db file that was previously used with python (without resetting those parameters), the process of starting lute is very long.

@jzohrab
Copy link
Collaborator

jzohrab commented Nov 27, 2023

Got it. Will check re the long start-up time. Thanks, hadn't considered this scenario!

@jzohrab jzohrab added bug Something isn't working and removed question Further information is requested labels Nov 27, 2023
@jzohrab jzohrab changed the title Feature request: Add option to migrate from python config to docker Reset db settings to docker-specific values when using Docker Dec 15, 2023
@jzohrab
Copy link
Collaborator

jzohrab commented Dec 15, 2023

Old title was "Feature request: Add option to migrate from python config to docker", which wasn't the real issue. This is a good suggestion that should be a quick fix. Also, check the startup time!

@jzohrab jzohrab changed the title Reset db settings to docker-specific values when using Docker Reset db settings to docker-specific values when using Docker (and check start-up time) Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants