elixir-nx / hnswlib

Elixir binding for the hnswlib library.
Apache License 2.0
52 stars 9 forks source link

missing checksum.exs file #8

Closed cbh123 closed 11 months ago

cbh123 commented 11 months ago

With the latest release, I get a step further (thank you!). But I'm now seeing a missing checksum file when I deploy. Any idea how to fix this?

I added this to my mix.exs:

{:hnswlib, github: "elixir-nx/hnswlib", tag: "v0.1.2"}

Then on compilation:

#0 44.63 Error happened while installing hnswlib from precompiled binary: "missing checksum.exs file".

Full error:

#0 44.28 Downloading precompiled NIF to /root/.cache/hnswlib-nif-2.17-x86_64-linux-gnu-0.1.2.tar.gz
#0 44.63 Error happened while installing hnswlib from precompiled binary: "missing checksum.exs file".
#0 44.63 
#0 44.63 Attempting to compile hnswlib from source...
#0 44.64 /bin/sh: 4: cmake: not found
#0 44.64 incomplete build of hnswlib found in '/app/_build/prod/lib/hnswlib/cmake_hnswlib', please delete that directory and retry
#0 44.64 make: *** [Makefile:37: /app/_build/prod/lib/hnswlib/priv/hnswlib_nif.so] Error 1
#0 44.64 could not compile dependency :hnswlib, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile hnswlib --force", update it with "mix deps.update hnswlib" or clean it with "mix deps.clean hnswlib"

Originally posted by @cbh123 in https://github.com/elixir-nx/hnswlib/issues/6#issuecomment-1719683148

josevalim commented 11 months ago

@cbh123 please use the released package, as that includes the checksum.exs file. otherwise you need to have cmake installed so it compiles it locally. :)

cbh123 commented 11 months ago

Ah, whoops! Yeah, I updated dep to use {:hnswlib, "~> 0.1.2"} and it deploys. Thanks!

Update: The deployment works, but then the app doesn't run in Fly :(. When I comment out {:hnswlib, "~> 0.1.2"} in my mix.exs, the app runs. When I add it back in, the app continually crashes with a bunch of logs that look like this:

2023-09-14T19:25:10Z app[9080e710a35918] ewr [info]19:25:10.238 [notice] SIGTERM received - shutting down
2023-09-14T19:25:10Z app[9080e710a35918] ewr [info]19:25:10.239 [info] Shutting down 63 sockets in 1 rounds of 2000ms
error.message="instance refused connection. is your app listening on 0.0.0.0:8080? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)" 2023-09-14T19:25:10Z proxy[e148e02a535089] ewr [error]request.method="GET" request.id="01HAAJF1T07G0D67YXK22PQ3E6-lga" 
error.message="instance refused connection. is your app listening on 0.0.0.0:8080? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)" 2023-09-14T19:25:10Z proxy[9080e710a35918] ewr [error]request.method="GET" request.id="01HAAJF1T07G0D67YXK22PQ3E6-lga" 
2023-09-14T19:25:11Z app[9080e710a35918] ewr [info] WARN Reaped child process with pid: 447 and signal: SIGUSR1, core dumped? false
2023-09-14T19:25:12Z app[9080e710a35918] ewr [info] INFO Main child exited normally with code: 0
2023-09-14T19:25:12Z app[9080e710a35918] ewr [info] INFO Starting clean up.
2023-09-14T19:25:12Z app[9080e710a35918] ewr [info] WARN hallpass exited, pid: 374, status: signal: 15 (SIGTERM)
2023-09-14T19:25:12Z app[9080e710a35918] ewr [info]2023/09/14 19:25:12 listening on [fdaa:0:3978:a7b:15e:8103:b31b:2]:22 (DNS: [fdaa::3]:53)
2023-09-14T19:25:13Z app[9080e710a35918] ewr [info][  248.805348] reboot: Restarting system
2023-09-14T19:25:14Z app[9080e710a35918] ewr [info][    0.212381] PCI: Fatal: No config space access function found

I'm struggling to figure out why this is. The only difference I can tell is that when I deploy without hnswlib, I see this:

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
  - 0.0.0.0:5432
Found these processes inside the machine with open listening sockets:
  PROCESS                                                                                                                                                                                                                                                                                                                                                                                                                                          | ADDRESSES                           
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*-------------------------------------
  /app/erts-14.0.2/bin/beam.smp -- -root /app -bindir /app/erts-14.0.2/bin -progname erl -- -home /nonexistent -- -proto_dist inet6_tcp -- -noshell -s elixir start_cli -mode embedded -setcookie R3GUFIFBBQVUKLU2EVAI7IDRJGGQZCKTPUW6DRGNCEP6VE6VCW4A==== -name emoji-01HAAKJAEN3V62D0B5PJB9NKXM@fdaa:0:3978:a7b:ab2:bd88:9a:2 -config /app/releases/0.1.0/sys -boot /app/releases/0.1.0/start -boot_var RELEASE_LIB /app/lib -- -extra --no-halt | [::]:33955, [::]:8080               
  /.fly/hallpass                                                                                                                                                                                                                                                                                                                                                                                                                                   | [fdaa:0:3978:a7b:ab2:bd88:9a:2]:22  
  /app/erts-14.0.2/bin/epmd -daemon                                                                                                                                                                                                                                                                                                                                                                                                                | 0.0.0.0:4369, [::]:4369            

When I deploy WITH hnsw, the warning is slightly different:

 WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
  - 0.0.0.0:8080
  - 0.0.0.0:5432
Found these processes inside the machine with open listening sockets:
  PROCESS                           | ADDRESSES                           
------------------------------------*-------------------------------------
  /.fly/hallpass                    | [fdaa:0:3978:a7b:ab2:bd88:9a:2]:22  
  /app/erts-14.0.2/bin/epmd -daemon | 0.0.0.0:4369, [::]:4369          

In both cases, the app successfully deploys. But when {:hnswlib, "~> 0.1.2"} is present, the app continually crashes.

I tried bumping up the memory but that didn't seem to help either.