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

tools: forcefully build without manifest checking #546

Merged
merged 1 commit into from
Jun 18, 2020
Merged

Conversation

reliveyy
Copy link
Collaborator

@reliveyy reliveyy commented Jun 18, 2020

This PR adds option -f and --force to tools/build command.

The redundant image pulling and tagging are also removed in this PR. See https://github.com/ExchangeUnion/xud-docker/pull/546/files#diff-8a792fef7c99bb820b9a2bbfe2d0d532L207-L212

@reliveyy reliveyy requested a review from raladev June 18, 2020 08:20
@reliveyy reliveyy self-assigned this Jun 18, 2020
@raladev
Copy link
Contributor

raladev commented Jun 18, 2020

if I understand correctly it should work in following way:

  • tools/build - check image existing in docker hub for each image -> exists (if it does not exist, do nothing) -> check sum of image -> build new if sum is old OR just tag pulled image
  • tools/build arby:latest - check image existing in docker hub -> exists (if it does not exist, move to build step) -> check sum of image -> build new if sum is old OR just tag pulled image
  • tools/build -f arby:latest - build the tag w/o any checks

For now:

  • tools/build returns nothing if there is no images in docker hub. (for example, when new branch in xud-docker is used). Solution: add output about docker hub checking and result of checking (no images in docker hub for this branch -> do nothing for tools/build call OR build image for tools/build arby call / image found, move to pulling);
  • no output for docker hub checking and result of checking as a result there is no difference between tools/build arby:latest and tools/build arby:latest -f for new branch. Solution: add info about image pulling step + info about skipping because of -f flag;
  • No use cases and examples for build/tools in README instead of tools/build. Difference in behavior of tools/build and tools/build arby confuses (for second one image will be built), so update of README is required + add info about force flag for tools/build arby -f case (because the flag does not work for tools/build -f call).

@reliveyy
Copy link
Collaborator Author

tools/build - check image existing in docker hub for each image -> exists (if it does not exist, do nothing) -> check sum of image -> build new if sum is old OR just tag pulled image

tools/build -> parse local git history and detect modifed images (details) -> check image with dockerhub registry -> missing or outdated -> real build

So tools/build may not interate over all images.

add output about docker hub checking and result of checking

FYI, you could inspect more details inside tools/tools.log. I used to print the details of modified images detection and dockerhub checking on the screen. But later I found out that I seldom look into these messages. So I think it is mainly used for debugging. Then I delete these messages to keep the build output clean recently.

But it is open to discuss of adding more details about the build like:

  • No images changed in current branch
  • Checking the existence of ... manifest on DockerHub registry
  • Checking if the mainfest is up-to-date

BTW, if the build is skipped, a message will be printed in this PR:

Image is up-to-date. Skip building.

there is no difference between tools/build arby:latest and tools/build arby:latest -f for new branch

As I said above, you could find the differences in tools/tools.log. And besides the log file, tools/build -f is a little bit faster than tools/build.

No use cases and examples for build/tools in README instead of tools/build

Indeed. I'll add help docs about tools/build, tools/push, tools/test command later in another PR. And I add this PR only because I need to test #549 locally. If I run tools/build without -f then I will always get build command skipped locally.

add info about force flag for tools/build arby -f case (because the flag does not work for tools/build -f call).

I didn't get it why -f doesn't work in your case. Or is it just because there is no remarkable output text differences? @raladev

@raladev
Copy link
Contributor

raladev commented Jun 18, 2020

Q: What is the behaviour of tools/build -f for new branch in xud-docker repo?
A (from @reliveyy): What images to build for this command based on modified images detection. So could be nothing or something.
But -f option will skip the dockerhub manifest checking (for existence and version) for all the images from modified images detection

@raladev raladev merged commit a99814f into master Jun 18, 2020
@raladev raladev deleted the force-build branch June 18, 2020 13:30
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.

2 participants