Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor python code: commonlize scripts utils and bootstrap #437

Merged

Conversation

gut
Copy link
Contributor

@gut gut commented Jun 5, 2018

And in order to do that, I intended to use the most up-to-date / robust
flavor of a functionality found.

Some output now is controlled through DaisyRunSuccess, DaisyRunStatus
and DaisyRunFailed.

Took this chance also to solve some flake8 warnings that I could.

@adjackura
Copy link
Contributor

/ok-to-test

@codecov
Copy link

codecov bot commented Jun 5, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@b5653a1). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #437   +/-   ##
=========================================
  Coverage          ?   74.58%           
=========================================
  Files             ?       34           
  Lines             ?     3463           
  Branches          ?        0           
=========================================
  Hits              ?     2583           
  Misses            ?      697           
  Partials          ?      183
Flag Coverage Δ
#go_unittests 74.58% <ø> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5653a1...34504b9. Read the comment docs.

@gut
Copy link
Contributor Author

gut commented Jun 5, 2018

rebased PR and adjusted content

@adjackura
Copy link
Contributor

The shared library is good, but don't mess with the logging messages. Leave the logging up to each library as the DaisyRun* prefix is not at all descriptive of the various tasks that we have. Also its not matching what we do for other workflows.

@gut
Copy link
Contributor Author

gut commented Jun 7, 2018

The shared library is good, but don't mess with the logging messages. Leave the logging up to each library as the DaisyRun* prefix is not at all descriptive of the various tasks that we have. Also its not matching what we do for other workflows.

Alright, I agree, however it'll be tricky to unify a bootstrap.py with such a requirement. Maybe I can make that prefix a parameter. Let's see.

@gut
Copy link
Contributor Author

gut commented Jun 8, 2018

@adjackura done. Please review once again

@gut
Copy link
Contributor Author

gut commented Jun 11, 2018

wait, I'll actually take this chance and also remove the gsutil dependency of bootstrap by copying the files from the bucket using a different mechanism.

@gut
Copy link
Contributor Author

gut commented Jun 11, 2018

wait, I'll actually take this chance and also remove the gsutil dependency of bootstrap by copying the files from the bucket using a different mechanism.

Any hints?

Gustavo Serra Scalet added 2 commits June 12, 2018 21:17
And in order to do that, I intended to use the most up-to-date / robust
flavor of a functionality found.

Took this chance also to solve some flake8 warnings that I could.
That will assist supporting distros that doesn't have gsutil installed.
@gut
Copy link
Contributor Author

gut commented Jun 13, 2018

Done. Now bootstrap doesn't depend on gsutils anymore, which I believe it's a win. (changes separated on the 2nd commit)
@adjackura would you please review this?

@adjackura adjackura requested a review from zmarano June 13, 2018 21:13
@zmarano
Copy link
Contributor

zmarano commented Jun 13, 2018

This change looks good but since it has a lot of changes and I may have missed something, I'll test our image builds after it is merged as well. On removing gsutil, do that in another PR. You would want to use the cloud storage python library and make sure you use the default service account credentials from the VM.

@gut
Copy link
Contributor Author

gut commented Jun 14, 2018

On removing gsutil, do that in another PR.

No problem, I can remove the commit from this PR, but I'm confused as this PR is approved. Will it be eventually merged or are you expecting me to make this changes before?

You would want to use the cloud storage python library and make sure you use the default service account credentials from the VM.

I'm not sure every image would have that package installed, would it? I preferred to use the base REST API for implementing it as I it would require less dependencies. Nevertheless it'd be even easier and simpler if I used the cloud storage python library.

Shall I proceed with all changes then?

@zmarano
Copy link
Contributor

zmarano commented Jun 14, 2018

Oh maybe I missed something? I still saw gsutil being used and called in this PR:
https://github.com/GoogleCloudPlatform/compute-image-tools/pull/437/files#diff-000c28015d35ee8c5a7977072608a5dcR94

@gut
Copy link
Contributor Author

gut commented Jun 14, 2018

Oh maybe I missed something? I still saw gsutil being used and called in this PR:
https://github.com/GoogleCloudPlatform/compute-image-tools/pull/437/files#diff-000c28015d35ee8c5a7977072608a5dcR94

Interesting. That's not bootstrap.py but I agree it makes sense to change it to a more pythonic way :-). I can do ti on a different PR, no problem. I'll just wait for this one as refactoring always freezes development so it would be better to make that PR on top of this one.

@zmarano
Copy link
Contributor

zmarano commented Jun 14, 2018

Oh I see- you were just talking about the bootstrap code- ok cool. I think we should probably get rid of the gsutil dependency everywhere if possible however that can be done later. Thanks! Can you sync your branch so I can merge.

@daisy-bot
Copy link

daisy-bot commented Jun 15, 2018

@gut: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/presubmit/flake8 34504b9 link /flake8

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

done

@zmarano zmarano merged commit f8bb913 into GoogleCloudPlatform:master Jun 15, 2018
@gut gut deleted the refactor-python-code branch June 15, 2018 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants