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

[teraslice] Add ex info option to teraslice v1 jobs api #3806

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sotojn
Copy link
Contributor

@sotojn sotojn commented Oct 23, 2024

This PR makes the following changes:

New Features

Ref to issue #3770

@sotojn sotojn self-assigned this Oct 23, 2024
@sotojn
Copy link
Contributor Author

sotojn commented Oct 23, 2024

Testing locally with several jobs:

curl "localhost:5678/v1/jobs?ex=_status"
[
    {
        "name": "data-to-noop2",
        "lifecycle": "persistent",
        "workers": 1,
        "assets": [
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 10000
            },
            {
                "_op": "noop"
            }
        ],
        "job_id": "c7269ccd-a664-4164-8b5f-66df079dbc24",
        "_context": "job",
        "_created": "2024-10-23T00:09:13.135Z",
        "_updated": "2024-10-23T00:09:13.135Z",
        "ex": {
            "_status": "stopped"
        }
    },
    {
        "name": "data-to-noop",
        "lifecycle": "persistent",
        "workers": 1,
        "assets": [
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 10000
            },
            {
                "_op": "noop"
            }
        ],
        "job_id": "2625c6ea-4a93-4617-b9fc-37203b6e74f5",
        "_context": "job",
        "_created": "2024-10-23T00:09:10.710Z",
        "_updated": "2024-10-23T00:09:10.710Z",
        "ex": {
            "_status": "failed"
        }
    },
    {
        "name": "j-datagen-to-kafka-1mil",
        "lifecycle": "once",
        "workers": 1,
        "log_level": "info",
        "assets": [
            "kafka",
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 1000000
            },
            {
                "_op": "kafka_sender",
                "topic": "rand-j-json-v1",
                "size": 25000
            }
        ],
        "job_id": "112c900d-e097-4d61-8279-39da4ad7791f",
        "_context": "job",
        "_created": "2024-10-23T00:08:49.622Z",
        "_updated": "2024-10-23T00:08:49.622Z",
        "ex": {}
    },
    {
        "name": "j-dgen-to-kafka-90k-per-min",
        "lifecycle": "persistent",
        "workers": 1,
        "log_level": "info",
        "assets": [
            "kafka",
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 20000,
                "delay": 10
            },
            {
                "_op": "kafka_sender",
                "topic": "data-every-90-sec",
                "size": 20000
            }
        ],
        "job_id": "fd445514-5d6c-440e-bacb-ff97c526afb2",
        "_context": "job",
        "_created": "2024-10-22T23:58:31.241Z",
        "_updated": "2024-10-22T23:58:31.241Z",
        "ex": {
            "_status": "stopped"
        }
    }
]

@sotojn
Copy link
Contributor Author

sotojn commented Oct 23, 2024

Heres another example with multiple queries:

curl "localhost:5678/v1/jobs?size=1&ex=_status,assets"
[
    {
        "name": "data-to-noop2",
        "lifecycle": "persistent",
        "workers": 1,
        "assets": [
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 10000
            },
            {
                "_op": "noop"
            }
        ],
        "job_id": "c7269ccd-a664-4164-8b5f-66df079dbc24",
        "_context": "job",
        "_created": "2024-10-23T00:09:13.135Z",
        "_updated": "2024-10-23T00:09:13.135Z",
        "ex": {
            "assets": [
                "74dcba12408fc02868d8c88b15be8a386092091b"
            ],
            "_status": "stopped"
        }
    }
]

Lastly without any queries:

curl "localhost:5678/v1/jobs"                           
[
    {
        "name": "data-to-noop2",
        "lifecycle": "persistent",
        "workers": 1,
        "assets": [
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 10000
            },
            {
                "_op": "noop"
            }
        ],
        "job_id": "c7269ccd-a664-4164-8b5f-66df079dbc24",
        "_context": "job",
        "_created": "2024-10-23T00:09:13.135Z",
        "_updated": "2024-10-23T00:09:13.135Z"
    },
    {
        "name": "data-to-noop",
        "lifecycle": "persistent",
        "workers": 1,
        "assets": [
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 10000
            },
            {
                "_op": "noop"
            }
        ],
        "job_id": "2625c6ea-4a93-4617-b9fc-37203b6e74f5",
        "_context": "job",
        "_created": "2024-10-23T00:09:10.710Z",
        "_updated": "2024-10-23T00:09:10.710Z"
    },
    {
        "name": "j-datagen-to-kafka-1mil",
        "lifecycle": "once",
        "workers": 1,
        "log_level": "info",
        "assets": [
            "kafka",
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 1000000
            },
            {
                "_op": "kafka_sender",
                "topic": "rand-j-json-v1",
                "size": 25000
            }
        ],
        "job_id": "112c900d-e097-4d61-8279-39da4ad7791f",
        "_context": "job",
        "_created": "2024-10-23T00:08:49.622Z",
        "_updated": "2024-10-23T00:08:49.622Z"
    },
    {
        "name": "j-dgen-to-kafka-90k-per-min",
        "lifecycle": "persistent",
        "workers": 1,
        "log_level": "info",
        "assets": [
            "kafka",
            "standard"
        ],
        "operations": [
            {
                "_op": "data_generator",
                "size": 20000,
                "delay": 10
            },
            {
                "_op": "kafka_sender",
                "topic": "data-every-90-sec",
                "size": 20000
            }
        ],
        "job_id": "fd445514-5d6c-440e-bacb-ff97c526afb2",
        "_context": "job",
        "_created": "2024-10-22T23:58:31.241Z",
        "_updated": "2024-10-22T23:58:31.241Z"
    }
]

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

Successfully merging this pull request may close these issues.

1 participant