Skip to content

Commit

Permalink
update docker for micro apptainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Udit8348 committed Nov 1, 2024
1 parent e73e1c2 commit 667fa16
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 29 deletions.
2 changes: 1 addition & 1 deletion ci/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ check_gcc_version() {
apt-get update -y

# install system dependencies
apt-get install -y build-essential valgrind libstdc++6 binutils python3 uuid-dev ccache
apt-get install -y build-essential valgrind libstdc++6 binutils python3 uuid-dev ccache cmake

# Check and install GCC 11 if necessary
if check_gcc_version; then
Expand Down
33 changes: 12 additions & 21 deletions miscs/docker/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,32 @@ FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies and upgrade installed components
RUN apt-get update -y && \
apt-get install -y \
# Update and install necessary dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
build-essential \
python3 \
git \
wget \
curl \
ca-certificates \
valgrind \
libstdc++6 \
binutils \
uuid-dev \
ccache \
cmake && \
apt-get upgrade -y && \
gcc_version=$(gcc -dumpversion) && \
if dpkg --compare-versions "$gcc_version" lt 11; then \
echo "GCC version is less than 11. Installing GCC 11..." && \
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
apt-get update -y && \
apt-get install -y g++-11 gcc-11 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100; \
else \
echo "GCC version is 11 or greater. No need to install GCC 11."; \
fi && \
ca-certificates && \
rm -rf /var/lib/apt/lists/*

# upgrade installed components
RUN apt-get upgrade && apt-get update

# temporary until remote dependency script gets updated
RUN apt-get install -y cmake

# Clone the Vortex repository
RUN git clone --depth=1 --recursive https://github.com/vortexgpgpu/vortex.git /vortex

# Set the initial working directory
WORKDIR /vortex

# install system dependencies
RUN ./ci/install_dependencies.sh

# Configure the build folder
RUN mkdir build && cd build && ../configure

Expand Down
29 changes: 22 additions & 7 deletions miscs/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,32 @@ You can install Docker desktop on MAC or PC or Ubuntu.
- MAC: https://docs.docker.com/desktop/install/mac-install
- Ubuntu: https://docs.docker.com/desktop/install/ubuntu

### 1- Create a Docker image from the Dockerfile
$ docker build -f Dockerfile.ubuntu -t vortex
### 1- Build a Docker Image from the Dockerfile
$ docker build --platform=linux/amd64 -t vortex-packaged -f Dockerfile.prod .

### 2- Build the Docker image
$ docker docker run -it vortex /bin/bash
### 2- Construct and run a Container from the Docker Image
$ docker run -it --name vortex --privileged=true --platform=linux/amd64 vortex-packaged

### 3- Build the project
### 3- Build the Project
One you login the Docker terminal, you will be in the build directory.

$ make -s

### 4- Run a simple test
### 4- Run a Simple Test
See `docs/` to learn more!

$ ./ci/blackbox.sh --cores=2 --app=vecadd
$ ./ci/blackbox.sh --cores=2 --app=vecadd

### 5- Exit the Container

$ exit
$ docker stop vortex

### 6- Restart and Re-Enter the Container
If you ran step `2` and then step `5` then, you have to start and re-enter the container

$ docker start vortex
$ docker exec -it vortex

---
Note: Apple Silicon macs will run the container in emulation mode, so compiling and running will take a considerable amount of time -- but it still works!

0 comments on commit 667fa16

Please sign in to comment.