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

Upload artifacts when publishing AgentRuns #420

Closed nickjalbert closed 2 years ago

nickjalbert commented 2 years ago

This PR gets artifact upload working again.

I think this is the shortest path to getting us back to sharing models; this is basically just porting forward the upload system to the new spec revamp.

Longer term, we should think more about artifacts being explicitly represented in the DAG (maybe something like a file-in and file-out component?) rather than doing this via a "side-channel" as we do here.

Demo:

# run the web server in another tab; clear the DB
cd example_agents/sb3_agent
rm -rf mlruns/
agentos run sb3_agent --function-name learn
agentos run sb3_agent --function-name evaluate
USE_LOCAL_SERVER=True agentos publish <id of agent run printed after previous command>

If you follow the demo, all the AgentRuns should have tarballs associated with them that contain the model that was trained/evaluated. For example:

Screenshot 2022-07-08 at 16-28-16 Select component to change Django site admin

nickjalbert commented 2 years ago

@andyk this is ready for you to take a look at when you have time!

andyk commented 2 years ago

This looks great! Thanks for getting this working again. I'm in favor of having this in place as a demo solution and potentially re-thinking in the future.

I tried this out per your instructions on my Macbook Pro M1 and it worked great! Merging.