-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from RoboTeamTwente/nova_2
Nova 2
- Loading branch information
Showing
113 changed files
with
6,982 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM roboteamtwente/roboteam:development | ||
|
||
# Create symbolic link from /home/roboteam to /home/roboteamtwente | ||
USER root | ||
RUN ln -s /home/roboteamtwente /home/roboteam | ||
|
||
# Install Java | ||
RUN apk add --no-cache openjdk11 | ||
|
||
# Install Java 21 | ||
RUN wget https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_alpine-linux_hotspot_21.0.1_12.tar.gz \ | ||
&& tar -xzf OpenJDK21U-jdk_x64_alpine-linux_hotspot_21.0.1_12.tar.gz \ | ||
&& mv jdk-21* /usr/lib/jvm/java-21-openjdk | ||
|
||
# Set up Java environment variables to point to Java 21 | ||
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk | ||
ENV PATH="${JAVA_HOME}/bin:${PATH}" | ||
|
||
WORKDIR /home/roboteam | ||
|
||
# Copy the entire current directory into the container | ||
COPY --chown=roboteamtwente:roboteamtwente . /home/roboteam/ | ||
|
||
# Make sure build.sh is executable | ||
RUN chmod +x build.sh | ||
|
||
# Add the lib directory to LD_LIBRARY_PATH | ||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/roboteam/build/release/lib | ||
|
||
# Switch back to the roboteamtwente user | ||
USER roboteamtwente |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This dockerfile uses the ray project's official ray image as a base. | ||
# It also adds the torch and gymnasium libraries to the image. | ||
# It also adds the roboteam RL code to the image. | ||
|
||
FROM rayproject/ray:latest-py310 | ||
|
||
# Install dependencies in a single layer to keep it cached | ||
RUN pip install torch==2.5.1 gymnasium numpy==1.24.3 ray[rllib]==2.38.0 pyzmq protobuf websockets | ||
|
||
# Copy the entire roboteam root folder (including the roboteam_ai and roboteam_networking folders) | ||
COPY roboteam_ai /roboteam/roboteam_ai | ||
COPY roboteam_networking /roboteam/roboteam_networking | ||
|
||
# Set working directory and Python path | ||
WORKDIR /roboteam | ||
ENV PYTHONPATH="/roboteam:${PYTHONPATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM python:3.9-slim | ||
|
||
# Install system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y libzmq3-dev build-essential && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Python dependencies | ||
RUN pip install pyzmq protobuf | ||
|
||
# Create working directory | ||
WORKDIR /app | ||
|
||
# Copy the Python script and proto files | ||
COPY roboteam_ai/src/rl/src/zmq_server.py /app/ | ||
COPY /roboteam_networking/ /app/roboteam_networking/ | ||
|
||
# Run the script | ||
CMD ["python", "zmq_server.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
In a ray or distributed computing cluster, the terms "head node" and "worker nodes" refer to different roles that containers play in the cluster. The head node is the master node in a Ray cluster. You typically have one head node. Worker nodes are the containers that execute the jobs, in parallel. You can have as many worker nodes as you want. | ||
|
||
----------------------------------------------------------- | ||
|
||
## Installing Kuberay | ||
|
||
curl <https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3> | bash | ||
helm repo add kuberay <https://ray-project.github.io/kuberay-helm/> | ||
helm repo update | ||
helm install kuberay-operator kuberay/kuberay-operator --namespace ray-system --create-namespace | ||
|
||
<https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/config.html> | ||
The above source was used for creating the ray-cluster.yaml | ||
|
||
Installing kubernetes and minikubernetes, you can follow this guide to check out how to install and run them: <https://medium.com/@areesmoon/installing-minikube-on-ubuntu-20-04-lts-focal-fossa-b10fad9d0511> | ||
|
||
Use 'pip install ray' and then 'pip show ray' to get your version of ray. | ||
|
||
----------------------------------------------------------- | ||
|
||
After you have both kubernetes and ray, use the following command to create a cluster: kubectl apply -f ray-cluster.yaml | ||
This cluster launches a ray head node and one worker node. Launch the external simulator using kubectl apply -f simulator.yaml | ||
|
||
'kubectl get pods'-> this is will give you the cluster name | ||
|
||
Use to forward the needed port to the ray service: kubectl port-forward svc/<cluster name> 8265:8265 | ||
This is the port that will be used inside ray_jobs.py, where we submit the jobs to ray. | ||
|
||
----------------------------------------------------------- | ||
|
||
## Useful commands | ||
|
||
kubectl apply -f ray-cluster.yaml | ||
kubectl delete -f ray-cluster.yaml | ||
helm install kuberay-operator ray/kuberay-operator | ||
helm uninstall kuberay-operator | ||
kubectl port-forward svc/roboteam-ray-cluster-head-nodeport 8265:8265 6379:6379 10001:10001 8000:8000 & | ||
minikube start -p ray --nodes 2 --memory 4000 --cpus 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.