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

airbyte-ci: multi arch build #32816

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Nov 27, 2023

What

We want to add a --architecture option to the connectors build command.
This will help users decide if they want to build single arch image are multi arch image locally, which has a significant execution time difference.

How

  • Expose a new --architecture option to `connectors build command
  • Set the default value to the current architecture
  • Refactor the related Steps to handle container variants if needed.

🚨 User Impact 🚨

  • Faster build by default; connector images will be built only for the user platform.
  • Enable multi-arch build for some use cases requiring it.

Manual testing:

* Pre-release publish still works

Copy link

vercel bot commented Nov 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Nov 29, 2023 10:36am

Copy link
Contributor Author

alafanechere commented Nov 27, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@alafanechere alafanechere marked this pull request as ready for review November 27, 2023 13:58
@alafanechere alafanechere requested a review from a team November 27, 2023 13:58
@alafanechere alafanechere force-pushed the augustin/11-24-airbyte-ci_multi_arch_build branch from a388429 to 8e625c4 Compare November 27, 2023 14:19
@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues connectors/source/faker and removed area/connectors Connector related issues labels Nov 27, 2023
@@ -17,10 +20,19 @@
default=False,
type=bool,
)
@click.option(
"-a",
"--architecture",
Copy link
Contributor

Choose a reason for hiding this comment

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

😍 much better name

@@ -53,6 +65,7 @@ async def build(ctx: click.Context, use_host_gradle_dist_tar: bool) -> bool:
ctx.obj["concurrency"],
ctx.obj["dagger_logs_path"],
ctx.obj["execute_timeout"],
build_platforms,
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we added this to the context instead? Lets test and publish reuse it

Copy link
Contributor Author

@alafanechere alafanechere Nov 28, 2023

Choose a reason for hiding this comment

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

I don't think architecture should be customized for test and publish.
If we'd want to run multiarch tests I think it should be handled at the test level and not with a customizable input.
Same idea for publish, I think we should always build and publish for all our supported architectures.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair opinion on this not being something we want customizable for publish/test

But I was thinking of moving this to the context so that the entry point for the information of "which platforms are we building for?"

So that if you learn in build that the archicture target comes from the context you can take that knowledge with you to publish and test

Its not too far away from how other configurations like docker hub crednetials, cdk_version, connector_acceptance_test_image and others are in the context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bnchrch I'm not sure which context you mean exactly.
Are we talking about the ConnectorContext, the ctx.obj, or the ClickPipelineContext?
I assume it's the ConnectorContext and I'll add it there. I can change it in a follow up PR if I'm wrong about your suggestion 😄

@@ -18,6 +18,10 @@ on:
type: string
default: ci-runner-connector-publish-large-dagger-0-6-4
required: true
airbyte-ci-binary-url:
Copy link
Contributor

Choose a reason for hiding this comment

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

😍

Copy link
Contributor

bnchrch commented Nov 28, 2023

Seems really close!

Just wanted to table the discussion on if we should hoist build_platforms to the context level

@alafanechere alafanechere force-pushed the augustin/11-24-airbyte-ci_multi_arch_build branch 2 times, most recently from b9866b0 to 619d58a Compare November 28, 2023 08:17
@alafanechere
Copy link
Contributor Author

@bnchrch I added a couple of tests

Just wanted to table the discussion on if we should hoist build_platforms to the context level

I'd prefer to not propagate build_platforms to the context level as it's currently a build command only option.
IMO local build is the single place where we should allow users to customize which architecture get built.
Architectures used for test and publish should be hardcoded (using the BUILD_PLATFORM const).

@alafanechere alafanechere requested a review from bnchrch November 28, 2023 10:48
Copy link
Contributor

@bnchrch bnchrch left a comment

Choose a reason for hiding this comment

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

Going to preapprove since your on long before I am!

But I left some follow up on the context idea.

The context object being a configuration object is something we already do and would likely go a long way in establishing common behaviours devs can take with them around our codebase.

We can still hardcode the build platforms for test/publish. It would just happen when we instantiate the context class.

@alafanechere alafanechere force-pushed the augustin/11-24-airbyte-ci_multi_arch_build branch from 6ddff0c to bac3e2f Compare November 29, 2023 10:12
@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues connectors/destination/duckdb and removed area/connectors Connector related issues labels Nov 29, 2023
@alafanechere alafanechere force-pushed the augustin/11-24-airbyte-ci_multi_arch_build branch from 7054179 to f64a96a Compare November 29, 2023 10:24
@alafanechere alafanechere enabled auto-merge (squash) November 29, 2023 10:30
@alafanechere alafanechere force-pushed the augustin/11-24-airbyte-ci_multi_arch_build branch from f64a96a to 7c8a6af Compare November 29, 2023 10:36
@alafanechere alafanechere merged commit 965ed21 into master Nov 29, 2023
21 checks passed
@alafanechere alafanechere deleted the augustin/11-24-airbyte-ci_multi_arch_build branch November 29, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants