-
Notifications
You must be signed in to change notification settings - Fork 0
Grpc manager #69
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
Grpc manager #69
Conversation
Сделал чекаут от #62. Там какие-то нужные наработки были, уже не помню какие правда. Как client работает в репо qemu-riscv-cluster я не очень понял, тестировал вот такими командами. Запросы отправляются, ответы приходят. Контроллер запускается вот так:
Воркер можно например так запустить:
|
|
||
- name: Install protoc | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y protobuf-compiler |
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.
вот здесь https://serverfault.com/questions/227190/how-do-i-ask-apt-get-to-skip-any-interactive-post-install-configuration-steps описан более правильный подход
@@ -12,12 +12,13 @@ COPY worker/src/ ./src/ | |||
COPY worker/include/ ./include/ | |||
COPY worker/BUILD ./ |
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.
nit: иногда чтоб не перечислять всё по отдельности что нужно скопировать проще воспользоваться .dockerignore
taskChan chan *Task // channel for transferring tasks to the worker | ||
conn conn.Unix | ||
state int | ||
last_pulse time.Time |
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.
обычно принято называть не pulse а hearbeat. но не важно :)
func genWorkerId() int { | ||
workerId += 1 | ||
return workerId | ||
if err := conn.Close(); err != nil { |
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.
гм. закрывает конекшн после каждого обмена request/response? действительно есть необходимость в закрытии?
SHUTTING_DOWN, // Завершение работы | ||
ERROR // Ошибка | ||
}; | ||
|
||
class WorkerException { | ||
class WorkerException : public std::exception { |
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.
можно было унаследоваться от std::runtime_error
. там уже конструктор со стрингой.
worker/communication.proto
Outdated
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.
У нас же уже есть такой proto файл, почему не можем переиспользовать?
No description provided.