-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add docker image for the pinner * push to gar using gcr json creds * add docker-compose.yml and expose pinner api port * add ewm-das tester to docker compose. * use 5080 port * add legacy upload support * add legacy calculate CID support * add legacy download * use only AMD platform * push stable versioned only images Signed-off-by: Pranay Valson <[email protected]> Co-authored-by: tarassh <[email protected]> Signed-off-by: Pranay Valson <[email protected]>
- Loading branch information
Showing
10 changed files
with
493 additions
and
10,024 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,59 @@ | ||
name: build-gar | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "develop" | ||
jobs: | ||
ewm-das: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to GCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: us-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.GCR_JSON_KEY }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Build & Publish the Docker image | ||
run: | | ||
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --platform=linux/amd64 . -f Dockerfile.pinner -t us-docker.pkg.dev/covalent-project/network/ewm-das:latest --push | ||
- name: Create .env file | ||
run: | | ||
touch .env | ||
{ | ||
echo "W3_AGENT_KEY=${{ secrets.W3_AGENT_KEY }}" | ||
echo "PROOF_OUT_HEX=${{ secrets.PROOF_OUT_HEX }}" | ||
echo "W3_DELEGATION_FILE=${{ secrets.W3_DELEGATION_FILE }}" | ||
} >> .env | ||
cat .env | ||
- name: Load .env file | ||
uses: xom9ikk/[email protected] | ||
|
||
- name: Run containers | ||
run: docker compose --env-file ".env" -f "docker-compose-ci.yml" up --build --remove-orphans --exit-code-from ewm-das-tester | ||
|
||
- name: Check running agent | ||
run: docker inspect ewm-das | ||
|
||
- name: Check running containers | ||
run: docker ps | ||
|
||
- name: Delete .env & bin files | ||
run: | | ||
rm -rf .env && rm -rf ./bin/block-ethereum | ||
- name: Stop containers | ||
if: always() | ||
run: docker compose -f "docker-compose-ci.yml" down |
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,37 @@ | ||
name: tag-release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
tagged-release: | ||
name: Tagged Release | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Login to GCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: us-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.GCR_JSON_KEY }} | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set env | ||
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
|
||
- name: Build & Publish the Docker image | ||
run: | | ||
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --platform=linux/amd64 . -f Dockerfile.pinner -t us-docker.pkg.dev/covalent-project/network/ewm-das:stable -t us-docker.pkg.dev/covalent-project/network/ewm-das:"${{ env.TAG }}" --push | ||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
draft: false | ||
prerelease: false | ||
files: | | ||
*.zip | ||
*.tar.gz |
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,61 @@ | ||
# Use an official Golang image as a base image | ||
FROM golang:1.23-bullseye AS builder | ||
|
||
# Set environment variables for CGO flags | ||
ENV CGO_CFLAGS="-O2 -D__BLST_PORTABLE__" | ||
ENV CGO_CXXFLAGS="-O2 -D__BLST_PORTABLE__" | ||
ENV CGO_LDFLAGS="-O2 -D__BLST_PORTABLE__" | ||
|
||
# Install necessary dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
git make bash curl gcc g++ musl musl-dev musl-tools && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the working directory for the pinner | ||
WORKDIR /go/src/pinner | ||
|
||
# Clone the pinner repository | ||
COPY . . | ||
|
||
# Build the pinner | ||
RUN CC=musl-gcc make build-pinner EXTRA_TAGS="-tags experimental" | ||
|
||
# Create a minimal runtime image | ||
FROM alpine:latest | ||
|
||
# Install necessary dependencies | ||
RUN apk update && apk add --no-cache bash nodejs npm git musl musl-dev curl \ | ||
&& npm install -g @web3-storage/[email protected] \ | ||
&& npm install -g crypto-random-string | ||
|
||
# Copy the built pinner binary | ||
COPY --from=builder /go/src/pinner/bin/pinner /usr/local/bin/pinner | ||
RUN chmod +x /usr/local/bin/pinner | ||
|
||
# Copy trusted setup files | ||
COPY --from=builder /go/src/pinner/test/data/trusted_setup.txt /root/.covalent/trusted_setup.txt | ||
|
||
# Copy test data | ||
COPY --from=builder /go/src/pinner/test/data/specimen-result.json /root/.covalent/test/specimen-result.json | ||
COPY --from=builder /go/src/pinner/scripts/das-pinner-tester.sh /root/.covalent/test/das-pinner-tester.sh | ||
RUN chmod +x /root/.covalent/test/das-pinner-tester.sh | ||
|
||
# Clean up | ||
RUN apk del git && rm -rf /var/cache/apk/* /root/.npm /tmp/* | ||
|
||
# Expose pinner API port | ||
EXPOSE 5080 | ||
|
||
# Expose the default IPFS port | ||
EXPOSE 4001 | ||
|
||
# Expose the default IPFS API port | ||
EXPOSE 5001 | ||
|
||
# Expose the default IPFS Gateway port | ||
EXPOSE 8080 | ||
|
||
HEALTHCHECK --interval=10s --timeout=5s CMD wget --no-verbose --tries=1 --spider localhost:5080/health | ||
|
||
ENTRYPOINT [ "/bin/bash", "-l", "-c" ] | ||
CMD [ "pinner --addr :5080 --w3-agent-key $W3_AGENT_KEY --w3-delegation-proof-path $W3_DELEGATION_FILE" ] |
Oops, something went wrong.