Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some potential issues #1344

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ jobs:

outputs:
localhost: ${{ steps.script.outputs.localhost }}
ibm_cf: ${{ steps.script.outputs.ibm_cf }}
code_engine: ${{ steps.script.outputs.code_engine }}

steps:
- name: Set jobs to run
id: script
run: |
echo "localhost=true" >> $GITHUB_OUTPUT
echo "ibm_cf=false" >> $GITHUB_OUTPUT
echo "code_engine=false" >> $GITHUB_OUTPUT


Expand All @@ -35,10 +33,10 @@ jobs:

steps:
- name: Clone Lithops repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -59,10 +57,10 @@ jobs:

steps:
- name: Clone Lithops repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- name: Clone Lithops repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -43,10 +43,10 @@ jobs:

steps:
- name: Clone Lithops repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
5 changes: 4 additions & 1 deletion lithops/localhost/v2/localhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ def kill_process(process):
for job_key_call_id in list(self.task_processes.keys()):
if job_key_call_id.startswith(job_key):
process = self.task_processes[job_key_call_id]
kill_process(process)
try:
kill_process(process)
except Exception:
pass
self.task_processes[job_key_call_id] = None

super().stop(job_keys)
Expand Down
3 changes: 2 additions & 1 deletion lithops/worker/jobrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os
import io
import sys
import ast
import pika
import time
import pickle
Expand Down Expand Up @@ -209,7 +210,7 @@ def run(self):
func = pickle.loads(self.job.func)
data = pickle.loads(self.job.data)

if eval(os.environ.get('__LITHOPS_REDUCE_JOB', 'False')):
if ast.literal_eval(os.environ.get('__LITHOPS_REDUCE_JOB', 'False')):
self._wait_futures(data)
elif is_object_processing_function(func):
self._load_object(data)
Expand Down
3 changes: 2 additions & 1 deletion lithops/worker/status.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import ast
import pika
import json
import time
Expand Down Expand Up @@ -44,7 +45,7 @@ def __init__(self, job, internal_storage):
'chunksize': job.chunksize
}

if eval(os.environ.get('WARM_CONTAINER', 'False')):
if ast.literal_eval(os.environ.get('WARM_CONTAINER', 'False')):
self.status['worker_cold_start'] = False
else:
self.status['worker_cold_start'] = True
Expand Down