Skip to content

Commit

Permalink
Switch agoric build to imported docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
minniux committed Aug 29, 2024
1 parent 0badb17 commit 144b89c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 37 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/agoric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and Push agoric Docker Image
on:
push:
tags:
- "agoric-upgrade-[0-9]+*"
- "agoric-sdk-[0-9]+*"
workflow_dispatch:

env:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Extract version from tag
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: echo "VERSION=${GITHUB_REF#refs/tags/agoric-sdk-}" >> $GITHUB_ENV

- name: Manually pull the base Docker image
run: |
Expand All @@ -52,9 +52,9 @@ jobs:

- name: Build and push agoric Docker image
run: |
./heighliner build -c agoric-agd --go-version 1.21 --git-ref ${{ env.VERSION }}
./heighliner build -c agoric-imported 1.21 --git-ref ${{ env.VERSION }}
- name: Tag and push Docker image
run: |
docker tag agoric:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:agoric-${{ env.VERSION }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:agoric-${{ env.VERSION }}
docker tag agoric-imported:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
42 changes: 10 additions & 32 deletions chains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,41 +78,19 @@
ln -s /root/.nvm/versions/node/*/bin/node /bin/node
# Agoric-sdk
- name: agoric-agd
dockerfile: cargo
github-organization: Agoric
github-repo: agoric-sdk
- name: agoric-imported
dockerfile: imported
base-image: ghcr.io/agoric/agoric-sdk
build-env:
- LEDGER_ENABLED=false
build-target: |
set -eux
cd golang/cosmos
export CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} CC=${ARCH}-linux-gnu-gcc CXX=${ARCH}-linux-gnu-g++
COMMIT=$(git log -1 --format='%H')
COMMON_LDFLAGS="-X github.com/cosmos/cosmos-sdk/version.Name=agoric \
-X github.com/cosmos/cosmos-sdk/version.AppName=agd \
-X github.com/cosmos/cosmos-sdk/version.Version=$VERSION \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$BUILD_TAGS" \
-X github.com/cosmos/cosmos-sdk/version.Commit=$COMMIT"
# Build daemon lib
go build -v -mod=readonly -tags "$BUILD_TAGS" -ldflags "$COMMON_LDFLAGS" -buildmode=c-shared -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go
# Build agd
go build -v -mod=readonly -tags "$BUILD_TAGS" -ldflags "$COMMON_LDFLAGS" -o ../../bin/agd ./cmd/agd
# Move to final location
cd ../../
mkdir /agoric-sdk
mv bin golang /agoric-sdk
binaries:
- /usr/src/agoric-sdk/golang/cosmos/build/agd
- /usr/src/agoric-sdk/packages/cosmic-swingset/bin/ag-chain-cosmos
- /usr/local/bin/node
directories:
- /agoric-sdk
final-image: |
set -eux
ln -s /agoric-sdk/bin/agd /bin/agd
mkdir -p /go/src/github.com/p2p-org/agoric-sdk/golang/cosmos/build /build/agoric-sdk/golang/cosmos/build
mv /agoric-sdk/golang/cosmos/build/libagcosmosdaemon.so /go/src/github.com/p2p-org/agoric-sdk/golang/cosmos/build/
ln -s /go/src/github.com/p2p-org/agoric-sdk/golang/cosmos/build/libagcosmosdaemon.so /build/agoric-sdk/golang/cosmos/build/libagcosmosdaemon.so
- /usr/src/agoric-sdk/
- /usr/local/lib/
- /usr/local/bin/

# Akash
- name: akash
Expand Down

0 comments on commit 144b89c

Please sign in to comment.