-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
10,949 additions
and
783 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM amazon/aws-cli | ||
RUN yum update -y && yum install -y tar gzip | ||
COPY docker/entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["sh", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
aws s3 cp "s3://$BUCKET/$KEY" "$DATA_DIR" | ||
tar -xzvf "$DATA_DIR/$KEY" -C "$DATA_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
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} /bin/operator | ||
RUN chmod +x /bin/operator | ||
RUN ln -s /bin/operator /operator | ||
|
||
ENTRYPOINT [ "operator" ] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ARG RUST_VERSION=1.81.0 | ||
ARG BRANCH=main | ||
|
||
FROM rust:${RUST_VERSION}-slim-bullseye AS build | ||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y libssl-dev pkg-config git ca-certificates | ||
RUN git clone https://github.com/cardano-scaling/hydra-control-plane.git | ||
RUN cd hydra-control-plane && git checkout ${BRANCH} | ||
|
||
WORKDIR /app/hydra-control-plane | ||
RUN cargo build --locked --release | ||
RUN cp ./target/release/metrics-exporter /bin/metrics-exporter | ||
RUN cp ./target/release/open-head /bin/open-head | ||
RUN cp ./target/release/control-plane /bin/control-plane | ||
|
||
FROM debian:bullseye-slim AS final | ||
RUN apt-get update && apt-get install -y ca-certificates curl | ||
WORKDIR /home/app | ||
|
||
# Copy the executable from the "build" stage. | ||
COPY --from=build /bin/metrics-exporter /bin/metrics-exporter | ||
COPY --from=build /bin/open-head /bin/open-head | ||
COPY --from=build /bin/control-plane /bin/control-plane | ||
|
||
# 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 | ||
|
||
CMD ["/bin/metrics-exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Docker | ||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- ".github/image/Dockerfile" | ||
- ".github/workflows/docker.yml" | ||
- "src/**" | ||
|
||
jobs: | ||
build: | ||
continue-on-error: true | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- release_for: Linux-x86_64 | ||
build_on: ubuntu-latest | ||
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 | ||
uses: actions/checkout@v4 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "release" | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Run cargo build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --target ${{ matrix.target }} ${{ matrix.args }} | ||
|
||
- name: rename binaries | ||
run: | | ||
mv target/${{ matrix.target }}/release/operator${{ matrix.ext }} operator-${{ matrix.release_for }}${{ matrix.ext }} | ||
- name: upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaries-${{ matrix.release_for }} | ||
path: operator-${{ matrix.release_for }}${{ matrix.ext }} | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/cardano-scaling/doom-patrol-operator | ||
tags: | | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=semver,pattern=v{{major}} | ||
type=semver,pattern=v{{major}}.{{minor}} | ||
type=semver,pattern=v{{version}} | ||
type=sha | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io/cardano-scaling | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: binaries-* | ||
merge-multiple: true | ||
path: .github/image/bin | ||
|
||
# we need to rename the artifact so that the name matches | ||
# the value that Docker uses for TARGET_ARCH to keep the | ||
# Dockerfile simple | ||
- name: Rename artifacts | ||
run: |+ | ||
mv .github/image/bin/operator-Linux-x86_64 .github/image/bin/operator-Linux-amd64 | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: .github/image | ||
platforms: linux/arm64,linux/amd64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ result* | |
.envrc | ||
.direnv | ||
# runtime | ||
protocol-parameters.json | ||
utxo.json | ||
*.vk | ||
*.sk | ||
|
Oops, something went wrong.