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

Use cloud build to build images instead #1923

Merged
merged 3 commits into from
Aug 23, 2019

Conversation

Bobgy
Copy link
Contributor

@Bobgy Bobgy commented Aug 22, 2019

Switched to use cloud build for building images.
I tested this could reduce image building time from 18m to ~10m.
Also, image building can be happening at the same time as cluster set up. This will save a lot of time.

/assign @IronPan


This change is Reviewable

IMAGES_BUILDING=true
CLOUD_BUILD_COMMON_ARGS=(. --async --format='value(id)' --substitutions=_GCR_BASE=${GCR_IMAGE_BASE_DIR})
# Use faster machine because this is CPU intensive
BUILD_ID_API_SERVER=$(gcloud builds submit ${CLOUD_BUILD_COMMON_ARGS[@]} \
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to combine these steps to a single file?
cloud build seems support parallel execution
waitFor: ['-']

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I also tried that.
There are some tradeoffs using waitFor: ['-']:

  • [major] slower because cloud build will run all the image builds in one machine, they compete for resources. Time taken is ~9min -> ~12min. Consider that we may need to build more images later. I think current approach is better. (or I can batch 3 image builds and only let api-server use a single job)
  • [minor] log will interleave for 4 builds, a little harder to read

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer

  • batch the 3 fast image builds
  • let api-server image build still be standalone

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made corresponding changes.

Copy link
Member

Choose a reason for hiding this comment

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

SG. BTW with this change #1904 I'm not sure if building api-server images still consumes lots of resources. the change removed most of the dependencies such as tensorflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the heads up. I will take a look and change if building api-server is faster.

@IronPan
Copy link
Member

IronPan commented Aug 23, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IronPan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit fe8d96f into kubeflow:master Aug 23, 2019
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.

4 participants