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

fix(docs): updated readme and fixed launcher #298

Merged
merged 32 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
93d04d3
updated launcher
antiyro Sep 24, 2024
fbc246c
fixed more stuff
antiyro Sep 24, 2024
b84ee44
added port security
antiyro Sep 24, 2024
9fa90bc
small fix until docker image
antiyro Sep 24, 2024
949c86e
merged main
antiyro Sep 27, 2024
1068958
Merge branch 'main' of https://github.com/madara-alliance/madara into…
antiyro Sep 27, 2024
e66177b
Merge branch 'main' of https://github.com/madara-alliance/madara into…
antiyro Sep 30, 2024
9083b7c
fixed dockerfile
antiyro Sep 30, 2024
3f86de7
added release and docker build workflows
antiyro Oct 1, 2024
7381ac9
added release and docker build workflows
antiyro Oct 1, 2024
80e6623
changelog
antiyro Oct 1, 2024
a01f2dc
updated release workflow
antiyro Oct 1, 2024
dbb2e89
updated release workflow
antiyro Oct 1, 2024
7866af5
updated release workflow
antiyro Oct 1, 2024
22f4fc8
updated launcher and docker build release
antiyro Oct 1, 2024
afde752
updated launcher
antiyro Oct 1, 2024
4c6e13e
added chain config configuration
antiyro Oct 1, 2024
1b8b45f
optimized docker build and launcher
antiyro Oct 1, 2024
7089a96
resolved conflicts
antiyro Oct 1, 2024
f728bf9
cleaned inputs
antiyro Oct 2, 2024
3820581
updated readme
antiyro Oct 2, 2024
8e39384
updated readme
antiyro Oct 2, 2024
818c987
rebased with main
antiyro Oct 2, 2024
2bfc8e6
reverted working docker
antiyro Oct 2, 2024
32aac9f
Update Dockerfile
antiyro Oct 2, 2024
4677439
updated docker build according to new dockerfile
antiyro Oct 2, 2024
f19d4f5
Merge branch 'fix/high' of https://github.com/madara-alliance/madara …
antiyro Oct 2, 2024
d391bad
removed unused dependency tini
antiyro Oct 2, 2024
1a00ff1
updated some documentation
antiyro Oct 2, 2024
d6832bd
removed docker warnings
antiyro Oct 2, 2024
7d9e608
prettified markdown
antiyro Oct 2, 2024
fa645d4
runned prettier on md
antiyro Oct 2, 2024
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
7 changes: 0 additions & 7 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
Expand All @@ -31,7 +25,6 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/madara:latest
ghcr.io/${{ github.repository_owner }}/madara:${{ github.event.release.tag_name }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- fix(docs): updated readme and fixed launcher
- fix(ci): added gateway key to fix rate limit on tests
- feat(cli): launcher script and release workflows
- fix: cleaned cli settings for sequencer, devnet and full
Expand Down
58 changes: 23 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,48 @@
# Stage 1: Build the application
FROM rust:1.78 AS builder

# Install build dependencies
RUN apt-get -y update && \
RUN apt-get -y update && \
apt-get install -y clang && \
apt-get autoremove -y; \
apt-get clean; \
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /usr/src/madara/

# Copy the source code
# Copy the source code into the container
COPY Cargo.toml Cargo.lock ./
COPY crates crates
COPY cairo cairo
COPY cairo_0 cairo_0

# Installing Scarb
# Dynamically detect the architecture
ARG SCARB_VERSION="v2.8.2"
ARG SCARB_REPO="https://github.com/software-mansion/scarb/releases/download"
RUN ARCH=$(uname -m); \
if [ "$ARCH" = "x86_64" ]; then \
PLATFORM="x86_64-unknown-linux-gnu"; \
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
PLATFORM="aarch64-unknown-linux-gnu"; \
else \
echo "Unsupported architecture: $ARCH"; exit 1; \
fi && \
curl -fLS -o /usr/src/scarb.tar.gz \
$SCARB_REPO/$SCARB_VERSION/scarb-$SCARB_VERSION-$PLATFORM.tar.gz && \
tar -xz -C /usr/local --strip-components=1 -f /usr/src/scarb.tar.gz

# Installing scarb, new since devnet integration
ENV SCARB_VERSION="v2.8.2"
ENV SHELL="/bin/bash"
RUN curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- ${SCARB_VERSION}
ENV PATH="/root/.local/bin:${PATH}"
RUN scarb --version

# Install runtime dependencies
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates busybox && \
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Build the application in release mode
RUN cargo build --release

# Stage 2: Create the final runtime image
FROM debian:bookworm-slim

FROM debian:bookworm
# Install runtime dependencies
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates && \
apt-get autoremove -y; \
apt-get clean; \
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates &&\
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /usr/local/bin

# Copy the compiled binary from the builder stage
COPY --from=builder /usr/src/madara/target/release/madara .

# Chain presets to be mounted at startup
VOLUME crates/primitives/chain_config/presets
VOLUME crates/primitives/chain_config/resources
Comment on lines -56 to -57
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need to mount this anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

nop this is unused and was added as a fix for unaccessible chain configs but now we fetch them (iirc)


# Set the entrypoint
ENTRYPOINT ["./madara"]
Loading
Loading