nuclio / nuclio

High-Performance Serverless event and data processing platform
https://nuclio.io
Apache License 2.0
5.27k stars 528 forks source link

[Bug]: Caching of source code / no loading of changed code from git repository #3174

Open RoseDeSable opened 6 months ago

RoseDeSable commented 6 months ago

Nuclio Version checks

Issue Description

Hi, I have stored the sourcecode of the main program of my function in our git repository. The yaml-file of the function is so constructed, that the source code is loaded from the git repository at time of developing. First developing after the importing of the yaml is successful. But if I change the source in the git repository, the changing shows no effort after the developing. I examined this circumstance and come to the conclusion, that the old source is obviously cached in Nuclio and is not replaced by the new. An experiment confirms this: I deleted the source from the git repository and started the developing. This was successful ! First, if I deleted the function and newly loaded the yaml-file, then I received the message of the absence of the code file. The developing failed.

Best Regards Rose

Expected Behavior

-

Deployment Method

Docker

Nuclio Version

1.11.24

Additional Information

No response

TomerShor commented 6 months ago

Hi @RoseDeSable ,

Nuclio skips building a new image in some cases, such as when a specific image is set on the function spec. However, in your case and if not done explicitly, it sounds like it shouldn't skip building on redeployment.

Some questions to better understand the issue:

  1. What code entry type do you set? git or github?
  2. Can you share your function configuration yaml (redact any sensitive info). I'm mainly interested in the spec.build section.
RoseDeSable commented 6 months ago

Good Morning, my code entry type is "git"

Here is the build section - the sensitive parts are modified


build: path: "https://scm.int.my-enterprise/my-account/Nuclio.git" baseImageRegistry: "registry.int.my-enterprise:7008" image: cvat.our-project-modell_0_0_11-standard-ubuntu-python noCache: true baseImage: "registry.int.my-enterprise:7003/standard-ubuntu-python" commands:


TomerShor commented 6 months ago

@RoseDeSable Since you're working in a Docker environment, I suspect that the first created image is still cached by docker, and thus when it's building the function during redeployment, it essentially builds on top of the cached image, instead of building a fresh image.

If possible, I would appreciate seeing the relevant logs from the nuclio-dashboard container. You can do that by the following:

  1. Run docker logs <nuclio-dashboard-container-name>.
  2. Search for the log Building processor image, and locate the requestID relevant for this function's creation.
  3. grep on the logs for all logs with the same requestID.

This will help us better understand this and find the root cause. Thanks§1

RoseDeSable commented 6 months ago

Ok, I speak with my collegues. It could take a long time, until I will inform you.

RoseDeSable commented 6 months ago

Hello, here are the log data, that you wish. I hope, it is correct so. log_nuclio.txt