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

Pi/referee-server #42

Merged
merged 9 commits into from
Nov 16, 2024
Merged

Pi/referee-server #42

merged 9 commits into from
Nov 16, 2024

Conversation

Quantumplation
Copy link
Contributor

Adds a referee server to the hydra doom deployment.

Not sure if I did this right; not sure where to configure the image itself

@@ -169,7 +163,8 @@ impl Metrics {
*guard = Some(self.games_seconds.start_timer());
}

pub fn end_game(&self) {
pub fn end_game(&self, remaining_players: i64) {
self.players_current.sub(remaining_players);
Copy link
Contributor

@gonzalezzfelipe gonzalezzfelipe Nov 15, 2024

Choose a reason for hiding this comment

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

Should this be set? given that we are talking about the remaining players

Suggested change
self.players_current.sub(remaining_players);
self.players_current.set(remaining_players);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No; players current is supposed to be the current count of players; as a player joins, we increment it, and as a player disconnects we decrement it; but if a game ends, there might be remaining players that never disconnected so we subtract that amount.

In theory, of were doing one metric server per game, we could just do set(0) on startup, provided the stats aggregation will sum the amounts across each metrics server

Rather than trying to decrement by the number of players at the end of a game, we can just set it to 0, since each server is only ever running one game
Comment on lines 55 to 74
variable "sidecar_image" {
type = string
description = "The Docker image to use for the sidecar component of the Hydra node."
}

variable "dedicated_image" {
type = string
description = "The Docker image to use for the dedicated / referee server of the hydra node."
}

variable "open_head_image" {
type = string
description = "The Docker image to use for the open head component of the Hydra node."
}

variable "control_plane_image" {
type = string
description = "The Docker image to use for the control plane component of the Hydra node."
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

You should only need the dedicated_image var. The other should all match the main image that we build out of this same repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh i think this might be a merge snafu

@Quantumplation Quantumplation merged commit 950cae3 into main Nov 16, 2024
1 check passed
@Quantumplation Quantumplation deleted the pi/referee-server branch November 16, 2024 20:43
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.

3 participants