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

[Infra] Introduced multi stage build for images to improve built time #1079

Merged
merged 2 commits into from
Oct 27, 2024

Conversation

erikzaadi
Copy link
Member

@erikzaadi erikzaadi commented Oct 15, 2024

Description

Docker build improvements

What -

  • Remove the Github Action docker cache
  • Separate builder and runner images to prebuilt images to save time when releasing integrations
  • DRY up Github actions a bit (extract common docker build to composite action)

Why -

Releasing integrations took over 2 hours (!)

Type of change

Please leave one option from the following and delete the rest:

  • Non-breaking change (fix of existing functionality that will not change current behavior)

@erikzaadi erikzaadi force-pushed the PORT-10788 branch 7 times, most recently from 3ad1866 to 4547355 Compare October 15, 2024 15:03
@github-actions github-actions bot added size/S and removed size/XS labels Oct 15, 2024
@erikzaadi erikzaadi force-pushed the PORT-10788 branch 3 times, most recently from 0085ab3 to 1355b12 Compare October 20, 2024 09:14
@github-actions github-actions bot added size/M and removed size/S labels Oct 20, 2024
@erikzaadi erikzaadi force-pushed the PORT-10788 branch 4 times, most recently from a1e22c0 to ddda5b6 Compare October 20, 2024 09:54
@github-actions github-actions bot added size/L and removed size/M labels Oct 20, 2024
@erikzaadi erikzaadi requested a review from a team as a code owner October 20, 2024 13:57
@erikzaadi erikzaadi changed the title No more github action cache for docker builds No more github action cache for docker build + separate runner and builder images Oct 21, 2024
Copy link
Contributor

@Tankilevitch Tankilevitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, left some comments 🌊

Comment on lines 44 to 46
# - name: Setup docker (missing on MacOS)
# if: matrix.platform == 'linux/arm64'
# uses: douglascamata/setup-docker-macos-action@v1-alpha
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mistake?

@@ -0,0 +1,12 @@
ARG BASE_PYTHON_IMAGE=debian:trixie-slim
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we choose specific python version? or atleast add a comment about what is the python version used here

@@ -57,24 +52,13 @@ jobs:
needs: [prepare-matrix]
strategy:
# limit the number of parallel jobs to avoid hitting the ghcr.io rate limit
max-parallel: 5
max-parallel: 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it still within the rate limit treshold?

detect-changes:
uses: ./.github/workflows/detect-changes-matrix.yml
build-infra:
# runs-on: ${{ matrix.platform == 'linux/arm64' && 'macos-13' || 'ubuntu-latest' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment on lines 99 to 101
skip-push: 'yupp'
tags: ${{ steps.enrich-version.outputs.image_tag }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
load-created-image: 'yupp'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yupp?

docker run --platform ${{ matrix.platform }} --rm --entrypoint bash "${SINGLE_TAG}" -c 'ocean version'
docker-user: ${{ secrets.DOCKER_MACHINE_USER }}
docker-password: ${{ secrets.DOCKER_MACHINE_TOKEN }}
skip-push: 'yupp'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yupp?

@Tankilevitch Tankilevitch changed the title No more github action cache for docker build + separate runner and builder images [Infra] Introduced multi stage build for images to improve built time Oct 27, 2024
Copy link
Contributor

@Tankilevitch Tankilevitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please adjust small comments

build-integration:
runs-on: ubuntu-latest
runs-on: 'ubuntu-latest'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
runs-on: 'ubuntu-latest'
runs-on: ubuntu-latest

@@ -1,7 +1,6 @@
name: Build integration images
on:
pull_request:
workflow_dispatch:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to be able to run it manually?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build-infra-images

@erikzaadi erikzaadi merged commit 95003b9 into main Oct 27, 2024
17 checks passed
@erikzaadi erikzaadi deleted the PORT-10788 branch October 27, 2024 08:46
mk-armah pushed a commit that referenced this pull request Oct 30, 2024
# Description

What -  Add `openssl` certificates to image

Why - As part of separation of the images in #1079 the openssl
installation was missed for the deb image

How -

## Type of change

Please leave one option from the following and delete the rest:

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] New Integration (non-breaking change which adds a new integration)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Non-breaking change (fix of existing functionality that will not
change current behavior)
- [ ] Documentation (added/updated documentation)

<h4> All tests should be run against the port production
environment(using a testing org). </h4>

### Core testing checklist

- [ ] Integration able to create all default resources from scratch
- [ ] Resync finishes successfully
- [ ] Resync able to create entities
- [ ] Resync able to update entities
- [ ] Resync able to detect and delete entities
- [ ] Scheduled resync able to abort existing resync and start a new one
- [ ] Tested with at least 2 integrations from scratch
- [ ] Tested with Kafka and Polling event listeners
- [ ] Tested deletion of entities that don't pass the selector


### Integration testing checklist

- [ ] Integration able to create all default resources from scratch
- [ ] Resync able to create entities
- [ ] Resync able to update entities
- [ ] Resync able to detect and delete entities
- [ ] Resync finishes successfully
- [ ] If new resource kind is added or updated in the integration, add
example raw data, mapping and expected result to the `examples` folder
in the integration directory.
- [ ] If resource kind is updated, run the integration with the example
data and check if the expected result is achieved
- [ ] If new resource kind is added or updated, validate that
live-events for that resource are working as expected
- [ ] Docs PR link [here](#)

### Preflight checklist

- [ ] Handled rate limiting
- [ ] Handled pagination
- [ ] Implemented the code in async
- [ ] Support Multi account

## Screenshots

Include screenshots from your environment showing how the resources of
the integration will look.

## API Documentation

Provide links to the API documentation used for this integration.
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.

2 participants