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

feat: Refactor Dockerfile to better support new DevOps scenarios with Container App Jobs #18

Merged
merged 58 commits into from
Mar 1, 2024

Conversation

Krusty93
Copy link
Contributor

@Krusty93 Krusty93 commented Feb 23, 2024

Please check out comments below

List of Changes

Refactor Dockerfile to make the build immutable and environment agnostic. Multi layer to use cache.
Add .dockerignore
Update pipelines to use standard tags and cache (44 seconds build!!!)
Update docker compose file

Motivation and Context

Pipelines do not need to create custom container apps with this image but they can use container app jobs in serverless mode. Jobs can monitors github repositories and be triggered when a pipelines starts.

How Has This Been Tested?

3 months of testing in IO

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@Krusty93 Krusty93 changed the title Dockerfile v2 feat: Refactor Dockerfile to better support new DevOps scenarios with Container App Jobs Feb 23, 2024
@Krusty93
Copy link
Contributor Author

Current image's size is more than 2gb and containers need some time to start because of it - even if the dockerfile of this PR is multistage and multiple parallel downloads happen.

My proposal is to remove the following tools:

  • az cli
  • kubectl
  • helm
  • yarn
  • nodejs
  • yq
  • vim
  • python

Why? Because pipelines which need specific tools can install them, there are plenty of official and not official actions available on the marketplace - or we can build them on our own. Moreover, Dockerfile doesn't need to be updated with the latest tool version (i.e. nodejs actually sticks to v20).

Furthermore, we already install things as a part of the pipeline's jobs. If a pipeline doesn't do it, it is actually an easy fix.

Current draft PR contains some comments about each stage size in terms of megabytes, check them out.

Dockerfile Show resolved Hide resolved
@Krusty93 Krusty93 marked this pull request as ready for review February 26, 2024 08:48
@Krusty93 Krusty93 requested a review from a team as a code owner February 26, 2024 08:48
Dockerfile Outdated Show resolved Hide resolved
@pasqualedevita
Copy link
Member

pasqualedevita commented Feb 26, 2024

Current image's size is more than 2gb and containers need some time to start because of it - even if the dockerfile of this PR is multistage and multiple parallel downloads happen.

My proposal is to remove the following tools:

  • az cli
  • kubectl
  • helm
  • yarn
  • nodejs
  • yq
  • vim
  • python

Why? Because pipelines which need specific tools can install them, there are plenty of official and not official actions available on the marketplace - or we can build them on our own. Moreover, Dockerfile doesn't need to be updated with the latest tool version (i.e. nodejs actually sticks to v20).

Furthermore, we already install things as a part of the pipeline's jobs. If a pipeline doesn't do it, it is actually an easy fix.

Current draft PR contains some comments about each stage size in terms of megabytes, check them out.

If you need to use github self hosted runner to connect to azure, it's quite sure that you need az cli :) If you don't use az cli on self hosted runner probably you don't need a self hosted runner

I agree to purge:

  • node
  • python
  • vim

@Krusty93
Copy link
Contributor Author

Current image's size is more than 2gb and containers need some time to start because of it - even if the dockerfile of this PR is multistage and multiple parallel downloads happen.
My proposal is to remove the following tools:

  • az cli
  • kubectl
  • helm
  • yarn
  • nodejs
  • yq
  • vim
  • python

Why? Because pipelines which need specific tools can install them, there are plenty of official and not official actions available on the marketplace - or we can build them on our own. Moreover, Dockerfile doesn't need to be updated with the latest tool version (i.e. nodejs actually sticks to v20).
Furthermore, we already install things as a part of the pipeline's jobs. If a pipeline doesn't do it, it is actually an easy fix.
Current draft PR contains some comments about each stage size in terms of megabytes, check them out.

If you need to use github self hosted runner to connect to azure, it's quite sure that you need az cli :) If you don't use az cli on self hosted runner probably you don't need a self hosted runner

I agree to purge:

  • node
  • python
  • vim

Done! we saved around 500mb

@Krusty93 Krusty93 merged commit 993856b into main Mar 1, 2024
6 checks passed
@Krusty93 Krusty93 deleted the dockerfile-v2 branch March 1, 2024 15:23
Copy link
Contributor

github-actions bot commented Mar 1, 2024

🎉 This PR is included in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants