Skip to content

Commit f865074

Browse files
Saurav AgarwalSaurav Agarwal
authored andcommitted
Update docker
1 parent 52b7447 commit f865074

23 files changed

+97
-1107
lines changed

setup_utils/docker/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ARG BASE_IMAGE=agarwalsaurav/pytorch_base
2+
ARG BASE_TAG=pytorch2.2.1
3+
ARG SETUP_ARGS="-p"
4+
5+
FROM ${BASE_IMAGE}:${BASE_TAG}
6+
WORKDIR /app
7+
ADD . .
8+
ENV SETUP_ARGS=${SETUP_ARGS}
9+
10+
COPY setup_utils/install_dependencies.sh /install_dependencies.sh
11+
RUN chmod +x /install_dependencies.sh
12+
RUN /install_dependencies.sh
13+
14+
COPY setup_utils/docker/entrypoint.sh /entrypoint.sh
15+
RUN chmod +x /entrypoint.sh
16+
ENTRYPOINT ["/entrypoint.sh"]
17+
18+
# RUN export SETUP_ARGS=${SETUP_ARGS} && source ${VENV_PATH}/bin/activate && bash -c "./setup.sh ${SETUP_ARGS}"
File renamed without changes.
File renamed without changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
print_usage() {
2+
echo "Usage: ./build_all_images.sh <dockerhub_username/repo_name>"
3+
echo "Example: ./build_all_images.sh johndoe/repo_name"
4+
exit 1
5+
}
6+
if [ "$#" -ne 1 ]; then
7+
print_usage
8+
fi
9+
echo "Building image pytorch2.2.1"
10+
docker buildx build -t ${1}:pytorch2.2.1 -f ubuntu22.04.Dockerfile .
11+
docker image tag ${1}:pytorch2.2.1 ghcr.io/${1}:pytorch2.2.1
12+
docker push ${1}:pytorch2.2.1
13+
docker push ghcr.io/${1}:pytorch2.2.1
14+
echo "Building image pytorch2.2.1-cuda12.3.1"
15+
docker buildx build -t ${1}:pytorch2.2.1-cuda12.3.1 -f ubuntu22.04-cuda.Dockerfile .
16+
docker image tag ${1}:pytorch2.2.1-cuda12.3.1 ghcr.io/${1}:pytorch2.2.1-cuda12.3.1
17+
docker push ${1}:pytorch2.2.1-cuda12.3.1
18+
docker push ghcr.io/${1}:pytorch2.2.1-cuda12.3.1
19+
echo "Building image pytorch2.2.1-ros2humble"
20+
docker buildx build -t ${1}:pytorch2.2.1-ros2humble -f ubuntu22.04-ros2.Dockerfile .
21+
docker image tag ${1}:pytorch2.2.1-ros2humble ghcr.io/${1}:pytorch2.2.1-ros2humble
22+
docker push ${1}:pytorch2.2.1-ros2humble
23+
docker push ghcr.io/${1}:pytorch2.2.1-ros2humble
24+
echo "Building image pytorch2.2.1-cuda12.3.1-ros2humble"
25+
docker buildx build -t ${1}:pytorch2.2.1-cuda12.3.1-ros2humble -f ubuntu22.04-cuda-ros2.Dockerfile .
26+
docker image tag ${1}:pytorch2.2.1-cuda12.3.1-ros2humble ghcr.io/${1}:pytorch2.2.1-cuda12.3.1-ros2humble
27+
docker push ${1}:pytorch2.2.1-cuda12.3.1-ros2humble
28+
docker push ghcr.io/${1}:pytorch2.2.1-cuda12.3.1-ros2humble

setup_utils/docker/ubuntu22.04-cuda12.3.1-ros2humble/requirements.txt renamed to setup_utils/docker/base_images/requirements.txt

File renamed without changes.

setup_utils/docker/ubuntu22.04-ros2humble/requirements.txt renamed to setup_utils/docker/base_images/requirements_cpu.txt

File renamed without changes.

setup_utils/docker/ubuntu22.04-cuda12.3.1-ros2humble/Dockerfile renamed to setup_utils/docker/base_images/ubuntu22.04-cuda-ros2.Dockerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,8 @@ COPY requirements.txt /opt/requirements.txt
7272
RUN python3.10 -m venv /opt/venv
7373
RUN /opt/venv/bin/pip install --no-cache-dir wheel
7474
RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt
75+
ENV VENV_PATH /opt/venv
7576

76-
RUN mkdir -p /opt/dependencies/build; \
77-
mkdir -p /opt/dependencies/src
78-
COPY install_dependencies.sh /opt/dependencies/install_dependencies.sh
79-
RUN ["/bin/bash", "-c", "/opt/dependencies/install_dependencies.sh"]
80-
RUN rm -r /opt/dependencies
81-
82-
ENV CoverageControl_ws /opt/CoverageControl_ws
83-
ENV LD_LIBRARY_PATH ${CoverageControl_ws}/install/lib:/usr/local/lib:${LD_LIBRARY_PATH}
84-
ENV PATH ${CoverageControl_ws}/install/bin:${PATH}
85-
COPY .bashrc /root/.bashrc
77+
ENV LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}
78+
COPY .ros.bashrc /root/.bashrc
8679
RUN echo "source /opt/venv/bin/activate" >> /root/.bashrc
87-
88-
RUN mkdir -p ${CoverageControl_ws}
89-
WORKDIR ${CoverageControl_ws}

setup_utils/docker/ubuntu22.04-cuda12.3.1/Dockerfile renamed to setup_utils/docker/base_images/ubuntu22.04-cuda.Dockerfile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,8 @@ COPY requirements.txt /opt/requirements.txt
6262
RUN python3.11 -m venv /opt/venv
6363
RUN /opt/venv/bin/pip install --no-cache-dir wheel
6464
RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt
65+
ENV VENV_PATH /opt/venv
6566

66-
RUN mkdir -p /opt/dependencies/build; \
67-
mkdir -p /opt/dependencies/src
68-
COPY install_dependencies.sh /opt/dependencies/install_dependencies.sh
69-
RUN ["/bin/bash", "-c", "/opt/dependencies/install_dependencies.sh"]
70-
RUN rm -r /opt/dependencies
71-
72-
ENV CoverageControl_ws /opt/CoverageControl_ws
73-
ENV LD_LIBRARY_PATH ${CoverageControl_ws}/install/lib:/usr/local/lib:${LD_LIBRARY_PATH}
74-
ENV PATH ${CoverageControl_ws}/install/bin:${PATH}
67+
ENV LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}
7568
COPY .bashrc /root/.bashrc
7669
RUN echo "source /opt/venv/bin/activate" >> /root/.bashrc
77-
78-
RUN mkdir -p ${CoverageControl_ws}
79-
WORKDIR ${CoverageControl_ws}

setup_utils/docker/ubuntu22.04-ros2humble/Dockerfile renamed to setup_utils/docker/base_images/ubuntu22.04-ros2.Dockerfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,12 @@ RUN rm -rf /var/lib/apt/lists/*; \
6868
rm -f /var/cache/apt/archives/parital/*.deb; \
6969
rm -f /var/cache/apt/*.bin
7070

71-
COPY requirements.txt /opt/requirements.txt
71+
COPY requirements_cpu.txt /opt/requirements.txt
7272
RUN python3.10 -m venv /opt/venv
7373
RUN /opt/venv/bin/pip install --no-cache-dir wheel
7474
RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt
75+
ENV VENV_PATH /opt/venv
7576

76-
RUN mkdir -p /opt/dependencies/build; \
77-
mkdir -p /opt/dependencies/src
78-
COPY install_dependencies.sh /opt/dependencies/install_dependencies.sh
79-
RUN ["/bin/bash", "-c", "/opt/dependencies/install_dependencies.sh"]
80-
RUN rm -r /opt/dependencies
81-
82-
ENV CoverageControl_ws /opt/CoverageControl_ws
83-
ENV LD_LIBRARY_PATH ${CoverageControl_ws}/install/lib:/usr/local/lib:${LD_LIBRARY_PATH}
84-
ENV PATH ${CoverageControl_ws}/install/bin:${PATH}
85-
COPY .bashrc /root/.bashrc
77+
ENV LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}
78+
COPY .ros.bashrc /root/.bashrc
8679
RUN echo "source /opt/venv/bin/activate" >> /root/.bashrc
87-
88-
RUN mkdir -p ${CoverageControl_ws}
89-
WORKDIR ${CoverageControl_ws}

setup_utils/docker/ubuntu22.04/Dockerfile renamed to setup_utils/docker/base_images/ubuntu22.04.Dockerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,12 @@ RUN rm -rf /var/lib/apt/lists/*; \
5858
rm -f /var/cache/apt/archives/parital/*.deb; \
5959
rm -f /var/cache/apt/*.bin
6060

61-
COPY requirements.txt /opt/requirements.txt
61+
COPY requirements_cpu.txt /opt/requirements.txt
6262
RUN python3.11 -m venv /opt/venv
6363
RUN /opt/venv/bin/pip install --no-cache-dir wheel
6464
RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt
65+
ENV VENV_PATH /opt/venv
6566

66-
RUN mkdir -p /opt/dependencies/build; \
67-
mkdir -p /opt/dependencies/src
68-
COPY install_dependencies.sh /opt/dependencies/install_dependencies.sh
69-
RUN ["/bin/bash", "-c", "/opt/dependencies/install_dependencies.sh"]
70-
RUN rm -r /opt/dependencies
71-
72-
ENV CoverageControl_ws /opt/CoverageControl_ws
73-
ENV LD_LIBRARY_PATH ${CoverageControl_ws}/install/lib:/usr/local/lib:${LD_LIBRARY_PATH}
74-
ENV PATH ${CoverageControl_ws}/install/bin:${PATH}
67+
ENV LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}
7568
COPY .bashrc /root/.bashrc
7669
RUN echo "source /opt/venv/bin/activate" >> /root/.bashrc
77-
78-
RUN mkdir -p ${CoverageControl_ws}
79-
WORKDIR ${CoverageControl_ws}

0 commit comments

Comments
 (0)