Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Integration Test

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Build services
run: docker compose build

- name: Start services
run: docker compose up -d

- name: Wait 60 seconds
run: sleep 60

# 1) Show the logs for debug
- name: Docker Compose Logs
run: docker compose logs

# 2) Check if any containers have exited with an error
- name: Check containers status
run: |
# If any container's STATUS shows "Exit" or "exited", fail
# because that means the container died or crashed.
if docker compose ps | grep -q 'Exit'; then
echo "A container has exited with an error."
exit 1
fi

- name: Tear down
run: docker compose down
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish
on:
push:
branches: [ main ]
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -14,17 +14,17 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push hyperion-proxy
uses: docker/build-push-action@v5
with:
Expand All @@ -35,7 +35,7 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}/hyperion-proxy:latest
ghcr.io/${{ github.repository }}/hyperion-proxy:${{ github.sha }}

- name: Build and push tag
uses: docker/build-push-action@v5
with:
Expand All @@ -51,4 +51,4 @@ jobs:
env:
KEY: ${{ secrets.TEST_SERVER_KEY }}
run: |
curl -X POST -H "Key: $KEY" https://hyperion-test.duckdns.org
curl -X POST -H "Key: $KEY" https://hyperion-test.duckdns.org
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ heapless = '0.8.0'
heed = "0.21.0"
hex = '0.4.3'
humantime = '2.1.0'
hyperion-proxy = { path = "crates/hyperion-proxy" }
itertools = "0.14.0"
kanal = '0.1.0-pre8'
libc = '0.2.155'
Expand Down Expand Up @@ -113,7 +114,6 @@ toml = '0.8.14'
tracing-appender = '0.2.3'
uuid = '1.12.0'


[workspace.dependencies.bvh]
git = 'https://github.com/andrewgazelka/bvh-data'

Expand Down Expand Up @@ -298,6 +298,12 @@ git = 'https://github.com/andrewgazelka/valence'
branch = 'feat-open'
git = 'https://github.com/andrewgazelka/valence'

[workspace.dependencies.tag]
path = "events/tag"

[workspace.dependencies.rust-mc-bot]
path = "tools/rust-mc-bot"

[workspace.lints]
[workspace.lints.clippy]
cast_precision_loss = 'allow'
Expand Down
16 changes: 13 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ RUN --mount=type=cache,target=${CARGO_HOME}/registry \
cargo build --profile release-full --frozen --workspace && \
mkdir -p /app/build && \
cp target/release-full/hyperion-proxy /app/build/ && \
cp target/release-full/tag /app/build/
cp target/release-full/tag /app/build/ && \
cp target/release-full/rust-mc-bot /app/build/

# Runtime base image
FROM ubuntu:24.04 AS runtime-base
Expand All @@ -102,11 +103,20 @@ LABEL org.opencontainers.image.source="https://github.com/andrewgazelka/hyperion
EXPOSE 8080
ENTRYPOINT ["/hyperion-proxy"]
CMD ["0.0.0.0:8080"]
# NYC Release

FROM runtime-base AS tag
COPY --from=build-release /app/build/tag /
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"]
CMD ["--ip", "0.0.0.0", "--port", "35565"]

FROM runtime-base AS rust-mc-bot
COPY --from=build-release /app/build/rust-mc-bot /
LABEL org.opencontainers.image.source="https://github.com/andrewgazelka/rust-mc-bot" \
org.opencontainers.image.description="Rust Minecraft Bot" \
org.opencontainers.image.version="0.1.0"
ENTRYPOINT ["/rust-mc-bot"]
CMD ["hyperion-proxy:25565", "500", "4"]

18 changes: 16 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
ports:
- "25565:25565"
command: [ "--server", "tag:35565", "0.0.0.0:25565" ]
restart: unless-stopped
# restart: unless-stopped
environment:
- RUST_LOG=info
networks:
Expand All @@ -26,7 +26,21 @@ services:
expose:
- "35565"
command: [ ]
restart: unless-stopped
# restart: unless-stopped
environment:
- RUST_LOG=info
networks:
- proxy-network
rust-mc-bot:
# image: ghcr.io/hyperion-mc/hyperion/rust-mc-bot:latest
build:
context: .
dockerfile: Dockerfile
target: rust-mc-bot
command: [ "hyperion-proxy:25565", "500", "2" ]
# restart: unless-stopped
depends_on:
- hyperion-proxy
environment:
- RUST_LOG=info
networks:
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ watch:
debug:
#!/usr/bin/env -S parallel --shebang --ungroup --jobs 3
RUST_BACKTRACE=full RUN_MODE=debug-{{arch}} cargo watch --postpone --no-vcs-ignores -w {{project_root}}/.trigger-debug -s './target/debug/tag'
RUST_BACKTRACE=full ulimit -Sn {{fds}} && cargo run --bin hyperion-proxy --release
RUST_BACKTRACE=full ulimit -Sn {{fds}} && cargo run --bin hyperion-proxy --release-full -- --server "127.0.0.1:35565" "0.0.0.0:25565"
cargo watch -w '{{project_root}}/crates/hyperion' -w '{{project_root}}/events/tag' -s 'cargo check -p tag && cargo build -p tag' -s 'touch {{project_root}}/.trigger-debug'

# run in release mode with tracy; auto-restarts on changes
Expand All @@ -96,7 +96,7 @@ release:
release-full:
#!/usr/bin/env -S parallel --shebang --ungroup --jobs 2
RUN_MODE=release-f-{{arch}} cargo run --profile release-full -p tag'
ulimit -Sn {{fds}} && cargo run --bin hyperion-proxy --profile release-full
ulimit -Sn {{fds}} && cargo run --bin hyperion-proxy --profile release-full

# run a given number of bots to connect to hyperion
bots ip='127.0.0.1:25565' count='1000':
Expand Down