Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

Feature/client #37

Merged
merged 13 commits into from
Aug 17, 2018
Merged

Feature/client #37

merged 13 commits into from
Aug 17, 2018

Conversation

liehe
Copy link
Member

@liehe liehe commented Aug 16, 2018

No description provided.

@martinjaggi
Copy link
Member

typically better to rebase the PR than to do several merges, no?

Ralf Grubenmann added 2 commits August 16, 2018 12:15
subjects:
- kind: ServiceAccount
name: {{ template "mlbench.worker.fullname" . }}-sa
---
Copy link
Member

Choose a reason for hiding this comment

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

Each helm resource should be in a separate file, if we want to release that chart to the Helm Chart repository at some point.

See https://github.com/helm/helm/blob/master/docs/chart_best_practices/templates.md

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. Thanks.

assert len(api_response.items) == 1
ip = api_response.items[0].status.pod_ip

response = requests.post("http://{ip}/api/metrics/".format(ip=ip), data=payload)
Copy link
Member

Choose a reason for hiding this comment

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

Is this blocking? Did you try it by wrapping the call with the kubernetes.stream function?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking about adding non-blocking version later. But it will not take too long. I can update this module before merge.

Copy link
Member Author

Choose a reason for hiding this comment

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

kubernetes.stream is used for watching api endpoints, no? What we want is more like having another thread to post?

Copy link
Member

Choose a reason for hiding this comment

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

It is intended to watch api endpoints, yes. But when I looked into the source, it looks like it can wrap any api call and it will do the call using websockets without blocking instead of waiting for a call to finish.

the client also has a (mostly undocumented) functionality for threads already, with the async=True keyword-argument for all. E.g. kubernetes-client/gen#67

@Panaetius
Copy link
Member

Rebase is good for a clean history, though it can be more work in a long lived feature branch.
And it should only be used on a local branch that has not been pushed remotely, which on a long-lived feature branch can be a bit risky (Never pushing means all that work could be lost).

From what I know it comes down to personal choice and there's not settled "better" approach.

The official GitFlow docs don't have a preference either way ( https://www.atlassian.com/git/tutorials/merging-vs-rebasing )

@liehe
Copy link
Member Author

liehe commented Aug 16, 2018

@martinjaggi @Panaetius
In developing the feature/client branch, sometimes I need to get updates from develop branch, like new api and interface, while I can't immediately integrate my code to develop. So I merged develop branch to feature/client several times. It makes the commit history spaghetti.

Perhaps I should not merge the updates too early. What do you suggest in this situation?

ENV PYTHONPATH /codes

RUN pip install kubernetes
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 probably be done with a requirements.txt and pip install, especially if we add additional packages in the future

Copy link
Member Author

Choose a reason for hiding this comment

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

One thing to mention is that installing kubernetes python client from anaconda will downgrade some core packages. So I use pip this time.

Copy link
Member

Choose a reason for hiding this comment

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

But you can use pip with a requirements file as well, pip install -r requirements.txt, which also let's you write what version to install. Then if kubernetes gets updated it doesn't suddenly break the build. No need for anaconda.

@Panaetius Panaetius merged commit 74fd58b into develop Aug 17, 2018
@Panaetius Panaetius deleted the feature/client branch August 17, 2018 09:42
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.

3 participants