ocean-data-factory-sweden / kso

Notebooks to upload/download marine footage, connect to a citizen science project, train machine learning models and publish marine biological observations.
GNU General Public License v3.0
5 stars 12 forks source link

[build-and-test-container] add check-strategy + fix syntax if statement #240

Closed Diewertje11 closed 1 year ago

Diewertje11 commented 1 year ago
[build-and-test-container] add check-strategy + fix syntax

This commit contains 2 things:
* Correct the syntax of the if statement in the build docker part. Also,
  this if statement is now temporarily commented out, see notion below.
* Add check-strategy: The logic is that when nothing has been changed to
  the docker/requirement files, we want to update the master docker so
  that it contains the correct code, but we do not want to rebuild the
  whole docker image, since this takes a lot of time. This check
  strategy allows for that optimisation, by returning update instead of
  rebuild. The build-and-push action is then replaced by the two
  separate steps, where we can pull in the current docker image and copy
  in the new code.
  NOTE THAT THIS IS AN HACK. It causes the image size to increase every
  time we update an image. However, it might be the fastest solution and
  for now it is the easies. See issue #244 for more info.

  Also note that currently, since the if-statement is commented out, this
  happens for all branches, which is what we want to speed up the
  process of creating new docker environments for Emil to test things
  out. After the Notion below is resolved, this will only happen for the
  master image.

NOTE:
When we move to a stable master branch and Emil does not need to test
things anymore on the dev branch, we need to add back in the if
statement in the build, so that we only rebuild on changes or when we
push to master.