Skip to content

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

Merged
merged 30 commits into from
Jun 15, 2025
Merged

Grpc manager #69

merged 30 commits into from
Jun 15, 2025

Conversation

jcdkiki
Copy link
Collaborator

@jcdkiki jcdkiki commented May 27, 2025

No description provided.

@jcdkiki
Copy link
Collaborator Author

jcdkiki commented May 27, 2025

Сделал чекаут от #62. Там какие-то нужные наработки были, уже не помню какие правда.

Как client работает в репо qemu-riscv-cluster я не очень понял, тестировал вот такими командами.
image

Запросы отправляются, ответы приходят.

Контроллер запускается вот так:

cd controller
go run cmd/grpc_server/main.go

Воркер можно например так запустить:

docker compose build
docker run \
        --user "$(id -u):$(id -g)" \
        -d \
        -v "/run/controller:/run/controller" \
        -e "METRICS_GATEWAY_ADDRESS=metrics" \
        -e "METRICS_GATEWAY_PORT=9091" \
        -e "METRICS_WORKER_NAME=${worker}" \
        --name "${worker}" \
        "grpc_server-worker"

@katyasots katyasots linked an issue May 28, 2025 that may be closed by this pull request

- name: Install protoc
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
Copy link

Choose a reason for hiding this comment

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

@@ -12,12 +12,13 @@ COPY worker/src/ ./src/
COPY worker/include/ ./include/
COPY worker/BUILD ./
Copy link

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
Copy link

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 {
Copy link

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 {
Copy link

Choose a reason for hiding this comment

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

можно было унаследоваться от std::runtime_error. там уже конструктор со стрингой.

@jcdkiki jcdkiki closed this Jun 13, 2025
@jcdkiki jcdkiki reopened this Jun 13, 2025
Copy link
Collaborator

Choose a reason for hiding this comment

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

У нас же уже есть такой proto файл, почему не можем переиспользовать?

@AndrewGavril AndrewGavril merged commit e957283 into main Jun 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

combine grpc_server and manager
3 participants