These are the steps to submit your own agent:
To favor an easy start, we provide example agents files (scripts and weights) that work out-of-the-box (but are only minimally trained) in our DIAMBRA Agents repository, for both Stable Baselines 3 and Ray RLlib.
Do not add your tokens directly in the submission YAML file, they will be publicly visible.
Assuming you are using the arena-stable-baselines3-on3.10-bullseye
dependencies image, and have your agent’s files stored on GitHub, create a file named submission-manifest.yaml
with the following content:
mode: AIvsCOM
image: diambra/arena-stable-baselines3-on3.10-bullseye:2.1
version: v2.1
command:
- python
- "/sources/agent.py"
- "/sources/models/model.zip"
sources:
.: git+https://username:{{.Secrets.token}}@github.com/username/repository_name.git#ref=branch_name
Replace username
and repository_name.git#ref=branch_name
with the appropriate values, and change image
and command
fields according to your specific use case.
Then, submit your agent using the manifest file:
diambra agent submit --submission.secret token=your_gh_token --submission.manifest submission-manifest.yaml
Replace your_gh_token
with the GitHub token you saved earlier.
Note that this will clone your entire repository (including Git LFS files) and put its content inside the /sources/
folder directly.
Explicit sources specification will not work with Git LFS files, to submit them, the only option is to use the automatic git clone
mechanism described above.
In case you don’t want to clone all your repository, you can explicitly specify the source files you want to download as follows:
---
mode: AIvsCOM
image: diambra/arena-stable-baselines3-on3.10-bullseye:2.1
version: v2.1
command:
- python
- "/sources/agent.py"
- "/sources/models/model.zip"
sources:
agent.py: https://{{.Secrets.token}}@raw.githubusercontent.com/username/repo_name/path/to/trained-agent/your_agent.py
models/model.zip: https://{{.Secrets.token}}@raw.githubusercontent.com/username/repo_name/path/to/nn-weights/your_model.zip
In case you have multiple source files you need to use, and you want to avoid to list them all, the best way to proceed is to leverage our automatic git clone
feature described above. But if you really do not want to use it, you can add the source files to a zip archive, store it in your repository and leverage our automatic unzip
feature as follows:
mode: AIvsCOM
image: diambra/arena-stable-baselines3-on3.10-bullseye:2.1
version: v2.1
command:
- python
- "/sources/data/agent.py"
- "/sources/data/models/model.zip"
sources:
data: https+unzip://{{.Secrets.token}}@raw.githubusercontent.com/username/repo_name/path/to/data/data.zip
Note that in the url of the zip file to be downloaded there is an additional +unzip
string following https
.
If you want to avoid using submission files, you can use the command line to directly submit your agent. Assuming you are using the arena-stable-baselines3-on3.10-bullseye
dependencies image and have your agent’s files stored on GitHub:
diambra agent submit \
--submission.mode AIvsCOM \
--submission.version v2.1 \
--submission.source .=git+https://username:{{.Secrets.token}}@github.com/username/repository_name.git#ref=branch_name \
--submission.secret token=your_gh_token \
--submission.set-command \
arena-stable-baselines3-on3.10-bullseye \
python "/sources/agent.py" "/sources/models/model.zip"
Replace username
and repository_name.git#ref=branch_name
with the appropriate values and your_gh_token
with the GitHub token you saved earlier.
Note that, in this case, the dependencies image
and command
fields we discussed above are merged together and provided as values to the last argument --submission.set-command
. Use the same order and change their values according to your specific use case.