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

fast_build.add always shows ADD . / in logs #971

Closed
johnboiles opened this issue Jan 10, 2019 · 5 comments
Closed

fast_build.add always shows ADD . / in logs #971

johnboiles opened this issue Jan 10, 2019 · 5 comments

Comments

@johnboiles
Copy link

I'm noticing that using fast_build.add I'm always getting ADD . / in the logs, no matter what arguments I pass into fast_build.add. It's pretty minor since it appears everything does get copied in as expected, it was just confusing. I would expect to see something like ADD /path/to/source /path/in/container.

> tilt version
v0.4.2, built 2019-01-09
@maiamcc
Copy link
Contributor

maiamcc commented Jan 10, 2019

Hi @johnboiles -- good call, it hadn't occurred to me that this log output could be confusing, but you're totally right! We'll look into whether this can be clarified at all, but know that this is currently expected behavior.

In case you're curious about why this is happening (feel free to ignore this if not):

This is a side-effect of the way we do fast builds. We tar up all your files ourselves, in a format that matches the way we want to un-tar them, and generate a Dockerfile and run it with our homemade tar file as the build context.

So if you call .add(/path/to/source, /path/in/container), we create a tar archive such that all the files in /path/to/source live in the directory /path/in/container. The Dockerfile we generate just has a single add statement: ADD . / -- but because of the way we tar'd everything up, this will unpack everything into the right place on the container.

Hope that makes sense! (If it doesn't and you're still curious about how this all works under the hood, I'm happy to answer more questions.)

@johnboiles
Copy link
Author

Thanks for the explanation! Feel free to close the ticket if you think that’s appropriate.

In my case I had a typo in my run command that made it appear like my files weren’t getting copied in. The ADD log line seemed to confirm this hypothesis so I ended up burning a little time checking that files were copied before I found the real issue

@maiamcc
Copy link
Contributor

maiamcc commented Jan 10, 2019

Threw something together -- turns out it's more annoying than it should be to print that ADD statement with something like

# we tarred up everything so it ends up in the right place in your container, promise
ADD . /

😕 so, seems like this is the next best thing (added some logging that you can get by running tilt with the --verbose flag). @johnboiles does this seem like it would have been helpful to have?

──┤ Building: fe ├──────────────────────────────────────────────
STEP 1/2 — Building from scratch: [gcr.io/windmill-public-containers/servantes/fe]
  │ Tarring context…
    ╎ /Users/maia/code/prog/src1 --> /path/in/container/1
    ╎ /Users/maia/code/prog/src2 --> /path/in/container/2
    ╎ Created tarball (size: 24 MB)
  │ Building image
    ╎ [1/6] FROM docker.io/library/golang:1.10
    ╎ [2/6] RUN apt update && apt install -y unzip time make
    ╎ [3/6] RUN wget https://github.com/google/protobuf/releases/download/...
    ╎ [4/6] RUN go get github.com/golang/protobuf/protoc-gen-go
    ╎ [5/6] ADD . /
    ╎ [6/6] RUN go install github.com/windmilleng/servantes/fe
...

If so, we'll add it in. If not, we'll drop it :)

@jazzdan
Copy link
Contributor

jazzdan commented Jan 10, 2019

Maybe it would help to make it more clear that this is docker output, for debugging/showing progress, and not "tilt" output? WDYT?

@maiamcc
Copy link
Contributor

maiamcc commented Jan 15, 2019

We added some code to at least give a little more visibility into what's going on if you run tilt in --verbose mode -- going to close this issue. Thanks for the report!

@maiamcc maiamcc closed this as completed Jan 15, 2019
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

No branches or pull requests

3 participants