feat(builder+docker+user-data): proxy settings #2825
Conversation
any chance to have a new user-data in the jenkins job to create the /etc/environment_proxy ? |
@lorieri the functional tests are currently failing because starting the deis-builder container runs into this: If |
Jenkins should be using the same user-data file here. It's relying on https://github.com/deis/deis/blob/master/tests/bin/test-integration.sh so the issue has to do with the functional tests: https://github.com/deis/deis/blob/master/builder/tests/builder_test.go#L48-L56 You'll probably have to write out a temporary file and mount that in to reflect the integration tests. |
yes, if they want proxy settings all units load /etc/environment, I was going to use that file but I was afraid to break other things, so I created that new one @bacongobbler I tried to fix the test |
That test is run on the host instead of in a docker container (such as your laptop), so you'll need to populate a temp file via http://golang.org/pkg/io/ioutil/#TempFile (it can be empty since we're just |
d6af240
to
528c3a6
Compare
code LGTM, though let's squash these commits again and change the commit message to
As well as an explanation/justification of the problem and solution as noted in http://docs.deis.io/en/latest/contributing/standards/#commit-style so we can better understand the changes involved here. |
9e06ba3
to
9e38475
Compare
@lorieri Can you add documentation around using this? It's a helpful change, but a user wouldn't know it's there without documentation. It also looks like you need to run |
http_proxy= | ||
https_proxy= | ||
all_proxy= | ||
no_proxy= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why both uppercase and lowercase? I'm familiar with the lowercase form for many unix commands, but not the uppercase form as a shell environment variable (outside of CGI which is a different use context and scope).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ianblenke builder runs custom buildpacks and we don't know what kind of program it will run, some programs use uppercase and others lowercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lorieri I took your base docs and fleshed them out a bit. Feel free to make changes as necessary. |
ping @bacongobbler @mboersma for docs review - otherwise, I think this is ready to ship. |
@carmstrong thanks, I have nothing to add |
@@ -31,6 +35,14 @@ func TestBuilder(t *testing.T) { | |||
"/deis/domains", | |||
"/deis/services", | |||
} | |||
setproxy := []byte("HTTP_PROXY=\nhttp_proxy=\n") | |||
|
|||
tmpfile,errfile := ioutil.TempFile("/tmp", "deis-test-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation here isn't consistent: we need to gofmt
this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run gofmt but I was waiting @carmstrong to help me with the docs, let me do this now
nervermind |
@@ -65,4 +79,6 @@ func TestBuilder(t *testing.T) { | |||
dockercli.DeisServiceTest(t, name, port, "tcp") | |||
etcdutils.VerifyEtcdValue(t, "/deis/builder/host", host, etcdPort) | |||
etcdutils.VerifyEtcdValue(t, "/deis/builder/port", port, etcdPort) | |||
|
|||
defer os.Remove(tmpfile.Name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved up to line 45. That way, the next person reading this won't be wondering where the call to defer
is hiding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, at that time I was not sure I could do that :)
@lorieri Could you rebase this off master? We'll review again and try to get it in v1.4.0. Thanks! |
done |
@lorieri You'll have to rebase one last time - we just fixed a bug in the tests in master. Sorry! |
done 👍 |
|
||
tmpfile, errfile := ioutil.TempFile("/tmp", "deis-test-") | ||
if errfile != nil { | ||
panic(errfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should call t.Fatal
here instead of panic
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Proxy support for builder and coreos' docker daemon Non-cloud installations may require http proxy, this commit creates empty values for those settings
@mboersma done |
These proxy settings changes and related docs LGTM. |
feat(builder+docker+user-data): proxy settings
Proxy settings for coreos, builder, slugrunner, slugbuilder and docker
originally using /etc/environment, changed to /etc/environment_proxy to avoid current automations failures
closes #1734 -- edited by @bacongobbler