Skip to content

Commit

Permalink
fix(antithesis): docker compose (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka authored Dec 23, 2024
1 parent 68f06fb commit 78a5b50
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,14 @@ LABEL org.opencontainers.image.source="https://github.com/andrewgazelka/hyperion
org.opencontainers.image.description="Hyperion Tag Event" \
org.opencontainers.image.version="0.1.0"

ENTRYPOINT ["/tag"]
CMD ["--ip", "0.0.0.0", "--port", "35565"]

FROM antithesis-runtime-base AS antithesis-bot

COPY --from=antithesis /app/antithesis-bot /
LABEL org.opencontainers.image.source="https://github.com/andrewgazelka/hyperion" \
org.opencontainers.image.description="Hyperion Antithesis Bot" \
org.opencontainers.image.version="0.1.0"
org.opencontainers.image.version="0.1.0"

ENTRYPOINT ["/antithesis-bot"]
5 changes: 4 additions & 1 deletion antithesis/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ services:
platform: linux/amd64
restart: unless-stopped
environment:
- HOST=hyperion-proxy:25565
- ADDRESS=hyperion-proxy:25565
- RUST_LOG=info
networks:
- proxy-network

depends_on:
- hyperion-proxy

build:
context: ..
dockerfile: Dockerfile
target: antithesis-bot


networks:
proxy-network:
driver: bridge
6 changes: 3 additions & 3 deletions tools/antithesis-bot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod bot;

#[derive(Deserialize, Debug)]
pub struct LaunchArguments {
ip: String,
address: String,

#[serde(default = "default_bot_count")]
bot_count: u32,
Expand All @@ -28,14 +28,14 @@ pub async fn start(args: LaunchArguments) -> eyre::Result<()> {

tracing::info!("args = {args:?}");

let LaunchArguments { ip, bot_count } = args;
let LaunchArguments { address, bot_count } = args;

if bot_count > UNUSUALLY_HIGH_BOT_THRESHOLD {
tracing::warn!("bot_count {bot_count} is unusually high. This may cause issues.");
}

for _ in 0..bot_count {
bot::launch(&ip).await?;
bot::launch(&address).await?;
}

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions tools/antithesis-bot/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use antithesis_bot::LaunchArguments;
use tracing::warn;
use tracing::trace;

#[tokio::main]
async fn main() -> eyre::Result<()> {
tracing_subscriber::fmt::init();
if let Err(e) = dotenvy::dotenv() {
warn!("Failed to load .env file: {}", e);
trace!("Failed to load .env file: {}", e);
}

// Deserialize environment variables into the struct
Expand Down

0 comments on commit 78a5b50

Please sign in to comment.