Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci/cd] Optimize docker build #248

Open
2 tasks done
mdartic opened this issue Aug 24, 2023 · 1 comment · Fixed by #249
Open
2 tasks done

[ci/cd] Optimize docker build #248

mdartic opened this issue Aug 24, 2023 · 1 comment · Fixed by #249
Assignees
Labels
next Next version of LocoKit based on Feathers 5, Nuxt 3, ... Quality 💪 Improve the behaviour of existing features.
Milestone

Comments

@mdartic
Copy link
Member

mdartic commented Aug 24, 2023

@mdartic mdartic self-assigned this Aug 24, 2023
@mdartic mdartic added this to the 1.0.0-next milestone Aug 24, 2023
@mdartic mdartic added Quality 💪 Improve the behaviour of existing features. next Next version of LocoKit based on Feathers 5, Nuxt 3, ... labels Aug 24, 2023
@mdartic
Copy link
Member Author

mdartic commented Aug 25, 2023

So, after discussion with @kiorky, I try several things :

  • parallelization with matrix on platforms
    • an issue appears, with the build & push github action, the latest build is pushed and overwrite all previously images
    • a better idea of this could be the use of docker manifest to create a multi-arch manifest (https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/) AFTER all platforms are built
    • this could also help us if we want to test all built images (particularly arm32 ones)
    • the last step of the workflow could be the push of the tag with the multi-arch manifest
  • set the cache-from / cache-to
    • I don't see any improvements on build time
    • I let them for now and check if there is some benefits
  • move the docker build job in the api-quality workflow to reuse build artifacts
    • this is the main shift, as it cut off the build time from one hour to ~6mn
    • and this, without the use of matrix as it breaks the push of multi-arch images

Initial time:

https://github.com/locokit/locokit/actions/runs/5923472268

Image

After use of parallelization with matrix on platforms:

https://github.com/locokit/locokit/actions/runs/5965675095

Image

After shifting docker build in the api quality workflow:

with parallelization (and issue when pushing tag to hub.docker.com)

https://github.com/locokit/locokit/actions/runs/5966002861

Image

without parallelization (and no issue on push)

https://github.com/locokit/locokit/actions/runs/5966049744

Image

For now, we'll stay on what is in the PR, so :

  • shift of the docker build in the api quality workflow
  • reuse of build artifacts for docker build
  • no matrix / parallelization by platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next Next version of LocoKit based on Feathers 5, Nuxt 3, ... Quality 💪 Improve the behaviour of existing features.
Projects
Status: To be released
Development

Successfully merging a pull request may close this issue.

1 participant