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

NEAR Lake Indexer does not work on macos #393

Closed
itegulov opened this issue Nov 29, 2023 · 4 comments · Fixed by #392
Closed

NEAR Lake Indexer does not work on macos #393

itegulov opened this issue Nov 29, 2023 · 4 comments · Fixed by #392
Assignees
Labels
Emerging Tech Emerging Tech flying formation at Pagoda Near BOS NEAR BOS team at Pagoda

Comments

@itegulov
Copy link
Contributor

itegulov commented Nov 29, 2023

Description

Running NEAR Lake Indexer results into the following errors:

2023-11-29T02:07:23.918329Z ERROR ThreadId(09) mpc_recovery_node::protocol:
could not fetch contract's state: handler error:
[Function call returned an error: wasm execution failed with error:
  CompilationError(WasmerCompileError {
      msg: "The target x86_64 without AVX is not yet supported (see https://docs.wasmer.io/ecosystem/wasmer/wasmer-features)"
  })
]

The most likely reason is that I built the original image on an x86 Linux machine and we need a separate macos ARM-based image. Dockerfile was added in this PR.

Proposed steps to resolve this:

  1. Try to build NEAR Lake Indexer Dockerfile as is and if it works push it to near-lake-indexer regsitry with latest-aarch64 tag
  2. If it does not work, write a separate macos-specific Dockerfile and upstream it to the near-lake-indexer repo then push to the registry
  3. (Optional) Figure out how to make latest tag conditionally choose which image to pull depending on your host system. I know that Docker Hub can do this, not sure about Github Container Registry.
@itegulov itegulov added Near BOS NEAR BOS team at Pagoda Emerging Tech Emerging Tech flying formation at Pagoda labels Nov 29, 2023
@ppca ppca moved this from Backlog to In Progress in Emerging Technologies Nov 29, 2023
@ppca
Copy link
Contributor

ppca commented Nov 29, 2023

question: https://github.com/orgs/near/packages/container/near-lake-indexer/147379646?tag=e6519c922435f3d18b5f2ddac5d1ec171ef4dd6b how is the tag picked?

We currently in code intentionally force to use a specific tag of the indexer (same for the os-relayer), I guess we'd want to stick with that. If so, I could build a macos image at the same commit you built the above one from, and push it. We can configure same tag to contain multiple images for different architectures, and when I do docker pull, it will pull the compatible one, example: https://github.com/orgs/near/packages/container/near-lake-indexer/152859204?tag=toy

Or I could also build a linux version and a macOS image from latest code, put them both under the tag of latest, and both under the tag of commit_hash. But then a PR is needed and folks need to pull the new docker image (edited)

btw, using the docker image of indexer built locally on mac machine, all tests are running fine

@ppca
Copy link
Contributor

ppca commented Nov 30, 2023

This is how to enable automatically pulling the image compatible with your local system from the same tag: doc

@itegulov
Copy link
Contributor Author

question: github.com/orgs/near/packages/container/near-lake-indexer/147379646?tag=e6519c922435f3d18b5f2ddac5d1ec171ef4dd6b how is the tag picked?

This is the commit hash of the indexer at the moment when I built it: near/near-lake-indexer@e6519c9

We currently in code intentionally force to use a specific tag of the indexer (same for the os-relayer), I guess we'd want to stick with that. If so, I could build a macos image at the same commit you built the above one from, and push it. We can configure same tag to contain multiple images for different architectures, and when I do docker pull, it will pull the compatible one, example: github.com/orgs/near/packages/container/near-lake-indexer/152859204?tag=toy

Yes, that's awesome and exactly what I was looking for!

Or I could also build a linux version and a macOS image from latest code, put them both under the tag of latest, and both under the tag of commit_hash. But then a PR is needed and folks need to pull the new docker image (edited)

Yeah I would say just build latest and we can update the tag in #392 to make that PR actually fix tests on macos. Also, I don't actually think you need to pull the docker images manually given that you have logged into Github Container Registry already. The tests will just pull the image automatically so I wouldn't worry too much about other people needing to pull the image

btw, using the docker image of indexer built locally on mac machine, all tests are running fine

👍

@ppca
Copy link
Contributor

ppca commented Dec 1, 2023

ghcr.io/near/near-lake-indexer:18ef24922fd7b5b8985ea793fdf7a939e57216ba added with both images and also marked as latest

@ppca ppca moved this from In Progress to Done in Emerging Technologies Dec 1, 2023
@ppca ppca linked a pull request Dec 1, 2023 that will close this issue
@ppca ppca closed this as completed in #392 Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emerging Tech Emerging Tech flying formation at Pagoda Near BOS NEAR BOS team at Pagoda
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants