Stop creating new toy assets when restarting the docker-compose stack#2018
Stop creating new toy assets when restarting the docker-compose stack#2018
Conversation
…tart Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Documentation build overview
Show files changed (3 files in total): 📝 3 modified | ➕ 0 added | ➖ 0 deleted
|
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Flix6x
left a comment
There was a problem hiding this comment.
I reviewed and tested this and it works as advertised.
@nhoening I'd like to get your opinion on these two issues:
- I did have a local
flexmeasures-instancedirectory with arequirements.txtwhose contents I needed to move into the newrequirements.txtthat would now become part of the repo. If you want, we could also leave this file out. What do you think? - After running
docker compose up, the state file is removed and it will keep showing up in thegit diff. My IDE did let me move the change into a separate change list, so I'm not bothered by it that much. The only way I see around that would be to move the state information into Postgres instead. What do you think?
|
I don't understand the first issue. Be aware that we are moving away from requirements.txt files, apart from using them in plugins probably. The second issue: I guess we should flip the file to mark when we have done it, and not have it in git (in fact, add it to .gitignore) |
|
Good suggestion. @copilot flip the marker logic as suggested by @nhoening, and remove the new You must not change the PR title and you must append to the PR description of this PR (#2018). Do not replace its current contents. |
…ead of deleting marker file Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Done in bae24ca. The marker logic is now flipped: the |
Each
docker compose upre-ranflexmeasures add toy-account, which skipped account/user creation (those check for existence) but always recreated all toy assets, resulting in N copies after N restarts.Changes
docker-compose.yml— Server startup command now gates toy account creation on a state file: ifflexmeasures-instance/.toy-account-createddoes not yet exist, the toy account is created and the file is touched; subsequent restarts skip creation with an informative message:.gitignore— Added/flexmeasures-instanceso the state file (and any user-local config such asflexmeasures.cfg) is never accidentally committed.documentation/dev/docker-compose.rst— Updated to reflect the first-run-only behaviour.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.