Skip to content

Attempt 2 at docker run script#207

Merged
istio-testing merged 3 commits intoistio:masterfrom
howardjohn:run-script-2
Mar 9, 2020
Merged

Attempt 2 at docker run script#207
istio-testing merged 3 commits intoistio:masterfrom
howardjohn:run-script-2

Conversation

@howardjohn
Copy link
Copy Markdown
Member

WIP until we can verify on osx

* Add docker run script

* Break out environment setup into a common script

This allows running the same set of logic for the script runs and
makefile runs. It also allows non makefile users to source this and
continue to run `go test ./...` or whatever they want, without
duplicated logic.

* Fix lint

* clean up

(cherry picked from commit dfe763e)
(cherry picked from commit 0b5b799084d5654b1260fbb49a1f4c4c45389434)
@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Mar 9, 2020
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Mar 9, 2020
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 9, 2020
@howardjohn
Copy link
Copy Markdown
Member Author

To try out this PR, pull down istio/istio#21997

^ also tests it passes in CI

@howardjohn howardjohn marked this pull request as ready for review March 9, 2020 17:28
@howardjohn howardjohn requested a review from a team as a code owner March 9, 2020 17:28
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Mar 9, 2020
@ericvn
Copy link
Copy Markdown
Contributor

ericvn commented Mar 9, 2020

Noted TMPDIR was needed on MacOS and @howardjohn fixed that in the prior commit.

LGTM

@istio-testing istio-testing merged commit 70f2f42 into istio:master Mar 9, 2020
Copy link
Copy Markdown
Member

@sdake sdake left a comment

Choose a reason for hiding this comment

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

looks great.

Nice work @howardjohn .

Cheers
-steve

$(shell mkdir -p out)
$(shell $(PWD)/common/scripts/setup_env.sh envfile > out/.env)
include out/.env
export out/.env
Copy link
Copy Markdown
Member

@clarketm clarketm Mar 10, 2020

Choose a reason for hiding this comment

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

Is this valid syntax? Nothing is exported. Should be:

- export out/.env
+ export

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, I think this worked when I looked since istio/istio redundantly sets all of these. Testing locally what you suggested makes this work, Ill send a PR in a minute (testing it in https://github.com/istio/istio/pull/22018/files#diff-b67911656ef5d18c4ae36cb6741b7965)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've commented this odd difference between bash and Makefile so people don't change it around without understanding the implications. See: #211

$(info Building with your local toolchain.)
# If we are not in build container, we need a workaround to get environment properly set
# Write to file, then include
$(shell mkdir -p out)
Copy link
Copy Markdown
Member

@clarketm clarketm Mar 10, 2020

Choose a reason for hiding this comment

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

This fails check-clean-repo target. Can we change this to mktemp or add out/ to all .gitignore files?

https://prow.istio.io/view/gcs/istio-prow/pr-logs/pull/istio_test-infra/2485/gencheck_test-infra/1681

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All repos are putting output in out/ so we should add it to .gitignore everywhere. I sent it to a couple repos but must have missed some

Copy link
Copy Markdown
Member

@clarketm clarketm Mar 10, 2020

Choose a reason for hiding this comment

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

An alternative is to use a common .gitignore; something like: #210 could simplify to distribution across the various istio/* repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants