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

[Problem] XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX #5427

Open
QWQyyy opened this issue Jul 8, 2023 · 3 comments
Open

[Problem] XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX #5427

QWQyyy opened this issue Jul 8, 2023 · 3 comments

Comments

@QWQyyy
Copy link

QWQyyy commented Jul 8, 2023

Why is OpenWhisk's log printing these things and how should I adjust the configuration to resolve these?
image
image
and invoker logs:
image
How to fix it?

@QWQyyy
Copy link
Author

QWQyyy commented Jul 8, 2023

we cann't find error logs in controller pods.
image

@QWQyyy
Copy link
Author

QWQyyy commented Jul 8, 2023

my code:

import pandas as pd
from torchvision import datasets, transforms
import numpy as np
import os
from minio import Minio
from minio.error import S3Error


def main(args):
    # 转换器
    transform_train = transforms.Compose([transforms.RandomHorizontalFlip(p=0.5),
                                          transforms.ToTensor(),
                                          transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))])
    transform_test = transforms.Compose([transforms.ToTensor(),
                                         transforms.Normalize((0.485, 0.456, 0.406), (0.226, 0.224, 0.225))])
    # 数据集路径
    data_path = "/dataset/CIFAR10"

    # 加载训练集和测试集
    train_dataset = datasets.CIFAR10(root=data_path, train=True, transform=transform_train, download=True)
    test_dataset = datasets.CIFAR10(root=data_path, train=False, transform=transform_test, download=True)
    # 将训练集数据保存到CSV文件
    train_data = []
    for i, (image, label) in enumerate(train_dataset):
        image_data = np.array(image).tolist()  # 转换为列表
        train_data.append([image_data, label])
    train_df = pd.DataFrame(train_data, columns=['image', 'label'])
    train_csv_data = train_df.to_csv(index=False)
    save_to_minio(train_csv_data, "cifar", "train_dataset.csv")
    # 将测试集数据保存到CSV文件
    test_data = []
    for i, (image, label) in enumerate(test_dataset):
        image_data = np.array(image).tolist()  # 转换为列表
        test_data.append([image_data, label])
    test_df = pd.DataFrame(test_data, columns=['image', 'label'])
    test_csv_data = test_df.to_csv(index=False)
    save_to_minio(test_csv_data, "cifar", "test_dataset.csv")
    result = {'res': '666'}
    return result



def save_to_minio(data, bucket_name, object_name):
    # 创建与MinIO服务器的连接
    client = Minio(
        "192.168.1.23:9000",
        access_key="CuZRDbhLVIIjfDp4M4p8",
        secret_key="tFDb4aoeSqlCB0bH6BoYfNvIWXqSCJQCZ6UD0Hd9",
        secure=False
    )

    # 将数据保存到MinIO存储中
    try:
        data_bytes = data.encode()  # 将字符串转换为字节类型
        data_stream = io.BytesIO(data_bytes)  # 创建可读取的字节流
        client.put_object(bucket_name, object_name, data_stream, len(data_bytes))
        s1 = "echo 数据已成功保存到MinIO存储,存储桶:" + bucket_name + ",对象:" + object_name
        os.system(s1)
    except S3Error as exc:
        s2 = "echo 保存数据到MinIO存储失败:" + str(exc)
        os.system(s2)

Is it because I called the external storage during the execution of the openwhisk function, so the function cannot be executed smoothly?

@rabbah
Copy link
Member

rabbah commented Jul 25, 2023

The runtime proxies emit these markers - they are used by the invoker to determine if the output stream is flushed for the function invocation. You should not observe them in an actual activation record (but you if are running the container explicitly, you will see them). Why runtime container are you using and how did you build it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants