-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Current situation
- User runs
docker compose upusing thedocker-compose.yml: toy account, toy user and toy assets created. Assets:- NL transmission zone
- toy-building
- toy-battery
- toy-solar
- User reruns
docker compose up: toy account and toy user already exist (not recreated), but some of the toy assets are recreated. Assets:- NL transmission zone
- toy-building (x2)
- toy-battery (x2)
- toy-solar (x2)
- Et cetera. Assets after N
down->up:- NL transmission zone
- toy-building (x N)
- toy-battery (x N)
- toy-solar (x N)
Ideas
- Adjust
cli.data_add.add_toy_accountto prevent new toy assets being created if they exist already. - Adjust
docker-compose.ymlto not rerunflexmeasures add toy-account --name 'Docker Toy Account'when that account already exists.if ! flexmeasures list accounts | grep -q "Docker Toy Account"; then flexmeasures add toy-account --name 'Docker Toy Account' fi - Adjust
docker-compose.ymlto not rerunflexmeasures add toy-account --name 'Docker Toy Account'after the first timedocker compose upran.if [ ! -f /app/instance/.toy_account_created ]; then flexmeasures add toy-account --name 'Docker Toy Account' touch /app/instance/.toy_account_created fi
Considerations
From a user perspective, I like the third option best. Why? Because I imagine that as a first-time user it's nice that you get a toy site to play around with, but once you set up your own site you will probably delete the toy site/account and it would feel really weird when it reappears the next time you run docker compose up. Even better might be to do the opposite, by having the marker file (named .create-toy-account) in the repo, and removing it the first time docker compose up runs. That way it's slightly nicer in the sense that a) the marker file does not need to live indefinitely on the user's device, and b) having the file explicitly in our repo better signals this design pattern, where temporary marker files are used for first-time use, and this can even be clearly documented inside the file itself.