mysterious-hair-40059
02/22/2023, 10:05 AMModuleNotFoundError
.
What could I be doing wrong please?tall-lock-23197
tall-lock-23197
mysterious-hair-40059
02/22/2023, 10:42 AM[1/1] currentAttempt done. Last Error: USER::Pod failed. No message received from kubernetes.
[fde22ae742e034d5c9b1-n0-0] terminated with exit code (1). Reason [Error]. Message:
.8/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/opt/venv/lib/python3.8/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/opt/venv/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/venv/lib/python3.8/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/opt/venv/lib/python3.8/site-packages/flytekit/bin/entrypoint.py", line 476, in execute_task_cmd
_execute_task(
File "/opt/venv/lib/python3.8/site-packages/flytekit/exceptions/scopes.py", line 160, in system_entry_point
return wrapped(*args, **kwargs)
File "/opt/venv/lib/python3.8/site-packages/flytekit/bin/entrypoint.py", line 348, in _execute_task
_task_def = resolver_obj.load_task(loader_args=resolver_args)
File "/opt/venv/lib/python3.8/site-packages/flytekit/core/python_auto_container.py", line 280, in load_task
task_module = importlib.import_module(task_module)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'flexs_app'
I used FlyteRemote and ran register_workflow
method.
Also, the script that runs FlyteRemote isn't in packaged along with the project that has the workflow. Could this cause an issue?tall-lock-23197
mysterious-hair-40059
02/22/2023, 11:59 AMflyte-demo
├── Dockerfile
├── LICENSE
├── README.md
├── flyte_remote.py # the flyte remote script
├── requirements.txt
└── flexs_app # app directory
├── __init__.py
└── app_service.py
└── tasks.py
└── workflows.py
mysterious-hair-40059
02/22/2023, 12:38 PMArgs:
pyflyte-execute
--inputs
<s3://s3-bucket/metadata/propeller/flexs-app-development-f2eb08b12a2b84bb591e/n0/data/inputs.pb>
--output-prefix
<s3://s3-bucket/metadata/propeller/flexs-app-development-f2eb08b12a2b84bb591e/n0/data/0>
--raw-output-data-prefix
<s3://s3-bucket/data/h4/f2eb08b12a2b84bb591e-n0-0>
--checkpoint-path
<s3://s3-bucket/data/h4/f2eb08b12a2b84bb591e-n0-0/_flytecheckpoints>
--prev-checkpoint
""
--resolver
flytekit.core.python_auto_container.default_task_resolver
--
task-module
flexs_app.tasks
task-name
get_fitness
State: Terminated
Reason: Error
Message:
Seems it's failing because of the task-moduletall-lock-23197
my_project
. So what is it exactly with regard to your directory structure?tall-lock-23197
from .your-module ...
mysterious-hair-40059
02/22/2023, 1:42 PMflexs_app
. I've corrected the error in the first code block in this thread.
I am actually using relative import. But the error still persists.tall-lock-23197
mysterious-hair-40059
02/22/2023, 2:12 PMFROM python:3.10-slim-buster
WORKDIR /code
EXPOSE 8000
RUN pip install --upgrade pip
COPY ./requirements.txt ./
RUN pip install -r requirements.txt
COPY . /code
mysterious-hair-40059
02/22/2023, 2:13 PMdocker run -it image_id bash
to check the content of the image, everything is there, along with the flexs_app directory.average-finland-92144
02/22/2023, 4:27 PMmysterious-hair-40059
02/22/2023, 5:50 PM"""Flyte Remote"""
from flytekit.remote import FlyteRemote
from flytekit.configuration import Config, SerializationSettings, ImageConfig
from .workflows import train_wf
from typing import Dict
from flytekit.configuration import Config, PlatformConfig
import flytekit
import uuid
def get_get_version():
"""To avoid version conflicts,
we generate a unique version prefix for each run of this script.
"""
_VERSION_PREFIX = "flexs-app_v" + uuid.uuid4().hex[:3]
# logger.warning(f"Test version prefix is {_VERSION_PREFIX}")
print(f"Flexs-app version prefix is {_VERSION_PREFIX}")
def fn(suffix: str = "") -> str:
return _VERSION_PREFIX + (f"_{suffix}" if suffix else "")
return fn
get_version = get_get_version()
IMAGE_STR = "docker_user/repo_name:tag"
image_config = ImageConfig.auto(img_name=IMAGE_STR)
remote = FlyteRemote(config=Config(
platform=PlatformConfig(
endpoint= "localhost:8089",
insecure=True,
insecure_skip_verify=True,
)
))
# remote = FlyteRemote(config=Config.auto())
def register_and_run_workflow(workflow_name: flytekit.core.workflow.WorkflowBase, inputs: Dict):
version = get_version("1")
serialization_settings = SerializationSettings(
project="flexs-app",
domain="development",
version=version,
image_config=image_config,
)
remote.register_workflow(workflow_name, serialization_settings)
fetched_wf = remote.fetch_workflow(
name=workflow_name.name,
project="flexs-app",
domain="development",
version=version,
)
# print("fetched_wf", fetched_wf)
remote.execute(
entity=fetched_wf,
inputs=inputs,
project="flexs-app",
domain="development",
version=version,
image_config=image_config,
)
return "done"
if __name__ == "__main__":
inputs = {
"items": [
'FTLIE',
'FTLIE',
'FTLIE',
'FTLIE',
'FTLIE',
]
}
print(register_and_run_workflow(train_wf, inputs))
mysterious-hair-40059
02/22/2023, 5:50 PMmysterious-hair-40059
02/23/2023, 9:50 AMaverage-finland-92144
02/24/2023, 4:07 PMhigh-accountant-32689
02/24/2023, 7:56 PMPYTHONPATH
env var to /code
in your dockerfile?mysterious-hair-40059
02/28/2023, 10:28 AMflytekit.exceptions.user.FlyteAssertion: Failed to put data from /tmp/flyte-t0xpsb9t/sandbox/local_flytekit/engine_dir to <s3://flyte-bucket/metadata/propeller/flexs> (recursive=True)
. And it says to `Original exception: AWS CLI not found! Please install it with pip install awscli
. Is it to be installed via dockerfile or in the cluster?tall-lock-23197
mysterious-hair-40059
02/28/2023, 12:06 PM2 Insufficient cpu, 0/2 nodes are available: 2 No preemption victims found for incoming pod.
If I add limits to each task via the Resources
module, it raises OOMKilled
out-of-memory error.
It seem to be requiring more resources than expected. Please what could be the issue?
I am running a two-node cluster with 2 CPUs and 4GB RAM per node.average-finland-92144
02/28/2023, 2:59 PMmysterious-hair-40059
02/28/2023, 3:01 PMaverage-finland-92144
02/28/2023, 4:08 PMhigh-accountant-32689
02/28/2023, 4:41 PMmysterious-hair-40059
02/28/2023, 4:48 PMdef get_scores(seqs: List[str]) -> np.ndarray:
time.sleep(60)
scores = np.random.rand(len(sequences))
return scores
the task:
@task
def get_fitness(seqs: List[str]) -> np.ndarray:
fitnesses = get_scores(seqs=seqs)
return fitnesses
Also, it might be helpful to note that get_scores
is actually a method of a class. I took it out and make it a function in this example.high-accountant-32689
02/28/2023, 9:11 PMaverage-finland-92144
02/28/2023, 9:15 PMhigh-accountant-32689
02/28/2023, 9:24 PMmysterious-hair-40059
03/01/2023, 2:24 PMtall-lock-23197
high-accountant-32689
03/02/2023, 4:35 AMmysterious-hair-40059
03/02/2023, 2:19 PMmysterious-hair-40059
03/02/2023, 2:32 PMRuntimeExecutionError: failed during plugin execution, caused by: failed to check existence of futures file: [User] Failed to do HEAD on futures file
with Forbidden: Forbidden
status code: 403
still be as a result of insufficient resources?
Because the metadata could be found on s3 but it complains of this? @high-accountant-32689high-accountant-32689
03/13/2023, 6:45 PMflytekit
and potentially other plugins are you using? We had an issue some time ago where one of flytekit's dependencies (fsspec
) released a new version which broke flytekit (and we fixed with https://github.com/flyteorg/flytekit/commit/be24c52f3fb8f7949db172f490cca95fa0f0e413).