diff --git a/.github/workflows/developer-docker-workflow.yml b/.github/workflows/developer-docker-workflow.yml new file mode 100644 index 0000000000..16d2fea129 --- /dev/null +++ b/.github/workflows/developer-docker-workflow.yml @@ -0,0 +1,36 @@ +name: Build developer image + +on: + push: + branches: ["develop"] + pull_request: + branches: ["develop"] + +env: + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: llnl/raja/developer + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: build docker image + run: docker build --build-arg njobs=2 --file containers/developer/Dockerfile --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest . + + - name: push docker image + run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ No newline at end of file diff --git a/containers/developer/Dockerfile b/containers/developer/Dockerfile new file mode 100644 index 0000000000..01ccbedc6f --- /dev/null +++ b/containers/developer/Dockerfile @@ -0,0 +1,36 @@ +############################################################################### + # Copyright (c) 2016-22, Lawrence Livermore National Security, LLC + # and RAJA project contributors. See the RAJA/LICENSE file for details. + # + # SPDX-License-Identifier: (BSD-3-Clause) + ############################################################################### + + FROM ghcr.io/rse-ops/cuda-ubuntu-20.04:cuda-11.1.1 AS nvcc11 + + ARG USER=rajadev + ENV HOME /home/${USER} + + RUN apt-get update && apt-get install -y supervisor + + RUN useradd --create-home --shell /bin/bash ${USER} + USER ${USER} + + WORKDIR $HOME + RUN git clone --recursive -b develop https://github.com/llnl/raja + + WORKDIR $HOME/raja/build + RUN . /opt/spack/share/spack/setup-env.sh && spack load cuda && \ + cmake -DCMAKE_CXX_COMPILER=g++ -DENABLE_CUDA=On -DCMAKE_CUDA_STANDARD=14 -DCMAKE_CUDA_ARCHITECTURES=70 -DENABLE_OPENMP=On .. + + WORKDIR /opt/archives + RUN curl -L https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.69.1/openvscode-server-v1.69.1-linux-x64.tar.gz > \ + /opt/archives/openvscode-server-v1.69.1-linux-x64.tar.gz + RUN tar xzf openvscode-server-v1.69.1-linux-x64.tar.gz && chown -R ${USER}:${USER} openvscode-server-v1.69.1-linux-x64 + + USER root + ADD supervisord.conf /etc/supervisord.conf + RUN sed -i "s/XXX/${USER}/g" /etc/supervisord.conf + + RUN touch /var/log/openvscode-server.log && chown -R ${USER}:${USER} /var/log/openvscode-server.log + + CMD ["/usr/bin/supervisord"] \ No newline at end of file diff --git a/containers/developer/supervisord.conf b/containers/developer/supervisord.conf new file mode 100644 index 0000000000..4e364d4bc2 --- /dev/null +++ b/containers/developer/supervisord.conf @@ -0,0 +1,10 @@ +[supervisord] + nodaemon = true + user = XXX + logfile = /tmp/supervisord.log + + [program:openvscode-server] + environment=HOME="/home/XXX",USER="XXX" + redirect_stderr = true + stdout_logfile = /var/log/openvscode-server.log + command = /opt/archives/openvscode-server-v1.69.1-linux-x64/bin/openvscode-server --without-connection-token --host 0.0.0.0 \ No newline at end of file diff --git a/containers/developer/user-data.sh b/containers/developer/user-data.sh new file mode 100644 index 0000000000..e2997ffaed --- /dev/null +++ b/containers/developer/user-data.sh @@ -0,0 +1,12 @@ +#!/bin/bash + + yum update -y + amazon-linux-extras install docker + systemctl start docer + systemctl enable docker + + wget https://raw.githubusercontent.com/LLNL/RAJA/task/tut-reorg-aws/exercises/Dockerfile + wget https://raw.githubusercontent.com/LLNL/RAJA/task/tut-reorg-aws/exercises/supervisord.conf + + env DOCKER_BUILDKIT=1 docker build . -t raja-aws-tut + docker run --init --gpus all -p 3000:3000 raja-aws-tut \ No newline at end of file