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(docker-chaosnet): release snapshot docker build failed CI #1847

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Linter
on:
push:
branches: ["main"]
paths: ["**.go", "**.proto", "go.mod", "go.sum"]
paths: ["**.go", "**.proto", "go.mod", "go.sum", "**go.mod", "**go.sum"]
pull_request:
paths: ["**.go", "**.proto", "go.mod", "go.sum"]
paths: ["**.go", "**.proto", "go.mod", "go.sum", "**go.mod", "**go.sum"]

# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 0 * * *" # Runs automatically every day
pull_request:
# paths makes the action run only when the given paths are changed
paths: ["**.go", "**.proto", "go.mod", "go.sum"]
paths: ["**.go", "**.proto", "go.mod", "go.sum", "**go.mod", "**go.sum"]

# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Unit Tests

on:
pull_request:
paths: ["**.go", "**.proto", "go.mod", "go.sum"]
paths: ["**.go", "**.proto", "go.mod", "go.sum", "**go.mod", "**go.sum", "contrib/docker/*"]

# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1837](https://github.com/NibiruChain/nibiru/pull/1837) - feat(eth): protos, eth types, and evm module types
- [#1838](https://github.com/NibiruChain/nibiru/pull/1838) - feat(eth): Go-ethereum, crypto, encoding, and unit tests for evm/types
- [#1841](https://github.com/NibiruChain/nibiru/pull/1841) - feat(eth): Collections encoders for bytes, Ethereum addresses, and Ethereum hashes
- [#1847](https://github.com/NibiruChain/nibiru/pull/1847) - fix(docker-chaosnet): release snapshot docker build failed CI.

#### Dapp modules: perp, spot, etc

Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ FROM golang:1.21 AS builder

WORKDIR /nibiru

COPY go.sum go.mod ./
# copy go.mod, go.sum to WORKDIR
COPY go.sum go.mod ./
# copy geth to WORKDIR/geth
COPY geth ./geth
RUN go mod download
COPY . .

Expand Down
8 changes: 6 additions & 2 deletions contrib/docker/chaosnet.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ FROM golang:1.21 AS builder

WORKDIR /nibiru

COPY go.sum go.mod ./
# copy go.mod, go.sum to WORKDIR
COPY go.sum go.mod ./
# copy geth to WORKDIR/geth
COPY geth ./geth
Comment on lines +7 to +8
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Review Summary

The verification process aimed to ensure that the geth executable is correctly placed and has the necessary permissions set for execution within the Docker container. The script executed checked for the presence and executable permissions of files named geth across the repository.

Findings

The output from the script indicates mixed results:

  • Some instances of the geth file have executable permissions set.
  • Several instances of the geth file do not have executable permissions set.

This inconsistency suggests that while some geth files are prepared for execution, others are not, which could lead to issues depending on which file is being copied into the Docker container.

Action Required

Given the mixed permissions observed, it is recommended to ensure that the specific geth file intended for use in the Docker container has executable permissions set. This might involve setting the permissions explicitly in the Dockerfile or verifying that the correct file with the necessary permissions is being used.

Analysis chain

Ensure that the geth executable is correctly placed and has the necessary permissions set for execution within the Docker container.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the `geth` file exists and has execute permissions
fd 'geth' --exec bash -c 'if [ -x {} ]; then echo "Executable permission is set for geth."; else echo "Executable permission is NOT set for geth."; fi'

Length of output: 612

RUN go mod download
COPY . .
# copy the rest of the project to WORKDIR
COPY . .

RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
Expand Down
Loading