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] Speed up check_images_exist #18873

Merged
merged 3 commits into from
Nov 3, 2022

Conversation

perangel
Copy link
Contributor

@perangel perangel commented Nov 2, 2022

What

Small performance optimization for how we check for the existence of images in tools/bin/check_images_exist.sh.

# old
./tools/bin/check_images_exist.sh all 6.31s user 3.50s system 4% cpu 3:35.97 total

# new
./tools/bin/check_images_exist.sh all  3.56s user 2.21s system 6% cpu 1:29.55 total

NOTE: The best-case scenario (no rate limit) we can get it down to ~30s

How

  • We use docker compose pull to verify if an image referenced in a docker compose file exists
  • Some of our images approach ~1Gb in size
  • We can verify if an image exists by just calling the dockerhub API instead of performing a docker pull

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@perangel perangel temporarily deployed to more-secrets November 2, 2022 20:04 Inactive
@supertopher supertopher requested a review from a team November 2, 2022 20:26
@perangel perangel temporarily deployed to more-secrets November 2, 2022 20:35 Inactive
Copy link
Contributor

@supertopher supertopher left a comment

Choose a reason for hiding this comment

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

Looks fantastic @perangel

Copy link
Contributor

@git-phu git-phu left a comment

Choose a reason for hiding this comment

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

looks good!

Now I'm curious though about why we were pulling platform images to begin with.

@davinchia do you have any extra context around why we were pulling platform images to verify they exist instead of just checking the API response (which is what we already do for connector images anyway)?

@supertopher
Copy link
Contributor

ran locally. output for others

√ airbyte $ ./tools/bin/check_images_exist.sh all
./tools/bin/check_images_exist.sh:20: set +o xtrace
checking images for: all
Checking platform images exist...
	airbyte/init: 0.40.18
	URL: https://hub.docker.com/v2/repositories/airbyte/init/tags/0.40.18
	STATUS: found

	airbyte/bootloader: 0.40.18
	URL: https://hub.docker.com/v2/repositories/airbyte/bootloader/tags/0.40.18
	STATUS: found

	airbyte/db: 0.40.18
	URL: https://hub.docker.com/v2/repositories/airbyte/db/tags/0.40.18
	STATUS: found

	airbyte/worker: 0.40.18
	URL: https://hub.docker.com/v2/repositories/airbyte/worker/tags/0.40.18
	STATUS: found

	airbyte/server: 0.40.18
	URL: https://hub.docker.com/v2/repositories/airbyte/server/tags/0.40.18

<more lines here>


	airbyte/source-firebolt: 0.1.0
	URL: https://hub.docker.com/v2/repositories/airbyte/source-firebolt/tags/0.1.0
	STATUS: found

	airbyte/source-elasticsearch: 0.1.0
	URL: https://hub.docker.com/v2/repositories/airbyte/source-elasticsearch/tags/0.1.0
	STATUS: found

	airbyte/source-waiteraid: 0.1.0
	URL: https://hub.docker.com/v2/repositories/airbyte/source-waiteraid/tags/0.1.0
	STATUS: found

	airbyte/source-yandex-metrica: 0.1.0
	URL: https://hub.docker.com/v2/repositories/airbyte/source-yandex-metrica/tags/0.1.0
	STATUS: found

	airbyte/source-zoom: 0.1.0
	URL: https://hub.docker.com/v2/repositories/airbyte/source-zoom/tags/0.1.0
	STATUS: found

Success! All connector images exist!
Image check complete.

@perangel perangel merged commit c5936b0 into master Nov 3, 2022
@perangel perangel deleted the perangel/perf-ci/speed-up-image-checks-for-compose branch November 3, 2022 02:02
letiescanciano added a commit that referenced this pull request Nov 3, 2022
* master: (38 commits)
  New Source: Gridly (#18342)
  🎉 New Source: Alpha Vantage (#18320)
  ci_integration_test.sh: cut GITHUB_STEP_SUMMARY (#18895)
  🎉 New Source: Datadog [python cdk] (#18150)
  Hide Reject all button in consent dialog (#18596)
  feat: add doc url to track event (#18690)
  fix: install java in oss catalog deploy action (#18887)
  [CI] Speed up check_images_exist (#18873)
  Extract open API (#18879)
  Remove unused interfaces (#18880)
  add action for deploying oss connector catalog to GCS (#18633)
  feat: generate full connector catalog json (#18562)
  Add unsupported_protocol_version column to Connection (#18876)
  Extract OAuth API (#18818)
  update images to have non-transparent background (#18874)
  DiscoverSchema endpoints calculates diff and breaking change (#18571)
  Validate protocol version on connector update (#18639)
  Bmoric/extract notification api (#18812)
  Show version and changelog status for affected connectors (#18845)
  Bmoric/extract logs api (#18621)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants