https://lakefs.io/ logo
#help
Title
# help
g

Giuseppe Barbieri

02/08/2024, 9:55 AM
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

Niro

02/08/2024, 10:01 AM
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

Giuseppe Barbieri

02/08/2024, 10:10 AM
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

Niro

02/08/2024, 10:11 AM
Is the webhook server deployed as part of the docker file?
g

Giuseppe Barbieri

02/08/2024, 10:11 AM
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

Niro

02/08/2024, 10:12 AM
To be able to communicate with the outside world you need to configure networking rules for inbound and outbound communication
g

Giuseppe Barbieri

02/08/2024, 10:13 AM
uff, so much configuring
ok, thanks
n

Niro

02/08/2024, 10:14 AM
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

Giuseppe Barbieri

02/09/2024, 8:45 AM
so I tried the quickstart, but I got the same error, the quickstart does use the docker as well
n

Niro

02/09/2024, 12:17 PM
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

Amit Kesarwani

02/09/2024, 8:06 PM
@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

Giuseppe Barbieri

02/12/2024, 9:47 AM
> 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

Ariel Shaqed (Scolnicov)

02/13/2024, 11:41 AM
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

Giuseppe Barbieri

02/14/2024, 5:35 AM
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