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): building simapp docker image #47

Merged
merged 8 commits into from
Dec 18, 2024

Conversation

rootulp
Copy link
Contributor

@rootulp rootulp commented Dec 17, 2024

Closes #46

Also I noticed the install-dependencies command didn't show up in make help output. Fixed a few other small things while reviewing it.

@rootulp rootulp self-assigned this Dec 17, 2024
@rootulp rootulp marked this pull request as ready for review December 17, 2024 19:48
@rootulp rootulp changed the title fix: simd issue fix(docker): building simapp docker image Dec 17, 2024
@@ -19,7 +19,7 @@ WORKDIR /celestia_zkevm_ibc_demo

RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build
make build-simapp
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was the fix. make build doesn't do anything b/c it was recently renamed to make build-simapp

Copy link
Collaborator

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this

@cmwaters
Copy link
Collaborator

Is the problem here that we should be pushing the changes to simapp to ghcr

simapp-validator:
    image: ghcr.io/celestiaorg/simapp:latest

@rootulp
Copy link
Contributor Author

rootulp commented Dec 18, 2024

Yea we can do that too. My impression is that if you have a Docker image locally tag with latest then Docker will use that instead of fetching the latest one from GHCR so this could be fixed with:

  1. Build the docker image locally via make install-dependencies (this PR)
  2. Manually push an image to GHCR. Update: done.
  3. In CI automatically push an image to GHCR: GitHub workflow to publish simapp Docker image #48

@cmwaters
Copy link
Collaborator

If we're pushing the images to ghcr then we don't need to add make build-simapp-docker to make install-dependencies

@cmwaters
Copy link
Collaborator

cmwaters commented Dec 18, 2024

As an aside, I get this error when trying to build the docker image:

EDIT: It might be because I need to build it locally first

❯ make build-simapp-docker
--> Building Docker image
/opt/homebrew/bin/docker build -t ghcr.io/celestiaorg/simapp -f docker/Dockerfile .
[+] Building 102.6s (13/14)                                                                                                                                  docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                         0.0s
 => => transferring dockerfile: 1.36kB                                                                                                                                       0.0s
 => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 2)                                                                                               0.0s
 => [internal] load metadata for docker.io/library/alpine:3.20                                                                                                               1.2s
 => [internal] load metadata for docker.io/library/golang:1.23.1-alpine3.20                                                                                                  1.9s
 => [internal] load .dockerignore                                                                                                                                            0.0s
 => => transferring context: 2B                                                                                                                                              0.0s
 => [builder 1/5] FROM docker.io/library/golang:1.23.1-alpine3.20@sha256:ac67716dd016429be8d4c2c53a248d7bcdf06d34127d3dc451bda6aa5a87bc06                                    7.4s
 => => resolve docker.io/library/golang:1.23.1-alpine3.20@sha256:ac67716dd016429be8d4c2c53a248d7bcdf06d34127d3dc451bda6aa5a87bc06                                            0.0s
 => => sha256:6cac1a4b065c9c855fffe18402bb1a7f6f7e3d3c997a5d6efece488ea46d240e 293.50kB / 293.50kB                                                                           0.7s
 => => sha256:a355a3cac949bed5cda9c62103ceb0f004727cedcd2a17d7c9836aea1a452fda 70.62MB / 70.62MB                                                                             2.5s
 => => sha256:391ae752cf17d63466dfc6a65b5ea06393c5e072568fed74b4365617fd9d56df 125B / 125B                                                                                   0.6s
 => => sha256:ac67716dd016429be8d4c2c53a248d7bcdf06d34127d3dc451bda6aa5a87bc06 10.29kB / 10.29kB                                                                             0.0s
 => => sha256:779ec1419250e4c96273bab8a7aa4e06f68e8fba0d4928bd6f6d86baa4f7bf82 1.92kB / 1.92kB                                                                               0.0s
 => => sha256:07228514b78b57adcf9b81fa791a62f3003088958e0afcee6fd09f297abb9370 2.07kB / 2.07kB                                                                               0.0s
 => => sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B                                                                                     0.7s
 => => extracting sha256:6cac1a4b065c9c855fffe18402bb1a7f6f7e3d3c997a5d6efece488ea46d240e                                                                                    0.0s
 => => extracting sha256:a355a3cac949bed5cda9c62103ceb0f004727cedcd2a17d7c9836aea1a452fda                                                                                    4.6s
 => => extracting sha256:391ae752cf17d63466dfc6a65b5ea06393c5e072568fed74b4365617fd9d56df                                                                                    0.0s
 => => extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1                                                                                    0.0s
 => [stage-1 1/4] FROM docker.io/library/alpine:3.20@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a                                                 0.0s
 => [internal] load build context                                                                                                                                           66.8s
 => => transferring context: 14.19GB                                                                                                                                        66.5s
 => [builder 2/5] RUN apk update && apk add --no-cache     gcc     git     linux-headers     make     musl-dev                                                               3.9s
 => [builder 3/5] COPY . /celestia_zkevm_ibc_demo                                                                                                                           22.3s
 => [builder 4/5] WORKDIR /celestia_zkevm_ibc_demo                                                                                                                           0.0s
 => [builder 5/5] RUN uname -a &&    CGO_ENABLED=0 GOOS=linux GOARCH=arm64     make build                                                                                    0.1s
 => CACHED [stage-1 2/4] RUN apk update && apk add --no-cache     bash     curl     jq     make     && adduser celestia     -D     -g celestia     -h /home/celestia     -s  0.0s
 => ERROR [stage-1 3/4] COPY --from=builder /celestia_zkevm_ibc_demo/build/simd /bin/simd                                                                                    0.0s
------
 > [stage-1 3/4] COPY --from=builder /celestia_zkevm_ibc_demo/build/simd /bin/simd:
------

 1 warning found (use docker --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 2)
Dockerfile:49
--------------------
  47 |     
  48 |     # Copy in the txsim binary
  49 | >>> COPY --from=builder /celestia_zkevm_ibc_demo/build/simd /bin/simd
  50 |     
  51 |     USER ${USER_NAME}
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref dd6cb81c-a37e-4bd4-9875-a5e10dede00a::nccjuf3vk2o8rgwhpwxxk7kia: "/celestia_zkevm_ibc_demo/build/simd": not found
make: *** [build-simapp-docker] Error 1

Makefile Outdated Show resolved Hide resolved
@rootulp rootulp merged commit d1edc78 into celestiaorg:main Dec 18, 2024
4 checks passed
@rootulp rootulp deleted the rp/fix-simd-exec branch December 18, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

simapp /bin/simd: cannot execute binary file: Exec format error
2 participants