agentos-project / agentos

The Python Component System (PCS) is an API and CLI for building, running, and sharing Python code. AgentOS is a set of libraries built on top of PCS that make it easy to build, run, and share agents that use Reinforcement Learning.
https://agentos.org
Apache License 2.0
13 stars 4 forks source link

Add `outer_run` and `model_input_run` to AgentRun spec #400

Closed nickjalbert closed 2 years ago

nickjalbert commented 2 years ago

Update: Added model_input_run also.

Small change that adds the outer_run to the AgentRun spec. Let's us get rid of the custom to_registry() function (for now). Now we end up with specs on web that look like:

{
            "identifier": "a6174a2cfb1c9392f9edaa45b28a972fc43b066c",
            "identifier_link": "http://localhost:8000/api/v1/components/a6174a2cfb1c9392f9edaa45b28a972fc43b066c/",
            "body": {
                "data": {
                    "tags": {
                        "run_type": "evaluate",
                        "pcs.is_run": "True",
                        "mlflow.user": "nickj",
                        "sb3_agent_run": "True",
                        "mlflow.runName": "AgentOS evaluate with Agent 'ed3bfcf02dc95c6887239a0218328d0f12531c78' and Env '8f94030e78e50ee997632918efee74469e099fa7'",
                        "agent_identifier": "ed3bfcf02dc95c6887239a0218328d0f12531c78",
                        "pcs.is_agent_run": "True",
                        "mlflow.parentRunId": "b56be6e634a74601b3968dd13a9ad921",
                        "mlflow.source.name": "/home/nickj/agentos/lean-env/bin/agentos",
                        "mlflow.source.type": "LOCAL",
                        "model_input_run_id": "e0061ab57a8e4bce834a8c4761497902",
                        "environment_identifier": "8f94030e78e50ee997632918efee74469e099fa7",
                        "mlflow.source.git.commit": "0c31041bb5eb11c64400432c1f8e9e04020f6f8f"
                    },
                    "metrics": {
                        "max_reward": 1076.0,
                        "min_reward": 89.0,
                        "step_count": 2414.0,
                        "mean_reward": 241.4,
                        "episode_count": 10.0,
                        "median_reward": 129.5,
                        "training_step_count": 4096.0,
                        "training_episode_count": 159.0
                    }
                },
                "info": {
                    "run_id": "4b16c6e9d76c440b92eebdeaa4ff6adc",
                    "status": "FINISHED",
                    "user_id": "unknown",
                    "end_time": 1655116546665,
                    "run_uuid": "4b16c6e9d76c440b92eebdeaa4ff6adc",
                    "start_time": 1655116545914,
                    "artifact_uri": "file:///home/nickj/agentos/example_agents/sb3_agent/mlruns/0/4b16c6e9d76c440b92eebdeaa4ff6adc/artifacts",
                    "experiment_id": "0",
                    "lifecycle_stage": "active"
                },
                "type": "AgentRun",
                "outer_run": "spec:a01989f0184ae7ead6c4501960c90026a603ad12",
                "experiment_id": "0",
                "model_input_run": "spec:fe81ca830a94e2506914442d8932ea2b53143d8e"
            }
        },
        ...
andyk commented 2 years ago

Thanks! Merged.