Skip to content

Commit

Permalink
tidy up dockers
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Nov 12, 2024
1 parent 0ddfbf8 commit 66e9554
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 146 deletions.
20 changes: 20 additions & 0 deletions .github/images/hcp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM debian:12-slim

RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*

ARG TARGETARCH
COPY bin/operator-Linux-${TARGETARCH} /hcp/operator
COPY bin/rpc-Linux-${TARGETARCH} /hcp/rpc
COPY bin/metrics-exporter-Linux-${TARGETARCH} /hcp/metrics-exporter
COPY bin/open-head-Linux-${TARGETARCH} /hcp/open-head

RUN chmod +x /hcp/*

ENV PATH="/hcp:${PATH}"

# Configure rocket to listen on all interfaces.
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8000

# Expose the port that the application listens on.
EXPOSE 8000
10 changes: 0 additions & 10 deletions .github/images/operator/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions .github/images/rpc/Dockerfile

This file was deleted.

33 changes: 0 additions & 33 deletions .github/images/rpc/dockerfile.hydra

This file was deleted.

31 changes: 18 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on:
push:
branches:
- "main"
- "refactor/monorepo"
paths:
- ".github/image/Dockerfile"
- ".github/images/hcp/Dockerfile"
- ".github/workflows/docker.yml"
- "src/**"
- "crates/**"

jobs:
build:
Expand All @@ -21,11 +22,6 @@ jobs:
target: x86_64-unknown-linux-gnu
args: "--locked --release"

- release_for: Linux-arm64
build_on: buildjet-2vcpu-ubuntu-2204-arm
target: "aarch64-unknown-linux-gnu"
args: "--locked --release"

runs-on: ${{ matrix.build_on }}
steps:
- name: checkout repository
Expand All @@ -48,13 +44,19 @@ jobs:

- name: rename binaries
run: |
mv target/${{ matrix.target }}/release/operator${{ matrix.ext }} operator-${{ matrix.release_for }}${{ matrix.ext }}
mv target/${{ matrix.target }}/release/operator operator-${{ matrix.release_for }}
mv target/${{ matrix.target }}/release/rpc rpc-${{ matrix.release_for }}
mv target/${{ matrix.target }}/release/metrics-exporter rpc-${{ matrix.release_for }}
mv target/${{ matrix.target }}/release/open-head open-head-${{ matrix.release_for }}
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.release_for }}
path: operator-${{ matrix.release_for }}${{ matrix.ext }}
path: |
operator-${{ matrix.release_for }}
rpc-${{ matrix.release_for }}
metrics-exporter-${{ matrix.release_for }}
docker:
runs-on: ubuntu-latest
Expand All @@ -75,7 +77,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/cardano-scaling/doom-patrol-operator
images: ghcr.io/cardano-scaling/hydra-control-plane
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern=v{{major}}
Expand Down Expand Up @@ -103,12 +105,15 @@ jobs:
- name: Rename artifacts
run: |+
mv .github/image/bin/operator-Linux-x86_64 .github/image/bin/operator-Linux-amd64
mv .github/image/bin/rpc-Linux-x86_64 .github/image/bin/rpc-Linux-amd64
mv .github/image/bin/metrics-exporter-Linux-x86_64 .github/image/bin/metrics-exporter-Linux-amd64
mv .github/image/bin/open-head-Linux-x86_64 .github/image/bin/open-head-Linux-amd64
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .github/image
platforms: linux/arm64,linux/amd64
context: .github/images/hcp
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion crates/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name = "metrics-exporter"
path = "src/bin/metric_exporter/main.rs"

[[bin]]
name = "control-plane"
name = "rpc"
path = "src/main.rs"

[dependencies]
Expand Down
36 changes: 0 additions & 36 deletions crates/rpc/Rocket.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,3 @@ ttl_minutes = 1
port = 8000
address = "0.0.0.0"
admin_key_file = "keys/admin.sk"

[[local.nodes]]
local_url = "ws://127.0.0.1"
port = 4001
admin_key_file = "keys/local.admin.sk"
max_players = 5
region = "local"
persisted = false
reserved = false

[ec2]
ttl_minutes = 1
port = 8000
address = "0.0.0.0"

[[ec2.hosts]]
local_url = "wss://host1.hydra-doom.sundae.fi"
start_port = 4001
end_port = 4001
region = "us-east-2"
admin_key_file = "admin.sk"
stats_file_prefix = "stats/host1"
max_players = 10
persisted = false
reserved = true

[[ec2.hosts]]
local_url = "wss://host1.hydra-doom.sundae.fi"
start_port = 4002
end_port = 4010
region = "us-east-2"
admin_key_file = "admin.sk"
stats_file_prefix = "stats/host1"
max_players = 10
persisted = false
reserved = false

0 comments on commit 66e9554

Please sign in to comment.