Comments (5)
astroilov points out correctly that the other alternative approach here is to excise the internal docker bits from current extractrepo binary.
Right now it's fairly baked in, and pulling it out wouldn't be pretty. In particular given the dynamic generation of the ephemeral dockerfile it produces, we'd need to have separate running steps there: running docker image that just takes config as input and generates an ephemeral dockerfile, and then something to run that resulting dockerfile.
I don't see a super clean approach either way.
from kythe.
Behind door A, investigating the extent to which dind will work for us:
FROM docker:dind
ADD extractrepo extractrepo
ENTRYPOINT ["/extractrepo"]
I'm having some normal docker mechanical difficulties in dealing with input/output, but my initial guess is that's purely because I don't know how to hold this tool properly, not because of any problems with dind.
from kythe.
^ Nope actually I'm wrong. My problem is still dind, not because of holding input/output:
$ docker run -i -t -v ~/code/testrepo:/inputrepo -v /tmp/dockertest:/outputrepo test-extract -local /inputrepo --output /outputrepo
2018/06/14 19:35:55 Using configuration file: ""
2018/06/14 19:35:55 Failed to clean up docker image: exit status 1
2018/06/14 19:35:55 Failed to extract repo: building docker image: exit status 1
Command output time="2018-06-14T19:35:55Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory"
context canceled
dang
from kythe.
Ok well:
$ docker run -i -t -v ~/code/testrepo:/inputrepo -v /tmp/dockertest:/outputrepo -v /var/run/docker.sock:/var/run/docker.sock test-extract -local /inputrepo --output /outputrepo
2018/06/14 19:40:19 Using configuration file: ""
2018/06/14 19:40:21 Failed to extract repo: extracting repo: exit status 1
Command output: cp: cannot stat 'pom.xml': No such file or directory
That might be much closer (probably just failed to copy the repo in properly because this is literally the first time I've ever tried to pass data into docker.
from kythe.
Ok update - docker in docker sort of works. There's complications in mapping 1st-layer container volumes to the 2nd-layer innermost container. That can be hacked around with e.g.:
$ - outside
/ # - inside first container
# - inside innermost container
(/tmp/testdocker/Dockerfile is just a dummy docker file to show proof of concept, it would be replaced with the extractrepo generated Dockerfile)
$ docker run --entrypoint "sh" -i -t --volume /tmp/repodir -v ~/code/craigtest:/inputrepo -v /tmp/dockertest:/output -v/tmp/testdocker:/buildstuff -v /var/run/docker.sock:/var/run/docker.sock test-extract
/ # docker build -t bad-test /buildstuff
/ # echo 'fake repo' > /tmp/repodir/notarealrepo
/ # export UNSPEAKABLETHINGS=`cat /proc/self/cgroup | grep 'docker/' | tail -1 | awk -F "/" '{print $3}' | cut -c 1-12`
/ # docker run -i -t --entrypoint "sh" --volumes-from $UNSPEAKABLETHINGS bad-test
# cat /tmp/repodir/notarealrepo
fake repo
This will need a modification to extractrepo binary to configure the temp repo dir from output, since the specific volume has to be mapped at container create time. However we have flexibility here and can just name it whatever we want.
Also I think we're still strongly leaning towards not doing docker-in-docker for medium term. This is just a temporary hack.
from kythe.
Related Issues (20)
- ERROR: no such package '@io_kythe//kythe/data': The repository '@io_kythe' could not be resolved: Repository '@io_kythe' is not defined HOT 1
- CloudDataflowSDK example project: now archived and empty HOT 2
- Catch obvious type errors during elaboration
- Error recovery can lead to ungrounded variables HOT 1
- `using` template names with aliasing on does not work as expected
- C++ indexer tests should not use empty corpus values
- Add allowlist for goals from file nodes HOT 3
- Support Clang VFS overlay in extraction/indexing HOT 1
- Add more well-formedness checks to the verifier HOT 3
- Update switch statements for the new clang::TemplateArgument::StructuralValue value
- Use `denotes` for C++ gflags support
- KytheInlineMetadataLoader doesn't follow rules of MappingRule
- Support multiple goal patterns in verifier
- cc_index rule doesn't set log level correctly HOT 4
- Decorate bound variables in Java patterns
- C++ implicit members should be implicit HOT 2
- Decorations not found for several files in Bazel HOT 1
- protobuf: emit typed edges for RPCs
- Compilation failures in boringssl HOT 5
- [Bazel CI] FATAL: Bazel crashed due to an internal error while evaluating node HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kythe.