Skip to content

Commit

Permalink
Merge branch 'main' into rp/ica
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Mar 14, 2024
2 parents 2c49441 + 2660108 commit af5e42f
Show file tree
Hide file tree
Showing 74 changed files with 2,094 additions and 2,659 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ on:
schedule:
- cron: '24 20 * * 4'

env:
GO_VERSION: '1.21.6'

jobs:
analyze:
name: Analyze
Expand Down Expand Up @@ -59,7 +56,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'

- name: Build binary
run: |
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
GORELEASER_ACCESS_TOKEN:
required: true

env:
GO_VERSION: '1.21.1'

jobs:
goreleaser-check:
runs-on: ubuntu-latest
Expand All @@ -32,7 +29,7 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'
- name: Create .release-env file
run: |-
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_ACCESS_TOKEN}}' >> .release-env
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ name: govulncheck
on:
pull_request:

env:
GO_VERSION: '1.21.6'

jobs:
govulncheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v4
go-version-file: 'go.mod'
- name: make govulncheck
run: make govulncheck
5 changes: 1 addition & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: lint
on:
workflow_call:

env:
GO_VERSION: '1.21.6'

jobs:
golangci-lint:
name: golangci-lint
Expand All @@ -14,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'
- uses: technote-space/[email protected]
with:
# This job will pass without running if go.mod, go.sum, and *.go
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
- cron: "0 6 * * *"
workflow_dispatch:

env:
GO_VERSION: '1.21.6'

jobs:
test-e2e:
runs-on: ubuntu-latest
Expand All @@ -16,7 +13,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'

- name: Setup kubeconfig
env:
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: test
on:
workflow_call:

env:
GO_VERSION: '1.21.6'

jobs:
test-short:
runs-on: ubuntu-latest
Expand All @@ -13,7 +10,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'

- name: Run tests in short mode
run: make test-short
Expand All @@ -26,7 +23,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'

- name: Run tests
run: make test
Expand All @@ -38,13 +35,13 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'

- name: Generate coverage.txt
run: make test-coverage

- name: Upload coverage.txt
uses: codecov/codecov-action@v4.0.1
uses: codecov/codecov-action@v4.1.0
with:
file: ./coverage.txt

Expand All @@ -55,7 +52,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'

- name: Run tests in race mode
run: make test-race
Expand All @@ -67,7 +64,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: 'go.mod'

- name: Run fuzz tests
run: make test-fuzz
47 changes: 30 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# stage 1 Generate celestia-appd Binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.6-alpine3.18 as builder

# This Dockerfile performs a multi-stage build. BUILDER_IMAGE is the image used
# to compile the celestia-appd binary. RUNTIME_IMAGE is the image that will be
# returned with the final celestia-appd binary.
#
# Separating the builder and runtime image allows the runtime image to be
# considerably smaller because it doesn't need to have Golang installed.
ARG BUILDER_IMAGE=docker.io/golang:1.22.1-alpine3.18
ARG RUNTIME_IMAGE=docker.io/alpine:3.19.1
ARG TARGETOS
ARG TARGETARCH

# Stage 1: Build the celestia-appd binary inside a builder image that will be discarded later.
# Ignore hadolint rule because hadolint can't parse the variable.
# See https://github.com/hadolint/hadolint/issues/339
# hadolint ignore=DL3006
FROM --platform=$BUILDPLATFORM ${BUILDER_IMAGE} AS builder
ENV CGO_ENABLED=0
ENV GO111MODULE=on
# hadolint ignore=DL3018
Expand All @@ -20,15 +30,16 @@ RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build

# stage 2
FROM docker.io/alpine:3.19.1

# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
# Stage 2: Create a minimal image to run the celestia-appd binary
# Ignore hadolint rule because hadolint can't parse the variable.
# See https://github.com/hadolint/hadolint/issues/339
# hadolint ignore=DL3006
FROM ${RUNTIME_IMAGE} AS runtime
# Use UID 10,001 because UIDs below 10,000 are a security risk.
# Ref: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
ARG USER_NAME=celestia

ENV CELESTIA_HOME=/home/${USER_NAME}

# hadolint ignore=DL3018
RUN apk update && apk add --no-cache \
bash \
Expand All @@ -40,15 +51,17 @@ RUN apk update && apk add --no-cache \
-h ${CELESTIA_HOME} \
-s /sbin/nologin \
-u ${UID}

# Copy in the binary
# Copy the celestia-appd binary from the builder into the final image.
COPY --from=builder /celestia-app/build/celestia-appd /bin/celestia-appd

# Copy the entrypoint script into the final image.
COPY --chown=${USER_NAME}:${USER_NAME} docker/entrypoint.sh /opt/entrypoint.sh

# Set the user to celestia.
USER ${USER_NAME}

# p2p, rpc, prometheus, api and grpc ports
EXPOSE 26656 26657 26660 1317 9090

# Expose ports:
# 1317 is the default API server port.
# 9090 is the default GRPC server port.
# 26656 is the default node p2p port.
# 26657 is the default RPC port.
# 26660 is the port used for Prometheus.
EXPOSE 1317 9090 26656 26657 26660
ENTRYPOINT [ "/bin/bash", "/opt/entrypoint.sh" ]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspa
PROJECTNAME=$(shell basename "$(PWD)")
HTTPS_GIT := https://github.com/celestiaorg/celestia-app.git
PACKAGE_NAME := github.com/celestiaorg/celestia-app
GOLANG_CROSS_VERSION ?= v1.21.6
GOLANG_CROSS_VERSION ?= v1.22.1

# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=celestia-app \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ node | | | |

### Source

1. [Install Go](https://go.dev/doc/install) 1.21.6
1. [Install Go](https://go.dev/doc/install) 1.22.1
1. Clone this repo
1. Install the celestia-app CLI

Expand Down
Loading

0 comments on commit af5e42f

Please sign in to comment.