If you are using a Kubernetes-managed cluster, you can host the reward oracle as a remote service. This allows you to assign it a cluster IP for easier access by multiple experiment pods. You can scale this by repeating the server startup step to create multiple instances, enabling parallel experiments.
Follow these steps to set up the remote reward oracle:
- Create the Kubernetes service: Apply the service definition to your cluster.
- Deploy the serving pod: Apply the
k8s/serving.yaml configuration to start your job/pod. Note: Ensure you update the path to the readiness probe script within the YAML file. - Start the remote server: Once inside the pod, execute the remote server module.
- Run the experiment: Start your experiment using the
remote preference oracle and point it to the service URL.
# 1) Create the service:
kubectl create -f k8s/rm-service.yaml
# 2a) Start your job/pod with `k8s/serving.yaml` applied.
# (Ensure you change the path to the readiness probe script in the yaml)
# 2b) Inside the pod, start the remote server:
MOSEC_LOG_LEVEL=debug python -m oat.oracles.remote.server
# 3) With this being set up, start your experiment:
python -m oat.experiment.main \
--preference_oracle remote \
--remote_rm_url http://remote-rm \
# other flags...