Open stefanleminh opened 2 years ago
We might not need additional caching libraries for this - because we have a multistage building process for the docker images we may use the caching functionality of Docker itself, to skip the steps of downloading the dependencies each time we execute a build, by simply modifying the Dockerfiles.
A reference for maven: https://www.baeldung.com/ops/docker-cache-maven-dependencies
Quick note - although the solution works locally, because of the caching of the locally ran instance of Docker, it doesn't for github. Most probably they don't leave any dangling artefacts after completion of each build so they could save space(or creating a temporary vm for the build only, which is destroyed after completion). Carrying on with trying the original idea of using caching of artifacts from Stefan.
Adding changes with caching of Docker layers on github actions + local caching. Some results:
Cypress Worst case scenario(changes in poms for marketplace service, admin-ui and authentication service) - 9:43 Non-dependency changes for marketplace service, admin-ui and authentication service + cache - 8:50 - Times are actually most dependent on admin-ui. There Vaadin library is at fault, because it needs the compiled java project to decide which dependencies to download No changes for marketplace service, admin-ui or authentication service + cache - 5:50
Frontend + deploy: Worst-case scenario(changes to package.json of main project or any webcomponent + deployment) - 10:00 Non dependency changes + cache - 8:20
Marketplace service + deploy: Worse case scenario(changes in pom.xml + deployment) - 4:47 Non dependency changes + cache - 2:00
Quick notes for Github caching as of time of writing:
Some links for future docs when wiki is up:
Dokumentation in wiki will be done as soon as wiki is available.
Link to technical document on akros wiki: https://wiki.akros.ch/display/TO/Docker+layers+and+Github+Actions+caching
Currently neither Docker-Containers, no mvn or npm dependencies get cached. This results in relatively long build-times in Github Actions, especially with Cypress building the entire docker-compose infrastructure and the UI building the UI and the webcomponents.
Fortunately, Github Actions provide a way to cache these artifacts. This should be implemented in this ticket.