Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

feat(builder+docker+user-data): proxy settings #2825

Merged
merged 2 commits into from Feb 13, 2015
Merged

Conversation

lorieri
Copy link
Contributor

@lorieri lorieri commented Dec 30, 2014

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

@lorieri
Copy link
Contributor Author

lorieri commented Dec 30, 2014

any chance to have a new user-data in the jenkins job to create the /etc/environment_proxy ?

@lorieri lorieri changed the title Proxy Settings feat(builder+docker+user-data): proxy settings Dec 30, 2014
@mboersma
Copy link
Member

@lorieri the functional tests are currently failing because starting the deis-builder container runs into this:
/app/bin/entry: line 4: /etc/environment_proxy: No such file or directory
The entrypoint script isn't finding that file inside the container.

If test-integration.sh isn't passing for you locally, it's not going to work for Jenkins either. I'm not sure exactly what this PR intends to fix, but maybe user-data isn't the right place for this. Are users supposed to edit user-data to add proxy values before provisioning?

@bacongobbler
Copy link
Member

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.

@lorieri
Copy link
Contributor Author

lorieri commented Dec 30, 2014

yes, if they want proxy settings
but they can leave it with empty values

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

@bacongobbler
Copy link
Member

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 source'ing it), then you can reference that file and mount it into the container.

@bacongobbler
Copy link
Member

looks like a few stray commits made it in: d3b6347 and eff3b7a. Would you mind removing those and squashing your other commits together once you fix up the functional test, please? :)

@bacongobbler
Copy link
Member

code LGTM, though let's squash these commits again and change the commit message to

feat(builder): add proxy support

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.

@carmstrong
Copy link
Contributor

@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 gofmt on the source.

http_proxy=
https_proxy=
all_proxy=
no_proxy=

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).

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carmstrong
Copy link
Contributor

@lorieri I took your base docs and fleshed them out a bit. Feel free to make changes as necessary.

@carmstrong
Copy link
Contributor

ping @bacongobbler @mboersma for docs review - otherwise, I think this is ready to ship.

@lorieri
Copy link
Contributor Author

lorieri commented Jan 13, 2015

@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-")
Copy link
Member

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.

Copy link
Contributor Author

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

@lorieri
Copy link
Contributor Author

lorieri commented Jan 13, 2015

@carmstrong I've lost your docs commit, could commit it again ?

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())
Copy link
Member

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.

Copy link
Contributor Author

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 :)

@carmstrong
Copy link
Contributor

@lorieri Could you rebase this off master? We'll review again and try to get it in v1.4.0. Thanks!

@carmstrong carmstrong added this to the v1.4 milestone Feb 12, 2015
@carmstrong carmstrong assigned carmstrong and unassigned mboersma Feb 12, 2015
@lorieri
Copy link
Contributor Author

lorieri commented Feb 12, 2015

done

@carmstrong
Copy link
Contributor

@lorieri You'll have to rebase one last time - we just fixed a bug in the tests in master. Sorry!

@lorieri
Copy link
Contributor Author

lorieri commented Feb 13, 2015

done 👍


tmpfile, errfile := ioutil.TempFile("/tmp", "deis-test-")
if errfile != nil {
panic(errfile)
Copy link
Member

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.

Copy link
Member

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
@lorieri
Copy link
Contributor Author

lorieri commented Feb 13, 2015

@mboersma done

@mboersma
Copy link
Member

These proxy settings changes and related docs LGTM.

mboersma added a commit that referenced this pull request Feb 13, 2015
feat(builder+docker+user-data): proxy settings
@mboersma mboersma merged commit 3d59fef into deis:master Feb 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slugbuilder fails behind proxy
5 participants