Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/test-s3mgrt' into test-s3mgrt
Browse files Browse the repository at this point in the history
  • Loading branch information
boddumanohar committed Jun 22, 2023
2 parents a06d88e + 48e95f7 commit 66fb03b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 115 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/build-&-publish-docker-image.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .github/workflows/build-s3-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- master
- staging
- test-s3mgrt
tags:
- 'v*.*.*'
pull_request:
Expand Down Expand Up @@ -53,7 +54,9 @@ jobs:
sudo apt -y install build-essential nghttp2 libnghttp2-dev libssl-dev wget unzip containerd docker.io
- name: Install
run: make build
run: |
docker build -t zbox_base -f docker.local/base.Dockerfile .
docker run --rm -v $PWD:/migrate --workdir=/migrate zbox_base make build
- name: Zip release
run: tar -czvf s3mgrt-linux.tar.gz ./s3mgrt
Expand Down Expand Up @@ -83,7 +86,7 @@ jobs:
aws-region: us-east-2

- name: Push to AWS S3
if: github.ref == 'refs/heads/staging'
if: github.ref == 'refs/heads/test-s3mgrt'
run: |
aws s3 cp s3mgrt s3://${{ secrets.S3_MGRT_BINARY_BUCKET }}/s3mgrt
Expand Down Expand Up @@ -267,4 +270,4 @@ jobs:
repository: ${{ github.repository }}
status_name: "0Chain System Tests"
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
github_token: ${{ github.token }}
github_token: ${{ github.token }}
54 changes: 6 additions & 48 deletions docker.local/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,8 @@
FROM ubuntu:22.04 as s3mgrt-build
FROM golang:1.20.4-alpine3.18 as zbox_base

LABEL zchain="s3mgrt"
RUN apk add --update --no-cache linux-headers build-base git cmake bash perl grep py3-pip python3-dev curl

# https://mirrors.alpinelinux.org/
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apt update && apt -y install curl build-essential nghttp2 libnghttp2-dev libssl-dev containerd docker.io

RUN if [ "$(uname -m)" = "x86_64" ] ; then curl -L -o go1.20.4.tar.gz https://go.dev/dl/go1.20.4.linux-amd64.tar.gz ; else curl -L -o go1.20.4.tar.gz https://go.dev/dl/go1.20.4.linux-arm64.tar.gz ; fi
# RUN [ -d /usr/local/go ] && rm -rf /usr/local/go
RUN tar -C /usr/local -xzf go1.20.4.tar.gz
RUN export PATH=$PATH:/usr/local/go/bin
ENV PATH=$PATH:/usr/local/go/bin
RUN go version

# # Install Herumi's cryptography
# WORKDIR /tmp

# COPY ./docker.local/bin/mcl.tar.gz ./
# COPY ./docker.local/bin/bls.tar.gz ./

# RUN tar zxvf mcl.tar.gz && rm mcl.tar.gz && mv mcl* mcl

# RUN tar zxvf bls.tar.gz && rm bls.tar.gz && mv bls* bls

# RUN make -C mcl -j $(nproc) lib/libmclbn256.so install
# RUN cp mcl/lib/libmclbn256.so /usr/local/lib

# RUN make MCL_DIR=$(pwd)/mcl -C bls -j $(nproc) install

# RUN rm -R /tmp/mcl && rm -R /tmp/bls

ENV SRC_DIR=/0chain
WORKDIR $SRC_DIR

# Download the dependencies:
# Will be cached if we don't change mod/sum files
COPY ./go.mod ./go.sum $SRC_DIR
RUN go mod download

COPY . $SRC_DIR
RUN make build

FROM ubuntu:22.04
RUN apt update && apt -y install build-essential nghttp2 libnghttp2-dev libssl-dev
COPY --from=s3mgrt-build /usr/local/lib/libmcl*.so \
/usr/local/lib/libbls*.so \
/usr/local/lib/

COPY --from=s3mgrt-build /0chain/s3mgrt /usr/local/bin/s3mgrt
RUN apk upgrade
# Install Herumi's cryptography
RUN apk del libstdc++ gmp-dev openssl-dev vips-dev
RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main libstdc++ gmp-dev openssl-dev vips-dev

0 comments on commit 66fb03b

Please sign in to comment.