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
315 stars 103 forks source link

Runtime deploy --memory 2000 #1385

Closed thodson-usgs closed 1 month ago

thodson-usgs commented 1 month ago

Running lithops runtime deploy --memory 2000 command fails but changing --memory to any other value, like 1999 or 2001, will deploy successfully.

My only experience with lithops is working through the cubed lithops examples:

lithops runtime build -b aws_lambda -f docker/Dockerfile_aws_lambda cubed-runtime
lithops runtime deploy -b aws_lambda --memory 2000 --timeout 180 cubed-runtime # optional, will be done automatically on first use

Being expert in neither cubed nor lithops, I'm unsure. However, I don't see an obvious issue with the cubed-runtime, so this might be an issue with lithops.

JosepSampe commented 1 month ago

Could you post the error message you are seeing when deploying the runtime?

I just ran a test and it appears to work properly with 2000MB:

josep@pc:~/runtime/aws_lambda$ lithops runtime deploy -b aws_lambda -s aws_s3 --memory 2000 --timeout 180 cubed-runtime
2024-07-15 11:04:18,405 [INFO] config.py:139 -- Lithops v3.4.2.dev0 - Python3.10
2024-07-15 11:04:18,406 [DEBUG] config.py:101 -- Loading configuration from /home/josep/.lithops/config
2024-07-15 11:04:18,429 [DEBUG] config.py:179 -- Loading Serverless backend module: aws_lambda
2024-07-15 11:04:18,491 [DEBUG] config.py:219 -- Loading Storage backend module: aws_s3
2024-07-15 11:04:18,496 [DEBUG] aws_s3.py:36 -- Creating AWS S3 Client
2024-07-15 11:04:18,616 [INFO] aws_s3.py:59 -- S3 client created - Region: eu-west-1
2024-07-15 11:04:19,503 [DEBUG] aws_lambda.py:53 -- Creating AWS Lambda client
2024-07-15 11:04:20,048 [INFO] aws_lambda.py:97 -- AWS Lambda client created - Region: eu-west-1
2024-07-15 11:04:20,049 [INFO] aws_lambda.py:448 -- Deploying runtime: cubed-runtime - Memory: 2000 Timeout: 180
2024-07-15 11:04:46,584 [DEBUG] aws_lambda.py:155 -- "lithops-worker-75h4-342dev0-07e8ca4079" function is being deployed... (status: Pending)
2024-07-15 11:04:46,673 [DEBUG] aws_lambda.py:165 -- Ok --> function "lithops-worker-75h4-342dev0-07e8ca4079" is active
2024-07-15 11:04:46,673 [DEBUG] aws_lambda.py:516 -- OK --> Created lambda function lithops-worker-75h4-342dev0-07e8ca4079
2024-07-15 11:04:46,673 [DEBUG] aws_lambda.py:700 -- Extracting runtime metadata from: cubed-runtime
2024-07-15 11:04:51,907 [DEBUG] storage.py:520 -- Uploading runtime metadata to: aws_s3://lithops-eu-west-1-75h4/lithops.runtimes/aws_lambda/3.4.2.dev0/eu-west-1/lithops-worker-75h4-342dev0-07e8ca4079.meta.json
2024-07-15 11:04:52,353 [DEBUG] aws_s3.py:106 -- PUT Object lithops.runtimes/aws_lambda/3.4.2.dev0/eu-west-1/lithops-worker-75h4-342dev0-07e8ca4079.meta.json - Size: 6.3KiB - OK
2024-07-15 11:04:52,353 [DEBUG] storage.py:526 -- Storing runtime metadata into local cache: /home/josep/.lithops/cache/lithops.runtimes/aws_lambda/3.4.2.dev0/eu-west-1/lithops-worker-75h4-342dev0-07e8ca4079.meta.json
2024-07-15 11:04:52,355 [INFO] cli.py:527 -- Runtime deployed
josep@pc:~/runtime/aws_lambda$ lithops runtime list -b aws_lambda -s aws_s3
2024-07-15 11:05:11,333 [INFO] config.py:139 -- Lithops v3.4.2.dev0 - Python3.10
2024-07-15 11:05:12,108 [INFO] aws_lambda.py:97 -- AWS Lambda client created - Region: eu-west-1

Runtime Name            Memory Size  Lithops Version    Worker Name
--------------------  -------------  -----------------  --------------------------------------
cubed-runtime                  2000  3.4.2.dev0         lithops-worker-75h4-342dev0-07e8ca4079

Total runtimes: 1
josep@pc:~/runtime/aws_lambda$ lithops hello -b aws_lambda -s aws_s3 -d
2024-07-15 11:06:47,927 [INFO] config.py:139 -- Lithops v3.4.2.dev0 - Python3.10
2024-07-15 11:06:47,927 [DEBUG] config.py:101 -- Loading configuration from /home/josep/.lithops/config
2024-07-15 11:06:47,948 [DEBUG] config.py:179 -- Loading Serverless backend module: aws_lambda
2024-07-15 11:06:48,006 [DEBUG] config.py:219 -- Loading Storage backend module: aws_s3
2024-07-15 11:06:48,007 [DEBUG] aws_s3.py:36 -- Creating AWS S3 Client
2024-07-15 11:06:48,104 [INFO] aws_s3.py:59 -- S3 client created - Region: eu-west-1
2024-07-15 11:06:48,869 [DEBUG] aws_lambda.py:53 -- Creating AWS Lambda client
2024-07-15 11:06:49,421 [INFO] aws_lambda.py:97 -- AWS Lambda client created - Region: eu-west-1
2024-07-15 11:06:49,423 [DEBUG] invokers.py:105 -- ExecutorID 6af756-0 - Invoker initialized. Max workers: 1000
2024-07-15 11:06:49,423 [DEBUG] invokers.py:307 -- ExecutorID 6af756-0 - Serverless invoker created
2024-07-15 11:06:49,423 [DEBUG] executors.py:151 -- Function executor for aws_lambda created with ID: 6af756-0
2024-07-15 11:06:49,423 [INFO] invokers.py:119 -- ExecutorID 6af756-0 | JobID A000 - Selected Runtime: cubed-runtime - 2000MB
2024-07-15 11:06:49,423 [DEBUG] storage.py:476 -- Runtime metadata found in local disk cache
2024-07-15 11:06:49,424 [DEBUG] job.py:242 -- ExecutorID 6af756-0 | JobID A000 - Serializing function and data
2024-07-15 11:06:49,425 [DEBUG] serialize.py:75 -- Referenced Modules: lithops
2024-07-15 11:06:49,425 [DEBUG] module_dependency.py:109 -- Module 'lithops' is already installed in the runtime, skipping
2024-07-15 11:06:49,425 [DEBUG] serialize.py:120 -- Modules to transmit: None
2024-07-15 11:06:49,425 [DEBUG] job.py:276 -- ExecutorID 6af756-0 | JobID A000 - Uploading function and modules to the storage backend
2024-07-15 11:06:49,557 [DEBUG] aws_s3.py:106 -- PUT Object lithops.jobs/6af756-0/e2768d39249e2433cc16fc425a4494e6.func.pickle - Size: 684.0B - OK
2024-07-15 11:06:49,557 [DEBUG] job.py:316 -- ExecutorID 6af756-0 | JobID A000 - Data per activation is < 8.0KiB. Passing data through invocation payload
2024-07-15 11:06:49,557 [INFO] invokers.py:186 -- ExecutorID 6af756-0 | JobID A000 - Starting function invocation: hello() - Total: 1 activations
2024-07-15 11:06:49,557 [DEBUG] invokers.py:212 -- ExecutorID 6af756-0 | JobID A000 - Worker processes: 1 - Chunksize: 1
2024-07-15 11:06:49,558 [DEBUG] invokers.py:316 -- ExecutorID 6af756-0 - Async invoker 0 started
2024-07-15 11:06:49,558 [DEBUG] invokers.py:316 -- ExecutorID 6af756-0 - Async invoker 1 started
2024-07-15 11:06:49,559 [DEBUG] invokers.py:445 -- ExecutorID 6af756-0 | JobID A000 - Free workers: 1000 - Going to run 1 activations in 1 workers
2024-07-15 11:06:49,560 [INFO] invokers.py:225 -- ExecutorID 6af756-0 | JobID A000 - View execution logs at /tmp/lithops-josep/logs/6af756-0-A000.log
2024-07-15 11:06:49,561 [DEBUG] monitor.py:429 -- ExecutorID 6af756-0 - Starting Storage job monitor
2024-07-15 11:06:49,562 [INFO] executors.py:494 -- ExecutorID 6af756-0 - Getting results from 1 function activations
2024-07-15 11:06:49,562 [INFO] wait.py:101 -- ExecutorID 6af756-0 - Waiting for 1 function activations to complete
2024-07-15 11:06:49,956 [DEBUG] invokers.py:388 -- ExecutorID 6af756-0 | JobID A000 - Calls 00000 invoked (0.397s) - Activation ID: 3a8bcd48-d0d6-4310-9e5f-c939b8f7c8a8
2024-07-15 11:06:51,716 [DEBUG] monitor.py:144 -- ExecutorID 6af756-0 - Pending: 0 - Running: 0 - Done: 1
2024-07-15 11:06:51,716 [DEBUG] monitor.py:457 -- ExecutorID 6af756-0 - Storage job monitor finished
2024-07-15 11:06:52,566 [DEBUG] future.py:229 -- ExecutorID 6af756-0 | JobID A000 - Got status from call 00000 - Activation ID: 3a8bcd48-d0d6-4310-9e5f-c939b8f7c8a8 - Time: 0.16 seconds
2024-07-15 11:06:52,566 [DEBUG] future.py:286 -- ExecutorID 6af756-0 | JobID A000 - Got output from call 00000 - Activation ID: 3a8bcd48-d0d6-4310-9e5f-c939b8f7c8a8
2024-07-15 11:06:52,567 [INFO] executors.py:618 -- ExecutorID 6af756-0 - Cleaning temporary data
2024-07-15 11:06:52,568 [DEBUG] executors.py:519 -- ExecutorID 6af756-0 - Finished getting results

Hello josep! Lithops is working as expected :)
thodson-usgs commented 1 month ago

Well, now I can't deploy at all, so this Issue might be renamed "Confused new user"

I'll start with lithops hello, which succeeds.

(cubed-lithops-aws-examples) IGSASC167LTTOH2:aws thodson$ lithops hello -b aws_lambda -s aws_s3 -d
2024-07-16 16:52:17,519 [INFO] config.py:139 -- Lithops v3.4.1 - Python3.11
2024-07-16 16:52:17,519 [DEBUG] config.py:101 -- Loading configuration from /Users/thodson/.lithops/config.aws
2024-07-16 16:52:17,533 [DEBUG] config.py:179 -- Loading Serverless backend module: aws_lambda
2024-07-16 16:52:17,605 [DEBUG] config.py:220 -- Loading Storage backend module: aws_s3
2024-07-16 16:52:17,608 [DEBUG] aws_s3.py:36 -- Creating AWS S3 Client
2024-07-16 16:52:17,734 [INFO] aws_s3.py:59 -- S3 client created - Region: us-west-2
2024-07-16 16:52:18,419 [DEBUG] aws_lambda.py:53 -- Creating AWS Lambda client
2024-07-16 16:52:18,715 [INFO] aws_lambda.py:97 -- AWS Lambda client created - Region: us-west-2
2024-07-16 16:52:18,716 [DEBUG] invokers.py:93 -- ExecutorID 4de279-0 - Invoker initialized. Max workers: 1000
2024-07-16 16:52:18,716 [DEBUG] invokers.py:295 -- ExecutorID 4de279-0 - Serverless invoker created
2024-07-16 16:52:18,716 [DEBUG] executors.py:148 -- Function executor for aws_lambda created with ID: 4de279-0
2024-07-16 16:52:18,716 [INFO] invokers.py:107 -- ExecutorID 4de279-0 | JobID A000 - Selected Runtime: default-runtime-v311 - 2500MB
2024-07-16 16:52:18,717 [DEBUG] storage.py:483 -- Runtime metadata not found in local cache. Retrieving it from storage
2024-07-16 16:52:18,717 [DEBUG] storage.py:487 -- Trying to download runtime metadata from: aws_s3://lithops-us-west-2-pts7/lithops.runtimes/aws_lambda/3.4.1/us-west-2/lithops-worker-pts7-341-ab149458f8.meta.json
2024-07-16 16:52:18,832 [DEBUG] storage.py:509 -- Runtime metadata not found in storage
2024-07-16 16:52:18,832 [INFO] invokers.py:115 -- Runtime default-runtime-v311 with 2500MB is not yet deployed
2024-07-16 16:52:18,832 [INFO] aws_lambda.py:388 -- Deploying runtime: default-runtime-v311 - Memory: 2500 - Timeout: 180
2024-07-16 16:52:18,832 [DEBUG] aws_lambda.py:297 -- Listing lambda layers
2024-07-16 16:52:19,356 [DEBUG] aws_lambda.py:301 -- Listed 37 layers
2024-07-16 16:52:19,356 [INFO] aws_lambda.py:187 -- Creating lambda layer for runtime default-runtime-v311
2024-07-16 16:52:19,371 [DEBUG] aws_lambda.py:199 -- Creating "layer builder" function
2024-07-16 16:52:44,961 [DEBUG] aws_lambda.py:155 -- "lithops_v341_pts7_layer_builder_512MB" function is being deployed... (status: Pending)
2024-07-16 16:52:45,091 [DEBUG] aws_lambda.py:165 -- Ok --> function "lithops_v341_pts7_layer_builder_512MB" is active
2024-07-16 16:52:45,092 [DEBUG] aws_lambda.py:220 -- OK --> Created "layer builder" function default-runtime-v311
2024-07-16 16:52:45,092 [DEBUG] aws_lambda.py:230 -- Invoking "layer builder" function
2024-07-16 16:53:17,881 [DEBUG] aws_lambda.py:233 -- OK --> Layer lithops_v341_pts7_default-runtime-v311_layer built
2024-07-16 16:53:17,882 [DEBUG] aws_lambda.py:239 -- Trying to delete "layer builder" function
2024-07-16 16:53:18,439 [DEBUG] aws_lambda.py:247 -- Creating layer lithops_v341_pts7_default-runtime-v311_layer ...
2024-07-16 16:53:27,478 [DEBUG] aws_lambda.py:264 -- OK --> Layer lithops_v341_pts7_default-runtime-v311_layer created
2024-07-16 16:53:27,479 [DEBUG] utils.py:234 -- Creating function handler zip in lithops_lambda.zip
2024-07-16 16:53:56,413 [DEBUG] aws_lambda.py:155 -- "lithops-worker-pts7-341-ab149458f8" function is being deployed... (status: Pending)
2024-07-16 16:53:56,554 [DEBUG] aws_lambda.py:165 -- Ok --> function "lithops-worker-pts7-341-ab149458f8" is active
2024-07-16 16:53:56,554 [DEBUG] aws_lambda.py:442 -- OK --> Created lambda function lithops-worker-pts7-341-ab149458f8
2024-07-16 16:53:56,554 [DEBUG] aws_lambda.py:700 -- Extracting runtime metadata from: default-runtime-v311
2024-07-16 16:53:57,885 [DEBUG] storage.py:520 -- Uploading runtime metadata to: aws_s3://lithops-us-west-2-pts7/lithops.runtimes/aws_lambda/3.4.1/us-west-2/lithops-worker-pts7-341-ab149458f8.meta.json
2024-07-16 16:53:58,414 [DEBUG] aws_s3.py:106 -- PUT Object lithops.runtimes/aws_lambda/3.4.1/us-west-2/lithops-worker-pts7-341-ab149458f8.meta.json - Size: 6.2KiB - OK
2024-07-16 16:53:58,414 [DEBUG] storage.py:526 -- Storing runtime metadata into local cache: /Users/thodson/.lithops/cache/lithops.runtimes/aws_lambda/3.4.1/us-west-2/lithops-worker-pts7-341-ab149458f8.meta.json
2024-07-16 16:53:58,420 [DEBUG] job.py:242 -- ExecutorID 4de279-0 | JobID A000 - Serializing function and data
2024-07-16 16:53:58,421 [DEBUG] serialize.py:75 -- Referenced Modules: lithops
2024-07-16 16:53:58,421 [DEBUG] module_dependency.py:109 -- Module 'lithops' is already installed in the runtime, skipping
2024-07-16 16:53:58,422 [DEBUG] serialize.py:120 -- Modules to transmit: None
2024-07-16 16:53:58,422 [DEBUG] job.py:276 -- ExecutorID 4de279-0 | JobID A000 - Uploading function and modules to the storage backend
2024-07-16 16:53:58,645 [DEBUG] aws_s3.py:106 -- PUT Object lithops.jobs/4de279-0/6b2b0dbb9c8bcc6f5c320970aef8ea39.func.pickle - Size: 781.0B - OK
2024-07-16 16:53:58,645 [DEBUG] job.py:316 -- ExecutorID 4de279-0 | JobID A000 - Data per activation is < 8.0KiB. Passing data through invocation payload
2024-07-16 16:53:58,645 [INFO] invokers.py:174 -- ExecutorID 4de279-0 | JobID A000 - Starting function invocation: hello() - Total: 1 activations
2024-07-16 16:53:58,645 [DEBUG] invokers.py:200 -- ExecutorID 4de279-0 | JobID A000 - Worker processes: 1 - Chunksize: 1
2024-07-16 16:53:58,646 [DEBUG] invokers.py:304 -- ExecutorID 4de279-0 - Async invoker 0 started
2024-07-16 16:53:58,646 [DEBUG] invokers.py:304 -- ExecutorID 4de279-0 - Async invoker 1 started
2024-07-16 16:53:58,646 [DEBUG] invokers.py:433 -- ExecutorID 4de279-0 | JobID A000 - Free workers: 1000 - Going to run 1 activations in 1 workers
2024-07-16 16:53:58,649 [INFO] invokers.py:213 -- ExecutorID 4de279-0 | JobID A000 - View execution logs at /private/var/folders/zr/jc46d6cs531df81bpgj4681sz25hhs/T/lithops-thodson/logs/4de279-0-A000.log
2024-07-16 16:53:58,649 [DEBUG] monitor.py:429 -- ExecutorID 4de279-0 - Starting Storage job monitor
2024-07-16 16:53:58,649 [INFO] executors.py:491 -- ExecutorID 4de279-0 - Getting results from 1 function activations
2024-07-16 16:53:58,649 [INFO] wait.py:101 -- ExecutorID 4de279-0 - Waiting for 1 function activations to complete
2024-07-16 16:53:58,984 [DEBUG] invokers.py:376 -- ExecutorID 4de279-0 | JobID A000 - Calls 00000 invoked (0.337s) - Activation ID: 66b2783d-a54e-48af-b4e5-7a329ff52cb4
2024-07-16 16:54:01,032 [DEBUG] monitor.py:144 -- ExecutorID 4de279-0 - Pending: 0 - Running: 0 - Done: 1
2024-07-16 16:54:01,033 [DEBUG] monitor.py:457 -- ExecutorID 4de279-0 - Storage job monitor finished
2024-07-16 16:54:01,669 [DEBUG] future.py:229 -- ExecutorID 4de279-0 | JobID A000 - Got status from call 00000 - Activation ID: 66b2783d-a54e-48af-b4e5-7a329ff52cb4 - Time: 0.14 seconds
2024-07-16 16:54:01,669 [DEBUG] future.py:286 -- ExecutorID 4de279-0 | JobID A000 - Got output from call 00000 - Activation ID: 66b2783d-a54e-48af-b4e5-7a329ff52cb4
2024-07-16 16:54:01,670 [INFO] executors.py:615 -- ExecutorID 4de279-0 - Cleaning temporary data
2024-07-16 16:54:01,686 [DEBUG] executors.py:516 -- ExecutorID 4de279-0 - Finished getting results

Hello thodson! Lithops is working as expected :)

Now I'll attempt to deploy.

(cubed-lithops-aws-examples) IGSASC167LTTOH2:aws thodson$ lithops runtime deploy -b aws_lambda --memory 2000 --timeout 180 cubed-runtime
2024-07-16 16:57:14,371 [INFO] config.py:139 -- Lithops v3.4.1 - Python3.11
2024-07-16 16:57:14,371 [DEBUG] config.py:101 -- Loading configuration from /Users/thodson/.lithops/config.aws
2024-07-16 16:57:14,382 [DEBUG] config.py:179 -- Loading Serverless backend module: aws_lambda
2024-07-16 16:57:14,445 [DEBUG] config.py:220 -- Loading Storage backend module: aws_s3
2024-07-16 16:57:14,448 [DEBUG] aws_s3.py:36 -- Creating AWS S3 Client
2024-07-16 16:57:14,568 [INFO] aws_s3.py:59 -- S3 client created - Region: us-west-2
2024-07-16 16:57:15,253 [DEBUG] aws_lambda.py:53 -- Creating AWS Lambda client
2024-07-16 16:57:15,545 [INFO] aws_lambda.py:97 -- AWS Lambda client created - Region: us-west-2
2024-07-16 16:57:15,546 [INFO] aws_lambda.py:448 -- Deploying runtime: cubed-runtime - Memory: 2000 Timeout: 180
2024-07-16 16:57:16,866 [DEBUG] aws_lambda.py:165 -- Ok --> function "lithops-worker-pts7-341-c2d3f802c2" is active
2024-07-16 16:57:16,866 [DEBUG] aws_lambda.py:516 -- OK --> Created lambda function lithops-worker-pts7-341-c2d3f802c2
2024-07-16 16:57:16,866 [DEBUG] aws_lambda.py:700 -- Extracting runtime metadata from: cubed-runtime
Traceback (most recent call last):
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/bin/lithops", line 8, in <module>
    sys.exit(lithops_cli())
             ^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/lithops/scripts/cli.py", line 523, in deploy
    runtime_meta = compute_handler.deploy_runtime(runtime_name, runtime_memory, runtime_timeout)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/lithops/serverless/serverless.py", line 84, in deploy_runtime
    return self.backend.deploy_runtime(runtime_name, memory, timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/lithops/serverless/backends/aws_lambda/aws_lambda.py", line 531, in deploy_runtime
    runtime_meta = self._generate_runtime_meta(runtime_name, memory)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/thodson/.local/miniforge3/envs/cubed-lithops-aws-examples/lib/python3.11/site-packages/lithops/serverless/backends/aws_lambda/aws_lambda.py", line 714, in _generate_runtime_meta
    raise Exception(f'An error occurred: {result}')
Exception: An error occurred: {'errorType': 'Runtime.InvalidEntrypoint', 'errorMessage': 'RequestId: 36dc7bb2-48b2-45b5-9126-cdc188132bbe Error: fork/exec /usr/local/bin/python: exec format error'}

And my config:

lithops:
    backend: aws_lambda
    storage: aws_s3

aws:
    region: us-west-2

aws_lambda:
    execution_role: arn:aws:iam::807615458658:role/lambdaLithopsExecutionRole
    architecture: arm64

aws_s3:
    bucket: arn:aws:s3:::cubed-thodson-temp
thodson-usgs commented 1 month ago

Well, it works now. After a break of several hours, I tried

lithops clean -b aws_lambda

And now everything works fine. Coincidence?

JosepSampe commented 1 month ago

The error message you experienced is caused by a mismatch between the runtime architecture and the platform you are using. In AWS Lambda, you can run runtimes on either the x86 or arm64 platforms. These runtimes are not compatible with each other, and you need to use a different Dockerfile source image to build your runtime accordingly.

For example, if you build a runtime with an x86 base Dockerfile, it will not be compatible if you try to run it on an arm64 architecture, and vice versa. If you build an image using an arm64 base Dockerfile, it won't be compatible with the x86 platform.

It seems you have encountered one of these inconsistencies. To resolve any kind of inconsistency in Lithops, you can safely run lithops clean -b aws_lambda. This command removes all the temporary data and is like starting from scratch.

I assume this issue is resolved. Feel free to reopen it or open a new issue if you encounter any other problems or have any further questions.

thodson-usgs commented 1 month ago

Thank you for orienting me @JosepSampe. Lithops is amazing.