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

Merged
merged 3 commits into from
Oct 23, 2024
Merged

Conversation

sotojn
Copy link
Contributor

@sotojn sotojn commented Oct 23, 2024

This PR makes the following changes:

New Features

Documentation

  • Updated management api docs to reflect changes to v1/jobs endpoint

Bumps

  • teraslice from v2.6.1 to v2.6.2

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"
    }
]

@sotojn sotojn marked this pull request as ready for review October 23, 2024 16:08
@sotojn sotojn requested review from busma13 and godber October 23, 2024 16:08
Copy link
Contributor

@busma13 busma13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@godber godber merged commit 0d5cf94 into master Oct 23, 2024
66 checks passed
@godber godber deleted the fix-jobs-ex-api branch October 23, 2024 20:28
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.

3 participants