I'm trying to upload and commit my first webhook i...
# help
g
I'm trying to upload and commit my first webhook in
*lakefs://*repo0*/*main*/*_lakefs_actions*/*dataset.yml
, however, when I try to commit my changes through the web-interface, I get: > pre-commit hook aborted, run id '5dnve4sesbvc72vvdd50': 1 error occurred: * hook run id '0000_0000' failed on action 'Dataset' hook 'dataset_validator': Post "http://0.0.0.0:8080/webhooks/format": dial tcp 0.0.0.08080 connect: connection refused
I do have a server listening on http://0.0.0.0:8080/webhooks/format and simply replying with a text "Hello World!" for the moment
n
Hi @Giuseppe Barbieri, it seems like lakeFS is trying to run the pre-commit hook you added in the action file and fails due to connectivity to the webhook server. Can you provide some details on your setup? How did you set up lakeFS and the webhook server?
g
lakeFS is still the one from lakeFS-samples, the webhook server is a simple ktor application with the routing plugin to answer on
0.0.0.0:8080/webhooks/format
Copy code
fun main() {
    embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module)
        .start(wait = true)
}

fun Application.module() {
    configureRouting()
}

fun Application.configureRouting() {
    routing {
        get("/webhooks/format") {
            call.respondText("Hello World!")
        }
    }
}
n
Is the webhook server deployed as part of the docker file?
g
note: it works because visiting http://0.0.0.0:8080/webhooks/format I get "Hello World!"
no
there is no communication possible between docker and the outside?
n
To be able to communicate with the outside world you need to configure networking rules for inbound and outbound communication
g
uff, so much configuring
ok, thanks
n
That's docker for you 😄 - I highly suggest for your use case to switch to a local settings using the quickstart as discussed before - it will save much of the overhead you have to deal with
g
so I tried the quickstart, but I got the same error, the quickstart does use the docker as well
n
You do not have to run the quickstart under a docker container. You can simply use the lakefs binary and run
./lakefs run --quickstart
(unix syntax) You can either build the binary from the source or use one from our latest release
a
@Giuseppe Barbieri If you want to communicate from Docker container to webhook server outside the container, you can use http://host.docker.internal:8080/webhooks/format
👍 1
g
> pre-commit hook aborted, run id '5dlb5okesbvc72r71od0': 1 error occurred: * hook run id '0000_0000' failed on action 'Dataset' hook 'dataset_validator': Post "http://host.docker.internal:8080/webhooks/format": dial tcp: lookup host.docker.internal on 127.0.0.1153 no such host If I add the flag, as suggested here:
sudo docker compose --add-host=host.docker.internal:host-gateway --profile local-lakefs up
it complains it's an unknown flag
a
AFAIK
--add-host
is a flag for docker run, not docker compose. Network elements of the docker compose file are described here. You are probably using the wrong type of docker network . I believe that your current round of problems is more relevant to Docker configuration and networking than it is to lakeFS. Please note that while we can help with Docker configuration, we are by no means experts on it. I would advise picking a set of technologies with which you are comfortable and using that, rather than trying to pick up speed on both containerization and lakeFS at the same time. For testing it may be easiest to run both lakeFS and your hooks server locally on your machine, without any containerization
g
or testing it may be easiest to run both lakeFS and your hooks server locally on your machine, without any containerization
yeah, that's exactly what I ended up doing
sunglasses lakefs 1