Skip to content

Commit

Permalink
updates from learnings during the 0.20 release
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
  • Loading branch information
nhoening committed Apr 16, 2024
1 parent 55db814 commit b3592dd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
29 changes: 15 additions & 14 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ For a MINOR or MAJOR release:

- [ ] Run automated tests via `make test`.
- [ ] Create the docker compose stack (this tests building and also creates the Docker image for release):
- `docker rmi flexmeasures-server flexmeasures-worker` (might need a `docker compose down` if you've built earlier)
- `docker rm flexmeasures-server-1 flexmeasures-worker-1; docker rmi flexmeasures-server flexmeasures-worker` (might need a `docker compose down` if you've built earlier)
- `docker compose build`

For a MINOR or MAJOR release:
Expand All @@ -51,7 +51,7 @@ For a MINOR or MAJOR release:
- [ ] Run the last steps of the tutorial (see link above, we still need to add prices and schedule). You can run `../tsc/tsc/scripts/run-tutorial-in-docker.sh` (in this repo).
- [ ] Validate that a schedule was made in the CLI (the above script should do so)
- [ ] (MAJOR release) Also check with `--as-job`, as that touches different code:
- `TOMORROW=$(date --date="next day" '+%Y-%m-%d'); docker exec -it flexmeasures-worker-1 bash -c "flexmeasures add schedule for-storage --sensor-id 2 --consumption-price-sensor 1 --start ${TOMORROW}T07:00+01:00 --duration PT12H --soc-at-start 50% --roundtrip-efficiency 90% --as-job"`
- `TOMORROW=$(date --date="next day" '+%Y-%m-%d'); docker exec -it flexmeasures-worker-1 bash -c "flexmeasures add schedule for-storage --sensor 2 --consumption-price-sensor 1 --start ${TOMORROW}T07:00+01:00 --duration PT12H --soc-at-start 50% --roundtrip-efficiency 90% --as-job"`
- `docker logs flexmeasures-worker-1` # this should tell you if schedule creation went well.
- [ ] Do a quick UI test: log in toy-user, select battery asset, view schedule
- Run an API test (TODO, maybe use a script to get the tutorial data or add something as well)
Expand All @@ -74,15 +74,24 @@ For a MINOR or MAJOR release:
- Add the version tag: `git tag -s -a v<major>.<minor>.<patch> -m ""`
- `git push --tags`
- [ ] Check if the documentation builds on [readthedocs.org](https://readthedocs.org/projects/flexmeasures/builds/) (login via Github)
- [ ] Create a release on GitHub based on the new tag (you can copy the title from your blog post and also paste the change log notes in there; the "Generate release notes" button is also cool; code assets are added automatically)
- [ ] (MINOR or MAJOR) Publish the blog post in Publii ("Sync your website")
- [ ] Create a release on GitHub based on the new tag (you can copy the title from your blog post and also paste the change log notes in there; the "Generate release notes" button is also cool; code assets are added automatically)
- [ ] (MINOR or MAJOR) Publish the blog post in Publii ("Sync your website") - if you need a Github token, you can generate one [like this](https://github.com/settings/tokens/new?scopes=public_repo,repo_deployment&description=Token for Deployment to GitHub Pages). Other Server settings for [Publii under Github Pages](https://getpublii.com/docs/host-static-website-github-pages.html): "Website URL":"flexmeasures.io", "API Server": "api.github.com", "Username": "FlexMeasures", "Repository": "website".
- [ ] Release to Pypi
- Run `./to_pypi.sh` # Credentials in Seita's keepass store, use `__token__` as username and the access token as password
- Run `./to_pypi.sh` # Credentials in Seita's keepass store (in the "PyPi" card's description), use `__token__` as username and the access token as password
- Test (in some fresh context) if pip installs the fresh version:
- `python3 -m venv testing-fm-latest`
- `source testing-fm-latest/bin/activate`
- `pip install --upgrade flexmeasures` # should download & install new version
- `deactivate && rm -rf testing-fm-latest`
- [ ] Release to Docker Hub:
- [ ] Check `docker images` (CREATED column) to make sure the `flexmeasures-server` image is the one you just built (under "Test steps")
- [ ] Re-build, because we want the new git version tag to be part of it: `docker compose build`
- [ ] `docker tag flexmeasures-server lfenergy/flexmeasures:v<major>.<minor>.<patch>`
- [ ] `docker tag lfenergy/flexmeasures:v<major>.<minor>.<patch> lfenergy/flexmeasures:latest`
- [ ] `docker login -u flexmeasures` # Credentials for the Docker account are in Seita's keepass store. When using Docker Desktop (maybe for all Docker demons), you need a GPG key to use the Linux pass-store (https://docs.docker.com/desktop/get-started/#sign-in-to-docker-desktop)
- `docker push lfenergy/flexmeasures:v<major>.<minor>.<patch>`
- `docker push lfenergy/flexmeasures:latest`
- Check on https://hub.docker.com/r/lfenergy/flexmeasures/tags
- [ ] Mention the release (with link to the blog post) on:
- [ ] the @flexmeasures Twitter account
- [ ] the @flexmeasures@fosstodon.org Mastodon account
Expand All @@ -97,15 +106,7 @@ For a MINOR or MAJOR release:
- [ ] Tag the new commit with `v<major>.<minor+1>.0.dev0` (MINOR) or `v<major+1>.0.0.dev0` (MAJOR)
- [ ] `git push --tags`
- [ ] `git checkout main`
- [ ] Create a new version of our Docker image:
- [ ] Check `docker images` (CREATED column) to make sure the `flexmeasures-server` image is the one you just built (under "Test steps")
- [ ] `docker tag flexmeasures-server lfenergy/flexmeasures:v<major>.<minor>.<patch>`
- [ ] `docker tag lfenergy/flexmeasures:v<major>.<minor>.<patch> lfenergy/flexmeasures:latest`
- [ ] `docker login -u flexmeasures` # Credentials for the Docker account are in Seita's keepass store. When using Docker Desktop (maybe for all Docker demons), you need a GPG key to use the Linux pass-store (https://docs.docker.com/desktop/get-started/#sign-in-to-docker-desktop)
- `docker push lfenergy/flexmeasures:v<major>.<minor>.<patch>`
- `docker push lfenergy/flexmeasures:latest`
- Check on https://hub.docker.com/r/lfenergy/flexmeasures/tags
- [ ] Close the current milestone and make a new milestone on https://github.com/FlexMeasures/flexmeasures/milestones
- [ ] Close the current milestone and make a new milestone on https://github.com/FlexMeasures/flexmeasures/milestones (you can move over not-closed issues manually)
- [ ] (MINOR or MAJOR) Update `documentation/changelog.rst` to avoid wasting time on change log merge conflicts later:
- Add a placeholder for the next patch release
- Add a placeholder for the next minor release
Expand Down
9 changes: 5 additions & 4 deletions tsc/scripts/run-tutorial-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ ${TOMORROW}T22:00:00,10
${TOMORROW}T23:00:00,7" > prices-tomorrow.csv

docker cp prices-tomorrow.csv flexmeasures-server-1:/app
docker exec -it flexmeasures-server-1 bash -c "flexmeasures add beliefs --sensor-id 1 --source toy-user prices-tomorrow.csv --timezone utc"
docker exec -it flexmeasures-server-1 bash -c "flexmeasures add beliefs --sensor 1 --source toy-user prices-tomorrow.csv --timezone utc"

echo "[TUTORIAL-RUNNER] creating schedule ..."
docker exec -it flexmeasures-server-1 bash -c "flexmeasures add schedule for-storage --sensor-id 2 --consumption-price-sensor 1 \
docker exec -it flexmeasures-server-1 bash -c "flexmeasures add schedule for-storage --sensor 2 --consumption-price-sensor 1 \
--start ${TOMORROW}T07:00+01:00 --duration PT12H --soc-at-start 50% \
--roundtrip-efficiency 90%"
# we also want to use --as-job here (testing the queuing), but for some reason using exec with -c and a command, the container can't see the redis port
# We also want to use --as-job here (testing the queuing), but for some reason using exec with -c and a command, the container can't see the redis port
# You can also exec into the container in a bash session, then define TOMORROW (and maybe add prices if not done yet) and run this commans with --as-job

echo "[TUTORIAL-RUNNER] displaying schedule..."
docker exec -it flexmeasures-server-1 bash -c "flexmeasures show beliefs --sensor-id 2 --start ${TOMORROW}T07:00:00+01:00 --duration PT12H"
docker exec -it flexmeasures-server-1 bash -c "flexmeasures show beliefs --sensor 2 --start ${TOMORROW}T07:00:00+01:00 --duration PT12H"

0 comments on commit b3592dd

Please sign in to comment.