gen
gen copied to clipboard
docker container based infrastructure
I created this issue from @zimmski reply. https://github.com/go-clang/gen/issues/117#issuecomment-246612962
I don't know go-clang dev's actual developing flow. That is write code on the local environment, and test using Vagrant? or all works on the local environment? Anyway, v3.9 can not CI test... So I have slightly fixed the Dockerfile that was for my personal. based by sbinet's PR. Very roughly.
It can build the LLVM version 3.8 ~ 4.0
, also with the -msan
testing.
Here the travis results and sample repository.
- gen with
v3.9
andv4.0
- https://travis-ci.org/zchee/go-clang-gen/builds/159643917
- https://github.com/zchee/go-clang-gen/tree/docker-infra
- bootstrap with
v4.0
- https://travis-ci.org/zchee/go-clang-bootstrap/builds/159654567
- https://github.com/zchee/go-clang-bootstrap/tree/docker-infra
- v3.8 with
-race
test- https://travis-ci.org/zchee/go-clang-v3.8/builds/159652079
- https://github.com/zchee/go-clang-v3.8/tree/docker-v3.8
- v3.9 with
-msan
test (-msan
warninng will failed CI, use|| true
)- https://travis-ci.org/zchee/go-clang-v3.9/builds/159652864
- https://github.com/zchee/go-clang-v3.9/tree/docker-v3.9
It can test on clean Linux environment (now use ubuntu/xenial
. sorry, not trusty
) with the make docker-test
or make ci
.
Can CI testing with the no limit, related apt package whitelist.
Needs to maintain them is the only goclang/base
image. The each version automatically setup by $LLVM_VERSION
env using ONBUILD
.
It might be a good idea with use the hub.docker.com
web hook.
Each repo has Dockerfile.base
because I can not upload docker image to the hub.docker.com
.
But maybe not corresponding to the switching version scripts. And little hacky and confusing (travis cache, use ONBUILD
, etc)
This was my hobby of through today from yesterday ;) I want to always the same test results because I use macOS. That is little different the Linux.
If you don't like it, no problem. Please closing this issue. but if you interested it, I will rewrite along your request. Thanks for great Clang interface.
There is an open PR of @sbinet https://github.com/go-clang/gen/pull/103 which is of the go-clang items I want to finish this week. It would be good if we can combine both efforts. Have you taken a look at that PR?
The development process is described in the README of the gen
repository starting from here https://github.com/go-clang/gen#how-to-contribute Basically we are using a Vagrant based VM to compile and test, but git commands should be executed outside of Vagrant. It would be ideal if we could switch to Docker for both developement and the CI.
@zimmski
There is an open PR of @sbinet #103 which is of the go-clang items I want to finish this week. It would be good if we can combine both efforts. Have you taken a look at that PR?
Yes, I know that PR. My Dockerfile based it. and same approach.
But it seems needs the maintain two(or more) Dockerfile because of separate Dockerfile that install Go(goclang/base
) and install LLVM(goclang/build
).
So, I did merge to one Dockerfile with ONBUILD
and --build-arg LLVM_VERSION=$LLVM_VERSION
.
The development process is described in the README of the gen repository starting from here https://github.com/go-clang/gen#how-to-contribute Basically we are using a Vagrant based VM to compile and test, but git commands should be executed outside of Vagrant. It would be ideal if we could switch to Docker for both developement and the CI.
Ah, go-clang already explain the developer flow. I overlooked. Sorry...
What should I do? Create new PR(with some fix)? or comment https://github.com/go-clang/gen/pull/103?
@zchee I took a look at your changes, and it looks pretty cool. Some remarks: a.) I am not really sure if you should do a new PR, I leave this up to @sbinet since he did put a lo of effort into his PR. I do not want that to go to waste. b.) travis.yml: The docker start/stop look rather hackish. According to https://docs.travis-ci.com/user/docker/ they are not needed. c.) Changing to a newer Ubuntu version is fine with me as long as we support Clang 3.4 to 3.9 with it. d.) Sadly the -msan flag does not make much sense at this point see https://github.com/go-clang/gen/issues/123#issuecomment-249829293 maybe we should also switch to a manually built version of LLVM/Clang? @sbinet @marxriedl would do you think? e.) Would it make sense to just use one Dockerfile and simply add the LLVM/Clang version via the build argument, and pushing the different versions using a corresponding docker image tag? However, I do not know if Docker hub allows building the same image with different arguments.
@zimmski I almost understand. Of curse, I'm not going to waste @sbinet PR. I will reply later. Thanks for checking my changes.
@zchee feel free to steal parts or all of my initial PR as you deem necessary. I have very few cycles for go-clang these days, unfortunately...
@zimmski I'll rewrite some Dockerfile
to more easy maintenance for go-clang dev. sorry for a delay.
@sbinet I understand. I'll create a new pull request with reference to it. Thanks for a good "base" image :)
Cool!