Skip to content

dist: optimize build script and Dockerfile#22

Merged
steveej merged 3 commits into
openshift:masterfrom
steveej-forks:improve-build-deploy
Dec 4, 2018
Merged

dist: optimize build script and Dockerfile#22
steveej merged 3 commits into
openshift:masterfrom
steveej-forks:improve-build-deploy

Conversation

@steveej
Copy link
Copy Markdown
Contributor

@steveej steveej commented Dec 4, 2018

This change removes the overhead of sending the whole target directory
to the Docker daemon as the build context. Instead we can create a
mininum build context which contains only the desired static binaries.

Also removes the obsolete runtime deps.

/cc @riuvshin

@openshift-ci-robot
Copy link
Copy Markdown

@steveej: GitHub didn't allow me to request PR reviews from the following users: riuvshin.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

This change removes the overhead of sending the whole target directory
to the Docker daemon as the build context. Instead we can create a
mininum build context which contains only the desired static binaries.

/cc @riuvshin

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 4, 2018
Comment thread dist/build_deploy.sh Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this will lead to workspace growing with every new build, I would like to overwrite all generated files or clean-up after the build

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, isn't the CI job spawned with a clean workspace?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no, this one has static slaves.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a cleanup trap, PTAL

This change removes the overhead of sending the whole target directory
to the Docker daemon as the build context. Instead we can create a
mininum build context which contains only the desired static binaries.
@steveej steveej force-pushed the improve-build-deploy branch from 7dbf7dc to fbc9981 Compare December 4, 2018 14:27
@steveej steveej changed the title dist: send only binaries as docker build context dist: optimize build script and Dockerfile for speed and size Dec 4, 2018
@steveej
Copy link
Copy Markdown
Contributor Author

steveej commented Dec 4, 2018

[test]

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 4, 2018
@steveej steveej changed the title dist: optimize build script and Dockerfile for speed and size dist: optimize build script and Dockerfile Dec 4, 2018
@steveej
Copy link
Copy Markdown
Contributor Author

steveej commented Dec 4, 2018

triggering another build to test if subsequent builds now work. previously it failed to cleanup the workspace cause some leftover files were owned by root.

[test]

Comment thread dist/Dockerfile
FROM centos:7

RUN yum -y groupinstall 'Development Tools'
RUN yum -y install openssl-devel
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

have you tested resulting image with this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tested the steps from the docker-based stack outlined in #20 and it works as expected

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ideally our CI would test that ;-)

@steveej
Copy link
Copy Markdown
Contributor Author

steveej commented Dec 4, 2018

The two consecutive builds (6 and 7) were successful, I think this is good to go.

@riuvshin
Copy link
Copy Markdown
Contributor

riuvshin commented Dec 4, 2018

awesome!
/lgtm

@riuvshin
Copy link
Copy Markdown
Contributor

riuvshin commented Dec 4, 2018

[test]

1 similar comment
@riuvshin
Copy link
Copy Markdown
Contributor

riuvshin commented Dec 4, 2018

[test]

@riuvshin
Copy link
Copy Markdown
Contributor

riuvshin commented Dec 4, 2018

/lgtm

@openshift-ci-robot
Copy link
Copy Markdown

@riuvshin: changing LGTM is restricted to assignees, and only openshift/cincinnati repo collaborators may be assigned issues.

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@steveej
Copy link
Copy Markdown
Contributor Author

steveej commented Dec 4, 2018

I probably can't do it myself either ;-) but let's see

/lgtm

@openshift-ci-robot
Copy link
Copy Markdown

@steveej: you cannot LGTM your own PR.

Details

In response to this:

I probably can't do it myself either ;-) but let's see

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@steveej steveej merged commit fade171 into openshift:master Dec 4, 2018
@steveej steveej deleted the improve-build-deploy branch December 4, 2018 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants