Closed lyuxiaosu closed 8 months ago
Hi,
This may happen if the cluster deployment failed at some point in the past, and you are running it again.
In fact, if you were to run the instructions you pasted on a completely fresh directory, the first time you run docker ps
(with, btw, you are better off running faasmctl status
), you should see that most containers failed to start.
This is because when you deploy a development cluster with --mount-source
, faasmctl
will mount your local ./dev/faasm/build
into /build/faasm
and share this directory with all the containers. As a consequence, the first time you run the code (and ./dev
does not exist) /build/faasm
will be empty in all directories (and in particular the binaries won't be in /build/faasm/bin
).
Similarly, when deploying with --mount-source
, we will mount ./dev/faasm-local
into /usr/local/faasm
for all containers in the cluster. /usr/local/faasm
is a very important directory for faasm
as it stores all the cross-compilation toolchain in /usr/local/faasm/tools
and the LLVM sysroot to cross-compile to WASM in /usr/local/faasm/llvm-sysroot
.
Your error is complaining that /usr/local/faasm/toolchain
is an empty directory. This is because faasmctl deploy.compose
did not populate the sysroot mount. This population happens here: https://github.com/faasm/faasmctl/blob/main/faasmctl/util/compose.py#L241-L268. In summary, if ./dev/faasm-local
already existed for some reason, the population is skipped. This can happen after a failed deployment.
In short, I suggest doing the following steps:
faasmctl delete
sudo rm -rf ./dev
faasmctl deploy.compose --mount-source .
# Now this should report some failed containers
faasmctl status
faasmctl cli.faasm
inv dev.tools
exit
faasmctl restart -s worker -s upload -s planner
# All containers should be happy now
faasmctl status
faasmctl cli.cpp
inv func demo hello
Note that what I just described is exactly what the e2e
tests do: https://github.com/faasm/faasm/blob/main/tests/e2e/run.sh
Thanks for the detailed reply @csegarragonz , this solved the problem, now I can build and run happily:) Really appreciate!
Glad I could help!
Hi, I want to build faasm and deploy a local cluster with it. If I use the released version to deploy, everything is fine, but if I used the local build version,
inv func demo hello
doesn't work. Here is the step I did.docker ps
to check all containers are runningdocker logs
to check all containers are running in normalThen it gets some errors:
This can be reproduced. Did I miss something? Thank you for your help.