lithops-cloud / lithops

A multi-cloud framework for big data analytics and embarrassingly parallel jobs, that provides an universal API for building parallel applications in the cloud ☁️🚀
http://lithops.cloud
Apache License 2.0
317 stars 105 forks source link

k8s - Unable to extract metadata from the runtime #1087

Closed AaronSoria closed 1 year ago

AaronSoria commented 1 year ago

I run lithops using k8s as backend and minio as storage in my dev environment. I run lithops test and works fine

/app # lithops test
2023-03-21 23:11:00,979 [INFO] config.py:134 -- Lithops v2.9.0
2023-03-21 23:11:07,911 [INFO] minio.py:61 -- MinIO client created - Endpoint: http://192.168.100.91:9000
2023-03-21 23:11:08,272 [INFO] k8s.py:81 -- Kubernetes Job client created - Namespace: default
2023-03-21 23:11:08,272 [INFO] invokers.py:108 -- ExecutorID 663acb-0 | JobID A000 - Selected Runtime: docker.io/aarons28/lithops-kubernetes-default-v310:2.9.0 - 1024MB
2023-03-21 23:11:08,580 [INFO] invokers.py:172 -- ExecutorID 663acb-0 | JobID A000 - Starting function invocation: hello() - Total: 1 activations
2023-03-21 23:11:10,633 [INFO] invokers.py:208 -- ExecutorID 663acb-0 | JobID A000 - View execution logs at /tmp/lithops-root/logs/663acb-0-A000.log
2023-03-21 23:11:10,633 [INFO] wait.py:97 -- ExecutorID 663acb-0 - Getting results from 1 function activations

  100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1

2023-03-21 23:11:19,167 [INFO] executors.py:612 -- ExecutorID 663acb-0 - Cleaning temporary data

Hello root! Lithops is working as expected :)

But when I want to use a custom runtime have the following issue

2023-03-21 23:07:12,748 [INFO] config.py:134 -- Lithops v2.9.0
2023-03-21 23:07:15,004 [INFO] minio.py:61 -- MinIO client created - Endpoint: http://192.168.100.91:9000
2023-03-21 23:07:15,025 [INFO] k8s.py:81 -- Kubernetes Job client created - Namespace: default
convertion Starts at:  2023-03-21 23:07:15.026377
2023-03-21 23:07:15,026 [INFO] invokers.py:108 -- ExecutorID a64f21-0 | JobID M000 - Selected Runtime: docker.io/aarons28/lithops-kubernetes-default-v310:1.1 - 1024MB
2023-03-21 23:07:15,124 [INFO] invokers.py:116 -- Runtime docker.io/aarons28/lithops-kubernetes-default-v310:1.1 with 1024MB is not yet deployed
2023-03-21 23:07:15,124 [INFO] k8s.py:200 -- Deploying runtime: docker.io/aarons28/lithops-kubernetes-default-v310:1.1 - Memory: 1024 Timeout: 600
2023-03-21 23:07:15,189 [INFO] k8s.py:371 -- Extracting metadata from: docker.io/aarons28/lithops-kubernetes-default-v310:1.1
Traceback (most recent call last):
  File "/app/parallel_k8s.py", line 37, in <module>
    results = p.map(process_img, [DataTransferObject('https://fondosmil.com/fondo/17009.jpg', 'output1.jpg'),
  File "/usr/lib/python3.10/site-packages/lithops/executors.py", line 266, in map
    runtime_meta = self.invoker.select_runtime(job_id, runtime_memory)
  File "/usr/lib/python3.10/site-packages/lithops/invokers.py", line 117, in select_runtime
    runtime_meta = self.compute_handler.deploy_runtime(self.runtime_name, runtime_memory, runtime_timeout)
  File "/usr/lib/python3.10/site-packages/lithops/serverless/serverless.py", line 73, in deploy_runtime
    return self.backend.deploy_runtime(runtime_name, memory, timeout=timeout)
  File "/usr/lib/python3.10/site-packages/lithops/serverless/backends/k8s/k8s.py", line 202, in deploy_runtime
    runtime_meta = self._generate_runtime_meta(docker_image_name)
  File "/usr/lib/python3.10/site-packages/lithops/serverless/backends/k8s/k8s.py", line 439, in _generate_runtime_meta
    raise Exception("Unable to extract metadata from the runtime")
Exception: Unable to extract metadata from the runtime

I build the image following the documentation and the I also have a public repo for that image

JosepSampe commented 1 year ago

@AaronSoria As I can see your custom runtime does not contain the boto3 library required by the MinIO backend.

Can you check if this is the problem?

AaronSoria commented 1 year ago

Solved, I was missing boto3