Skip to content

Docker - j/Jobs ARG To Reduce Build Time - #241

Closed
amcrn wants to merge 1 commit into
meta:masterfrom
amcrn:enh/make-jobs-arg
Closed

amcrn wants to merge 1 commit into
meta:masterfrom
amcrn:enh/make-jobs-arg

Conversation

@amcrn

@amcrn amcrn commented Mar 28, 2018 •

Copy link
Copy Markdown

Context: With Docker 1.9+ (since Nov 2015), ARG can be used to
provide build-time arguments.

The mcrouter Dockerfile does not support the ability to provide
a build-time argument for the number of make jobs. Why this
matters:

vCPU -j arg passed Time Elapsed
2 none 27m26.955s
2 -j2 18m20.238s
4 -j4 11m34.981s

If -j is set to the number of vCPUs, the time it takes to build
mcrouter decreases significantly.

$ docker build -t mcrouter /home/amcrn/mcrouter/mcrouter/scripts/docker

would still default to -j1, whereas:

$ docker build --build-arg MAKE_JOBS=4 -t mcrouter \
    /home/amcrn/mcrouter/mcrouter/scripts/docker

would use -j4.

Closes: #97

Context: With Docker 1.9 (Nov 2015), ARG can be used to provide
build-time arguments.

The mcrouter Dockerfile does not support the ability to provide
a build-time argument for the number of `make` jobs. Why this
matters:

| vCPU | -j arg passed | Time Elapsed |
| --- | --- | --- |
| 2 | none | 27m26.955s |
| 2 | -j2 | 18m20.238s |
| 4 | -j4 | 11m34.981s |

If `-j` is set to the number of vCPUs, the time it takes to build
mcrouter decreases significantly.

```
$ docker build -t mcrouter /home/amcrn/mcrouter/mcrouter/scripts/docker
```

would still default to `-j1`, whereas:

```
$ docker build --build-arg MAKE_JOBS=4 -t mcrouter \
    /home/amcrn/mcrouter/mcrouter/scripts/docker
```

would use `-j4`.

Closes: #97
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@amcrn

amcrn commented May 24, 2018

Copy link
Copy Markdown
Author

Hey @andreazevedo , sorry for the direct ping, but would you (or someone on your team) mind reviewing this? I signed the CLA much later after sending the pull request, so I think this fell off the radar. Thanks!

@amcrn

amcrn commented Nov 7, 2019

Copy link
Copy Markdown
Author

Largely addressed by e89989e

@amcrn amcrn closed this Nov 7, 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.

Make -j/Jobs ARG For Dockerfile To Cut Down On Build Time

2 participants